#include <G4MoleculeCounter.hh>
Definition at line 81 of file G4MoleculeCounter.hh.
◆ CounterMapType
◆ RecordedMolecules
◆ G4MoleculeCounter()
G4MoleculeCounter::G4MoleculeCounter |
( |
| ) |
|
|
protected |
Definition at line 55 of file G4MoleculeCounter.cc.
static G4ThreadLocal double fPrecision
G4bool fCheckTimeIsConsistentWithScheduler
static const double picosecond
◆ ~G4MoleculeCounter()
G4MoleculeCounter::~G4MoleculeCounter |
( |
| ) |
|
|
protectedvirtual |
◆ AddAMoleculeAtTime()
Definition at line 234 of file G4MoleculeCounter.cc.
241 G4cout <<
"G4MoleculeCounter::AddAMoleculeAtTime : " << molecule->
GetName()
245 CounterMapType::iterator counterMap_i =
254 else if (counterMap_i->second.empty())
258 counterMap_i->second[
time] = number;
263 NbMoleculeAgainstTime::reverse_iterator end = counterMap_i->second.rbegin();
270 if (end->first <=
time ||
275 double newValue = end->second + number;
277 counterMap_i->second[
time] = newValue;
288 errMsg <<
"Time of species " 289 << molecule->
GetName() <<
" is " 291 <<
" global time is " 294 G4Exception(
"G4MoleculeCounter::RemoveAMoleculeAtTime",
std::ostringstream G4ExceptionDescription
const G4String & GetName() const
CounterMapType fCounterMap
const G4MoleculeDefinition * GetDefinition() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static G4Scheduler * Instance()
std::map< const G4MoleculeDefinition *, G4bool > fDontRegister
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4ThreadLocal double fPrecision
◆ CheckTimeForConsistency()
void G4MoleculeCounter::CheckTimeForConsistency |
( |
G4bool |
flag | ) |
|
|
inline |
◆ DeleteInstance()
void G4MoleculeCounter::DeleteInstance |
( |
| ) |
|
|
static |
◆ DontRegister()
Definition at line 210 of file G4MoleculeCounter.hh.
std::map< const G4MoleculeDefinition *, G4bool > fDontRegister
◆ Dump()
void G4MoleculeCounter::Dump |
( |
| ) |
|
Definition at line 576 of file G4MoleculeCounter.cc.
586 NbMoleculeAgainstTime::iterator it2 = it->second.begin();
587 NbMoleculeAgainstTime::iterator end2 = it->second.end();
589 for(;it2!=end2;++it2)
const G4String & GetName() const
CounterMapType fCounterMap
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4GLOB_DLL std::ostream G4cout
◆ GetMoleculeCounter()
◆ GetNbMoleculeAgainstTime()
◆ GetNMoleculesAtTime()
Definition at line 226 of file G4MoleculeCounter.cc.
int SearchUpperBoundTime(double time, bool sameTypeOfMolecule)
G4bool SearchTimeMap(G4MolecularConfiguration *molecule)
◆ GetRecordedMolecules()
Definition at line 509 of file G4MoleculeCounter.cc.
513 G4cout <<
"Entering in G4MoleculeCounter::RecordMolecules" <<
G4endl;
516 CounterMapType::iterator it;
521 output->push_back(it->first);
CounterMapType fCounterMap
std::unique_ptr< std::vector< G4MolecularConfiguration * > > RecordedMolecules
G4GLOB_DLL std::ostream G4cout
◆ GetRecordedTimes()
Definition at line 526 of file G4MoleculeCounter.cc.
532 CounterMapType::iterator it;
533 CounterMapType::const_iterator ite;
535 NbMoleculeAgainstTime::iterator it2;
536 NbMoleculeAgainstTime::const_iterator ite2;
542 for (it2 = (it->second).begin(), ite2 = (it->second).end(); it2 != ite2;
546 output->insert(it2->first);
CounterMapType fCounterMap
std::unique_ptr< std::set< G4double > > RecordedTimes
◆ GetVerbose()
G4int G4MoleculeCounter::GetVerbose |
( |
| ) |
|
|
inline |
◆ Initialize()
void G4MoleculeCounter::Initialize |
( |
| ) |
|
Definition at line 97 of file G4MoleculeCounter.cc.
101 while ((mol_iterator)())
CounterMapType fCounterMap
static G4MoleculeTable * Instance()
G4ConfigurationIterator GetConfigurationIterator()
◆ InitializeInstance()
void G4MoleculeCounter::InitializeInstance |
( |
| ) |
|
|
static |
◆ Instance()
◆ InUse()
G4bool G4MoleculeCounter::InUse |
( |
| ) |
|
|
static |
◆ IsRegistered()
Definition at line 215 of file G4MoleculeCounter.hh.
std::map< const G4MoleculeDefinition *, G4bool > fDontRegister
◆ IsTimeCheckedForConsistency()
G4bool G4MoleculeCounter::IsTimeCheckedForConsistency |
( |
| ) |
const |
|
inline |
◆ RegisterAll()
void G4MoleculeCounter::RegisterAll |
( |
| ) |
|
|
inlinevirtual |
Definition at line 221 of file G4MoleculeCounter.hh.
std::map< const G4MoleculeDefinition *, G4bool > fDontRegister
◆ RemoveAMoleculeAtTime()
Definition at line 334 of file G4MoleculeCounter.cc.
341 G4cout <<
"G4MoleculeCounter::RemoveAMoleculeAtTime : " 352 errMsg <<
"Time of species " 353 << molecule->
GetName() <<
" is " 355 <<
" global time is " 358 G4Exception(
"G4MoleculeCounter::RemoveAMoleculeAtTime",
366 if (nbMolPerTime.empty())
371 "You are trying to remove molecule " + molecule->
GetName()
372 +
" from the counter while this kind of molecules has not been registered yet";
373 G4Exception(
"G4MoleculeCounter::RemoveAMoleculeAtTime",
"",
380 NbMoleculeAgainstTime::reverse_iterator it = nbMolPerTime.rbegin();
396 if (it == nbMolPerTime.rend())
406 +
" recorded at the time or even before the time asked";
407 G4Exception(
"G4MoleculeCounter::RemoveAMoleculeAtTime",
"",
455 errMsg <<
"Is time going back?? " << molecule->
GetName()
457 <<
" while last recorded time was " 459 G4Exception(
"G4MoleculeCounter::RemoveAMoleculeAtTime",
460 "RETURN_TO_THE_FUTUR",
480 double finalN = it->second - number;
486 errMsg <<
"After removal of " << number <<
" species of " 487 << molecule->
GetName() <<
" the final number at time " 488 <<
G4BestUnit(
time,
"Time") <<
" is less than zero and so not valid." 489 <<
" Global time is " 491 <<
". Previous selected time is " 494 G4Exception(
"G4MoleculeCounter::RemoveAMoleculeAtTime",
499 nbMolPerTime[
time] = finalN;
std::ostringstream G4ExceptionDescription
const G4String & GetName() const
CounterMapType fCounterMap
const G4MoleculeDefinition * GetDefinition() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static G4Scheduler * Instance()
std::map< const G4MoleculeDefinition *, G4bool > fDontRegister
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4ThreadLocal double fPrecision
std::map< G4double, G4int, compDoubleWithPrecision > NbMoleculeAgainstTime
G4bool fCheckTimeIsConsistentWithScheduler
◆ ResetCounter()
void G4MoleculeCounter::ResetCounter |
( |
| ) |
|
|
inlinevirtual |
Definition at line 184 of file G4MoleculeCounter.hh.
188 G4cout <<
" ---> G4MoleculeCounter::ResetCounter" <<
G4endl;
CounterMapType fCounterMap
std::unique_ptr< Search > fpLastSearch
G4GLOB_DLL std::ostream G4cout
◆ SearchTimeMap()
Definition at line 114 of file G4MoleculeCounter.cc.
127 CounterMapType::iterator mol_it =
fCounterMap.find(molecule);
CounterMapType fCounterMap
std::unique_ptr< Search > fpLastSearch
◆ SearchUpperBoundTime()
int G4MoleculeCounter::SearchUpperBoundTime |
( |
double |
time, |
|
|
bool |
sameTypeOfMolecule |
|
) |
| |
Definition at line 144 of file G4MoleculeCounter.cc.
147 CounterMapType::iterator mol_it =
fpLastSearch->fLastMoleculeSearched;
151 if (timeMap.empty())
return 0;
153 NbMoleculeAgainstTime::iterator end_time = timeMap.end();
155 if (sameTypeOfMolecule ==
true)
165 NbMoleculeAgainstTime::iterator upperToLast =
fpLastSearch 169 if (upperToLast == end_time)
174 if (upperToLast->first >
time)
191 NbMoleculeAgainstTime::iterator up_time_it = timeMap.upper_bound(
time);
193 if (up_time_it == end_time)
195 NbMoleculeAgainstTime::reverse_iterator last_time = timeMap.rbegin();
200 return last_time->second;
206 if (up_time_it == timeMap.begin())
CounterMapType fCounterMap
std::unique_ptr< Search > fpLastSearch
std::map< G4double, G4int, compDoubleWithPrecision > NbMoleculeAgainstTime
◆ SetTimeSlice()
void G4MoleculeCounter::SetTimeSlice |
( |
double |
timeSlice | ) |
|
◆ SetVerbose()
void G4MoleculeCounter::SetVerbose |
( |
G4int |
level | ) |
|
|
inline |
◆ Use()
void G4MoleculeCounter::Use |
( |
G4bool |
flag = true | ) |
|
|
static |
◆ G4Molecule
◆ fCheckTimeIsConsistentWithScheduler
G4bool G4MoleculeCounter::fCheckTimeIsConsistentWithScheduler |
|
protected |
◆ fCounterMap
◆ fDontRegister
◆ fpInstance
◆ fpLastSearch
std::unique_ptr<Search> G4MoleculeCounter::fpLastSearch |
|
protected |
◆ fUse
G4bool G4MoleculeCounter::fUse = false |
|
staticprotected |
◆ fVerbose
G4int G4MoleculeCounter::fVerbose |
|
protected |
The documentation for this class was generated from the following files: