Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
G4DNAChemistryManager Class Reference

#include <G4DNAChemistryManager.hh>

Public Member Functions

void WriteInto (const G4String &, std::ios_base::openmode mode=std::ios_base::out)
 
void CloseFile ()
 
G4bool IsChemistryActived ()
 
void SetChemistryActivation (G4bool)
 
void CreateWaterMolecule (ElectronicModification, G4int, const G4Track *)
 
void CreateSolvatedElectron (const G4Track *, G4ThreeVector *finalPosition=0)
 
void PushMolecule (G4Molecule *&molecule, double time, const G4ThreeVector &position, int parentID)
 
void PushMoleculeAtParentTimeAndPlace (G4Molecule *&molecule, const G4Track *)
 
void AddEmptyLineInOuputFile ()
 

Static Public Member Functions

static G4DNAChemistryManagerInstance ()
 
static void DeleteInstance ()
 

Protected Member Functions

G4DNAWaterExcitationStructureGetExcitationLevel ()
 
G4DNAWaterIonisationStructureGetIonisationLevel ()
 
void InitializeFile ()
 
 G4DNAChemistryManager ()
 

Friends

class std::auto_ptr< G4DNAChemistryManager >
 

Detailed Description

G4DNAChemistryManager is called from the physics models. It creates the water molecules and the solvated electrons and and send them to synchronous step manager 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 71 of file G4DNAChemistryManager.hh.

Constructor & Destructor Documentation

G4DNAChemistryManager::G4DNAChemistryManager ( )
protected

Definition at line 60 of file G4DNAChemistryManager.cc.

Referenced by Instance().

60  :
61  fActiveChemistry(false)
62 {
63  fExcitationLevel = 0;
64  fIonisationLevel = 0;
65  fWriteFile = false;
66 }

Member Function Documentation

void G4DNAChemistryManager::AddEmptyLineInOuputFile ( )

Definition at line 335 of file G4DNAChemistryManager.cc.

References G4endl.

336 {
337  if(fWriteFile)
338  {
339  *fOutput << G4endl;
340  }
341 }
#define G4endl
Definition: G4ios.hh:61
void G4DNAChemistryManager::CloseFile ( )

Close the file specified with WriteInto

Definition at line 132 of file G4DNAChemistryManager.cc.

133 {
134  if (fOutput->is_open())
135  {
136  fOutput->close();
137  }
138 
139  fWriteFile = false;
140 }
void G4DNAChemistryManager::CreateSolvatedElectron ( const G4Track theIncomingTrack,
G4ThreeVector finalPosition = 0 
)

On the same idea as the previous method but for solvated electron. This method should be used by the physics model of the ElectronSolvatation process.

Definition at line 225 of file G4DNAChemistryManager.cc.

References G4Molecule::BuildTrack(), G4Electron_aq::Definition(), python.hepunit::eV, fAlive, G4endl, G4Track::GetKineticEnergy(), G4Track::GetPosition(), G4Track::GetTrackID(), G4ITTrackHolder::Instance(), G4ITManager< T >::Instance(), python.hepunit::nanometer, python.hepunit::picosecond, G4ITTrackHolder::PushTrack(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by G4DNATransformElectronModel::SampleSecondaries(), and G4DNAOneStepSolvatationModel::SampleSecondaries().

228 {
229  if(fWriteFile)
230  {
231  *fOutput << setw(11)<< theIncomingTrack->GetTrackID()
232  << setw(10)<< "e_aq"
233  << setw(14)<< -1
234  << std::setprecision(2) << std::fixed
235  << setw(13)<< theIncomingTrack->GetKineticEnergy()/eV
236  << std::setprecision(6) << std::scientific
237  << setw(22)<< (theIncomingTrack->GetPosition().x())/nanometer
238  << setw(22)<< (theIncomingTrack->GetPosition().y())/nanometer
239  << setw(22)<< (theIncomingTrack->GetPosition().z())/nanometer ;
240 
241  if(finalPosition != 0)
242  {
243  *fOutput<< setw(14)<< (finalPosition->x())/nanometer
244  << setw(14)<< (finalPosition->y())/nanometer
245  << setw(14)<< (finalPosition->z())/nanometer ;
246  }
247 
248  *fOutput << G4endl;
249  }
250 
251  if(fActiveChemistry)
252  {
254  G4Track * e_aqTrack(0);
255  if(finalPosition)
256  {
257  e_aqTrack = e_aq->BuildTrack(picosecond,*finalPosition);
258  }
259  else
260  {
261  e_aqTrack = e_aq->BuildTrack(picosecond,theIncomingTrack->GetPosition());
262  }
263  e_aqTrack -> SetTrackStatus(fAlive);
264  e_aqTrack -> SetParentID(theIncomingTrack->GetTrackID());
265  G4ITTrackHolder::Instance()->PushTrack(e_aqTrack);
266  G4ITManager<G4Molecule>::Instance()->Push(e_aqTrack);
267  }
268 }
static G4Electron_aq * Definition()
double x() const
const G4ThreeVector & GetPosition() const
double z() const
int nanometer
Definition: hepunit.py:35
G4double GetKineticEnergy() const
static G4ITManager< T > * Instance()
G4int GetTrackID() const
G4Track * BuildTrack(G4double globalTime, const G4ThreeVector &Position)
Definition: G4Molecule.cc:263
int picosecond
Definition: hepunit.py:86
double y() const
static G4ITTrackHolder * Instance()
#define G4endl
Definition: G4ios.hh:61
virtual void PushTrack(G4Track *)
void G4DNAChemistryManager::CreateWaterMolecule ( ElectronicModification  modification,
G4int  electronicLevel,
const G4Track theIncomingTrack 
)

Method used by DNA physics model to create a water molecule. The ElectronicModification is a flag telling wheter 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, for instance an electron.

Definition at line 160 of file G4DNAChemistryManager.cc.

References G4Molecule::BuildTrack(), G4H2O::Definition(), eDissociativeAttachment, eExcitedMolecule, eIonizedMolecule, energy(), python.hepunit::eV, G4DNAWaterExcitationStructure::ExcitationEnergy(), fStopButAlive, G4endl, GetExcitationLevel(), GetIonisationLevel(), G4Track::GetPosition(), G4Track::GetTrackID(), G4ITTrackHolder::Instance(), G4DNAWaterIonisationStructure::IonisationEnergy(), left, python.hepunit::nanometer, python.hepunit::picosecond, G4ITTrackHolder::PushTrack(), right, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by G4DNAEmfietzoglouExcitationModel::SampleSecondaries(), G4DNAMillerGreenExcitationModel::SampleSecondaries(), G4DNABornExcitationModel::SampleSecondaries(), G4DNAMeltonAttachmentModel::SampleSecondaries(), G4DNARuddIonisationModel::SampleSecondaries(), G4DNARuddIonisationExtendedModel::SampleSecondaries(), and G4DNABornIonisationModel::SampleSecondaries().

163 {
164  if(fWriteFile)
165  {
166  G4double energy = -1.;
167 
168  switch (modification)
169  {
171  energy = -1;
172  break;
173  case eExcitedMolecule :
174  energy = GetExcitationLevel()->ExcitationEnergy(electronicLevel);
175  break;
176  case eIonizedMolecule :
177  energy = GetIonisationLevel()->IonisationEnergy(electronicLevel);
178  break;
179  }
180 
181  *fOutput << setw(11) << left << theIncomingTrack->GetTrackID()
182  << setw(10) << "H2O"
183  << left << modification
184  << internal <<":"
185  << right <<electronicLevel
186  << left
187  << setw(11) << ""
188  << std::setprecision(2) << std::fixed
189  << setw(13) << energy/eV
190  << std::setprecision(6) << std::scientific
191  << setw(22) << (theIncomingTrack->GetPosition().x())/nanometer
192  << setw(22) << (theIncomingTrack->GetPosition().y())/nanometer
193  << setw(22) << (theIncomingTrack->GetPosition().z())/nanometer
194  << G4endl;
195  }
196 
197  if(fActiveChemistry)
198  {
199  G4Molecule * H2O = new G4Molecule (G4H2O::Definition());
200 
201  switch (modification)
202  {
204  H2O -> AddElectron(5,1);
205  break;
206  case eExcitedMolecule :
207  H2O -> ExciteMolecule(electronicLevel);
208  break;
209  case eIonizedMolecule :
210  H2O -> IonizeMolecule(electronicLevel);
211  break;
212  }
213 
214  G4Track * H2OTrack = H2O->BuildTrack(1*picosecond,
215  theIncomingTrack->GetPosition());
216 
217  H2OTrack -> SetParentID(theIncomingTrack->GetTrackID());
218  H2OTrack -> SetTrackStatus(fStopButAlive);
219  H2OTrack -> SetKineticEnergy(0.);
220 
222  }
223 }
static G4H2O * Definition()
Definition: G4H2O.cc:46
double x() const
const G4ThreeVector & GetPosition() const
double z() const
G4DNAWaterExcitationStructure * GetExcitationLevel()
int nanometer
Definition: hepunit.py:35
double precision function energy(A, Z)
Definition: dpm25nuc6.f:4106
G4int GetTrackID() const
G4Track * BuildTrack(G4double globalTime, const G4ThreeVector &Position)
Definition: G4Molecule.cc:263
int picosecond
Definition: hepunit.py:86
double y() const
static G4ITTrackHolder * Instance()
#define G4endl
Definition: G4ios.hh:61
virtual void PushTrack(G4Track *)
double G4double
Definition: G4Types.hh:76
G4DNAWaterIonisationStructure * GetIonisationLevel()
void G4DNAChemistryManager::DeleteInstance ( )
static

You should rather use DeleteInstance than the destructor of this class

Definition at line 93 of file G4DNAChemistryManager.cc.

References chemManExistence.

94 {
96  if(fInstance.get())
97  {
98  fInstance.reset();
99  }
100 }
G4Mutex chemManExistence
G4DNAWaterExcitationStructure * G4DNAChemistryManager::GetExcitationLevel ( )
protected

Definition at line 142 of file G4DNAChemistryManager.cc.

Referenced by CreateWaterMolecule().

143 {
144  if(!fExcitationLevel)
145  {
146  fExcitationLevel = new G4DNAWaterExcitationStructure;
147  }
148  return fExcitationLevel;
149 }
G4DNAWaterIonisationStructure * G4DNAChemistryManager::GetIonisationLevel ( )
protected

Definition at line 151 of file G4DNAChemistryManager.cc.

Referenced by CreateWaterMolecule().

152 {
153  if(!fIonisationLevel)
154  {
155  fIonisationLevel = new G4DNAWaterIonisationStructure;
156  }
157  return fIonisationLevel;
158 }
void G4DNAChemistryManager::InitializeFile ( )
protected

Definition at line 102 of file G4DNAChemistryManager.cc.

References G4endl, and left.

103 {
104  *fOutput << std::setprecision(6) << std::scientific;
105  *fOutput << setw(11) << left << "#Parent ID"
106  << setw(10) << "Molecule"
107  << setw(14) << "Elec Modif"
108  << setw(13) << "Energy (eV)"
109  << setw(22) << "X pos of parent [nm]"
110  << setw(22) << "Y pos of parent [nm]"
111  << setw(22) << "Z pos of parent [nm]"
112  << setw(14) << "X pos [nm]"
113  << setw(14) << "Y pos [nm]"
114  << setw(14) << "Z pos [nm]"
115  << G4endl
116  << setw(21) << "#"
117  << setw(13) << "1)io/ex=0/1"
118  << G4endl
119  << setw(21) << "#"
120  << setw(13) << "2)level=0...5"
121  << G4endl;
122 }
#define G4endl
Definition: G4ios.hh:61
G4DNAChemistryManager * G4DNAChemistryManager::Instance ( void  )
static
G4bool G4DNAChemistryManager::IsChemistryActived ( )
inline

Definition at line 159 of file G4DNAChemistryManager.hh.

160 {
161  return fActiveChemistry;
162 }
void G4DNAChemistryManager::PushMolecule ( G4Molecule *&  molecule,
double  time,
const G4ThreeVector position,
int  parentID 
)

WARNING : In case chemistry is not activated, PushMolecule will take care of deleting the transfered molecule. Before calling this method, it is also possible to check if the chemistry is activated through IsChemistryActived(). This method will create the track corresponding to the transfered molecule and will be in charge of loading the new track to the system.

Definition at line 271 of file G4DNAChemistryManager.cc.

References G4Molecule::BuildTrack(), fAlive, G4endl, G4Molecule::GetName(), G4ITTrackHolder::Instance(), G4ITManager< T >::Instance(), python.hepunit::nanometer, G4ITTrackHolder::PushTrack(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

273 {
274  if(fWriteFile)
275  {
276  *fOutput << setw(11)<< parentID
277  << setw(10)<< molecule->GetName()
278  << setw(14)<< -1
279  << std::setprecision(2) << std::fixed
280  << setw(13)<< -1
281  << std::setprecision(6) << std::scientific
282  << setw(22)<< (position.x())/nanometer
283  << setw(22)<< (position.y())/nanometer
284  << setw(22)<< (position.z())/nanometer;
285  *fOutput << G4endl;
286  }
287 
288  if(fActiveChemistry)
289  {
290  G4Track* track = molecule->BuildTrack(time,position);
291  track -> SetTrackStatus(fAlive);
292  track -> SetParentID(parentID);
294  G4ITManager<G4Molecule>::Instance()->Push(track);
295  }
296  else
297  {
298  delete molecule;
299  molecule = 0;
300  }
301 }
double x() const
double z() const
int nanometer
Definition: hepunit.py:35
const G4String & GetName() const
Definition: G4Molecule.cc:243
static G4ITManager< T > * Instance()
G4Track * BuildTrack(G4double globalTime, const G4ThreeVector &Position)
Definition: G4Molecule.cc:263
double y() const
static G4ITTrackHolder * Instance()
#define G4endl
Definition: G4ios.hh:61
virtual void PushTrack(G4Track *)
void G4DNAChemistryManager::PushMoleculeAtParentTimeAndPlace ( G4Molecule *&  molecule,
const G4Track theIncomingTrack 
)

WARNING : In case chemistry is not activated, PushMoleculeAtParentTimeAndPlace will take care of deleting the transfered molecule. Before calling this method, it is also possible to check if the chemistry is activated through IsChemistryActived(). This method will create the track corresponding to the transfered molecule and will be in charge of loading the new track to the system.

Definition at line 303 of file G4DNAChemistryManager.cc.

References G4Molecule::BuildTrack(), python.hepunit::eV, fAlive, G4endl, G4Track::GetGlobalTime(), G4Track::GetKineticEnergy(), G4Molecule::GetName(), G4Track::GetPosition(), G4Track::GetTrackID(), G4ITTrackHolder::Instance(), G4ITManager< T >::Instance(), python.hepunit::nanometer, G4ITTrackHolder::PushTrack(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

305 {
306  if(fWriteFile)
307  {
308  *fOutput << setw(11)<< theIncomingTrack->GetTrackID()
309  << setw(10)<< molecule->GetName()
310  << setw(14)<< -1
311  << std::setprecision(2) << std::fixed
312  << setw(13)<< theIncomingTrack->GetKineticEnergy()/eV
313  << std::setprecision(6) << std::scientific
314  << setw(22)<< (theIncomingTrack->GetPosition().x())/nanometer
315  << setw(22)<< (theIncomingTrack->GetPosition().y())/nanometer
316  << setw(22)<< (theIncomingTrack->GetPosition().z())/nanometer ;
317  *fOutput << G4endl;
318  }
319 
320  if(fActiveChemistry)
321  {
322  G4Track* track = molecule->BuildTrack(theIncomingTrack->GetGlobalTime(),theIncomingTrack->GetPosition());
323  track -> SetTrackStatus(fAlive);
324  track -> SetParentID(theIncomingTrack->GetTrackID());
326  G4ITManager<G4Molecule>::Instance()->Push(track);
327  }
328  else
329  {
330  delete molecule;
331  molecule = 0;
332  }
333 }
double x() const
const G4ThreeVector & GetPosition() const
double z() const
int nanometer
Definition: hepunit.py:35
const G4String & GetName() const
Definition: G4Molecule.cc:243
G4double GetKineticEnergy() const
static G4ITManager< T > * Instance()
G4int GetTrackID() const
G4double GetGlobalTime() const
G4Track * BuildTrack(G4double globalTime, const G4ThreeVector &Position)
Definition: G4Molecule.cc:263
double y() const
static G4ITTrackHolder * Instance()
#define G4endl
Definition: G4ios.hh:61
virtual void PushTrack(G4Track *)
void G4DNAChemistryManager::SetChemistryActivation ( G4bool  flag)
inline

Definition at line 164 of file G4DNAChemistryManager.hh.

165 {
166  fActiveChemistry = flag;
167 }
void G4DNAChemistryManager::WriteInto ( const G4String ,
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 124 of file G4DNAChemistryManager.cc.

References G4String::data().

126 {
127  fOutput = new std::ofstream();
128  fOutput->open(output.data(), mode);
129  fWriteFile = true;
130 }

Friends And Related Function Documentation

friend class std::auto_ptr< G4DNAChemistryManager >
friend

Definition at line 73 of file G4DNAChemistryManager.hh.


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