Geant4_10
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,
86  G4double r0, G4double z0);
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 
111  inline void SetCheckVolume(G4VPhysicalVolume* v) { fCheckVolume = v;};
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*);
123  void AddPhantomElectron(const G4DynamicParticle*);
124  void AddTargetElectron(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;
132  G4RootAnalysisManager* fAnalysisManager;
133 
134  const G4ParticleDefinition* fGamma;
135  const G4ParticleDefinition* fElectron;
136  const G4ParticleDefinition* fPositron;
137 
138  G4VPhysicalVolume* fCheckVolume;
139  G4VPhysicalVolume* fGasVolume;
140  G4VPhysicalVolume* fPhantom;
141  G4VPhysicalVolume* fTarget1;
142  G4VPhysicalVolume* fTarget2;
143  G4String fHistName;
144 
145  G4int fNHisto;
146  G4int fVerbose;
147  G4int fNBinsZ;
148  G4int fNBinsR;
149  G4int fNBinsE;
150  G4int fScoreBin;
151 
152  G4double fScoreZ;
153  G4double fAbsorberZ;
154  G4double fAbsorberR;
155 
156  G4double fMaxEnergy;
157 
158  G4double fStepZ;
159  G4double fStepR;
160  G4double fStepE;
161  G4double fNormZ;
162  G4double fSumR;
163 
164  G4int fNevt;
165  G4int fNelec;
166  G4int fNposit;
167  G4int fNgam;
168  G4int fNstep;
169  G4int fNgamPh;
170  G4int fNgamTar;
171  G4int fNeTar;
172  G4int fNePh;
173  G4int fNstepTarget;
174 
175  G4DataVector fVolumeR;
176  G4DataVector fGammaE;
177  G4DataVector fEdep;
178  std::vector<G4int> fHisto;
179 
180 };
181 
182 #endif
void SetNumberDivR(G4int val)
Definition: Histo.hh:99
void AddPhantomGamma(G4double e, G4double r)
Definition: Histo.cc:398
static Histo * GetPointer()
Definition: Histo.cc:59
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
const XML_Char * name
Definition: expat.h:151
int G4int
Definition: G4Types.hh:78
void ScoreNewTrack(const G4Track *aTrack)
Definition: Histo.cc:345
void SetHistoName(const G4String &name)
Definition: Histo.hh:90
G4int GetNumberDivZ() const
Definition: Histo.hh:97
tuple v
Definition: test.py:18
G4int GetNumberDivR() const
Definition: Histo.hh:100
void SetAbsorberR(G4double val)
Definition: Histo.hh:105
void BeginOfHisto()
Definition: Histo.cc:107
void SetVerbose(G4int val)
Definition: Histo.hh:93
jump r
Definition: plot.C:36
void SetNumberDivE(G4int val)
Definition: Histo.hh:102
void SetScoreZ(G4double val)
Definition: Histo.hh:106
void SetMaxEnergy(G4double val)
Definition: Histo.hh:108
void SetGasVolume(G4VPhysicalVolume *v)
Definition: Histo.hh:112
void EndOfHisto()
Definition: Histo.cc:159
void SetPhantom(G4VPhysicalVolume *v)
Definition: Histo.hh:113
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:415
double G4double
Definition: G4Types.hh:76
void SetCheckVolume(G4VPhysicalVolume *v)
Definition: Histo.hh:111
void SetAbsorberZ(G4double val)
Definition: Histo.hh:104
void SetNumberDivZ(G4int val)
Definition: Histo.hh:96
void AddStepInTarget()
Definition: Histo.hh:91