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 | #ifndef Histo_h |
---|
27 | #define Histo_h 1 |
---|
28 | |
---|
29 | //--------------------------------------------------------------------------- |
---|
30 | // |
---|
31 | // ClassName: Histo |
---|
32 | // |
---|
33 | // Description: Singleton class to hold Emc geometry parameters. |
---|
34 | // User cannot access to the constructor. |
---|
35 | // The pointer of the only existing object can be got via |
---|
36 | // Histo::GetPointer() static method. |
---|
37 | // The first invokation of this static method makes |
---|
38 | // the singleton object. |
---|
39 | // |
---|
40 | // Author: V.Ivanchenko 27/09/00 |
---|
41 | // |
---|
42 | //---------------------------------------------------------------------------- |
---|
43 | // |
---|
44 | |
---|
45 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
46 | |
---|
47 | #include "globals.hh" |
---|
48 | #include <vector> |
---|
49 | #include "G4DynamicParticle.hh" |
---|
50 | #include "G4VPhysicalVolume.hh" |
---|
51 | #include "G4DataVector.hh" |
---|
52 | #include "G4Track.hh" |
---|
53 | |
---|
54 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
55 | |
---|
56 | namespace AIDA { |
---|
57 | class ITree; |
---|
58 | class ITuple; |
---|
59 | class IHistogram1D; |
---|
60 | class IAnalysisFactory; |
---|
61 | } |
---|
62 | |
---|
63 | class Histo |
---|
64 | { |
---|
65 | |
---|
66 | public: |
---|
67 | // With description |
---|
68 | |
---|
69 | static Histo* GetPointer(); |
---|
70 | |
---|
71 | Histo(); |
---|
72 | |
---|
73 | ~Histo(); |
---|
74 | |
---|
75 | void BeginOfHisto(); |
---|
76 | // In this method histogramms are booked |
---|
77 | |
---|
78 | void EndOfHisto(); |
---|
79 | // In this method bookHisto method is called in which histogramms are filled |
---|
80 | |
---|
81 | public: // Without description |
---|
82 | |
---|
83 | void SetHistoName(const G4String& name) {histName = name;}; |
---|
84 | void SetHistoType(const G4String& type) {histType = type;}; |
---|
85 | void bookHisto(); |
---|
86 | void SaveToTuple(const G4String&, G4double); |
---|
87 | void SaveToTuple(const G4String&, G4double, G4double); |
---|
88 | void SaveEvent(); |
---|
89 | |
---|
90 | G4double GetTrackLength() const {return trackLength;}; |
---|
91 | void ResetTrackLength() {trackLength = 0.0, trackAbs = true;}; |
---|
92 | void SetTrackOutAbsorber() {trackAbs = false;}; |
---|
93 | G4bool GetTrackInAbsorber() const {return trackAbs;}; |
---|
94 | void AddTrackLength(G4double x) {trackLength += x;}; |
---|
95 | |
---|
96 | void AddDeltaElectron(const G4DynamicParticle*); |
---|
97 | void AddPhoton(const G4DynamicParticle*); |
---|
98 | void AddPhantomPhoton(const G4DynamicParticle*); |
---|
99 | void AddTargetPhoton(const G4DynamicParticle*); |
---|
100 | void AddPhantomElectron(const G4DynamicParticle*); |
---|
101 | void AddTargetElectron(const G4DynamicParticle*); |
---|
102 | void AddPositron(const G4DynamicParticle*) {n_posit++;}; |
---|
103 | void AddStepInTarget() {n_step_target++;}; |
---|
104 | |
---|
105 | void SetVerbose(G4int val) {verbose = val;}; |
---|
106 | G4int GetVerbose() const {return verbose;}; |
---|
107 | |
---|
108 | void SetHistoNumber(G4int val) {nHisto = val;}; |
---|
109 | void SetNtuple(G4bool val) {nTuple = val;}; |
---|
110 | |
---|
111 | void SetNumberDivZ(G4int val) {nBinsZ = val; }; |
---|
112 | G4int GetNumberDivZ() const {return nBinsZ;}; |
---|
113 | void SetNumberDivR(G4int val) {nBinsR = val; }; |
---|
114 | G4int GetNumberDivR() const {return nBinsR;}; |
---|
115 | void SetNumberDivE(G4int val) {nBinsE = val; }; |
---|
116 | |
---|
117 | void SetFirstEventToDebug(G4int val) {nEvt1 = val;}; |
---|
118 | G4int FirstEventToDebug() const {return nEvt1;}; |
---|
119 | void SetLastEventToDebug(G4int val) {nEvt2 = val;}; |
---|
120 | G4int LastEventToDebug() const {return nEvt2;}; |
---|
121 | |
---|
122 | void SetAbsorberZ(G4double val) {absorberZ = val;}; |
---|
123 | void SetAbsorberR(G4double val) {absorberR = val;}; |
---|
124 | void SetScoreZ(G4double val) {scoreZ = val;}; |
---|
125 | |
---|
126 | void SetMaxEnergy(G4double val) {maxEnergy = val;}; |
---|
127 | G4double GetMaxEnergy() const {return maxEnergy;}; |
---|
128 | |
---|
129 | void AddEvent() {n_evt++;}; |
---|
130 | void AddStep() {n_step++;}; |
---|
131 | |
---|
132 | void SetCheckVolume(G4VPhysicalVolume* v) {checkVolume = v;}; |
---|
133 | void SetGasVolume(G4VPhysicalVolume* v) {gasVolume = v;}; |
---|
134 | G4VPhysicalVolume* CheckVolume() const {return checkVolume;}; |
---|
135 | G4VPhysicalVolume* GasVolume() const {return gasVolume;}; |
---|
136 | |
---|
137 | void SetPhantom(G4VPhysicalVolume* v) {phantom = v;}; |
---|
138 | void SetTarget1(G4VPhysicalVolume* v) {target1 = v;}; |
---|
139 | void SetTarget2(G4VPhysicalVolume* v) {target2 = v;}; |
---|
140 | |
---|
141 | void AddStep(G4double e, G4double r1, G4double z1, G4double r2, G4double z2, |
---|
142 | G4double r0, G4double z0); |
---|
143 | void AddGamma(G4double e, G4double r); |
---|
144 | void ScoreNewTrack(const G4Track* aTrack); |
---|
145 | |
---|
146 | private: |
---|
147 | |
---|
148 | // MEMBERS |
---|
149 | static Histo* fManager; |
---|
150 | |
---|
151 | G4VPhysicalVolume* checkVolume; |
---|
152 | G4VPhysicalVolume* gasVolume; |
---|
153 | G4VPhysicalVolume* phantom; |
---|
154 | G4VPhysicalVolume* target1; |
---|
155 | G4VPhysicalVolume* target2; |
---|
156 | G4String histName; |
---|
157 | G4String histType; |
---|
158 | |
---|
159 | std::vector<AIDA::IHistogram1D*> histo; |
---|
160 | AIDA::IAnalysisFactory* af; |
---|
161 | AIDA::ITuple* ntup; |
---|
162 | AIDA::ITree* tree; |
---|
163 | G4int nHisto; |
---|
164 | G4int nHisto1; |
---|
165 | G4int verbose; |
---|
166 | G4int nBinsZ; |
---|
167 | G4int nBinsR; |
---|
168 | G4int nBinsE; |
---|
169 | G4int nScoreBin; |
---|
170 | G4int nEvt1; |
---|
171 | G4int nEvt2; |
---|
172 | |
---|
173 | G4double absorberZ; |
---|
174 | G4double stepZ; |
---|
175 | G4double scoreZ; |
---|
176 | G4double absorberR; |
---|
177 | G4double stepR; |
---|
178 | G4double maxEnergy; |
---|
179 | G4double stepE; |
---|
180 | G4double normZ; |
---|
181 | G4double sumR; |
---|
182 | |
---|
183 | G4double trackLength; |
---|
184 | G4bool trackAbs; // Track is in absorber |
---|
185 | G4int n_evt; |
---|
186 | G4int n_elec; |
---|
187 | G4int n_posit; |
---|
188 | G4int n_gam; |
---|
189 | G4int n_step; |
---|
190 | G4int n_gam_ph; |
---|
191 | G4int n_gam_tar; |
---|
192 | G4int n_e_tar; |
---|
193 | G4int n_e_ph; |
---|
194 | G4int n_step_target; |
---|
195 | G4int n_neutron; |
---|
196 | G4bool nTuple; |
---|
197 | G4DataVector volumeR; |
---|
198 | G4DataVector gammaE; |
---|
199 | |
---|
200 | }; |
---|
201 | |
---|
202 | #endif |
---|