Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:03

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 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software
0028 // shall cite the following Geant4-DNA collaboration publication:
0029 // Med. Phys. 37 (2010) 4692-4708
0030 // and papers
0031 // M. Batmunkh et al. J Radiat Res Appl Sci 8 (2015) 498-507
0032 // O. Belov et al. Physica Medica 32 (2016) 1510-1520
0033 // The Geant4-DNA web site is available at http://geant4-dna.org
0034 //
0035 // -------------------------------------------------------------------
0036 // November 2016
0037 // -------------------------------------------------------------------
0038 //
0039 /// \file Run.hh
0040 /// \brief Definition of the Run class
0041 
0042 #ifndef Run_h
0043 #define Run_h 1
0044 
0045 #include "G4Molecule.hh"
0046 #include "G4Run.hh"
0047 #include "G4VProcess.hh"
0048 #include "globals.hh"
0049 
0050 #include <map>
0051 
0052 class DetectorConstruction;
0053 class G4ParticleDefinition;
0054 class G4Molecule;
0055 
0056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0057 
0058 class Run : public G4Run
0059 {
0060   public:
0061     Run(DetectorConstruction*);
0062     ~Run() override;
0063 
0064     void SetPrimary(G4ParticleDefinition* particle, G4double energy);
0065     void AddPrimaryLET(G4double let);
0066     void SetTrackLength(G4double tracklen);
0067     void CountProcesses(const G4VProcess* process);
0068     void ParticleCount(G4String, G4double);
0069     void ParticleCountNeuron(G4String, G4double);
0070     void MoleculeCount(G4String, G4double);
0071     void MoleculeCountNeuron(G4Molecule* molecule);
0072     void AddEdep(G4double edep);
0073     void AddEflow(G4double eflow);
0074     void ParticleFlux(G4String, G4double);
0075 
0076     void Merge(const G4Run*) override;
0077     void EndOfRun();
0078 
0079     // Edep in all volume
0080     G4double GetEdepALL() { return fEdepAll; }
0081     void SetEdepALL(G4double vall) { fEdepAll = vall; }
0082     void AddEdepALL(G4double vall)
0083     {
0084       fEdepAll += vall;
0085       fEdepAll_err += vall * vall;
0086     }
0087     // 0. Edep in homogeneous Medium
0088     G4double GetEdepMedium() { return fEdepMedium; }
0089     void SetEdepMedium(G4double vall) { fEdepMedium = vall; }
0090     void AddEdepMedium(G4double vall)
0091     {
0092       fEdepMedium += vall;
0093       fEdepMedium_err += vall * vall;
0094     }
0095     // 1. Edep in Bounding Slice Volume
0096     G4double GetEdepSlice() { return fEdepSlice; }
0097     void SetEdepSlice(G4double vall) { fEdepSlice = vall; }
0098     void AddEdepSlice(G4double vall)
0099     {
0100       fEdepSlice += vall;
0101       fEdepSlice_err += vall * vall;
0102     }
0103     // 2. Edep in Soma volume
0104     G4double GetEdepSoma() { return fEdepSoma; }
0105     void SetEdepSoma(G4double vall) { fEdepSoma = vall; }
0106     void AddEdepSoma(G4double vall)
0107     {
0108       fEdepSoma += vall;
0109       fEdepSoma_err += vall * vall;
0110     }
0111 
0112     void AddSomaCompart(G4int i, G4double x) { fSoma3DEdep[i] += x; }
0113     G4double GetSomaCompart(G4int i) { return fSoma3DEdep[i]; }
0114 
0115     // 3. Edep in Dendrites volume
0116     G4double GetEdepDend() { return fEdepDend; }
0117     void SetEdepDend(G4double vall) { fEdepDend = vall; }
0118     void AddEdepDend(G4double vall)
0119     {
0120       fEdepDend += vall;
0121       fEdepDend_err += vall * vall;
0122     }
0123 
0124     void AddDendCompart(G4int i, G4double x) { fDend3DEdep[i] += x; }
0125     G4double GetDendCompart(G4int i) { return fDend3DEdep[i]; }
0126 
0127     // 4. Edep in Axon volume
0128     G4double GetEdepAxon() { return fEdepAxon; }
0129     void SetEdepAxon(G4double vall) { fEdepAxon = vall; }
0130     void AddEdepAxon(G4double vall)
0131     {
0132       fEdepAxon += vall;
0133       fEdepAxon_err += vall * vall;
0134     }
0135 
0136     void AddAxonCompart(G4int i, G4double x) { fAxon3DEdep[i] += x; }
0137     G4double GetAxonCompart(G4int i) { return fAxon3DEdep[i]; }
0138 
0139     // 5. Edep in whole Neuron volume
0140     G4double GetEdepNeuron() { return fEdepNeuron; }
0141     void SetEdepNeuron(G4double vall) { fEdepNeuron = vall; }
0142     void AddEdepNeuron(G4double vall)
0143     {
0144       fEdepNeuron += vall;
0145       fEdepNeuron_err += vall * vall;
0146     }
0147 
0148   private:
0149     struct ParticleData
0150     {
0151         ParticleData() : fCount(0), fEmean(0.), fEmin(0.), fEmax(0.) {}
0152         ParticleData(G4int count, G4double ekin, G4double emin, G4double emax)
0153           : fCount(count), fEmean(ekin), fEmin(emin), fEmax(emax)
0154         {}
0155         G4int fCount;
0156         G4double fEmean;
0157         G4double fEmin;
0158         G4double fEmax;
0159     };
0160 
0161     DetectorConstruction* fDetector;
0162     G4ParticleDefinition* fParticle;
0163     G4double fEkin{0.0};
0164     G4double fLET{0.0};
0165     G4double fLET2{0.0};
0166     G4double ftrackLength{0.0};
0167     G4double fTrackLen{0.0};
0168     G4double fTrackLen2{0.0};
0169     G4int fNParticle{0};
0170 
0171     G4double* fSoma3DEdep;
0172     G4double* fDend3DEdep;
0173     G4double* fAxon3DEdep;
0174     G4double* fNeuron3DEdep;
0175     G4double fEdepAll, fEdepAll_err, fEdepMedium, fEdepMedium_err, fEdepSlice, fEdepSlice_err,
0176       fEdepSoma, fEdepSoma_err, fEdepDend, fEdepDend_err, fEdepAxon, fEdepAxon_err, fEdepNeuron,
0177       fEdepNeuron_err;
0178 
0179     G4int fmolNum{0};
0180     G4int fmolNum2{0};
0181     G4double fEnergyFlow{0.0};
0182     G4double fEnergyFlow2{0.0};
0183     std::map<G4String, G4int> fMoleculeNumber;
0184     std::map<G4String, G4int> fProcCounter;
0185     std::map<G4String, ParticleData> fParticleDataMap1;
0186     std::map<G4String, ParticleData> fParticleDataMap2;
0187 };
0188 
0189 #endif