Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:29:49

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 //  Author: F. Poignant, floriane.poignant@gmail.com
0027 //
0028 // file STCyclotronRun.hh
0029 #ifndef STCyclotronRun_h
0030 #define STCyclotronRun_h 1
0031 
0032 #include "G4Run.hh"
0033 #include "globals.hh"
0034 #include <map>
0035 #include <fstream>
0036 
0037 /// Run class
0038 ///
0039 /// In RecordEvent() there is collected information event per event 
0040 /// from Hits Collections, and accumulated statistic for the run 
0041 
0042 class STCyclotronRun : public G4Run
0043 {
0044   public:
0045 
0046   STCyclotronRun();
0047   virtual ~STCyclotronRun();
0048   
0049   virtual void Merge(const G4Run*);
0050   virtual void EndOfRun(G4double);
0051     
0052   public:
0053 
0054   //Accumulation functions
0055   void EnergyDepositionTarget(G4double);
0056   void EnergyDepositionFoil(G4double);
0057   void CountParticlesTarget();
0058 
0059   //Setting functions
0060   //parameters for the geometry
0061   //---> Target
0062   void SetTargetVolume(G4double);
0063   void SetTargetDiameter(G4double);
0064   void SetTargetThickness(G4double);
0065   //--->Foil
0066   void SetFoilVolume(G4double);
0067   void SetFoilThickness(G4double);
0068 
0069   //parameters for the beam
0070   void SetIrradiationTime(G4double);
0071   void SetBeamName(G4String);
0072   void SetBeamEnergy(G4double);
0073   void SetBeamCurrent(G4double);
0074   
0075   //parameters of the run
0076   void SetPrimariesPerEvent(G4int);
0077   void SetTimePerEvent(G4double);
0078   
0079   void StoreIsotopeID(G4int, G4String);
0080   std::map<G4int, G4String> GetIsotopeID();
0081   void ParticleParent(G4String,G4String);
0082 
0083   //Acumulation functions for maps
0084   //---->Accumulation of isotopes
0085   void PrimaryIsotopeCountTarget(G4String, G4double);
0086   void CountStableIsotopes(G4String);
0087   void DecayIsotopeCountTarget(G4String, G4String, G4double);
0088 
0089   //---->Accumulation of other particles
0090   void ParticleCountTarget(G4String);
0091 
0092   
0093   private:
0094 
0095   //Accumulable variables
0096   G4double fTotalEnergyDepositTarget;
0097   G4double fTotalEnergyDepositFoil;
0098   G4int fParticleTarget;
0099 
0100   //Store Isotopes created inside maps during the run
0101   std::map<G4String,G4int>    fPrimaryIsotopeCountTarget;  
0102   std::map<G4String,G4double> fPrimaryIsotopeTimeTarget;
0103   std::map<G4String,G4int>    fParticleCountTarget;
0104   std::map<G4String,G4double> fDecayIsotopeTimeTarget;
0105   std::map<G4String,G4String> fDecayIsotopeCountTarget;
0106   std::map<G4String,G4String> fParticleParent;
0107   std::map<G4String,G4int>    fStableIsotopeCountTarget;
0108   std::map<G4String,G4String> fStableIsotopeMumTarget;
0109 
0110   //Stored and used during the run
0111   std::map<G4int,G4String>    fIsotopeIDTarget;
0112 
0113 
0114   //Parameters that may be modified via messenger classes
0115  
0116   //--> geometry
0117   G4double fTargetThickness;
0118   G4double fTargetDiameter;
0119   G4double fFoilThickness;
0120   G4double fTargetVolume;
0121   G4double fFoilVolume;
0122   //---> run
0123   G4int fPrimariesPerEvent;
0124   G4double fTimePerEvent;
0125   //--> beam
0126   G4String fBeamName;
0127   G4double fBeamCurrent;
0128   G4double fBeamEnergy;
0129   
0130   //Write output in ASCII
0131   std::ofstream fOutPut;
0132   std::ofstream fOutPut1;
0133   std::ofstream fOutPut2;
0134   std::ofstream fOutPut3;
0135   std::ofstream fOutPut4;
0136   
0137 
0138 };
0139 
0140 #endif
0141 
0142