Geant4 10.7.0
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 ()
 
 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 (G4String s)
 
G4long StoL (G4String s)
 
G4double StoD (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}

Referenced by Instance().

Member Function Documentation

◆ AddEmptyLineInOutputFile()

void G4DNAChemistryManager::AddEmptyLineInOutputFile ( )

Definition at line 564 of file G4DNAChemistryManager.cc.

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

◆ 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 574 of file G4DNAChemistryManager.cc.

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

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 662 of file G4DNAChemistryManager.cc.

664{
665 if (fpThreadData->fpPhysChemIO)
666 {
667 fpThreadData->fpPhysChemIO->CreateSolvatedElectron(pIncomingTrack,
668 pFinalPosition);
669 }
670
671 if (fActiveChemistry)
672 {
673 PushMolecule(std::unique_ptr<G4Molecule>(new G4Molecule(G4Electron_aq::Definition())),
674 picosecond,
675 pFinalPosition ? *pFinalPosition : pIncomingTrack->GetPosition(),
676 pIncomingTrack->GetTrackID());
677 }
678}
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 606 of file G4DNAChemistryManager.cc.

609{
610 if (fpThreadData->fpPhysChemIO)
611 {
612 G4double energy = -1.;
613
614 switch (modification)
615 {
617 energy = 0.;
618 break;
619 case eExcitedMolecule:
620 energy = GetExcitationLevel()->ExcitationEnergy(electronicLevel);
621 break;
622 case eIonizedMolecule:
623 energy = GetIonisationLevel()->IonisationEnergy(electronicLevel);
624 break;
625 }
626
627 fpThreadData->fpPhysChemIO->CreateWaterMolecule(modification,
628 4 - electronicLevel,
629 energy,
630 pIncomingTrack);
631 }
632
633 if (fActiveChemistry)
634 {
635 G4Molecule* pH2OMolecule = new G4Molecule(G4H2O::Definition());
636
637 switch (modification)
638 {
640 pH2OMolecule->AddElectron(5, 1);
641 break;
642 case eExcitedMolecule:
643 pH2OMolecule->ExciteMolecule(4 - electronicLevel);
644 break;
645 case eIonizedMolecule:
646 pH2OMolecule->IonizeMolecule(4 - electronicLevel);
647 break;
648 }
649
650 G4Track* pH2OTrack = pH2OMolecule->BuildTrack(picosecond,
651 pIncomingTrack->GetPosition());
652
653 pH2OTrack->SetParentID(pIncomingTrack->GetTrackID());
654 pH2OTrack->SetTrackStatus(fStopButAlive);
655 pH2OTrack->SetKineticEnergy(0.);
656 PushTrack(pH2OTrack);
657 }
658}
@ 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:308
void AddElectron(G4int orbit, G4int n=1)
Definition: G4Molecule.cc:315
G4Track * BuildTrack(G4double globalTime, const G4ThreeVector &Position)
Definition: G4Molecule.cc:373
void ExciteMolecule(G4int)
Definition: G4Molecule.cc:301
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(), G4DNADingfelderChargeDecreaseModel::SampleSecondaries(), G4DNAEmfietzoglouExcitationModel::SampleSecondaries(), G4DNAEmfietzoglouIonisationModel::SampleSecondaries(), G4DNAMillerGreenExcitationModel::SampleSecondaries(), G4DNARuddIonisationExtendedModel::SampleSecondaries(), G4DNARuddIonisationModel::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 730 of file G4DNAChemistryManager.cc.

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

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

◆ ForceMasterReinitialization()

void G4DNAChemistryManager::ForceMasterReinitialization ( )

Definition at line 780 of file G4DNAChemistryManager.cc.

781{
782 fMasterInitialized = false;
784}

◆ ForceRebuildingPhysicsTable()

void G4DNAChemistryManager::ForceRebuildingPhysicsTable ( )

Definition at line 773 of file G4DNAChemistryManager.cc.

774{
775 fPhysicsTableBuilt = false;
776}

◆ ForceThreadReinitialization()

void G4DNAChemistryManager::ForceThreadReinitialization ( )

Definition at line 788 of file G4DNAChemistryManager.cc.

789{
790 fForceThreadReinitialization = true;
791}

◆ 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:430

◆ GetExcitationLevel()

G4DNAWaterExcitationStructure * G4DNAChemistryManager::GetExcitationLevel ( )
protected

Definition at line 584 of file G4DNAChemistryManager.cc.

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

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 595 of file G4DNAChemistryManager.cc.

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

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 507 of file G4DNAChemistryManager.cc.

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

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 }
419
421 // creates a concrete object of the scheduler
422
423
424 fpUserChemistryList->ConstructDissociationChannels();
425 if (!fSkipReactions)
426 {
427 fpUserChemistryList->ConstructReactionTable(G4DNAMolecularReactionTable::GetReactionTable());
428 }
429 else
430 {
432 }
433 fMasterInitialized = true;
434}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
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 }
486
487 if (fVerbose)
488 {
489 G4cout << "G4DNAChemistryManager::InitializeThread() is called"
490 << G4endl;
491 }
492
494
495 fpUserChemistryList->ConstructTimeStepModel(G4DNAMolecularReactionTable::GetReactionTable());
497
498 fpThreadData->fThreadInitialized = true;
499
501
503}
void Initialize()
Definition: G4Scheduler.cc:281
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(), G4DNADingfelderChargeDecreaseModel::SampleSecondaries(), G4DNAEmfietzoglouExcitationModel::SampleSecondaries(), G4DNAEmfietzoglouIonisationModel::SampleSecondaries(), G4DNAMeltonAttachmentModel::SampleSecondaries(), G4DNAMillerGreenExcitationModel::SampleSecondaries(), G4TDNAOneStepThermalizationModel< MODEL >::SampleSecondaries(), G4DNARuddIonisationExtendedModel::SampleSecondaries(), G4DNARuddIonisationModel::SampleSecondaries(), G4DNATransformElectronModel::SampleSecondaries(), and G4DNAPTBExcitationModel::SampleSecondaries().

◆ IsActivated()

G4bool G4DNAChemistryManager::IsActivated ( )
static

Definition at line 523 of file G4DNAChemistryManager.cc.

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

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

◆ IsChemistryActivated()

G4bool G4DNAChemistryManager::IsChemistryActivated ( )

Definition at line 530 of file G4DNAChemistryManager.cc.

531{
532 return fActiveChemistry;
533}

Referenced by IsActivated().

◆ IsCounterResetWhenRunEnds()

G4bool G4DNAChemistryManager::IsCounterResetWhenRunEnds ( ) const

Definition at line 759 of file G4DNAChemistryManager.cc.

760{
761 return fResetCounterWhenRunEnds;
762}

◆ 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 682 of file G4DNAChemistryManager.cc.

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

Referenced by CreateSolvatedElectron().

◆ PushTrack()

void G4DNAChemistryManager::PushTrack ( G4Track pTrack)
protected

Definition at line 745 of file G4DNAChemistryManager.cc.

746{
748}
virtual void Push(G4Track *)
static G4ITTrackHolder * Instance()

Referenced by CreateWaterMolecule(), and PushMolecule().

◆ ResetCounterWhenRunEnds()

void G4DNAChemistryManager::ResetCounterWhenRunEnds ( G4bool  resetCounterWhenRunEnds)

Definition at line 766 of file G4DNAChemistryManager.cc.

767{
768 fResetCounterWhenRunEnds = resetCounterWhenRunEnds;
769}

◆ 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:376
static G4VMoleculeCounter * Instance()
virtual void ResetCounter()=0

Referenced by SetNewValue().

◆ SetChemistryActivation()

void G4DNAChemistryManager::SetChemistryActivation ( G4bool  flag)

Definition at line 537 of file G4DNAChemistryManager.cc.

538{
539 fActiveChemistry = flag;
540}

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 714 of file G4DNAChemistryManager.cc.

715{
716 fpUserChemistryList.reset(&chemistryList);
717 fOwnChemistryList = false;
719}

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 707 of file G4DNAChemistryManager.cc.

708{
709 fpUserChemistryList.reset(pChemistryList);
710 fOwnChemistryList = false;
712}

◆ 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 721 of file G4DNAChemistryManager.cc.

722{
723 fpUserChemistryList = std::move(pChemistryList);
724 fOwnChemistryList = true;
726}

◆ SetGlobalTemperature()

void G4DNAChemistryManager::SetGlobalTemperature ( G4double  temperatureKelvin)
protected

Definition at line 699 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:417

◆ 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:543

◆ 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 752 of file G4DNAChemistryManager.cc.

753{
754 fVerbose = verbose;
755}

◆ TagThreadForReinitialization()

void G4DNAChemistryManager::TagThreadForReinitialization ( )

Definition at line 795 of file G4DNAChemistryManager.cc.

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

◆ 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 544 of file G4DNAChemistryManager.cc.

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

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