64 G4cout<<
"G4MoleculeCounter::AddAMoleculeAtTime : "<< molecule.
GetName()
91 G4cout <<
"G4MoleculeCounter::AddAMoleculeAtTime " <<
G4endl;
96 CounterMapType::iterator counterMap_i =
fCounterMap.find(molecule) ;
103 else if(counterMap_i->second.empty())
106 counterMap_i->second[time] = 1;
110 NbMoleculeAgainstTime::iterator end = counterMap_i->second.end();
116 if(end->first <= time)
118 counterMap_i->second[time]=end->second + 1;
122 NbMoleculeAgainstTime::iterator it = counterMap_i->second.lower_bound(time);
124 while(it->first > time && it!=counterMap_i->second.begin())
131 if(it==counterMap_i->second.begin() && it->first > time)
143 counterMap_i->second[time]=it->second + 1;
156 G4cout<<
"G4MoleculeCounter::RemoveAMoleculeAtTime : "<< molecule.
GetName()
165 if(nbMolPerTime.empty())
168 G4String errMsg =
"You are trying to remove molecule "
170 +
" from the counter while this kind of molecules has not been registered yet";
177 NbMoleculeAgainstTime::iterator it ;
179 if(nbMolPerTime.size() == 1)
181 it = nbMolPerTime.begin() ;
183 G4cout <<
"!! fCounterMap[molecule].size() == 1" <<
G4endl;
187 it = nbMolPerTime.lower_bound(time);
190 if(it==nbMolPerTime.end())
193 G4cout <<
" ********** NO ITERATOR !!!!!!!!! " <<
G4endl;
199 +
" record at the time or even before the time asked";
215 if(nbMolPerTime.value_comp()(*it, *nbMolPerTime.begin()))
223 +
" record at the time or even before the time asked";
238 if(it==nbMolPerTime.begin() && it->first > time)
250 nbMolPerTime[time]=it->second - 1;
262 G4cout<<
"Entering in G4MoleculeCounter::RecordMolecules"<<
G4endl;
265 CounterMapType::iterator it;
266 std::auto_ptr< vector<G4Molecule> > output (
new vector<G4Molecule>) ;
270 output->push_back((*it).first);
map< G4double, G4int, compDoubleWithPrecision > NbMoleculeAgainstTime
G4DLLIMPORT std::ostream G4cout
virtual void AddAMoleculeAtTime(const G4Molecule &, G4double)
static G4MoleculeCounter * GetMoleculeCounter()
std::map< const G4MoleculeDefinition *, G4bool > fDontRegister
static G4MoleculeCounter * fpInstance
CounterMapType fCounterMap
virtual void RemoveAMoleculeAtTime(const G4Molecule &, G4double)
static void DeleteInstance()
std::auto_ptr< vector< G4Molecule > > GetRecordedMolecules()
const G4String & GetName() const
const G4MoleculeDefinition * GetDefinition() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)