Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/extended/hadronic/Hadr03/include/Run.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 /// \file Run.hh
0027 /// \brief Definition of the Run class
0028 
0029 #ifndef Run_h
0030 #define Run_h 1
0031 
0032 #include "G4Run.hh"
0033 #include "G4VProcess.hh"
0034 #include "globals.hh"
0035 
0036 #include <map>
0037 
0038 class DetectorConstruction;
0039 class G4ParticleDefinition;
0040 class G4HadronicProcessStore;
0041 class G4Material;
0042 class G4Element;
0043 
0044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0045 
0046 class Run : public G4Run
0047 {
0048   public:
0049     Run(DetectorConstruction*);
0050     ~Run() override = default;
0051 
0052   public:
0053     void SetPrimary(G4ParticleDefinition* particle, G4double energy);
0054     void SetTargetXXX(G4bool);
0055     void CountProcesses(G4VProcess* process);
0056     void SumTrack(G4double);
0057     void CountNuclearChannel(G4String, G4double);
0058     void ParticleCount(G4String, G4double);
0059     void Balance(G4double);
0060     void CountGamma(G4int);
0061 
0062     void Merge(const G4Run*) override;
0063     void EndOfRun(G4bool);
0064 
0065   private:
0066     void PrintXS(const G4VProcess*, const G4Material*, const G4Element*, G4HadronicProcessStore*,
0067                  G4double dens, G4double& sum1, G4double& sum2);
0068 
0069     struct ParticleData
0070     {
0071         ParticleData() : fCount(0), fEmean(0.), fEmin(0.), fEmax(0.) {}
0072         ParticleData(G4int count, G4double ekin, G4double emin, G4double emax)
0073           : fCount(count), fEmean(ekin), fEmin(emin), fEmax(emax)
0074         {}
0075         G4int fCount;
0076         G4double fEmean;
0077         G4double fEmin;
0078         G4double fEmax;
0079     };
0080 
0081     struct NuclChannel
0082     {
0083         NuclChannel() : fCount(0), fQ(0.) {}
0084         NuclChannel(G4int count, G4double Q) : fCount(count), fQ(Q) {}
0085         G4int fCount;
0086         G4double fQ;
0087     };
0088 
0089   private:
0090     DetectorConstruction* fDetector = nullptr;
0091     G4ParticleDefinition* fParticle = nullptr;
0092     G4double fEkin = 0.;
0093 
0094     std::map<G4String, G4int> fProcCounter;
0095 
0096     G4int fTotalCount = 0;  // all processes counter
0097     G4int fGammaCount = 0;  // nb of events with gamma
0098     G4double fSumTrack = 0.;  // sum of trackLength
0099     G4double fSumTrack2 = 0.;  // sum of trackLength*trackLength
0100 
0101     std::map<G4String, NuclChannel> fNuclChannelMap;
0102     std::map<G4String, ParticleData> fParticleDataMap;
0103 
0104     G4bool fTargetXXX = false;
0105     G4double fPbalance[3];
0106     G4int fNbGamma[3];
0107 };
0108 
0109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0110 
0111 #endif