73 G4cout<<
"G4MoleculeCounter::AddAMoleculeAtTime : "<< molecule.
GetName()
77 CounterMapType::iterator counterMap_i = fCounterMap.find(molecule) ;
79 if(counterMap_i == fCounterMap.end())
83 fCounterMap[molecule][time] = 1;
85 else if(counterMap_i->second.empty())
89 counterMap_i->second[time] = 1;
93 NbMoleculeAgainstTime::iterator end = counterMap_i->second.end();
100 if(end->first <= time)
102 counterMap_i->second[time]=end->second + 1;
106 NbMoleculeAgainstTime::iterator it = counterMap_i->second.lower_bound(time);
108 while(it->first > time && it!=counterMap_i->second.begin())
116 if(it==counterMap_i->second.begin() && it->first > time)
130 counterMap_i->second[time]=it->second + 1;
145 G4cout<<
"G4MoleculeCounter::RemoveAMoleculeAtTime : "<< molecule.
GetName()
151 if(nbMolPerTime.empty())
154 G4String errMsg =
"You are trying to remove molecule "
156 +
" from the counter while this kind of molecules has not been registered yet";
163 NbMoleculeAgainstTime::iterator it ;
165 if(nbMolPerTime.size() == 1)
167 it = nbMolPerTime.begin() ;
174 it = nbMolPerTime.lower_bound(time);
177 if(it==nbMolPerTime.end())
187 +
" record at the time or even before the time asked";
204 if(nbMolPerTime.value_comp()(*it, *nbMolPerTime.begin()))
213 +
" record at the time or even before the time asked";
229 if(it==nbMolPerTime.begin() && it->first > time)
243 nbMolPerTime[time]=it->second - 1;
257 G4cout<<
"Entering in G4MoleculeCounter::RecordMolecules"<<
G4endl;
260 CounterMapType::iterator it;
263 for(it = fCounterMap.begin() ; it != fCounterMap.end() ; it++)
265 output->push_back(it->first);
virtual void AddAMoleculeAtTime(const G4Molecule &, G4double)
static G4MoleculeCounter * GetMoleculeCounter()
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4String & GetName() const
RecordedMolecules GetRecordedMolecules()
G4GLOB_DLL std::ostream G4cout
const G4MoleculeDefinition * GetDefinition() const
std::auto_ptr< std::vector< G4Molecule > > RecordedMolecules
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4ThreadLocal double fPrecision
static G4ThreadLocal G4MoleculeCounter * fpInstance
std::map< G4double, G4int, compDoubleWithPrecision > NbMoleculeAgainstTime
virtual void RemoveAMoleculeAtTime(const G4Molecule &, G4double)
void SetTimeSlice(double)
static void DeleteInstance()