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 *)

Static Public Member Functions

static G4DNAChemistryManagerInstance ()
static void DeleteInstance ()

Protected Member Functions

G4DNAWaterExcitationStructureGetExcitationLevel ()
G4DNAWaterIonisationStructureGetIonisationLevel ()

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 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 71 of file G4DNAChemistryManager.hh.


Member Function Documentation

void G4DNAChemistryManager::CloseFile (  ) 

Close the file specified with WriteInto

Definition at line 117 of file G4DNAChemistryManager.cc.

00118 {
00119     if (fOutput.is_open())
00120     {
00121         fOutput.close();
00122     }
00123     fWriteFile = false;
00124 }

void G4DNAChemistryManager::CreateSolvatedElectron ( const G4Track ,
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 209 of file G4DNAChemistryManager.cc.

References G4Molecule::BuildTrack(), G4Electron_aq::Definition(), fAlive, G4endl, G4Track::GetKineticEnergy(), G4Track::GetPosition(), G4Track::GetTrackID(), G4ITManager< T >::Instance(), G4ITTrackHolder::Instance(), and G4ITTrackHolder::PushTrack().

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

00212 {
00213     if(fWriteFile)
00214     {
00215         fOutput << setw(11)<< theIncomingTrack->GetTrackID()
00216                 << setw(10)<< "e_aq"
00217                 << setw(14)<< -1
00218                 << std::setprecision(2) << std::fixed
00219                 << setw(13)<< theIncomingTrack->GetKineticEnergy()/eV
00220                 << std::setprecision(6) << std::scientific
00221                 << setw(22)<< (theIncomingTrack->GetPosition().x())/nanometer
00222                 << setw(22)<< (theIncomingTrack->GetPosition().y())/nanometer
00223                 << setw(22)<< (theIncomingTrack->GetPosition().z())/nanometer  ;
00224 
00225         if(finalPosition != 0)
00226         {
00227             fOutput<< setw(14)<< (finalPosition->x())/nanometer
00228                    << setw(14)<< (finalPosition->y())/nanometer
00229                    << setw(14)<< (finalPosition->z())/nanometer ;
00230         }
00231 
00232         fOutput << G4endl;
00233     }
00234 
00235     if(fActiveChemistry)
00236     {
00237         G4Molecule* e_aq = new G4Molecule(G4Electron_aq::Definition());
00238         G4Track * e_aqTrack(0);
00239         if(finalPosition)
00240         {
00241             e_aqTrack  = e_aq->BuildTrack(picosecond,*finalPosition);
00242         }
00243         else
00244         {
00245             e_aqTrack  = e_aq->BuildTrack(picosecond,theIncomingTrack->GetPosition());
00246         }
00247         e_aqTrack -> SetTrackStatus(fAlive);
00248         e_aqTrack -> SetParentID(theIncomingTrack->GetTrackID());
00249         G4ITTrackHolder::Instance()->PushTrack(e_aqTrack);
00250         G4ITManager<G4Molecule>::Instance()->Push(e_aqTrack);
00251     }
00252 }

void G4DNAChemistryManager::CreateWaterMolecule ( ElectronicModification  ,
G4int  ,
const G4Track  
)

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

References G4Molecule::BuildTrack(), G4H2O::Definition(), eDissociativeAttachment, eExcitedMolecule, eIonizedMolecule, G4DNAWaterExcitationStructure::ExcitationEnergy(), fStopButAlive, G4endl, GetExcitationLevel(), GetIonisationLevel(), G4Track::GetPosition(), G4Track::GetTrackID(), G4ITTrackHolder::Instance(), G4DNAWaterIonisationStructure::IonisationEnergy(), and G4ITTrackHolder::PushTrack().

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

00147 {
00148     if(fWriteFile)
00149     {
00150         G4double energy = -1.;
00151 
00152         switch (modification)
00153         {
00154         case eDissociativeAttachment:
00155             energy = -1;
00156             break;
00157         case eExcitedMolecule :
00158             energy = GetExcitationLevel()->ExcitationEnergy(electronicLevel);
00159             break;
00160         case eIonizedMolecule :
00161             energy = GetIonisationLevel()->IonisationEnergy(electronicLevel);
00162             break;
00163         }
00164 
00165         fOutput << setw(11) << left << theIncomingTrack->GetTrackID()
00166                 << setw(10) << "H2O"
00167                 << left << modification
00168                 << internal <<":"
00169                 << right <<electronicLevel
00170                 << left
00171                 << setw(11) << ""
00172                 << std::setprecision(2) << std::fixed
00173                 << setw(13) << energy/eV
00174                 << std::setprecision(6) << std::scientific
00175                 << setw(22) << (theIncomingTrack->GetPosition().x())/nanometer
00176                 << setw(22) << (theIncomingTrack->GetPosition().y())/nanometer
00177                 << setw(22) << (theIncomingTrack->GetPosition().z())/nanometer
00178                 << G4endl;
00179     }
00180 
00181     if(fActiveChemistry)
00182     {
00183         G4Molecule * H2O = new G4Molecule (G4H2O::Definition());
00184 
00185         switch (modification)
00186         {
00187         case eDissociativeAttachment:
00188             H2O -> AddElectron(5,1);
00189             break;
00190         case eExcitedMolecule :
00191             H2O -> ExciteMolecule(electronicLevel);
00192             break;
00193         case eIonizedMolecule :
00194             H2O -> IonizeMolecule(electronicLevel);
00195             break;
00196         }
00197 
00198         G4Track * H2OTrack = H2O->BuildTrack(1*picosecond,
00199                                              theIncomingTrack->GetPosition());
00200 
00201         H2OTrack -> SetParentID(theIncomingTrack->GetTrackID());
00202         H2OTrack -> SetTrackStatus(fStopButAlive);
00203         H2OTrack -> SetKineticEnergy(0.);
00204 
00205         G4ITTrackHolder::Instance()->PushTrack(H2OTrack);
00206     }
00207 }

void G4DNAChemistryManager::DeleteInstance (  )  [static]

You should rather use DeleteInstance than the destructor of this class

Definition at line 85 of file G4DNAChemistryManager.cc.

Referenced by G4EmDNAPhysicsChemistry::~G4EmDNAPhysicsChemistry().

00086 {
00087     if(fInstance.get())
00088         fInstance.reset();
00089 }

G4DNAWaterExcitationStructure * G4DNAChemistryManager::GetExcitationLevel (  )  [protected]

Definition at line 126 of file G4DNAChemistryManager.cc.

Referenced by CreateWaterMolecule().

00127 {
00128     if(!fExcitationLevel)
00129     {
00130         fExcitationLevel = new G4DNAWaterExcitationStructure;
00131     }
00132     return fExcitationLevel;
00133 }

G4DNAWaterIonisationStructure * G4DNAChemistryManager::GetIonisationLevel (  )  [protected]

Definition at line 135 of file G4DNAChemistryManager.cc.

Referenced by CreateWaterMolecule().

00136 {
00137     if(!fIonisationLevel)
00138     {
00139         fIonisationLevel = new G4DNAWaterIonisationStructure;
00140     }
00141     return fIonisationLevel;
00142 }

G4DNAChemistryManager * G4DNAChemistryManager::Instance (  )  [static]

Definition at line 64 of file G4DNAChemistryManager.cc.

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

00065 {
00066     if(!fInstance.get()) fInstance = auto_ptr<G4DNAChemistryManager>(new G4DNAChemistryManager());
00067     return fInstance.get();
00068 }

G4bool G4DNAChemistryManager::IsChemistryActived (  )  [inline]

Definition at line 154 of file G4DNAChemistryManager.hh.

00155 {
00156     return fActiveChemistry;
00157 }

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

References G4Molecule::BuildTrack(), fAlive, G4endl, G4Molecule::GetName(), G4ITManager< T >::Instance(), G4ITTrackHolder::Instance(), and G4ITTrackHolder::PushTrack().

00257 {
00258     if(fWriteFile)
00259     {
00260         fOutput << setw(11)<< parentID
00261                 << setw(10)<< molecule->GetName()
00262                 << setw(14)<< -1
00263                 << std::setprecision(2) << std::fixed
00264                 << setw(13)<< -1
00265                 << std::setprecision(6) << std::scientific
00266                 << setw(22)<< (position.x())/nanometer
00267                 << setw(22)<< (position.y())/nanometer
00268                 << setw(22)<< (position.z())/nanometer;
00269         fOutput << G4endl;
00270     }
00271 
00272     if(fActiveChemistry)
00273     {
00274         G4Track* track = molecule->BuildTrack(time,position);
00275         track -> SetTrackStatus(fAlive);
00276         track -> SetParentID(parentID);
00277         G4ITTrackHolder::Instance()->PushTrack(track);
00278         G4ITManager<G4Molecule>::Instance()->Push(track);
00279     }
00280     else
00281     {
00282         delete molecule;
00283         molecule = 0;
00284     }
00285 }

void G4DNAChemistryManager::PushMoleculeAtParentTimeAndPlace ( G4Molecule *&  molecule,
const G4Track  
)

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

References G4Molecule::BuildTrack(), fAlive, G4endl, G4Track::GetGlobalTime(), G4Track::GetKineticEnergy(), G4Molecule::GetName(), G4Track::GetPosition(), G4Track::GetTrackID(), G4ITManager< T >::Instance(), G4ITTrackHolder::Instance(), and G4ITTrackHolder::PushTrack().

00289 {
00290     if(fWriteFile)
00291     {
00292         fOutput << setw(11)<< theIncomingTrack->GetTrackID()
00293                 << setw(10)<< molecule->GetName()
00294                 << setw(14)<< -1
00295                 << std::setprecision(2) << std::fixed
00296                 << setw(13)<< theIncomingTrack->GetKineticEnergy()/eV
00297                 << std::setprecision(6) << std::scientific
00298                 << setw(22)<< (theIncomingTrack->GetPosition().x())/nanometer
00299                 << setw(22)<< (theIncomingTrack->GetPosition().y())/nanometer
00300                 << setw(22)<< (theIncomingTrack->GetPosition().z())/nanometer  ;
00301         fOutput << G4endl;
00302     }
00303 
00304     if(fActiveChemistry)
00305     {
00306         G4Track* track = molecule->BuildTrack(theIncomingTrack->GetGlobalTime(),theIncomingTrack->GetPosition());
00307         track -> SetTrackStatus(fAlive);
00308         track -> SetParentID(theIncomingTrack->GetTrackID());
00309         G4ITTrackHolder::Instance()->PushTrack(track);
00310         G4ITManager<G4Molecule>::Instance()->Push(track);
00311     }
00312     else
00313     {
00314         delete molecule;
00315         molecule = 0;
00316     }
00317 }

void G4DNAChemistryManager::SetChemistryActivation ( G4bool   )  [inline]

Definition at line 159 of file G4DNAChemistryManager.hh.

Referenced by G4EmDNAPhysicsChemistry::ConstructProcess().

00160 {
00161     fActiveChemistry = flag;
00162 }

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


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:
Generated on Mon May 27 17:51:47 2013 for Geant4 by  doxygen 1.4.7