Geant4  10.02.p02
Histo.hh
Go to the documentation of this file.
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: Histo.hh 67994 2013-03-13 11:05:39Z gcosmo $
27 //
30 //
31 #ifndef Histo_h
32 #define Histo_h 1
33 
34 //---------------------------------------------------------------------------
35 //
36 // ClassName: Histo
37 //
38 // Description: Singleton class to hold Emc geometry parameters.
39 // User cannot access to the constructor.
40 // The pointer of the only existing object can be got via
41 // Histo::GetPointer() static method.
42 // The first invokation of this static method makes
43 // the singleton object.
44 //
45 // Author: V.Ivanchenko 27/09/00
46 //
47 //----------------------------------------------------------------------------
48 //
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
51 
52 #include "globals.hh"
53 #include "G4DynamicParticle.hh"
54 #include "G4VPhysicalVolume.hh"
55 #include "G4DataVector.hh"
56 #include "G4Track.hh"
57 #include <vector>
58 
59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
60 
62 
63 class Histo
64 {
65 
66 public:
67 
68  static Histo* GetPointer();
69 
70  Histo();
71 
72  ~Histo();
73 
74  void BeginOfHisto();
75  // In this method histogramms are booked
76 
77  void EndOfHisto();
78  // In this method bookHisto method is called in which histogramms are filled
79 
80 public:
81 
82  void ScoreNewTrack(const G4Track* aTrack);
83 
84  void AddPhantomStep(G4double e, G4double r1, G4double z1,
85  G4double r2, G4double z2,
87 
89 
90  inline void SetHistoName(const G4String& name) { fHistName = name; };
91  inline void AddStepInTarget() { ++fNstepTarget;};
92 
93  inline void SetVerbose(G4int val) { fVerbose = val;};
94  inline G4int GetVerbose() const { return fVerbose;};
95 
96  inline void SetNumberDivZ(G4int val) { fNBinsZ = val; };
97  inline G4int GetNumberDivZ() const { return fNBinsZ; };
98 
99  inline void SetNumberDivR(G4int val) { fNBinsR = val; };
100  inline G4int GetNumberDivR() const { return fNBinsR; };
101 
102  inline void SetNumberDivE(G4int val) { fNBinsE = val; };
103 
104  inline void SetAbsorberZ(G4double val) { fAbsorberZ = val; };
105  inline void SetAbsorberR(G4double val) { fAbsorberR = val; };
106  inline void SetScoreZ(G4double val) { fScoreZ = val; };
107 
108  inline void SetMaxEnergy(G4double val) { fMaxEnergy = val; };
109  inline G4double GetMaxEnergy() const { return fMaxEnergy;};
110 
112  inline void SetGasVolume(G4VPhysicalVolume* v) { fGasVolume = v;};
113  inline void SetPhantom(G4VPhysicalVolume* v) { fPhantom = v; };
114  inline void SetTarget1(G4VPhysicalVolume* v) { fTarget1 = v; };
115  inline void SetTarget2(G4VPhysicalVolume* v) { fTarget2 = v; };
116 
117 private:
118 
119  void BookHisto();
120 
121  void AddPhantomPhoton(const G4DynamicParticle*);
122  void AddTargetPhoton(const G4DynamicParticle*);
125 
126  inline void AddPhoton(const G4DynamicParticle*) { ++fNgam; };
127  inline void AddElectron(const G4DynamicParticle*){ ++fNelec; };
128  inline void AddPositron(const G4DynamicParticle*){ ++fNposit; };
129 
130  // MEMBERS
131  static Histo* fManager;
133 
137 
144 
145  G4int fNHisto;
146  G4int fVerbose;
151 
155 
157 
163 
174 
178  std::vector<G4int> fHisto;
179 
180 };
181 
182 #endif
void SetNumberDivR(G4int val)
Definition: Histo.hh:99
void AddPhantomPhoton(const G4DynamicParticle *)
Definition: Histo.cc:319
G4DataVector fEdep
Definition: Histo.hh:177
G4RootAnalysisManager * fAnalysisManager
Definition: Histo.hh:132
void AddPhantomGamma(G4double e, G4double r)
Definition: Histo.cc:399
G4int fScoreBin
Definition: Histo.hh:150
static Histo * GetPointer()
Definition: Histo.cc:59
G4int fNelec
Definition: Histo.hh:165
G4double GetMaxEnergy() const
Definition: Histo.hh:109
~Histo()
Definition: Histo.cc:70
void SetTarget2(G4VPhysicalVolume *v)
Definition: Histo.hh:115
Definition: Histo.hh:56
Histo()
Definition: Histo.cc:51
G4String name
Definition: TRTMaterials.hh:40
G4VPhysicalVolume * fTarget2
Definition: Histo.hh:142
G4VPhysicalVolume * fPhantom
Definition: Histo.hh:140
G4int fNHisto
Definition: Histo.hh:119
void AddElectron(const G4DynamicParticle *)
Definition: Histo.hh:127
G4VPhysicalVolume * fTarget1
Definition: Histo.hh:141
int G4int
Definition: G4Types.hh:78
const G4ParticleDefinition * fGamma
Definition: Histo.hh:134
G4int fNevt
Definition: Histo.hh:164
G4double fAbsorberZ
Definition: Histo.hh:153
void ScoreNewTrack(const G4Track *aTrack)
Definition: Histo.cc:346
void AddPhoton(const G4DynamicParticle *)
Definition: Histo.hh:126
G4double fStepE
Definition: Histo.hh:160
G4DataVector fGammaE
Definition: Histo.hh:176
void SetHistoName(const G4String &name)
Definition: Histo.hh:90
const G4ParticleDefinition * fElectron
Definition: Histo.hh:135
G4int GetNumberDivZ() const
Definition: Histo.hh:97
G4int fNstep
Definition: Histo.hh:168
const G4ParticleDefinition * fPositron
Definition: Histo.hh:136
G4VPhysicalVolume * fCheckVolume
Definition: Histo.hh:138
G4double fScoreZ
Definition: Histo.hh:152
G4int GetNumberDivR() const
Definition: Histo.hh:100
void SetAbsorberR(G4double val)
Definition: Histo.hh:105
void BeginOfHisto()
Definition: Histo.cc:107
G4double fStepZ
Definition: Histo.hh:158
G4int fNBinsZ
Definition: Histo.hh:147
void AddTargetElectron(const G4DynamicParticle *)
Definition: Histo.cc:326
void SetVerbose(G4int val)
Definition: Histo.hh:93
G4int fNBinsE
Definition: Histo.hh:149
G4int fNgam
Definition: Histo.hh:167
G4DataVector fVolumeR
Definition: Histo.hh:175
G4double fSumR
Definition: Histo.hh:162
void SetNumberDivE(G4int val)
Definition: Histo.hh:102
G4int fNgamTar
Definition: Histo.hh:170
G4int fNposit
Definition: Histo.hh:166
void SetScoreZ(G4double val)
Definition: Histo.hh:106
G4int fNePh
Definition: Histo.hh:172
void SetMaxEnergy(G4double val)
Definition: Histo.hh:108
G4double fNormZ
Definition: Histo.hh:161
void SetGasVolume(G4VPhysicalVolume *v)
Definition: Histo.hh:112
G4int fVerbose
Definition: Histo.hh:120
G4double fStepR
Definition: Histo.hh:159
G4int fNgamPh
Definition: Histo.hh:169
G4double fAbsorberR
Definition: Histo.hh:154
G4VPhysicalVolume * fGasVolume
Definition: Histo.hh:139
void EndOfHisto()
Definition: Histo.cc:159
G4int fNstepTarget
Definition: Histo.hh:173
void SetPhantom(G4VPhysicalVolume *v)
Definition: Histo.hh:113
void AddTargetPhoton(const G4DynamicParticle *)
Definition: Histo.cc:309
G4String fHistName
Definition: Histo.hh:115
G4int fNeTar
Definition: Histo.hh:171
void SetTarget1(G4VPhysicalVolume *v)
Definition: Histo.hh:114
G4int GetVerbose() const
Definition: Histo.hh:94
void AddPhantomStep(G4double e, G4double r1, G4double z1, G4double r2, G4double z2, G4double r0, G4double z0)
Definition: Histo.cc:416
std::vector< G4int > fHisto
Definition: Histo.hh:125
G4int fNBinsR
Definition: Histo.hh:148
double G4double
Definition: G4Types.hh:76
void SetCheckVolume(G4VPhysicalVolume *v)
Definition: Histo.hh:111
void SetAbsorberZ(G4double val)
Definition: Histo.hh:104
G4RootAnalysisManager * fManager
Definition: Histo.hh:108
void AddPositron(const G4DynamicParticle *)
Definition: Histo.hh:128
void AddPhantomElectron(const G4DynamicParticle *)
Definition: Histo.cc:336
void SetNumberDivZ(G4int val)
Definition: Histo.hh:96
G4double fMaxEnergy
Definition: Histo.hh:156
const G4double r0
void AddStepInTarget()
Definition: Histo.hh:91
void BookHisto()
Definition: Histo.cc:256