Geant4-11
G4DNAChemistryManager.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27
28// Author: Mathieu Karamitros
29//
30// The code is developed in the framework of the ESA AO7146
31//
32// We would be very happy hearing from you, send us your feedback! :)
33//
34// In order for Geant4-DNA to be maintained and still open-source,
35// article citations are crucial.
36// If you use Geant4-DNA chemistry and you publish papers about your software,
37// in addition to the general paper on Geant4-DNA:
38//
39// Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
40//
41// we would be very happy if you could please also cite the following
42// reference papers on chemistry:
43//
44// J. Comput. Phys. 274 (2014) 841-882
45// Prog. Nucl. Sci. Tec. 2 (2011) 503-508
46
47#pragma once
48
49#include "globals.hh"
50#include "G4ThreeVector.hh"
51#include <fstream>
52#include <memory>
53#include "G4UImessenger.hh"
54#include "G4VStateDependent.hh"
55
56class G4Track;
59class G4Molecule;
65class G4ITGun;
66class G4VPhysChemIO;
67
69{
73};
74
89{
90protected:
91 ~G4DNAChemistryManager() override;
92
93public:
94 //============================================================================
95 // STATIC METHODS
96 //============================================================================
99
100 static void DeleteInstance();
101 static G4bool IsActivated();
102
103 //============================================================================
104 // VIRTUAL METHODS
105 //============================================================================
106 // G4VStateDependent
107 G4bool Notify(G4ApplicationState requestedState) override;
108 // G4UImessenger
109 void SetNewValue(G4UIcommand*, G4String) override;
110 G4String GetCurrentValue(G4UIcommand* pCommand) override;
111
112 //============================================================================
113 // INITIALIZATION AND FINALIZATION METHODS
114 //============================================================================
117
120
122 void SetChemistryList(std::unique_ptr<G4VUserChemistryList>);
123
124 // [[deprecated]] : chemistry list should never be nullptr
126
128
129 void Initialize();
130 void Run();
131 void Clear();
132
140 void SetGun(G4ITGun* pChemSpeciesGun);
141
142 void SetPhysChemIO(std::unique_ptr<G4VPhysChemIO> pPhysChemIO);
143
144 void SetVerbose(G4int verbose);
145
152 void UseAsStandalone(G4bool flag);
154
155 void ResetCounterWhenRunEnds(G4bool resetCounterWhenRunEnds);
156
161
162 //============================================================================
163 // FILE OPERATIONS
164 //============================================================================
170 void WriteInto(const G4String&, std::ios_base::openmode mode =
171 std::ios_base::out);
173
177 void CloseFile();
178
179 //============================================================================
180 // PUSH MOLECULES
181 //============================================================================
190 G4int /*electronicLevel*/,
191 const G4Track* /*pIncomingTrack*/);
192
197 void CreateSolvatedElectron(const G4Track* /*pIncomingTrack*/,
198 G4ThreeVector* pFinalPosition = nullptr);
199
200 void PushMolecule(std::unique_ptr<G4Molecule> pMolecule,
201 G4double time,
202 const G4ThreeVector& position,
203 G4int parentID);
204
205protected:
207 void PushTrack(G4Track*);
208 void SetGlobalTemperature(G4double temperatureKelvin);
209
212 void InitializeFile();
213 void InitializeMaster();
214 void InitializeThread();
216
218
219private:
220 std::unique_ptr<G4UIdirectory> fpChemDNADirectory;
221 std::unique_ptr<G4UIcmdWithABool> fpActivateChem;
222 std::unique_ptr<G4UIcmdWithAnInteger> fpRunChem;
223 std::unique_ptr<G4UIcmdWithoutParameter> fpSkipReactionsFromChemList;
224 std::unique_ptr<G4UIcmdWithADoubleAndUnit> fpScaleForNewTemperature;
225 std::unique_ptr<G4UIcmdWithoutParameter> fpInitChem;
226
229
233 std::unique_ptr<G4VPhysChemIO> fpPhysChemIO;
235 };
236
238
241
242 std::unique_ptr<G4DNAWaterExcitationStructure> fpExcitationLevel;
243 std::unique_ptr<G4DNAWaterIonisationStructure> fpIonisationLevel;
244
245 std::unique_ptr<G4VUserChemistryList> fpUserChemistryList;
250
252
255};
G4ApplicationState
ElectronicModification
@ eIonizedMolecule
@ eDissociativeAttachment
@ eExcitedMolecule
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
void SetPhysChemIO(std::unique_ptr< G4VPhysChemIO > pPhysChemIO)
G4String GetCurrentValue(G4UIcommand *pCommand) override
G4bool IsCounterResetWhenRunEnds() const
void CreateSolvatedElectron(const G4Track *, G4ThreeVector *pFinalPosition=nullptr)
std::unique_ptr< G4UIcmdWithABool > fpActivateChem
std::unique_ptr< G4DNAWaterIonisationStructure > fpIonisationLevel
static G4DNAChemistryManager * GetInstanceIfExists()
static G4DNAChemistryManager * Instance()
void UseAsStandalone(G4bool flag)
void SetChemistryList(G4VUserChemistryList &)
void PushMolecule(std::unique_ptr< G4Molecule > pMolecule, G4double time, const G4ThreeVector &position, G4int parentID)
static G4ThreadLocal ThreadLocalData * fpThreadData
std::unique_ptr< G4UIcmdWithoutParameter > fpInitChem
void ResetCounterWhenRunEnds(G4bool resetCounterWhenRunEnds)
void SetGlobalTemperature(G4double temperatureKelvin)
void SetGun(G4ITGun *pChemSpeciesGun)
Inject custom species to the simulation.
G4DNAWaterIonisationStructure * GetIonisationLevel()
void Deregister(G4VUserChemistryList &)
std::unique_ptr< G4UIcmdWithADoubleAndUnit > fpScaleForNewTemperature
std::unique_ptr< G4UIdirectory > fpChemDNADirectory
G4DNAWaterExcitationStructure * GetExcitationLevel()
void SetNewValue(G4UIcommand *, G4String) override
std::unique_ptr< G4VUserChemistryList > fpUserChemistryList
std::unique_ptr< G4DNAWaterExcitationStructure > fpExcitationLevel
G4bool Notify(G4ApplicationState requestedState) override
std::unique_ptr< G4UIcmdWithoutParameter > fpSkipReactionsFromChemList
void SetVerbose(G4int verbose)
std::unique_ptr< G4UIcmdWithAnInteger > fpRunChem
static G4DNAChemistryManager * fgInstance
void WriteInto(const G4String &, std::ios_base::openmode mode=std::ios_base::out)
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
std::unique_ptr< G4VPhysChemIO > fpPhysChemIO
#define G4ThreadLocal
Definition: tls.hh:77