Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 "g4root.hh"
40 
41 #include <vector>
42 typedef std::vector<G4double> MyVector;
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50 
51 class Run : public G4Run
52 {
53 public:
54 
56  virtual ~Run();
57 
58  virtual void Merge(const G4Run*);
59 
60  void InitializePerEvent();
61  void FillPerEvent();
62 
63  inline void FillPerTrack(G4double,G4double);
64  inline void FillPerStep (G4double,G4int,G4int);
65 
66  inline void AddStep(G4double q);
67 
68  void EndOfRun(G4double edep, G4double rms, G4double& limit);
69 
70  inline void SetVerbose(G4int val) {fVerbose = val;};
71 
72 private:
73  void Reset();
74 
77 
78  G4int f_nLbin;
79  MyVector f_dEdL;
80  MyVector fSumELongit;
81  MyVector fSumE2Longit;
82  MyVector fSumELongitCumul;
83  MyVector fSumE2LongitCumul;
84 
85  G4int f_nRbin;
86  MyVector f_dEdR;
87  MyVector fSumERadial;
88  MyVector fSumE2Radial;
89  MyVector fSumERadialCumul;
90  MyVector fSumE2RadialCumul;
91 
92  G4double fChargTrLength;
93  G4double fSumChargTrLength;
94  G4double fSum2ChargTrLength;
95 
96  G4double fNeutrTrLength;
97  G4double fSumNeutrTrLength;
98  G4double fSum2NeutrTrLength;
99 
100  G4double fChargedStep;
101  G4double fNeutralStep;
102 
103  G4int fVerbose;
104 };
105 
106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107 
108 inline
109 void Run::FillPerTrack(G4double charge, G4double trkLength)
110 {
111  if (charge != 0.) fChargTrLength += trkLength;
112  else fNeutrTrLength += trkLength;
113 }
114 
115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
116 
117 inline
118 void Run::FillPerStep(G4double dEstep, G4int Lbin, G4int Rbin)
119 {
120  f_dEdL[Lbin] += dEstep; f_dEdR[Rbin] += dEstep;
121 }
122 
123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124 
125 inline void Run::AddStep(G4double q)
126 {
127  if (q == 0.0) { fNeutralStep += 1.0; }
128  else { fChargedStep += 1.0; }
129 }
130 
131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
132 
133 #endif
134 
The primary generator action class with particle gun.
void FillPerStep(G4double, G4int, G4int)
Definition: Run.hh:118
Run()
Definition: Run.cc:43
void InitializePerEvent()
Definition: Run.cc:97
void AddStep(G4double q)
Definition: Run.hh:125
void SetVerbose(G4int val)
Definition: Run.hh:70
int G4int
Definition: G4Types.hh:78
void FillPerTrack(G4double, G4double)
Definition: Run.hh:109
Definition: G4Run.hh:46
std::vector< G4double > MyVector
Definition: Run.hh:42
Detector construction class to define materials and geometry.
void EndOfRun()
Definition: Run.cc:147
double G4double
Definition: G4Types.hh:76
Definition: Run.hh:46
void FillPerEvent()
Definition: Run.cc:112
virtual void Merge(const G4Run *)
Definition: Run.cc:115
~Run()
Definition: Run.cc:72