Geant4 11.2.2
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 ()
 
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
 

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

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

◆ G4DNAChemistryManager()

G4DNAChemistryManager::G4DNAChemistryManager ( )
protected

Definition at line 103 of file G4DNAChemistryManager.cc.

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

Referenced by Instance().

Member Function Documentation

◆ AddEmptyLineInOutputFile()

void G4DNAChemistryManager::AddEmptyLineInOutputFile ( )

Definition at line 553 of file G4DNAChemistryManager.cc.

554{
555 if (fpThreadData->fpPhysChemIO)
556 {
557 fpThreadData->fpPhysChemIO->AddEmptyLineInOutputFile();
558 }
559}

◆ Clear()

void G4DNAChemistryManager::Clear ( )

Definition at line 164 of file G4DNAChemistryManager.cc.

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

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

◆ CloseFile()

void G4DNAChemistryManager::CloseFile ( )

Close the file specified with WriteInto

Definition at line 563 of file G4DNAChemistryManager.cc.

564{
565 if (fpThreadData->fpPhysChemIO)
566 {
567 fpThreadData->fpPhysChemIO->CloseFile();
568 }
569}

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 G4double delayedTime = 0.;
674 if(pIncomingTrack->GetUserInformation() != nullptr)
675 {
676 auto pPulseInfo = dynamic_cast<G4VUserPulseInfo*>
677 (pIncomingTrack->GetUserInformation());
678 if(pPulseInfo != nullptr)
679 {
680 delayedTime = pPulseInfo->GetDelayedTime();
681 }
682 }
683
684 PushMolecule(std::make_unique<G4Molecule>(G4Electron_aq::Definition()),
685 picosecond + delayedTime,
686 pFinalPosition != nullptr ? *pFinalPosition : pIncomingTrack->GetPosition(),
687 pIncomingTrack->GetTrackID());
688 }
689}
double G4double
Definition G4Types.hh:83
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
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 595 of file G4DNAChemistryManager.cc.

598{
599 if (fpThreadData->fpPhysChemIO)
600 {
601 G4double energy = -1.;
602
603 switch (modification)
604 {
606 energy = 0.;
607 break;
608 case eExcitedMolecule:
609 energy = GetExcitationLevel()->ExcitationEnergy(electronicLevel);
610 break;
611 case eIonizedMolecule:
612 energy = GetIonisationLevel()->IonisationEnergy(electronicLevel);
613 break;
614 }
615
616 fpThreadData->fpPhysChemIO->CreateWaterMolecule(modification,
617 4 - electronicLevel,
618 energy,
619 pIncomingTrack);
620 }
621
622 if (fActiveChemistry)
623 {
624 auto pH2OMolecule = new G4Molecule(G4H2O::Definition());
625
626 switch (modification)
627 {
629 pH2OMolecule->AddElectron(5, 1);
630 break;
631 case eExcitedMolecule:
632 pH2OMolecule->ExciteMolecule(4 - electronicLevel);
633 break;
634 case eIonizedMolecule:
635 pH2OMolecule->IonizeMolecule(4 - electronicLevel);
636 break;
637 }
638
639 G4double delayedTime = 0.;
640 if(pIncomingTrack->GetUserInformation() != nullptr)
641 {
642 auto pPulseInfo = dynamic_cast<G4VUserPulseInfo*>
643 (pIncomingTrack->GetUserInformation());
644 if(pPulseInfo != nullptr)
645 {
646 delayedTime = pPulseInfo->GetDelayedTime();
647 }
648 }
649
650 G4Track* pH2OTrack = pH2OMolecule->BuildTrack(picosecond + delayedTime,
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
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(), G4DNABornIonisationModel1::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 194 of file G4DNAChemistryManager.cc.

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

◆ Deregister()

void G4DNAChemistryManager::Deregister ( G4VUserChemistryList & chemistryList)

Definition at line 741 of file G4DNAChemistryManager.cc.

742{
743 if (fpUserChemistryList.get() == &chemistryList)
744 {
745 if (!fpUserChemistryList->IsPhysicsConstructor() || fOwnChemistryList)
746 {
747 fpUserChemistryList.reset();
748 }
749
750 fpUserChemistryList.release();
751 }
752}

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

◆ ForceMasterReinitialization()

void G4DNAChemistryManager::ForceMasterReinitialization ( )

Definition at line 791 of file G4DNAChemistryManager.cc.

792{
793 fMasterInitialized = false;
795}

◆ ForceRebuildingPhysicsTable()

void G4DNAChemistryManager::ForceRebuildingPhysicsTable ( )

Definition at line 784 of file G4DNAChemistryManager.cc.

785{
786 fPhysicsTableBuilt = false;
787}

◆ ForceThreadReinitialization()

void G4DNAChemistryManager::ForceThreadReinitialization ( )

Definition at line 799 of file G4DNAChemistryManager.cc.

800{
801 fForceThreadReinitialization = true;
802}

◆ GetCurrentValue()

G4String G4DNAChemistryManager::GetCurrentValue ( G4UIcommand * pCommand)
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 270 of file G4DNAChemistryManager.cc.

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

◆ GetExcitationLevel()

G4DNAWaterExcitationStructure * G4DNAChemistryManager::GetExcitationLevel ( )
protected

Definition at line 573 of file G4DNAChemistryManager.cc.

574{
575 if (!fpExcitationLevel)
576 {
577 fpExcitationLevel = std::make_unique<G4DNAWaterExcitationStructure>();
578 }
579 return fpExcitationLevel.get();
580}

Referenced by CreateWaterMolecule().

◆ GetInstanceIfExists()

G4DNAChemistryManager * G4DNAChemistryManager::GetInstanceIfExists ( )
static

Definition at line 149 of file G4DNAChemistryManager.cc.

150{
151 return fgInstance;
152}

Referenced by G4VUserChemistryList::~G4VUserChemistryList().

◆ GetIonisationLevel()

G4DNAWaterIonisationStructure * G4DNAChemistryManager::GetIonisationLevel ( )
protected

Definition at line 584 of file G4DNAChemistryManager.cc.

585{
586 if (!fpIonisationLevel)
587 {
588 fpIonisationLevel = std::make_unique<G4DNAWaterIonisationStructure>();
589 }
590 return fpIonisationLevel.get();
591}

Referenced by CreateWaterMolecule().

◆ HandleStandaloneInitialization()

void G4DNAChemistryManager::HandleStandaloneInitialization ( )
protected

Definition at line 426 of file G4DNAChemistryManager.cc.

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

497{
498 if (fVerbose != 0)
499 {
500 G4cout << "G4DNAChemistryManager::InitializeFile() is called"
501 << G4endl;
502 }
503
504 if (fpThreadData->fpPhysChemIO)
505 {
506 fpThreadData->fpPhysChemIO->InitializeFile();
507 }
508}

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 fMasterInitialized = true;
422}
@ 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 460 of file G4DNAChemistryManager.cc.

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

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

◆ InitializeThreadSharedData()

void G4DNAChemistryManager::InitializeThreadSharedData ( )
protected

Definition at line 290 of file G4DNAChemistryManager.cc.

291{
293 {
294 return;
295 }
296
299}
void Finalize(G4MoleculeDefinition *)
void PrepareMolecularConfiguration()
static G4MoleculeTable * Instance()
G4bool IsMasterThread()

Referenced by Initialize(), and Notify().

◆ Instance()

G4DNAChemistryManager * G4DNAChemistryManager::Instance ( )
static

Definition at line 124 of file G4DNAChemistryManager.cc.

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

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(), G4DNABornExcitationModel1::SampleSecondaries(), G4DNABornExcitationModel2::SampleSecondaries(), G4DNABornIonisationModel1::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 512 of file G4DNAChemistryManager.cc.

513{
514 return fgInstance != nullptr ? fgInstance->IsChemistryActivated() : false;
515}

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

◆ IsChemistryActivated()

G4bool G4DNAChemistryManager::IsChemistryActivated ( )

Definition at line 519 of file G4DNAChemistryManager.cc.

520{
521 return fActiveChemistry;
522}

Referenced by IsActivated().

◆ IsCounterResetWhenRunEnds()

G4bool G4DNAChemistryManager::IsCounterResetWhenRunEnds ( ) const

Definition at line 770 of file G4DNAChemistryManager.cc.

771{
772 return fResetCounterWhenRunEnds;
773}

◆ Notify()

G4bool G4DNAChemistryManager::Notify ( G4ApplicationState requestedState)
overridevirtual

Implements G4VStateDependent.

Definition at line 214 of file G4DNAChemistryManager.cc.

215{
216 if (requestedState == G4State_Quit)
217 {
218 if (fVerbose != 0)
219 {
220 G4cout << "G4DNAChemistryManager::Notify ---> received G4State_Quit"
221 << G4endl;
222 }
223 Clear();
224 }
225 else if (requestedState == G4State_GeomClosed)
226 {
227 fGeometryClosed = true;
228 }
229 else if (requestedState == G4State_Idle)
230 {
232 }
233
234 return true;
235}
@ 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 693 of file G4DNAChemistryManager.cc.

697{
698 assert(fActiveChemistry
699 && "To inject chemical species, the chemistry must be activated. "
700 "Check chemistry activation before injecting species.");
701 G4Track* pTrack = pMolecule->BuildTrack(time, position);
702 pTrack->SetTrackStatus(fAlive);
703 pTrack->SetParentID(parentID);
704 pMolecule.release();
705 PushTrack(pTrack);
706}
@ fAlive

Referenced by CreateSolvatedElectron().

◆ PushTrack()

void G4DNAChemistryManager::PushTrack ( G4Track * pTrack)
protected

Definition at line 756 of file G4DNAChemistryManager.cc.

757{
759}
void Push(G4Track *) override
static G4ITTrackHolder * Instance()

Referenced by CreateWaterMolecule(), and PushMolecule().

◆ ResetCounterWhenRunEnds()

void G4DNAChemistryManager::ResetCounterWhenRunEnds ( G4bool resetCounterWhenRunEnds)

Definition at line 777 of file G4DNAChemistryManager.cc.

778{
779 fResetCounterWhenRunEnds = resetCounterWhenRunEnds;
780}

◆ Run()

void G4DNAChemistryManager::Run ( )

Definition at line 302 of file G4DNAChemistryManager.cc.

303{
304 if (!fActiveChemistry)
305 {
306 return;
307 }
308
310
311 if (!fMasterInitialized)
312 {
313 G4ExceptionDescription description;
314 description << "Global components were not initialized.";
315 G4Exception("G4DNAChemistryManager::Run", "MASTER_INIT", FatalException,
316 description);
317 }
318
319 if (!fpThreadData->fThreadInitialized)
320 {
321 G4ExceptionDescription description;
322 description << "Thread local components were not initialized.";
323 G4Exception("G4DNAChemistryManager::Run", "THREAD_INIT", FatalException,
324 description);
325 }
326
329 if (fResetCounterWhenRunEnds)
330 {
332 }
333 CloseFile();
334}
void Process() override
static G4VMoleculeCounter * Instance()
virtual void ResetCounter()=0

Referenced by SetNewValue().

◆ SetChemistryActivation()

void G4DNAChemistryManager::SetChemistryActivation ( G4bool flag)

Definition at line 526 of file G4DNAChemistryManager.cc.

527{
528 fActiveChemistry = flag;
529}

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

726{
727 fpUserChemistryList.reset(&chemistryList);
728 fOwnChemistryList = false;
730}

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

719{
720 fpUserChemistryList.reset(pChemistryList);
721 fOwnChemistryList = false;
723}

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

733{
734 fpUserChemistryList = std::move(pChemistryList);
735 fOwnChemistryList = true;
737}

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

240{
241 if (pCommand == fpActivateChem.get())
242 {
244 }
245 else if (pCommand == fpRunChem.get())
246 {
247 int nbExec = value.empty() ? 1 : G4UIcommand::ConvertToInt(value);
248 for (int i = 0 ; i < nbExec ; ++i)
249 {
250 Run();
251 }
252 }
253 else if (pCommand == fpSkipReactionsFromChemList.get())
254 {
255 fSkipReactions = true;
256 }
257 else if (pCommand == fpScaleForNewTemperature.get())
258 {
259 SetGlobalTemperature(fpScaleForNewTemperature->ConvertToDimensionedDouble(value));
260 }
261 else if (pCommand == fpInitChem.get())
262 {
263 Initialize();
265 }
266}
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 90 of file G4DNAChemistryManager.cc.

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

◆ SetVerbose()

void G4DNAChemistryManager::SetVerbose ( G4int verbose)

Definition at line 763 of file G4DNAChemistryManager.cc.

764{
765 fVerbose = verbose;
766}

◆ TagThreadForReinitialization()

void G4DNAChemistryManager::TagThreadForReinitialization ( )

Definition at line 806 of file G4DNAChemistryManager.cc.

807{
808 fpThreadData->fThreadInitialized = false;
809}

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

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

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