Geant4 11.4.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)
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, const G4Track *parentTrack=nullptr)
void BeginOfEventAction (const G4Event *)
void BeginOfRunAction (const G4Run *)
void EndOfEventAction (const G4Event *)
void EndOfRunAction (const G4Run *)
Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
virtual ~G4UImessenger ()
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 void NotifyDeletion (const G4Event *)
virtual void NotifyDeletion (const G4Run *)

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 LtoS (G4long l)
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 (const 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 90 of file G4DNAChemistryManager.hh.

Constructor & Destructor Documentation

◆ ~G4DNAChemistryManager()

G4DNAChemistryManager::~G4DNAChemistryManager ( )
overrideprotected

Definition at line 157 of file G4DNAChemistryManager.cc.

158{
159 Clear();
160 fgInstance = nullptr;
161}

◆ G4DNAChemistryManager()

G4DNAChemistryManager::G4DNAChemistryManager ( )
protected

Definition at line 104 of file G4DNAChemistryManager.cc.

105 :
106 fpChemDNADirectory(new G4UIdirectory("/chem/"))
107 , fpActivateChem(new G4UIcmdWithABool("/chem/activate", this))
108 , fpRunChem(new G4UIcmdWithAnInteger("/chem/run", this))
109 , fpSkipReactionsFromChemList(new G4UIcmdWithoutParameter("/chem/skipReactionsFromChemList", this))
110 , fpScaleForNewTemperature(new G4UIcmdWithADoubleAndUnit("/chem/temperature", this))
111 , fpInitChem(new G4UIcmdWithoutParameter("/chem/init", this))
112 ,
113 fpExcitationLevel(nullptr)
114 , fpIonisationLevel(nullptr)
115 , fpUserChemistryList(nullptr)
116{
117 fpRunChem->SetParameterName("Number of runs to execute for the chemistry module"
118 "(this works when used in standalone", true, true);
119 fpRunChem->SetDefaultValue(1);
120 fpScaleForNewTemperature->SetUnitCategory("Temperature");
121}

Referenced by DeleteInstance(), GetInstanceIfExists(), and Instance().

Member Function Documentation

◆ AddEmptyLineInOutputFile()

void G4DNAChemistryManager::AddEmptyLineInOutputFile ( )

Definition at line 558 of file G4DNAChemistryManager.cc.

559{
560 if (fpThreadData->fpPhysChemIO)
561 {
562 fpThreadData->fpPhysChemIO->AddEmptyLineInOutputFile();
563 }
564}

◆ BeginOfEventAction()

void G4DNAChemistryManager::BeginOfEventAction ( const G4Event * pEvent)

Definition at line 778 of file G4DNAChemistryManager.cc.

779{
781}
void BeginOfEventAction(const G4Event *)
static G4MoleculeCounterManager * Instance()

◆ BeginOfRunAction()

void G4DNAChemistryManager::BeginOfRunAction ( const G4Run * pRun)

Definition at line 785 of file G4DNAChemistryManager.cc.

◆ Clear()

void G4DNAChemistryManager::Clear ( )

Definition at line 165 of file G4DNAChemistryManager.cc.

166{
167 fpIonisationLevel.reset();
168 fpExcitationLevel.reset();
169
170 if (fpUserChemistryList)
171 {
172 Deregister(*fpUserChemistryList);
173 }
174
175 fpChemDNADirectory.reset();
176 fpActivateChem.reset();
177 fpRunChem.reset();
178
179 fpSkipReactionsFromChemList.reset();
180 fpInitChem.reset();
181
182 if (fpThreadData != nullptr)
183 {
184 delete fpThreadData;
185 fpThreadData = nullptr;
186 }
187
192}
void Deregister(G4VUserChemistryList &)
static G4MoleculeCounterManager * GetInstanceIfExists()

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

◆ CloseFile()

void G4DNAChemistryManager::CloseFile ( )

Close the file specified with WriteInto

Definition at line 568 of file G4DNAChemistryManager.cc.

569{
570 if (fpThreadData->fpPhysChemIO)
571 {
572 fpThreadData->fpPhysChemIO->CloseFile();
573 }
574}

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

670{
671 if (fpThreadData->fpPhysChemIO)
672 {
673 fpThreadData->fpPhysChemIO->CreateSolvatedElectron(pIncomingTrack,
674 pFinalPosition);
675 }
676
677 if (fActiveChemistry)
678 {
679 G4double delayedTime = 0.;
680 if(pIncomingTrack->GetUserInformation() != nullptr)
681 {
682 auto pPulseInfo = dynamic_cast<G4VUserPulseInfo*>
683 (pIncomingTrack->GetUserInformation());
684 if(pPulseInfo != nullptr)
685 {
686 delayedTime = pPulseInfo->GetDelayedTime();
687 }
688 }
689
690 PushMolecule(std::make_unique<G4Molecule>(G4Electron_aq::Definition()),
691 picosecond + delayedTime,
692 pFinalPosition ? *pFinalPosition : pIncomingTrack->GetPosition(),
693 pIncomingTrack->GetTrackID(),
694 pIncomingTrack);
695 }
696}
double G4double
Definition G4Types.hh:83
void PushMolecule(std::unique_ptr< G4Molecule > pMolecule, G4double time, const G4ThreeVector &position, G4int parentID, const G4Track *parentTrack=nullptr)
static G4Electron_aq * Definition()
G4int GetTrackID() const
const G4ThreeVector & GetPosition() const
G4VUserTrackInformation * GetUserInformation() const

Referenced by G4DNATransformElectronModel::SampleSecondaries(), and G4TDNAOneStepThermalizationModel< MODEL >::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 600 of file G4DNAChemistryManager.cc.

603{
604 if (fpThreadData->fpPhysChemIO)
605 {
606 G4double energy = -1.;
607
608 switch (modification)
609 {
611 energy = 0.;
612 break;
613 case eExcitedMolecule:
614 energy = GetExcitationLevel()->ExcitationEnergy(electronicLevel);
615 break;
616 case eIonizedMolecule:
617 energy = GetIonisationLevel()->IonisationEnergy(electronicLevel);
618 break;
619 }
620
621 fpThreadData->fpPhysChemIO->CreateWaterMolecule(modification,
622 4 - electronicLevel,
623 energy,
624 pIncomingTrack);
625 }
626
627 if (fActiveChemistry)
628 {
629 auto pH2OMolecule = new G4Molecule(G4H2O::Definition());
630
631 switch (modification)
632 {
634 pH2OMolecule->AddElectron(5, 1);
635 break;
636 case eExcitedMolecule:
637 pH2OMolecule->ExciteMolecule(4 - electronicLevel);
638 break;
639 case eIonizedMolecule:
640 pH2OMolecule->IonizeMolecule(4 - electronicLevel);
641 break;
642 }
643
644 G4double delayedTime = 0.;
645 if(pIncomingTrack->GetUserInformation() != nullptr)
646 {
647 auto pPulseInfo = dynamic_cast<G4VUserPulseInfo*>
648 (pIncomingTrack->GetUserInformation());
649 if(pPulseInfo != nullptr)
650 {
651 delayedTime = pPulseInfo->GetDelayedTime();
652 }
653 }
654
655 G4Track *pH2OTrack = pH2OMolecule->BuildTrack(picosecond + delayedTime,
656 pIncomingTrack->GetPosition(),
657 pIncomingTrack);
658
659 pH2OTrack->SetParentID(pIncomingTrack->GetTrackID());
660 pH2OTrack->SetTrackStatus(fStopButAlive);
661 pH2OTrack->SetKineticEnergy(0.);
662 PushTrack(pH2OTrack);
663 }
664}
@ eIonizedMolecule
@ eDissociativeAttachment
@ eExcitedMolecule
@ fStopButAlive
G4DNAWaterIonisationStructure * GetIonisationLevel()
G4DNAWaterExcitationStructure * GetExcitationLevel()
static G4H2O * Definition()
Definition G4H2O.cc:42
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(), G4DNABornIonisationModel2::SampleSecondaries(), G4DNACPA100ExcitationModel::SampleSecondaries(), G4DNACPA100IonisationModel::SampleSecondaries(), G4DNADingfelderChargeDecreaseModel::SampleSecondaries(), G4DNAEmfietzoglouExcitationModel::SampleSecondaries(), G4DNAEmfietzoglouIonisationModel::SampleSecondaries(), G4DNAMillerGreenExcitationModel::SampleSecondaries(), G4DNAPTBExcitationModel::SampleSecondaries(), G4DNARPWBAExcitationModel::SampleSecondaries(), G4DNARPWBAIonisationModel::SampleSecondaries(), G4DNARuddIonisationExtendedModel::SampleSecondaries(), and G4DNARuddIonisationModel::SampleSecondaries().

◆ DeleteInstance()

void G4DNAChemistryManager::DeleteInstance ( )
static

Definition at line 196 of file G4DNAChemistryManager.cc.

197{
199
200 if (fgInstance != nullptr)
201 {
202 G4DNAChemistryManager* pDeleteMe = fgInstance;
203 fgInstance = nullptr;
204 lock.unlock();
205 delete pDeleteMe;
206 }
207 else
208 {
209 G4cerr << "G4DNAChemistryManager already deleted" << G4endl;
210 }
211 lock.unlock();
212}
G4TemplateAutoLock< G4Mutex > G4AutoLock
G4Mutex chemManExistence
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition G4ios.hh:67

◆ Deregister()

void G4DNAChemistryManager::Deregister ( G4VUserChemistryList & chemistryList)

Definition at line 749 of file G4DNAChemistryManager.cc.

750{
751 if (fpUserChemistryList.get() == &chemistryList)
752 {
753 if (!fpUserChemistryList->IsPhysicsConstructor() || fOwnChemistryList)
754 {
755 fpUserChemistryList.reset();
756 }
757
758 fpUserChemistryList.release();
759 }
760}

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

◆ EndOfEventAction()

void G4DNAChemistryManager::EndOfEventAction ( const G4Event * pEvent)

Definition at line 792 of file G4DNAChemistryManager.cc.

◆ EndOfRunAction()

void G4DNAChemistryManager::EndOfRunAction ( const G4Run * pRun)

Definition at line 799 of file G4DNAChemistryManager.cc.

◆ ForceMasterReinitialization()

void G4DNAChemistryManager::ForceMasterReinitialization ( )

Definition at line 813 of file G4DNAChemistryManager.cc.

814{
815 fMasterInitialized = false;
817}

◆ ForceRebuildingPhysicsTable()

void G4DNAChemistryManager::ForceRebuildingPhysicsTable ( )

Definition at line 806 of file G4DNAChemistryManager.cc.

807{
808 fPhysicsTableBuilt = false;
809}

◆ ForceThreadReinitialization()

void G4DNAChemistryManager::ForceThreadReinitialization ( )

Definition at line 821 of file G4DNAChemistryManager.cc.

822{
823 fForceThreadReinitialization = true;
824}

◆ GetCurrentValue()

G4String G4DNAChemistryManager::GetCurrentValue ( G4UIcommand * pCommand)
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 272 of file G4DNAChemistryManager.cc.

273{
274 if (pCommand == fpActivateChem.get())
275 {
276 return G4UIcmdWithABool::ConvertToString(fActiveChemistry);
277 }
278 if (pCommand == fpScaleForNewTemperature.get())
279 {
280 return fpScaleForNewTemperature->ConvertToStringWithBestUnit(G4MolecularConfiguration::GetGlobalTemperature());
281 }
282 if (pCommand == fpSkipReactionsFromChemList.get())
283 {
284 return G4UIcmdWithABool::ConvertToString(fSkipReactions);
285 }
286
287 return "";
288}
static G4String ConvertToString(G4bool boolVal)

◆ GetExcitationLevel()

G4DNAWaterExcitationStructure * G4DNAChemistryManager::GetExcitationLevel ( )
protected

Definition at line 578 of file G4DNAChemistryManager.cc.

579{
580 if (!fpExcitationLevel)
581 {
582 fpExcitationLevel = std::make_unique<G4DNAWaterExcitationStructure>();
583 }
584 return fpExcitationLevel.get();
585}

Referenced by CreateWaterMolecule().

◆ GetInstanceIfExists()

G4DNAChemistryManager * G4DNAChemistryManager::GetInstanceIfExists ( )
static

Definition at line 150 of file G4DNAChemistryManager.cc.

151{
152 return fgInstance;
153}

Referenced by G4VUserChemistryList::~G4VUserChemistryList().

◆ GetIonisationLevel()

G4DNAWaterIonisationStructure * G4DNAChemistryManager::GetIonisationLevel ( )
protected

Definition at line 589 of file G4DNAChemistryManager.cc.

590{
591 if (!fpIonisationLevel)
592 {
593 fpIonisationLevel = std::make_unique<G4DNAWaterIonisationStructure>();
594 }
595 return fpIonisationLevel.get();
596}

Referenced by CreateWaterMolecule().

◆ HandleStandaloneInitialization()

void G4DNAChemistryManager::HandleStandaloneInitialization ( )
protected

Definition at line 430 of file G4DNAChemistryManager.cc.

431{
432 if (!fUseInStandalone || fPhysicsTableBuilt)
433 {
434 return;
435 }
436
437 if (fVerbose != 0)
438 {
439 G4cout << "G4DNAChemistryManager: Build the physics tables for "
440 "molecule definition only."
441 << G4endl;
442 }
443
444 fpUserChemistryList->BuildPhysicsTable();
445
446 if (!fGeometryClosed)
447 {
448 if (fVerbose != 0)
449 {
450 G4cout << "G4DNAChemistryManager: Close geometry" << G4endl;
451 }
452
453 G4GeometryManager* pGeomManager = G4GeometryManager::GetInstance();
454 pGeomManager->OpenGeometry();
455 pGeomManager->CloseGeometry(true, true);
456 fGeometryClosed = true;
457 }
458
459 fPhysicsTableBuilt = true;
460}
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 352 of file G4DNAChemistryManager.cc.

353{
354 //===========================================================================
355 // MT MODE
356 //===========================================================================
358 {
359 //==========================================================================
360 // ON WORKER THREAD
361 //==========================================================================
363 {
364 InitializeThread(); // Will create and initialize G4Scheduler
365 return;
366 }
367 //==========================================================================
368 // ON MASTER THREAD
369 //==========================================================================
370
373 return;
374 }
375 //===========================================================================
376 // IS NOT IN MT MODE
377 //===========================================================================
378
381 // In this case: InitializeThread is called when Run() is called
382 return;
383}
G4bool IsWorkerThread()
G4bool IsMultithreadedApplication()

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

◆ InitializeFile()

void G4DNAChemistryManager::InitializeFile ( )
protected

Definition at line 501 of file G4DNAChemistryManager.cc.

502{
503 if (fVerbose != 0)
504 {
505 G4cout << "G4DNAChemistryManager::InitializeFile() is called"
506 << G4endl;
507 }
508
509 if (fpThreadData->fpPhysChemIO)
510 {
511 fpThreadData->fpPhysChemIO->InitializeFile();
512 }
513}

Referenced by InitializeThread().

◆ InitializeMaster()

void G4DNAChemistryManager::InitializeMaster ( )
protected

Definition at line 387 of file G4DNAChemistryManager.cc.

388{
389 if (fMasterInitialized)
390 {
391 return;
392 }
393
394 if (fVerbose != 0)
395 {
396 G4cout << "G4DNAChemistryManager::InitializeMaster() is called" << G4endl;
397 }
398
399
400 if (fpUserChemistryList == nullptr)
401 {
402 G4ExceptionDescription description;
403 description << "No user chemistry list has been provided.";
404 G4Exception("G4DNAChemistryManager::InitializeMaster", "NO_CHEM_LIST",
405 FatalException, description);
406 }else
407 {
408 fpUserChemistryList->ConstructDissociationChannels();
409 if (!fSkipReactions)
410 {
411 fpUserChemistryList->ConstructReactionTable(G4DNAMolecularReactionTable::GetReactionTable());
412 }
413 else
414 {
416 }
417 }
418
420 // creates a concrete object of the scheduler
421
424
425 fMasterInitialized = true;
426}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static G4DNAMolecularReactionTable * GetReactionTable()
static G4Scheduler * Instance()

Referenced by ForceMasterReinitialization(), and Initialize().

◆ InitializeThread()

void G4DNAChemistryManager::InitializeThread ( )
protected

Definition at line 464 of file G4DNAChemistryManager.cc.

465{
466 if (fpThreadData->fThreadInitialized && !fForceThreadReinitialization)
467 {
468 return;
469 }
470
471 if (fpUserChemistryList == nullptr)
472 {
473 G4ExceptionDescription description;
474 description << "No user chemistry list has been provided.";
475 G4Exception("G4DNAChemistryManager::InitializeThread", "NO_CHEM_LIST",
476 FatalException, description);
477 }else
478 {
479 HandleStandaloneInitialization();// To make coverty happy
480 fpUserChemistryList->ConstructTimeStepModel(G4DNAMolecularReactionTable::GetReactionTable());
481 }
482
483 if (fVerbose != 0)
484 {
485 G4cout << "G4DNAChemistryManager::InitializeThread() is called"
486 << G4endl;
487 }
488
490
493
494 fpThreadData->fThreadInitialized = true;
495
497}
void Initialize() override

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

◆ InitializeThreadSharedData()

void G4DNAChemistryManager::InitializeThreadSharedData ( )
protected

Definition at line 292 of file G4DNAChemistryManager.cc.

293{
295 {
296 return;
297 }
298
301}
void Finalize(G4MoleculeDefinition *)
void PrepareMolecularConfiguration()
static G4MoleculeTable * Instance()
G4bool IsMasterThread()

Referenced by Initialize(), and Notify().

◆ Instance()

G4DNAChemistryManager * G4DNAChemistryManager::Instance ( )
static

Definition at line 125 of file G4DNAChemistryManager.cc.

126{
127 if (fgInstance == nullptr)
128 {
130 if (fgInstance == nullptr) // MT : double check at initialisation
131 {
132 fgInstance = new G4DNAChemistryManager();
133 }
134 lock.unlock();
135 }
136
137 // make sure thread local data is initialized for all threads
138 if (fpThreadData == nullptr)
139 {
140 fpThreadData = new ThreadLocalData();
141 }
142
143 assert(fpThreadData != nullptr);
144
145 return fgInstance;
146}

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

◆ IsActivated()

G4bool G4DNAChemistryManager::IsActivated ( )
static

Definition at line 517 of file G4DNAChemistryManager.cc.

518{
519 return fgInstance != nullptr ? fgInstance->IsChemistryActivated() : false;
520}

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

◆ IsChemistryActivated()

G4bool G4DNAChemistryManager::IsChemistryActivated ( )

Definition at line 524 of file G4DNAChemistryManager.cc.

525{
526 return fActiveChemistry;
527}

◆ Notify()

G4bool G4DNAChemistryManager::Notify ( G4ApplicationState requestedState)
overridevirtual

Implements G4VStateDependent.

Definition at line 216 of file G4DNAChemistryManager.cc.

217{
218 if (requestedState == G4State_Quit)
219 {
220 if (fVerbose != 0)
221 {
222 G4cout << "G4DNAChemistryManager::Notify ---> received G4State_Quit"
223 << G4endl;
224 }
225 Clear();
226 }
227 else if (requestedState == G4State_GeomClosed)
228 {
229 fGeometryClosed = true;
230 }
231 else if (requestedState == G4State_Idle)
232 {
234 }
235
236 return true;
237}
@ G4State_Idle
@ G4State_Quit
@ G4State_GeomClosed

◆ PushMolecule()

void G4DNAChemistryManager::PushMolecule ( std::unique_ptr< G4Molecule > pMolecule,
G4double time,
const G4ThreeVector & position,
G4int parentID,
const G4Track * parentTrack = nullptr )

Definition at line 700 of file G4DNAChemistryManager.cc.

705{
706 assert(fActiveChemistry
707 && "To inject chemical species, the chemistry must be activated. "
708 "Check chemistry activation before injecting species.");
709 G4Track* pTrack = pMolecule->BuildTrack(time, position, parentTrack);
710 pTrack->SetTrackStatus(fAlive);
711 pTrack->SetParentID(parentID);
712 pMolecule.release();
713 PushTrack(pTrack);
714}
@ fAlive

Referenced by CreateSolvatedElectron().

◆ PushTrack()

void G4DNAChemistryManager::PushTrack ( G4Track * pTrack)
protected

Definition at line 764 of file G4DNAChemistryManager.cc.

765{
767}
void Push(G4Track *) override
static G4ITTrackHolder * Instance()

Referenced by CreateWaterMolecule(), and PushMolecule().

◆ Run()

void G4DNAChemistryManager::Run ( )

Definition at line 304 of file G4DNAChemistryManager.cc.

305{
306 if (!fActiveChemistry)
307 {
308 return;
309 }
310
312
313 if (!fMasterInitialized)
314 {
315 G4ExceptionDescription description;
316 description << "Global components were not initialized.";
317 G4Exception("G4DNAChemistryManager::Run", "MASTER_INIT", FatalException,
318 description);
319 }
320
321 if (!fpThreadData->fThreadInitialized)
322 {
323 G4ExceptionDescription description;
324 description << "Thread local components were not initialized.";
325 G4Exception("G4DNAChemistryManager::Run", "THREAD_INIT", FatalException,
326 description);
327 }
328
330
332
333 CloseFile();
334}
void Process() override

Referenced by SetNewValue().

◆ SetChemistryActivation()

void G4DNAChemistryManager::SetChemistryActivation ( G4bool flag)

Definition at line 531 of file G4DNAChemistryManager.cc.

532{
533 fActiveChemistry = flag;
534}

Referenced by SetChemistryList(), SetChemistryList(), SetChemistryList(), and SetNewValue().

◆ SetChemistryList() [1/3]

void G4DNAChemistryManager::SetChemistryList ( G4VUserChemistryList & chemistryList)

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

Definition at line 733 of file G4DNAChemistryManager.cc.

734{
735 fpUserChemistryList.reset(&chemistryList);
736 fOwnChemistryList = false;
738}

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

727{
728 fpUserChemistryList.reset(pChemistryList);
729 fOwnChemistryList = false;
731}

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

741{
742 fpUserChemistryList = std::move(pChemistryList);
743 fOwnChemistryList = true;
745}

◆ SetGlobalTemperature()

void G4DNAChemistryManager::SetGlobalTemperature ( G4double temperatureKelvin)
protected

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

346{
347 G4Scheduler::Instance()->SetGun(pChemGun);
348}
void SetGun(G4ITGun *) override

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 241 of file G4DNAChemistryManager.cc.

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

◆ SetPhysChemIO()

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

Definition at line 91 of file G4DNAChemistryManager.cc.

92{
93 fpThreadData->fpPhysChemIO = std::move(pPhysChemIO);
94}

◆ SetVerbose()

void G4DNAChemistryManager::SetVerbose ( G4int verbose)

Definition at line 771 of file G4DNAChemistryManager.cc.

772{
773 fVerbose = verbose;
774}

◆ TagThreadForReinitialization()

void G4DNAChemistryManager::TagThreadForReinitialization ( )

Definition at line 828 of file G4DNAChemistryManager.cc.

829{
830 fpThreadData->fThreadInitialized = false;
831}

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

339{
340 fUseInStandalone = flag;
341}

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

540{
541 if (fVerbose != 0)
542 {
543 G4cout << "G4DNAChemistryManager: Write chemical stage into "
544 << output.data() << G4endl;
545 }
546
547 if (!fpThreadData->fpPhysChemIO)
548 {
549 fpThreadData->fpPhysChemIO = std::make_unique<G4PhysChemIO::FormattedText>();
550 }
551
552 fpThreadData->fpPhysChemIO->WriteInto(output, mode);
553
554}

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