Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 //
28 //
29 #ifndef Histo_h
30 #define Histo_h 1
31 
32 //---------------------------------------------------------------------------
33 //
34 // ClassName: Histo
35 //
36 // Description: Singleton class to hold Emc geometry parameters.
37 // User cannot access to the constructor.
38 // The pointer of the only existing object can be got via
39 // Histo::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 "G4DynamicParticle.hh"
52 #include "G4VPhysicalVolume.hh"
53 #include "G4DataVector.hh"
54 #include "G4Track.hh"
55 #include <vector>
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
58 
60 
61 class Histo
62 {
63 
64 public:
65 
66  static Histo* GetPointer();
67 
68  Histo();
69 
70  ~Histo();
71 
72  void BeginOfHisto();
73  // In this method histogramms are booked
74 
75  void EndOfHisto();
76  // In this method bookHisto method is called in which histogramms are filled
77 
78 public:
79 
80  void ScoreNewTrack(const G4Track* aTrack);
81 
83  G4double r2, G4double z2,
84  G4double r0, G4double z0);
85 
87 
88  inline void SetHistoName(const G4String& name) { fHistName = name; };
89  inline void AddStepInTarget() { ++fNstepTarget;};
90 
91  inline void SetVerbose(G4int val) { fVerbose = val;};
92  inline G4int GetVerbose() const { return fVerbose;};
93 
94  inline void SetNumberDivZ(G4int val) { fNBinsZ = val; };
95  inline G4int GetNumberDivZ() const { return fNBinsZ; };
96 
97  inline void SetNumberDivR(G4int val) { fNBinsR = val; };
98  inline G4int GetNumberDivR() const { return fNBinsR; };
99 
100  inline void SetNumberDivE(G4int val) { fNBinsE = val; };
101 
102  inline void SetAbsorberZ(G4double val) { fAbsorberZ = val; };
103  inline void SetAbsorberR(G4double val) { fAbsorberR = val; };
104  inline void SetScoreZ(G4double val) { fScoreZ = val; };
105 
106  inline void SetMaxEnergy(G4double val) { fMaxEnergy = val; };
107  inline G4double GetMaxEnergy() const { return fMaxEnergy;};
108 
109  inline void SetCheckVolume(G4VPhysicalVolume* v) { fCheckVolume = v;};
110  inline void SetGasVolume(G4VPhysicalVolume* v) { fGasVolume = v;};
111  inline void SetPhantom(G4VPhysicalVolume* v) { fPhantom = v; };
112  inline void SetTarget1(G4VPhysicalVolume* v) { fTarget1 = v; };
113  inline void SetTarget2(G4VPhysicalVolume* v) { fTarget2 = v; };
114 
115 private:
116 
117  void BookHisto();
118 
119  void AddPhantomPhoton(const G4DynamicParticle*);
120  void AddTargetPhoton(const G4DynamicParticle*);
121  void AddPhantomElectron(const G4DynamicParticle*);
122  void AddTargetElectron(const G4DynamicParticle*);
123 
124  inline void AddPhoton(const G4DynamicParticle*) { ++fNgam; };
125  inline void AddElectron(const G4DynamicParticle*){ ++fNelec; };
126  inline void AddPositron(const G4DynamicParticle*){ ++fNposit; };
127 
128  // MEMBERS
129  static Histo* fManager;
130  G4RootAnalysisManager* fAnalysisManager;
131 
132  const G4ParticleDefinition* fGamma;
133  const G4ParticleDefinition* fElectron;
134  const G4ParticleDefinition* fPositron;
135 
136  G4VPhysicalVolume* fCheckVolume;
137  G4VPhysicalVolume* fGasVolume;
138  G4VPhysicalVolume* fPhantom;
139  G4VPhysicalVolume* fTarget1;
140  G4VPhysicalVolume* fTarget2;
141  G4String fHistName;
142 
143  G4int fNHisto;
144  G4int fVerbose;
145  G4int fNBinsZ;
146  G4int fNBinsR;
147  G4int fNBinsE;
148  G4int fScoreBin;
149 
150  G4double fScoreZ;
151  G4double fAbsorberZ;
152  G4double fAbsorberR;
153 
154  G4double fMaxEnergy;
155 
156  G4double fStepZ;
157  G4double fStepR;
158  G4double fStepE;
159  G4double fNormZ;
160  G4double fSumR;
161 
162  G4int fNevt;
163  G4int fNelec;
164  G4int fNposit;
165  G4int fNgam;
166  G4int fNstep;
167  G4int fNgamPh;
168  G4int fNgamTar;
169  G4int fNeTar;
170  G4int fNePh;
171  G4int fNstepTarget;
172 
173  G4DataVector fVolumeR;
174  G4DataVector fGammaE;
175  G4DataVector fEdep;
176  std::vector<G4int> fHisto;
177 
178 };
179 
180 #endif