Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:55

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /*
0027  * G4PhysChemIO.hh
0028  *
0029  *  Created on: 3 févr. 2017
0030  *      Author: matkara
0031  */
0032 #ifndef G4PHYSCHEMIO_HH_
0033 #define G4PHYSCHEMIO_HH_
0034 
0035 #include "G4VPhysChemIO.hh"
0036 
0037 //------------------------------------------------------------------------------
0038 namespace G4PhysChemIO{
0039   
0040 class FormattedText: public G4VPhysChemIO
0041 {
0042 public:
0043   FormattedText();
0044   ~FormattedText() override;
0045   
0046   void InitializeMaster() override{}
0047   void InitializeThread() override{}
0048   void InitializeFile() override;
0049   
0050   void NewRun() override{}
0051   void NewEvent() override{}
0052   
0053   /**
0054    * When DNA physics model create a water molecule, you'll get a notification
0055    * through this method.
0056    * The ElectronicModification is a flag telling whether the molecule
0057    * is ionized or excited, the electronic level is calculated by the
0058    * model and the IncomingTrack is the track responsible for the creation
0059    * of this molecule (electron, proton...)
0060    */
0061   void CreateWaterMolecule(G4int electronicModif,
0062                                    G4int /*electronicLevel*/,
0063                                    G4double energy,
0064                                    const G4Track* /*theIncomingTrack*/) override;
0065   
0066   /**
0067    * Same idea as the previous method but for solvated electron.
0068    * This method should be used by the physics model of the ElectronSolvatation
0069    * process.
0070    */
0071   void CreateSolvatedElectron(const G4Track* /*theIncomingTrack*/,
0072                                       G4ThreeVector* finalPosition = nullptr) override;
0073   
0074   //============================================================================
0075   // FILE OPERATIONS
0076   //============================================================================
0077   
0078   /**
0079    * Tells the chemistry manager to write into a file
0080    * the position and electronic state of the water molecule
0081    * and the position thermalized or not of the solvated electron
0082    */
0083   void WriteInto(const G4String&,
0084                          std::ios_base::openmode mode = std::ios_base::out) override;
0085   void AddEmptyLineInOutputFile() override;
0086   
0087   /**
0088    * Close the file specified with WriteInto
0089    */
0090   void CloseFile() override;
0091   
0092 protected:
0093   G4int fRunID; // unused
0094   G4int fEventID; // unused
0095   G4bool fFileInitialized;
0096   std::ofstream fOfstream;
0097 };
0098 
0099 //------------------------------------------------------------------------------
0100 
0101 class G4Analysis: public G4VPhysChemIO
0102 {
0103 public:
0104   G4Analysis(G4VAnalysisManager*);
0105   ~G4Analysis() override;
0106   
0107   void InitializeMaster() override{}
0108   void InitializeThread() override{}
0109   void InitializeFile() override;
0110   
0111   void NewRun() override{}
0112   void NewEvent() override{}
0113   
0114   /**
0115    * Method used by DNA physics model to create a water molecule.
0116    * The ElectronicModification is a flag telling wheter the molecule
0117    * is ionized or excited, the electronic level is calculated by the
0118    * model and the IncomingTrack is the track responsible for the creation
0119    * of this molecule, for instance an electron.
0120    */
0121   void CreateWaterMolecule(G4int electronicModif,
0122                                    G4int /*electronicLevel*/,
0123                                    G4double energy,
0124                                    const G4Track* /*theIncomingTrack*/) override;
0125   
0126   /**
0127    * Same idea as the previous method but for solvated electron.
0128    * This method should be used by the physics model of the ElectronSolvatation
0129    * process.
0130    */
0131   void CreateSolvatedElectron(const G4Track* /*theIncomingTrack*/,
0132                                       G4ThreeVector* finalPosition = nullptr) override;
0133   
0134   //============================================================================
0135   // FILE OPERATIONS
0136   //============================================================================
0137   
0138   /**
0139    * Tells the chemMan to write into a file
0140    * the position and electronic state of the water molecule
0141    * and the position thermalized or not of the solvated electron
0142    */
0143   void WriteInto(const G4String&, std::ios_base::openmode mode =
0144                          std::ios_base::out) override;
0145   void AddEmptyLineInOutputFile() override{}
0146   
0147   /**
0148    * Close the file specified with WriteInto
0149    */
0150   void CloseFile() override;
0151   
0152 protected:
0153   G4VAnalysisManager* fpAnalysisManager;
0154   int fNtupleID;
0155   G4bool fFileInitialized;
0156 };
0157   
0158 }
0159 
0160 #endif // G4PHYSCHEMIO_HH_