Geant4_10
Run.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 // $Id: Run.hh 75565 2013-11-04 11:24:11Z vnivanch $
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #ifndef Run_h
35 #define Run_h 1
36 
37 #include "G4Run.hh"
38 
39 #include "G4ParticleDefinition.hh"
40 #include "G4ThreeVector.hh"
41 #include "globals.hh"
42 
43 #include "g4root.hh"
44 
45 #include <vector>
46 typedef std::vector<G4double> MyVector;
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49 
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54 
55 class Run : public G4Run
56 {
57 public:
58 
60  virtual ~Run();
61 
62  virtual void Merge(const G4Run*);
63 
64  void InitializePerEvent();
65  void FillPerEvent();
66 
67  inline void FillPerTrack(G4double,G4double);
68  inline void FillPerStep (G4double,G4int,G4int);
69 
70  inline void AddStep(G4double q);
71 
72  void ComputeStatistics(G4double edep, G4double rms, G4double& limit);
73 
74  inline void SetVerbose(G4int val) {fVerbose = val;};
75 
76 private:
77  void Reset();
78 
81 
82  G4int f_nLbin;
83  MyVector f_dEdL;
84  MyVector fSumELongit;
85  MyVector fSumE2Longit;
86  MyVector fSumELongitCumul;
87  MyVector fSumE2LongitCumul;
88 
89  G4int f_nRbin;
90  MyVector f_dEdR;
91  MyVector fSumERadial;
92  MyVector fSumE2Radial;
93  MyVector fSumERadialCumul;
94  MyVector fSumE2RadialCumul;
95 
96  G4double fChargTrLength;
97  G4double fSumChargTrLength;
98  G4double fSum2ChargTrLength;
99 
100  G4double fNeutrTrLength;
101  G4double fSumNeutrTrLength;
102  G4double fSum2NeutrTrLength;
103 
104  G4double fChargedStep;
105  G4double fNeutralStep;
106 
107  G4int fVerbose;
108 };
109 
110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
111 
112 inline
113 void Run::FillPerTrack(G4double charge, G4double trkLength)
114 {
115  if (charge != 0.) fChargTrLength += trkLength;
116  else fNeutrTrLength += trkLength;
117 }
118 
119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120 
121 inline
122 void Run::FillPerStep(G4double dEstep, G4int Lbin, G4int Rbin)
123 {
124  f_dEdL[Lbin] += dEstep; f_dEdR[Rbin] += dEstep;
125 }
126 
127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
128 
129 inline void Run::AddStep(G4double q)
130 {
131  if (q == 0.0) { fNeutralStep += 1.0; }
132  else { fChargedStep += 1.0; }
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
136 
137 #endif
138 
void FillPerStep(G4double, G4int, G4int)
Definition: Run.hh:122
void InitializePerEvent()
Definition: Run.cc:103
void AddStep(G4double q)
Definition: Run.hh:129
void SetVerbose(G4int val)
Definition: Run.hh:74
int G4int
Definition: G4Types.hh:78
std::vector< G4double > MyVector
Definition: Run.hh:46
Double_t edep
Definition: macro.C:13
void FillPerTrack(G4double, G4double)
Definition: Run.hh:113
Definition: G4Run.hh:46
void ComputeStatistics()
Definition: Run.cc:97
double G4double
Definition: G4Types.hh:76
Definition: Run.hh:46
void FillPerEvent()
Definition: Run.cc:118
virtual void Merge(const G4Run *)
Definition: Run.cc:180
~Run()
Definition: Run.cc:60
Run(DetectorConstruction *)
Definition: Run.cc:46