Geant4  10.01.p01
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 
84 
91 
95 
99 
102 
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 
MyVector fSumELongit
Definition: Run.hh:80
void FillPerStep(G4double, G4int, G4int)
Definition: Run.hh:118
DetectorConstruction * fDet
Definition: Run.hh:75
MyVector fSumE2RadialCumul
Definition: Run.hh:90
G4double fSum2ChargTrLength
Definition: Run.hh:94
Run()
Definition: Run.cc:43
MyVector f_dEdL
Definition: Run.hh:79
MyVector fSumELongitCumul
Definition: Run.hh:82
G4double fSumNeutrTrLength
Definition: Run.hh:97
G4double fSum2NeutrTrLength
Definition: Run.hh:98
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
G4int f_nRbin
Definition: Run.hh:85
G4double fSumChargTrLength
Definition: Run.hh:93
MyVector fSumERadialCumul
Definition: Run.hh:89
MyVector fSumE2Radial
Definition: Run.hh:88
void FillPerTrack(G4double, G4double)
Definition: Run.hh:109
Definition: G4Run.hh:46
MyVector f_dEdR
Definition: Run.hh:86
std::vector< G4double > MyVector
Definition: Run.hh:42
G4int f_nLbin
Definition: Run.hh:78
G4double fChargTrLength
Definition: Run.hh:92
G4double fNeutralStep
Definition: Run.hh:101
MyVector fSumERadial
Definition: Run.hh:87
G4double fNeutrTrLength
Definition: Run.hh:96
MyVector fSumE2LongitCumul
Definition: Run.hh:83
G4double fChargedStep
Definition: Run.hh:100
Detector construction class to demonstrate various ways of placement.
void EndOfRun()
Definition: Run.cc:147
MyVector fSumE2Longit
Definition: Run.hh:81
double G4double
Definition: G4Types.hh:76
Definition: Run.hh:46
void FillPerEvent()
Definition: Run.cc:112
void Reset()
Definition: Run.cc:56
virtual void Merge(const G4Run *)
Definition: Run.cc:115
G4int fVerbose
Definition: Run.hh:103
PrimaryGeneratorAction * fKin
Definition: Run.hh:76
~Run()
Definition: Run.cc:72