Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DNAChemistryManager Class Reference

#include <G4DNAChemistryManager.hh>

+ Inheritance diagram for G4DNAChemistryManager:

Public Member Functions

G4bool Notify (G4ApplicationState requestedState) override
 
void SetNewValue (G4UIcommand *, G4String) override
 
G4String GetCurrentValue (G4UIcommand *pCommand) override
 
G4bool IsChemistryActivated ()
 
void SetChemistryActivation (G4bool)
 
void SetChemistryList (G4VUserChemistryList &)
 
void SetChemistryList (std::unique_ptr< G4VUserChemistryList >)
 
void SetChemistryList (G4VUserChemistryList *)
 
void Deregister (G4VUserChemistryList &)
 
void Initialize ()
 
void Run ()
 
void Clear ()
 
void SetGun (G4ITGun *pChemSpeciesGun)
 Inject custom species to the simulation.
 
void SetPhysChemIO (std::unique_ptr< G4VPhysChemIO > pPhysChemIO)
 
void SetVerbose (G4int verbose)
 
void UseAsStandalone (G4bool flag)
 
G4bool IsCounterResetWhenRunEnds () const
 
void ResetCounterWhenRunEnds (G4bool resetCounterWhenRunEnds)
 
void ForceMasterReinitialization ()
 
void TagThreadForReinitialization ()
 
void ForceThreadReinitialization ()
 
void ForceRebuildingPhysicsTable ()
 
void WriteInto (const G4String &, std::ios_base::openmode mode=std::ios_base::out)
 
void AddEmptyLineInOutputFile ()
 
void CloseFile ()
 
void CreateWaterMolecule (ElectronicModification, G4int, const G4Track *)
 
void CreateSolvatedElectron (const G4Track *, G4ThreeVector *pFinalPosition=nullptr)
 
void PushMolecule (std::unique_ptr< G4Molecule > pMolecule, G4double time, const G4ThreeVector &position, G4int parentID)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool operator!= (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 
- Public Member Functions inherited from G4VStateDependent
 G4VStateDependent (G4bool bottom=false)
 
virtual ~G4VStateDependent ()
 
G4bool operator== (const G4VStateDependent &right) const
 
G4bool operator!= (const G4VStateDependent &right) const
 
virtual G4bool Notify (G4ApplicationState requestedState)=0
 

Static Public Member Functions

static G4DNAChemistryManagerInstance ()
 
static G4DNAChemistryManagerGetInstanceIfExists ()
 
static void DeleteInstance ()
 
static G4bool IsActivated ()
 

Protected Member Functions

 ~G4DNAChemistryManager () override
 
void HandleStandaloneInitialization ()
 
void PushTrack (G4Track *)
 
void SetGlobalTemperature (G4double temperatureKelvin)
 
G4DNAWaterExcitationStructureGetExcitationLevel ()
 
G4DNAWaterIonisationStructureGetIonisationLevel ()
 
void InitializeFile ()
 
void InitializeMaster ()
 
void InitializeThread ()
 
void InitializeThreadSharedData ()
 
 G4DNAChemistryManager ()
 
- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (const G4String &s)
 
G4long StoL (const G4String &s)
 
G4double StoD (const G4String &s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 

Additional Inherited Members

- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Detailed Description

WARNING: THIS CLASS IS A PROTOTYPE G4DNAChemistryManager is called from the physics models. It creates the water molecules and the solvated electrons and and send them to G4ITStepManager to be treated in the chemistry stage. For this, the fActiveChemistry flag needs to be on. It is also possible to give already molecule's pointers already built. G4DNAChemistryManager will then be in charge of creating the track and loading it to the IT system. The user can also ask to create a file containing a information about the creation of water molecules and solvated electrons.

Definition at line 87 of file G4DNAChemistryManager.hh.

Constructor & Destructor Documentation

◆ ~G4DNAChemistryManager()

G4DNAChemistryManager::~G4DNAChemistryManager ( )
overrideprotected

Definition at line 164 of file G4DNAChemistryManager.cc.

165{
166 Clear();
167 fgInstance = nullptr;
168}

◆ G4DNAChemistryManager()

G4DNAChemistryManager::G4DNAChemistryManager ( )
protected

Definition at line 101 of file G4DNAChemistryManager.cc.

102 : G4UImessenger()
104 , fpChemDNADirectory(new G4UIdirectory("/chem/"))
105 , fpActivateChem(new G4UIcmdWithABool("/chem/activate", this))
106 , fpRunChem(new G4UIcmdWithAnInteger("/chem/run", this))
107 , fpSkipReactionsFromChemList(new G4UIcmdWithoutParameter("/chem/skipReactionsFromChemList", this))
108 , fpScaleForNewTemperature(new G4UIcmdWithADoubleAndUnit("/chem/temperature", this))
109 , fpInitChem(new G4UIcmdWithoutParameter("/chem/init", this))
110 , fActiveChemistry(false)
111 , fMasterInitialized(false)
112 , fForceThreadReinitialization(false)
113 , fpExcitationLevel(nullptr)
114 , fpIonisationLevel(nullptr)
115 , fpUserChemistryList(nullptr)
116 , fOwnChemistryList(false)
117 , fUseInStandalone(false)
118 , fPhysicsTableBuilt(false)
119 , fSkipReactions(false)
120 , fGeometryClosed(false)
121 , fVerbose(0)
122 , fResetCounterWhenRunEnds(true)
123{
124 fpRunChem->SetParameterName("Number of runs to execute for the chemistry module"
125 "(this works when used in standalone", true, true);
126 fpRunChem->SetDefaultValue(1);
127 fpScaleForNewTemperature->SetUnitCategory("Temperature");
128}
G4UImessenger()=default

Referenced by Instance().

Member Function Documentation

◆ AddEmptyLineInOutputFile()

void G4DNAChemistryManager::AddEmptyLineInOutputFile ( )

Definition at line 565 of file G4DNAChemistryManager.cc.

566{
567 if (fpThreadData->fpPhysChemIO)
568 {
569 fpThreadData->fpPhysChemIO->AddEmptyLineInOutputFile();
570 }
571}

◆ Clear()

void G4DNAChemistryManager::Clear ( )

Definition at line 172 of file G4DNAChemistryManager.cc.

173{
174 fpIonisationLevel.reset();
175 fpExcitationLevel.reset();
176
177 if (fpUserChemistryList)
178 {
179 Deregister(*fpUserChemistryList);
180 }
181
182 fpChemDNADirectory.reset();
183 fpActivateChem.reset();
184 fpRunChem.reset();
185
186 fpSkipReactionsFromChemList.reset();
187 fpInitChem.reset();
188
189 if (fpThreadData != nullptr)
190 {
191 delete fpThreadData;
192 fpThreadData = nullptr;
193 }
194
198}
void Deregister(G4VUserChemistryList &)
static void DeleteInstance()

Referenced by Notify(), and ~G4DNAChemistryManager().

◆ CloseFile()

void G4DNAChemistryManager::CloseFile ( )

Close the file specified with WriteInto

Definition at line 575 of file G4DNAChemistryManager.cc.

576{
577 if (fpThreadData->fpPhysChemIO)
578 {
579 fpThreadData->fpPhysChemIO->CloseFile();
580 }
581}

Referenced by Run().

◆ CreateSolvatedElectron()

void G4DNAChemistryManager::CreateSolvatedElectron ( const G4Track pIncomingTrack,
G4ThreeVector pFinalPosition = nullptr 
)

This method should be used by the physics model of the ElectronSolvatation process.

Definition at line 663 of file G4DNAChemistryManager.cc.

665{
666 if (fpThreadData->fpPhysChemIO)
667 {
668 fpThreadData->fpPhysChemIO->CreateSolvatedElectron(pIncomingTrack,
669 pFinalPosition);
670 }
671
672 if (fActiveChemistry)
673 {
674 PushMolecule(std::unique_ptr<G4Molecule>(new G4Molecule(G4Electron_aq::Definition())),
675 picosecond,
676 pFinalPosition ? *pFinalPosition : pIncomingTrack->GetPosition(),
677 pIncomingTrack->GetTrackID());
678 }
679}
void PushMolecule(std::unique_ptr< G4Molecule > pMolecule, G4double time, const G4ThreeVector &position, G4int parentID)
static G4Electron_aq * Definition()
G4int GetTrackID() const
const G4ThreeVector & GetPosition() const

Referenced by G4TDNAOneStepThermalizationModel< MODEL >::SampleSecondaries(), and G4DNATransformElectronModel::SampleSecondaries().

◆ CreateWaterMolecule()

void G4DNAChemistryManager::CreateWaterMolecule ( ElectronicModification  modification,
G4int  electronicLevel,
const G4Track pIncomingTrack 
)

Method used by DNA physics model to create a water molecule. The ElectronicModification is a flag telling whether the molecule is ionized or excited, the electronic level is calculated by the model and the IncomingTrack is the track responsible for the creation of this molecule (electron, proton...).

Definition at line 607 of file G4DNAChemistryManager.cc.

610{
611 if (fpThreadData->fpPhysChemIO)
612 {
613 G4double energy = -1.;
614
615 switch (modification)
616 {
618 energy = 0.;
619 break;
620 case eExcitedMolecule:
621 energy = GetExcitationLevel()->ExcitationEnergy(electronicLevel);
622 break;
623 case eIonizedMolecule:
624 energy = GetIonisationLevel()->IonisationEnergy(electronicLevel);
625 break;
626 }
627
628 fpThreadData->fpPhysChemIO->CreateWaterMolecule(modification,
629 4 - electronicLevel,
630 energy,
631 pIncomingTrack);
632 }
633
634 if (fActiveChemistry)
635 {
636 G4Molecule* pH2OMolecule = new G4Molecule(G4H2O::Definition());
637
638 switch (modification)
639 {
641 pH2OMolecule->AddElectron(5, 1);
642 break;
643 case eExcitedMolecule:
644 pH2OMolecule->ExciteMolecule(4 - electronicLevel);
645 break;
646 case eIonizedMolecule:
647 pH2OMolecule->IonizeMolecule(4 - electronicLevel);
648 break;
649 }
650
651 G4Track* pH2OTrack = pH2OMolecule->BuildTrack(picosecond,
652 pIncomingTrack->GetPosition());
653
654 pH2OTrack->SetParentID(pIncomingTrack->GetTrackID());
655 pH2OTrack->SetTrackStatus(fStopButAlive);
656 pH2OTrack->SetKineticEnergy(0.);
657 PushTrack(pH2OTrack);
658 }
659}
@ eIonizedMolecule
@ eDissociativeAttachment
@ eExcitedMolecule
@ fStopButAlive
double G4double
Definition: G4Types.hh:83
G4DNAWaterIonisationStructure * GetIonisationLevel()
G4DNAWaterExcitationStructure * GetExcitationLevel()
static G4H2O * Definition()
Definition: G4H2O.cc:42
void IonizeMolecule(G4int)
Definition: G4Molecule.cc:306
void AddElectron(G4int orbit, G4int n=1)
Definition: G4Molecule.cc:313
G4Track * BuildTrack(G4double globalTime, const G4ThreeVector &Position)
Definition: G4Molecule.cc:371
void ExciteMolecule(G4int)
Definition: G4Molecule.cc:299
void SetTrackStatus(const G4TrackStatus aTrackStatus)
void SetKineticEnergy(const G4double aValue)
void SetParentID(const G4int aValue)
G4double energy(const ThreeVector &p, const G4double m)

Referenced by G4DNABornExcitationModel1::SampleSecondaries(), G4DNABornExcitationModel2::SampleSecondaries(), G4DNABornIonisationModel1::SampleSecondaries(), G4DNABornIonisationModel2::SampleSecondaries(), G4DNACPA100ExcitationModel::SampleSecondaries(), G4DNACPA100IonisationModel::SampleSecondaries(), G4DNAEmfietzoglouExcitationModel::SampleSecondaries(), G4DNAEmfietzoglouIonisationModel::SampleSecondaries(), G4DNAMillerGreenExcitationModel::SampleSecondaries(), G4DNARuddIonisationExtendedModel::SampleSecondaries(), G4DNARuddIonisationModel::SampleSecondaries(), G4DNADingfelderChargeDecreaseModel::SampleSecondaries(), G4DNARPWBAExcitationModel::SampleSecondaries(), G4DNARPWBAIonisationModel::SampleSecondaries(), and G4DNAPTBExcitationModel::SampleSecondaries().

◆ DeleteInstance()

void G4DNAChemistryManager::DeleteInstance ( )
static

Definition at line 202 of file G4DNAChemistryManager.cc.

203{
205
206 if (fgInstance != nullptr)
207 {
208 G4DNAChemistryManager* pDeleteMe = fgInstance;
209 fgInstance = nullptr;
210 lock.unlock();
211 delete pDeleteMe;
212 }
213 else
214 {
215 G4cerr << "G4DNAChemistryManager already deleted" << G4endl;
216 }
217 lock.unlock();
218}
G4Mutex chemManExistence
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57

◆ Deregister()

void G4DNAChemistryManager::Deregister ( G4VUserChemistryList chemistryList)

Definition at line 731 of file G4DNAChemistryManager.cc.

732{
733 if (fpUserChemistryList.get() == &chemistryList)
734 {
735 if (!fpUserChemistryList->IsPhysicsConstructor() || fOwnChemistryList)
736 {
737 fpUserChemistryList.reset();
738 }
739
740 fpUserChemistryList.release();
741 }
742}

Referenced by Clear(), and G4VUserChemistryList::~G4VUserChemistryList().

◆ ForceMasterReinitialization()

void G4DNAChemistryManager::ForceMasterReinitialization ( )

Definition at line 781 of file G4DNAChemistryManager.cc.

782{
783 fMasterInitialized = false;
785}

◆ ForceRebuildingPhysicsTable()

void G4DNAChemistryManager::ForceRebuildingPhysicsTable ( )

Definition at line 774 of file G4DNAChemistryManager.cc.

775{
776 fPhysicsTableBuilt = false;
777}

◆ ForceThreadReinitialization()

void G4DNAChemistryManager::ForceThreadReinitialization ( )

Definition at line 789 of file G4DNAChemistryManager.cc.

790{
791 fForceThreadReinitialization = true;
792}

◆ GetCurrentValue()

G4String G4DNAChemistryManager::GetCurrentValue ( G4UIcommand pCommand)
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 278 of file G4DNAChemistryManager.cc.

279{
280 if (pCommand == fpActivateChem.get())
281 {
282 return G4UIcmdWithABool::ConvertToString(fActiveChemistry);
283 }
284 else if (pCommand == fpScaleForNewTemperature.get())
285 {
286 return fpScaleForNewTemperature->ConvertToStringWithBestUnit(G4MolecularConfiguration::GetGlobalTemperature());
287 }
288 else if (pCommand == fpSkipReactionsFromChemList.get())
289 {
290 return G4UIcmdWithABool::ConvertToString(fSkipReactions);
291 }
292
293 return "";
294}
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:446

◆ GetExcitationLevel()

G4DNAWaterExcitationStructure * G4DNAChemistryManager::GetExcitationLevel ( )
protected

Definition at line 585 of file G4DNAChemistryManager.cc.

586{
587 if (!fpExcitationLevel)
588 {
589 fpExcitationLevel.reset(new G4DNAWaterExcitationStructure);
590 }
591 return fpExcitationLevel.get();
592}

Referenced by CreateWaterMolecule().

◆ GetInstanceIfExists()

G4DNAChemistryManager * G4DNAChemistryManager::GetInstanceIfExists ( )
static

Definition at line 157 of file G4DNAChemistryManager.cc.

158{
159 return fgInstance;
160}

Referenced by G4VUserChemistryList::~G4VUserChemistryList().

◆ GetIonisationLevel()

G4DNAWaterIonisationStructure * G4DNAChemistryManager::GetIonisationLevel ( )
protected

Definition at line 596 of file G4DNAChemistryManager.cc.

597{
598 if (!fpIonisationLevel)
599 {
600 fpIonisationLevel.reset(new G4DNAWaterIonisationStructure);
601 }
602 return fpIonisationLevel.get();
603}

Referenced by CreateWaterMolecule().

◆ HandleStandaloneInitialization()

void G4DNAChemistryManager::HandleStandaloneInitialization ( )
protected

Definition at line 438 of file G4DNAChemistryManager.cc.

439{
440 if (!fUseInStandalone || fPhysicsTableBuilt)
441 {
442 return;
443 }
444
445 if (fVerbose)
446 {
447 G4cout << "G4DNAChemistryManager: Build the physics tables for "
448 "molecule definition only."
449 << G4endl;
450 }
451
452 fpUserChemistryList->BuildPhysicsTable();
453
454 if (!fGeometryClosed)
455 {
456 if (fVerbose)
457 {
458 G4cout << "G4DNAChemistryManager: Close geometry" << G4endl;
459 }
460
462 pGeomManager->OpenGeometry();
463 pGeomManager->CloseGeometry(true, true);
464 fGeometryClosed = true;
465 }
466
467 fPhysicsTableBuilt = true;
468}
G4GLOB_DLL std::ostream G4cout
static G4GeometryManager * GetInstance()
G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false, G4VPhysicalVolume *vol=nullptr)
void OpenGeometry(G4VPhysicalVolume *vol=nullptr)

Referenced by InitializeThread().

◆ Initialize()

void G4DNAChemistryManager::Initialize ( )

Definition at line 360 of file G4DNAChemistryManager.cc.

361{
362 //===========================================================================
363 // MT MODE
364 //===========================================================================
366 {
367 //==========================================================================
368 // ON WORKER THREAD
369 //==========================================================================
371 {
372 InitializeThread(); // Will create and initialize G4Scheduler
373 return;
374 }
375 //==========================================================================
376 // ON MASTER THREAD
377 //==========================================================================
378 else
379 {
382 return;
383 }
384 }
385 //===========================================================================
386 // IS NOT IN MT MODE
387 //===========================================================================
388 else
389 {
392 // In this case: InitializeThread is called when Run() is called
393 return;
394 }
395}
G4bool IsWorkerThread()
Definition: G4Threading.cc:123
G4bool IsMultithreadedApplication()
Definition: G4Threading.cc:130

Referenced by G4EmDNAChemistry::ConstructProcess(), G4EmDNAChemistry_option1::ConstructProcess(), G4EmDNAChemistry_option3::ConstructProcess(), G4EmDNAChemistry_option2::ConstructProcess(), and SetNewValue().

◆ InitializeFile()

void G4DNAChemistryManager::InitializeFile ( )
protected

Definition at line 508 of file G4DNAChemistryManager.cc.

509{
510 if (fVerbose)
511 {
512 G4cout << "G4DNAChemistryManager::InitializeFile() is called"
513 << G4endl;
514 }
515
516 if (fpThreadData->fpPhysChemIO)
517 {
518 fpThreadData->fpPhysChemIO->InitializeFile();
519 }
520}

Referenced by InitializeThread().

◆ InitializeMaster()

void G4DNAChemistryManager::InitializeMaster ( )
protected

Definition at line 399 of file G4DNAChemistryManager.cc.

400{
401 if (fMasterInitialized)
402 {
403 return;
404 }
405
406 if (fVerbose)
407 {
408 G4cout << "G4DNAChemistryManager::InitializeMaster() is called" << G4endl;
409 }
410
411
412 if (fpUserChemistryList == nullptr)
413 {
414 G4ExceptionDescription description;
415 description << "No user chemistry list has been provided.";
416 G4Exception("G4DNAChemistryManager::InitializeMaster", "NO_CHEM_LIST",
417 FatalException, description);
418 }else
419 {
420 fpUserChemistryList->ConstructDissociationChannels();
421 if (!fSkipReactions)
422 {
423 fpUserChemistryList->ConstructReactionTable(G4DNAMolecularReactionTable::GetReactionTable());
424 }
425 else
426 {
428 }
429 }
430
432 // creates a concrete object of the scheduler
433 fMasterInitialized = true;
434}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
static G4DNAMolecularReactionTable * GetReactionTable()
static G4Scheduler * Instance()
Definition: G4Scheduler.cc:101

Referenced by ForceMasterReinitialization(), and Initialize().

◆ InitializeThread()

void G4DNAChemistryManager::InitializeThread ( )
protected

Definition at line 472 of file G4DNAChemistryManager.cc.

473{
474 if (fpThreadData->fThreadInitialized && !fForceThreadReinitialization)
475 {
476 return;
477 }
478
479 if (fpUserChemistryList == nullptr)
480 {
481 G4ExceptionDescription description;
482 description << "No user chemistry list has been provided.";
483 G4Exception("G4DNAChemistryManager::InitializeThread", "NO_CHEM_LIST",
484 FatalException, description);
485 }else
486 {
487 HandleStandaloneInitialization();// To make coverty happy
488 fpUserChemistryList->ConstructTimeStepModel(G4DNAMolecularReactionTable::GetReactionTable());
489 }
490
491 if (fVerbose)
492 {
493 G4cout << "G4DNAChemistryManager::InitializeThread() is called"
494 << G4endl;
495 }
496
498
499 fpThreadData->fThreadInitialized = true;
500
502
504}
void Initialize()
Definition: G4Scheduler.cc:284
static void InitializeInstance()

Referenced by Initialize(), Run(), and SetNewValue().

◆ InitializeThreadSharedData()

void G4DNAChemistryManager::InitializeThreadSharedData ( )
protected

Definition at line 298 of file G4DNAChemistryManager.cc.

299{
301 {
302 return;
303 }
304
307}
void Finalize(G4MoleculeDefinition *)
void PrepareMolecularConfiguration()
static G4MoleculeTable * Instance()
G4bool IsMasterThread()
Definition: G4Threading.cc:124

Referenced by Initialize(), and Notify().

◆ Instance()

G4DNAChemistryManager * G4DNAChemistryManager::Instance ( )
static

Definition at line 132 of file G4DNAChemistryManager.cc.

133{
134 if (fgInstance == nullptr)
135 {
137 if (fgInstance == nullptr) // MT : double check at initialisation
138 {
139 fgInstance = new G4DNAChemistryManager();
140 }
141 lock.unlock();
142 }
143
144 // make sure thread local data is initialized for all threads
145 if (fpThreadData == nullptr)
146 {
147 fpThreadData = new ThreadLocalData();
148 }
149
150 assert(fpThreadData != nullptr);
151
152 return fgInstance;
153}

Referenced by G4EmDNAChemistry::ConstructProcess(), G4EmDNAChemistry_option1::ConstructProcess(), G4EmDNAChemistry_option3::ConstructProcess(), G4EmDNAChemistry_option2::ConstructProcess(), G4EmDNAChemistry::G4EmDNAChemistry(), G4EmDNAChemistry_option1::G4EmDNAChemistry_option1(), G4EmDNAChemistry_option2::G4EmDNAChemistry_option2(), G4EmDNAChemistry_option3::G4EmDNAChemistry_option3(), G4DNABornExcitationModel1::SampleSecondaries(), G4DNABornExcitationModel2::SampleSecondaries(), G4DNABornIonisationModel1::SampleSecondaries(), G4DNABornIonisationModel2::SampleSecondaries(), G4DNACPA100ExcitationModel::SampleSecondaries(), G4DNACPA100IonisationModel::SampleSecondaries(), G4DNAEmfietzoglouExcitationModel::SampleSecondaries(), G4DNAEmfietzoglouIonisationModel::SampleSecondaries(), G4DNAMeltonAttachmentModel::SampleSecondaries(), G4DNAMillerGreenExcitationModel::SampleSecondaries(), G4TDNAOneStepThermalizationModel< MODEL >::SampleSecondaries(), G4DNARuddIonisationExtendedModel::SampleSecondaries(), G4DNARuddIonisationModel::SampleSecondaries(), G4DNATransformElectronModel::SampleSecondaries(), G4DNADingfelderChargeDecreaseModel::SampleSecondaries(), G4DNARPWBAExcitationModel::SampleSecondaries(), G4DNARPWBAIonisationModel::SampleSecondaries(), and G4DNAPTBExcitationModel::SampleSecondaries().

◆ IsActivated()

G4bool G4DNAChemistryManager::IsActivated ( )
static

Definition at line 524 of file G4DNAChemistryManager.cc.

525{
526 return fgInstance ? fgInstance->IsChemistryActivated() : false;
527}

Referenced by G4TDNAOneStepThermalizationModel< MODEL >::SampleSecondaries().

◆ IsChemistryActivated()

G4bool G4DNAChemistryManager::IsChemistryActivated ( )

Definition at line 531 of file G4DNAChemistryManager.cc.

532{
533 return fActiveChemistry;
534}

Referenced by IsActivated().

◆ IsCounterResetWhenRunEnds()

G4bool G4DNAChemistryManager::IsCounterResetWhenRunEnds ( ) const

Definition at line 760 of file G4DNAChemistryManager.cc.

761{
762 return fResetCounterWhenRunEnds;
763}

◆ Notify()

G4bool G4DNAChemistryManager::Notify ( G4ApplicationState  requestedState)
overridevirtual

Implements G4VStateDependent.

Definition at line 222 of file G4DNAChemistryManager.cc.

223{
224 if (requestedState == G4State_Quit)
225 {
226 if (fVerbose)
227 {
228 G4cout << "G4DNAChemistryManager::Notify ---> received G4State_Quit"
229 << G4endl;
230 }
231 Clear();
232 }
233 else if (requestedState == G4State_GeomClosed)
234 {
235 fGeometryClosed = true;
236 }
237 else if (requestedState == G4State_Idle)
238 {
240 }
241
242 return true;
243}
@ G4State_Idle
@ G4State_Quit
@ G4State_GeomClosed

◆ PushMolecule()

void G4DNAChemistryManager::PushMolecule ( std::unique_ptr< G4Molecule pMolecule,
G4double  time,
const G4ThreeVector position,
G4int  parentID 
)

Definition at line 683 of file G4DNAChemistryManager.cc.

687{
688 assert(fActiveChemistry
689 && "To inject chemical species, the chemistry must be activated. "
690 "Check chemistry activation before injecting species.");
691 G4Track* pTrack = pMolecule->BuildTrack(time, position);
692 pTrack->SetTrackStatus(fAlive);
693 pTrack->SetParentID(parentID);
694 pMolecule.release();
695 PushTrack(pTrack);
696}
@ fAlive

Referenced by CreateSolvatedElectron().

◆ PushTrack()

void G4DNAChemistryManager::PushTrack ( G4Track pTrack)
protected

Definition at line 746 of file G4DNAChemistryManager.cc.

747{
749}
virtual void Push(G4Track *)
static G4ITTrackHolder * Instance()

Referenced by CreateWaterMolecule(), and PushMolecule().

◆ ResetCounterWhenRunEnds()

void G4DNAChemistryManager::ResetCounterWhenRunEnds ( G4bool  resetCounterWhenRunEnds)

Definition at line 767 of file G4DNAChemistryManager.cc.

768{
769 fResetCounterWhenRunEnds = resetCounterWhenRunEnds;
770}

◆ Run()

void G4DNAChemistryManager::Run ( )

Definition at line 310 of file G4DNAChemistryManager.cc.

311{
312 if (!fActiveChemistry)
313 {
314 return;
315 }
316
318
319 if (!fMasterInitialized)
320 {
321 G4ExceptionDescription description;
322 description << "Global components were not initialized.";
323 G4Exception("G4DNAChemistryManager::Run", "MASTER_INIT", FatalException,
324 description);
325 }
326
327 if (!fpThreadData->fThreadInitialized)
328 {
329 G4ExceptionDescription description;
330 description << "Thread local components were not initialized.";
331 G4Exception("G4DNAChemistryManager::Run", "THREAD_INIT", FatalException,
332 description);
333 }
334
337 if (fResetCounterWhenRunEnds)
338 {
340 }
341 CloseFile();
342}
void Process()
Definition: G4Scheduler.cc:379
static G4VMoleculeCounter * Instance()
virtual void ResetCounter()=0

Referenced by SetNewValue().

◆ SetChemistryActivation()

void G4DNAChemistryManager::SetChemistryActivation ( G4bool  flag)

Definition at line 538 of file G4DNAChemistryManager.cc.

539{
540 fActiveChemistry = flag;
541}

Referenced by SetChemistryList(), and SetNewValue().

◆ SetChemistryList() [1/3]

void G4DNAChemistryManager::SetChemistryList ( G4VUserChemistryList chemistryList)

Chemistry list is managed outside the chemistry manager (eg. constructor).

Definition at line 715 of file G4DNAChemistryManager.cc.

716{
717 fpUserChemistryList.reset(&chemistryList);
718 fOwnChemistryList = false;
720}

Referenced by G4EmDNAChemistry::G4EmDNAChemistry(), G4EmDNAChemistry_option1::G4EmDNAChemistry_option1(), G4EmDNAChemistry_option2::G4EmDNAChemistry_option2(), and G4EmDNAChemistry_option3::G4EmDNAChemistry_option3().

◆ SetChemistryList() [2/3]

void G4DNAChemistryManager::SetChemistryList ( G4VUserChemistryList pChemistryList)

Definition at line 708 of file G4DNAChemistryManager.cc.

709{
710 fpUserChemistryList.reset(pChemistryList);
711 fOwnChemistryList = false;
713}

◆ SetChemistryList() [3/3]

void G4DNAChemistryManager::SetChemistryList ( std::unique_ptr< G4VUserChemistryList pChemistryList)

Not a constructor or when used in standalone? Prefer this method.

Definition at line 722 of file G4DNAChemistryManager.cc.

723{
724 fpUserChemistryList = std::move(pChemistryList);
725 fOwnChemistryList = true;
727}

◆ SetGlobalTemperature()

void G4DNAChemistryManager::SetGlobalTemperature ( G4double  temperatureKelvin)
protected

Definition at line 700 of file G4DNAChemistryManager.cc.

Referenced by SetNewValue().

◆ SetGun()

void G4DNAChemistryManager::SetGun ( G4ITGun pChemSpeciesGun)

Inject custom species to the simulation.

This method should be called per thread, possibly from ActionInitialisation::Build. One can decide to set the same gun for all threads. It is the user responsibility to handle the pointer deletion.

Definition at line 353 of file G4DNAChemistryManager.cc.

354{
355 G4Scheduler::Instance()->SetGun(pChemGun);
356}
void SetGun(G4ITGun *)
Definition: G4Scheduler.hh:431

◆ SetNewValue()

void G4DNAChemistryManager::SetNewValue ( G4UIcommand pCommand,
G4String  value 
)
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 247 of file G4DNAChemistryManager.cc.

248{
249 if (pCommand == fpActivateChem.get())
250 {
252 }
253 else if (pCommand == fpRunChem.get())
254 {
255 int nbExec = value.empty() ? 1 : G4UIcommand::ConvertToInt(value);
256 for (int i = 0 ; i < nbExec ; ++i)
257 {
258 Run();
259 }
260 }
261 else if (pCommand == fpSkipReactionsFromChemList.get())
262 {
263 fSkipReactions = true;
264 }
265 else if (pCommand == fpScaleForNewTemperature.get())
266 {
267 SetGlobalTemperature(fpScaleForNewTemperature->ConvertToDimensionedDouble(value));
268 }
269 else if (pCommand == fpInitChem.get())
270 {
271 Initialize();
273 }
274}
void SetGlobalTemperature(G4double temperatureKelvin)
static G4bool GetNewBoolValue(const char *paramString)
static G4int ConvertToInt(const char *st)
Definition: G4UIcommand.cc:561

◆ SetPhysChemIO()

void G4DNAChemistryManager::SetPhysChemIO ( std::unique_ptr< G4VPhysChemIO pPhysChemIO)

Definition at line 88 of file G4DNAChemistryManager.cc.

89{
90 fpThreadData->fpPhysChemIO = std::move(pPhysChemIO);
91}

◆ SetVerbose()

void G4DNAChemistryManager::SetVerbose ( G4int  verbose)

Definition at line 753 of file G4DNAChemistryManager.cc.

754{
755 fVerbose = verbose;
756}

◆ TagThreadForReinitialization()

void G4DNAChemistryManager::TagThreadForReinitialization ( )

Definition at line 796 of file G4DNAChemistryManager.cc.

797{
798 fpThreadData->fThreadInitialized = false;
799}

◆ UseAsStandalone()

void G4DNAChemistryManager::UseAsStandalone ( G4bool  flag)

If the chemistry module is used in standalone (ie. without running the physics stage beforehand), the physics table still needs to be built. It is therefore necessary to flag the chemistry module as being run in standalone.

Definition at line 346 of file G4DNAChemistryManager.cc.

347{
348 fUseInStandalone = flag;
349}

◆ WriteInto()

void G4DNAChemistryManager::WriteInto ( const G4String output,
std::ios_base::openmode  mode = std::ios_base::out 
)

Tells the chemMan to write into a file the position and electronic state of the water molecule and the position thermalized or not of the solvated electron

Definition at line 545 of file G4DNAChemistryManager.cc.

547{
548 if (fVerbose)
549 {
550 G4cout << "G4DNAChemistryManager: Write chemical stage into "
551 << output.data() << G4endl;
552 }
553
554 if (!fpThreadData->fpPhysChemIO)
555 {
556 fpThreadData->fpPhysChemIO.reset(new G4PhysChemIO::FormattedText());
557 }
558
559 fpThreadData->fpPhysChemIO->WriteInto(output, mode);
560
561}

The documentation for this class was generated from the following files: