Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file hadronic/Hadr01/include/HistoManager << 26 // $Id: HistoManager.hh,v 1.9 2009/08/28 09:21:34 vnivanch Exp $ 27 /// \brief Definition of the HistoManager clas << 27 // GEANT4 tag $Name: geant4-09-03 $ 28 // 28 // 29 //-------------------------------------------- 29 //--------------------------------------------------------------------------- 30 // 30 // 31 // ClassName: HistoManager 31 // ClassName: HistoManager 32 // 32 // 33 // Description: Singleton class to hold parame 33 // Description: Singleton class to hold parameters and build histograms. 34 // User cannot access to the cons 34 // User cannot access to the constructor. 35 // The pointer of the only existi 35 // The pointer of the only existing object can be got via 36 // HistoManager::GetPointer() sta 36 // HistoManager::GetPointer() static method. 37 // The first invokation of this s 37 // The first invokation of this static method makes 38 // the singleton object. 38 // the singleton object. 39 // 39 // 40 // Author: V.Ivanchenko 27/09/00 40 // Author: V.Ivanchenko 27/09/00 41 // 41 // 42 // Modified: 42 // Modified: 43 // 04.06.2006 Adoptation of Hadr01 (V.Ivanchen << 43 // 04.06.2006 Adoptation of hadr01 (V.Ivanchenko) 44 // 03.10.2006 Add csFlag (V.Ivanchenko) 44 // 03.10.2006 Add csFlag (V.Ivanchenko) 45 // 16.11.2006 Add beamFlag (V.Ivanchenko) 45 // 16.11.2006 Add beamFlag (V.Ivanchenko) 46 // 46 // 47 //-------------------------------------------- 47 //---------------------------------------------------------------------------- 48 // 48 // 49 49 50 #ifndef HistoManager_h 50 #ifndef HistoManager_h 51 #define HistoManager_h 1 51 #define HistoManager_h 1 52 52 53 #include "G4Element.hh" << 54 #include "G4Material.hh" << 55 #include "globals.hh" 53 #include "globals.hh" >> 54 #include "G4Material.hh" >> 55 #include "G4Element.hh" 56 56 57 //....oooOO0OOooo........oooOO0OOooo........oo 57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 58 58 59 class Histo; 59 class Histo; 60 class G4Track; 60 class G4Track; 61 class G4Step; 61 class G4Step; 62 class G4ParticleDefinition; 62 class G4ParticleDefinition; 63 63 64 class HistoManager 64 class HistoManager 65 { 65 { 66 public: << 66 public: 67 static HistoManager* GetPointer(); << 67 >> 68 static HistoManager* GetPointer(); 68 69 69 private: << 70 private: 70 HistoManager(); << 71 71 72 public: << 72 HistoManager(); 73 ~HistoManager(); << 74 73 75 void BookHisto(); << 74 public: 76 << 75 77 void BeginOfRun(); << 76 ~HistoManager(); 78 void EndOfRun(); << 77 79 void BeginOfEvent(); << 78 void bookHisto(); 80 void EndOfEvent(); << 79 81 void Fill(G4int id, G4double x, G4double w << 80 void BeginOfRun(); 82 << 81 void EndOfRun(); 83 void ScoreNewTrack(const G4Track*); << 82 void BeginOfEvent(); 84 void AddTargetStep(const G4Step*); << 83 void EndOfEvent(); 85 void AddLeakingParticle(const G4Track*); << 84 void Fill(G4int id, G4double x, G4double w); 86 << 85 87 void SetVerbose(G4int val); << 86 void ScoreNewTrack(const G4Track*); 88 << 87 void AddTargetStep(const G4Step*); 89 inline void SetTargetRadius(G4double val) << 88 void AddLeakingParticle(const G4Track*); 90 { << 89 91 fRadius = val; << 90 void SetTargetLength(G4double val) {length = val;}; 92 fR2 = val * val; << 91 void SetNumberOfSlices(G4int val) {nSlices = val;}; 93 }; << 92 void SetNumberOfBinsE(G4int val) {nBinsE = val;}; 94 inline void SetTargetLength(G4double val) << 93 95 inline void SetNumberOfSlices(G4int val) { << 94 G4double Length() const {return length;}; 96 inline void SetNumberOfBinsE(G4int val) { << 95 G4int NumberOfSlices() const {return nSlices;}; 97 inline void SetDefaultBeamPositionFlag(G4b << 96 98 inline void SetMaxEnergyDeposit(G4double v << 97 void SetVerbose(G4int val); 99 << 98 G4int GetVerbose() const {return verbose;}; 100 inline G4double Radius() const { return fR << 99 101 inline G4double Length() const { return fL << 100 void SetDefaultBeamPositionFlag(G4bool f) {beamFlag = f;}; 102 inline G4bool DefaultBeamPosition() const << 101 G4bool DefaultBeamPosition() const {return beamFlag;}; 103 inline G4int NumberOfSlices() const { retu << 102 104 inline G4int GetVerbose() const { return f << 103 void SetTargetMaterial(const G4Material* mat); 105 << 104 const G4Material* TargetMaterial() const {return material;}; 106 inline G4int PrintBertiniXS() const { retu << 105 const G4Element* TargetElement() const {return elm;}; 107 inline void SetPrintBertiniXS(G4int key) { << 106 108 << 107 G4double CurrentKinEnergy() {return currentKinEnergy;}; 109 private: << 108 const G4ParticleDefinition* CurrentParticle() {return currentDef;}; 110 static HistoManager* fManager; << 109 111 << 110 void SetMaxEnergyDeposit(G4double val) {edepMax = val;}; 112 const G4ParticleDefinition* fPrimaryDef; << 111 113 const G4ParticleDefinition* fNeutron; << 112 private: 114 << 113 115 G4double fR2 = 0.0; << 114 static HistoManager* fManager; 116 G4double fRadius; << 115 117 G4double fLength; << 116 const G4ParticleDefinition* primaryDef; 118 G4double fEdepMax; << 117 const G4ParticleDefinition* currentDef; 119 G4double fEdepEvt = 0.0; << 118 const G4ParticleDefinition* neutron; 120 G4double fEdepEM = 0.0; << 119 const G4Material* material; 121 G4double fEdepPI = 0.0; << 120 G4Element* elm; 122 G4double fEdepP = 0.0; << 121 123 G4double fEdepSum = 0.0; << 122 G4double edepMax; 124 G4double fEdepSum2 = 0.0; << 123 G4double edepEvt; 125 G4double fAbsZ0 = 0.0; << 124 G4double edepEM; 126 G4double fPrimaryKineticEnergy = 0.0; << 125 G4double edepPI; 127 << 126 G4double edepP; 128 G4int fVerbose = 0; << 127 G4double edepSum; 129 G4int fNBinsE = 100; << 128 G4double edepSum2; 130 G4int fNSlices = 300; << 129 G4double beamEnergy; 131 << 130 G4double length; 132 G4int fNevt = 0; << 131 G4double absZ0; 133 G4int fNelec = 0; << 132 G4double primaryKineticEnergy; 134 G4int fNposit = 0; << 133 G4double currentKinEnergy; 135 G4int fNgam = 0; << 134 136 G4int fNprot_leak = 0; << 135 G4int verbose; 137 G4int fNpiofNleak = 0; << 136 G4int nBinsE; 138 G4int fNcpions = 0; << 137 G4int nSlices; 139 G4int fNpi0 = 0; << 138 140 G4int fNkaons = 0; << 139 G4int n_evt; 141 G4int fNmuons = 0; << 140 G4int n_elec; 142 G4int fNions = 0; << 141 G4int n_posit; 143 G4int fNdeut = 0; << 142 G4int n_gam; 144 G4int fNalpha = 0; << 143 G4int n_prot_leak; 145 G4int fNneutron = 0; << 144 G4int n_pion_leak; 146 G4int fNproton = 0; << 145 G4int n_cpions; 147 G4int fNaproton = 0; << 146 G4int n_pi0; 148 G4int fNneu_forw = 0; << 147 G4int n_kaons; 149 G4int fNneu_leak = 0; << 148 G4int n_muons; 150 G4int fNneu_back = 0; << 149 G4int n_ions; 151 G4int fNstep = 0; << 150 G4int n_deut; 152 G4int fNHisto = 28; << 151 G4int n_alpha; 153 G4int fPrintBertiniXS = -1; // 0 - all << 152 G4int n_neutron; >> 153 G4int n_proton; >> 154 G4int n_aproton; >> 155 G4int n_neu_forw; >> 156 G4int n_neu_leak; >> 157 G4int n_neu_back; >> 158 G4int n_step; >> 159 G4int nHisto; 154 160 155 G4bool fBeamFlag = true; << 161 G4bool beamFlag; 156 G4bool fHistoBooked = false; << 157 162 158 Histo* fHisto; << 163 Histo* histo; 159 }; 164 }; 160 165 161 #endif 166 #endif 162 167