[807] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // $Id: HistoManager.hh,v 1.8 2007/04/24 14:20:04 vnivanch Exp $ |
---|
| 27 | // GEANT4 tag $Name: $ |
---|
| 28 | |
---|
| 29 | #ifndef HistoManager_h |
---|
| 30 | #define HistoManager_h 1 |
---|
| 31 | |
---|
| 32 | //--------------------------------------------------------------------------- |
---|
| 33 | // |
---|
| 34 | // ClassName: HistoManager |
---|
| 35 | // |
---|
| 36 | // Description: Singleton class to hold Emc parameters and build histograms. |
---|
| 37 | // User cannot access to the constructor. |
---|
| 38 | // The pointer of the only existing object can be got via |
---|
| 39 | // HistoManager::GetPointer() static method. |
---|
| 40 | // The first invokation of this static method makes |
---|
| 41 | // the singleton object. |
---|
| 42 | // |
---|
| 43 | // Author: V.Ivanchenko 27/09/00 |
---|
| 44 | // |
---|
| 45 | //---------------------------------------------------------------------------- |
---|
| 46 | // |
---|
| 47 | |
---|
| 48 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 49 | |
---|
| 50 | #include "globals.hh" |
---|
| 51 | #include <vector> |
---|
| 52 | #include "G4DynamicParticle.hh" |
---|
| 53 | #include "G4VPhysicalVolume.hh" |
---|
| 54 | #include "G4DataVector.hh" |
---|
| 55 | #include "G4Track.hh" |
---|
| 56 | //#include "Histo.hh" |
---|
| 57 | |
---|
| 58 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 59 | |
---|
| 60 | class Histo; |
---|
| 61 | |
---|
| 62 | class HistoManager |
---|
| 63 | { |
---|
| 64 | |
---|
| 65 | public: |
---|
| 66 | // With description |
---|
| 67 | |
---|
| 68 | static HistoManager* GetPointer(); |
---|
| 69 | |
---|
| 70 | private: |
---|
| 71 | |
---|
| 72 | HistoManager(); |
---|
| 73 | |
---|
| 74 | public: // Without description |
---|
| 75 | |
---|
| 76 | ~HistoManager(); |
---|
| 77 | |
---|
| 78 | void bookHisto(); |
---|
| 79 | |
---|
| 80 | void BeginOfRun(); |
---|
| 81 | void EndOfRun(); |
---|
| 82 | |
---|
| 83 | void BeginOfEvent(); |
---|
| 84 | void EndOfEvent(); |
---|
| 85 | |
---|
| 86 | void ScoreNewTrack(const G4Track* aTrack); |
---|
| 87 | void AddEnergy(G4double edep, G4int idx, G4int copyNo); |
---|
| 88 | |
---|
| 89 | void AddDeltaElectron(const G4DynamicParticle*); |
---|
| 90 | void AddPhoton(const G4DynamicParticle*); |
---|
| 91 | |
---|
| 92 | G4double GetTrackLength() const {return trackLength;}; |
---|
| 93 | void ResetTrackLength() {trackLength = 0.0, trackAbs = true;}; |
---|
| 94 | void SetTrackOutAbsorber() {trackAbs = false;}; |
---|
| 95 | G4bool GetTrackInAbsorber() const {return trackAbs;}; |
---|
| 96 | void AddTrackLength(G4double x) {trackLength += x;}; |
---|
| 97 | void AddPositron(const G4DynamicParticle*) {n_posit++;}; |
---|
| 98 | void SetVerbose(G4int val) {verbose = val;}; |
---|
| 99 | G4int GetVerbose() const {return verbose;}; |
---|
| 100 | void SetHistoNumber(G4int val) {nHisto = val;}; |
---|
| 101 | void SetNtuple(G4bool val) {nTuple = val;}; |
---|
| 102 | |
---|
| 103 | void SetFirstEventToDebug(G4int val) {nEvt1 = val;}; |
---|
| 104 | G4int FirstEventToDebug() const {return nEvt1;}; |
---|
| 105 | void SetLastEventToDebug(G4int val) {nEvt2 = val;}; |
---|
| 106 | G4int LastEventToDebug() const {return nEvt2;}; |
---|
| 107 | |
---|
| 108 | void SetMaxEnergy(G4double val) {maxEnergy = val;}; |
---|
| 109 | G4double GetMaxEnergy() const {return maxEnergy;}; |
---|
| 110 | void SetThresholdEnergy(G4double val) {thKinE = val;}; |
---|
| 111 | void SetThresholdZ(G4double val) {thPosZ = val;}; |
---|
| 112 | void AddStep() {n_step++;}; |
---|
| 113 | |
---|
| 114 | // Acceptance parameters |
---|
| 115 | void SetEdepAndRMS(G4int, G4ThreeVector); |
---|
| 116 | void SetBeamEnergy(G4double val) {beamEnergy = val;}; |
---|
| 117 | |
---|
| 118 | private: |
---|
| 119 | |
---|
| 120 | // MEMBERS |
---|
| 121 | static HistoManager* fManager; |
---|
| 122 | |
---|
| 123 | G4int nHisto; |
---|
| 124 | G4int verbose; |
---|
| 125 | G4int nEvt1; |
---|
| 126 | G4int nEvt2; |
---|
| 127 | |
---|
| 128 | G4double beamEnergy; |
---|
| 129 | G4double maxEnergy; |
---|
| 130 | G4double maxEnergyAbs; |
---|
| 131 | G4double thKinE; |
---|
| 132 | G4double thPosZ; |
---|
| 133 | |
---|
| 134 | G4double trackLength; |
---|
| 135 | G4bool trackAbs; // Track is in absorber |
---|
| 136 | G4int n_evt; |
---|
| 137 | G4int n_elec; |
---|
| 138 | G4int n_posit; |
---|
| 139 | G4int n_gam; |
---|
| 140 | G4int n_step; |
---|
| 141 | G4int n_gamph; |
---|
| 142 | G4int n_gam_tar; |
---|
| 143 | G4int n_step_target; |
---|
| 144 | G4int nBinsE, nBinsEA, nBinsED; |
---|
| 145 | G4bool nTuple; |
---|
| 146 | |
---|
| 147 | G4double Eabs1, Eabs2, Eabs3, Eabs4; |
---|
| 148 | G4double E[25]; |
---|
| 149 | G4DataVector Evertex; |
---|
| 150 | G4DataVector Nvertex; |
---|
| 151 | |
---|
| 152 | G4double edeptrue[3]; |
---|
| 153 | G4double rmstrue[3]; |
---|
| 154 | G4double limittrue[3]; |
---|
| 155 | G4double edep[3]; |
---|
| 156 | G4double erms[3]; |
---|
| 157 | G4double edeptr[3]; |
---|
| 158 | G4double ermstr[3]; |
---|
| 159 | G4int stat[3]; |
---|
| 160 | G4int nmax; |
---|
| 161 | |
---|
| 162 | Histo* histo; |
---|
| 163 | |
---|
| 164 | |
---|
| 165 | |
---|
| 166 | }; |
---|
| 167 | |
---|
| 168 | #endif |
---|