Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExN07Run.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 //
26 //
27 // $Id$
28 //
29 
30 #ifndef ExN07Run_h
31 #define ExN07Run_h 1
32 
33 #include "globals.hh"
34 #include "G4Run.hh"
35 
36 #include "G4THitsMap.hh"
37 
38 class G4Event;
39 
40 class ExN07Run : public G4Run
41 {
42  public:
43  ExN07Run();
44  virtual ~ExN07Run();
45 
46  public:
47  virtual void RecordEvent(const G4Event*);
48 
49  private:
50  G4double GetTotal(const G4THitsMap<G4double> &map) const;
51  G4double FindMinimum(const G4THitsMap<G4double> &map) const;
52 
53  private:
54  // Maps for accumulation
55  // mapSum[i][j]
56  // i = 0 : Calor-A_abs j = 0 : total eDep
57  // i = 1 : Calor-A_gap j = 1 : number of gamma
58  // i = 2 : Calor-B_abs j = 2 : number of electron
59  // i = 3 : Calor-B_gap j = 3 : number of positron
60  // i = 4 : Calor-C_abs j = 4 : total step length for e+/e-
61  // i = 5 : Calor-C_gap j = 5 : total number of steps for e+/e-
62  G4THitsMap<G4double> mapSum[6][6];
63  G4int colIDSum[6][6];
64 
65  // Maps for minimum value
66  // i = 0 : Calor-A_abs j = 0 : minimum kinE at generation for gamma
67  // i = 1 : Calor-A_gap j = 1 : minimum kinE at generation for electron
68  // i = 2 : Calor-B_abs j = 2 : minimum kinE at generation for positron
69  // i = 3 : Calor-B_gap
70  // i = 4 : Calor-C_abs
71  // i = 5 : Calor-C_gap
72  G4THitsMap<G4double> mapMin[6][3];
73  G4int colIDMin[6][3];
74 
75  // Maps for accumulation in parallel world
76  // mapPara[i][j]
77  // i = 0 : Calor-AP_para j = 0 : total eDep
78  // i = 1 : Calor-BP_para j = 1 : number of gamma
79  // i = 2 : Calor-CP_para j = 2 : number of electron
80  // j = 3 : number of positron
81  // j = 4 : total step length for e+/e-
82  // j = 5 : total number of steps for e+/e-
83  G4THitsMap<G4double> mapPara[3][6];
84  G4int colIDPara[3][6];
85 
86  public:
87  inline G4double GetTotalE(G4int i) const
88  { return GetTotal(mapSum[i][0]); }
89  inline G4double GetNGamma(G4int i) const
90  { return GetTotal(mapSum[i][1]); }
91  inline G4double GetNElectron(G4int i) const
92  { return GetTotal(mapSum[i][2]); }
93  inline G4double GetNPositron(G4int i) const
94  { return GetTotal(mapSum[i][3]); }
95  inline G4double GetTotalL(G4int i) const
96  { return GetTotal(mapSum[i][4]); }
97  inline G4double GetNStep(G4int i) const
98  { return GetTotal(mapSum[i][5]); }
99 
100  inline G4double GetEMinGamma(G4int i) const
101  { return FindMinimum(mapMin[i][0]); }
103  { return FindMinimum(mapMin[i][1]); }
105  { return FindMinimum(mapMin[i][2]); }
106 
107  inline G4double GetParaValue(G4int i,G4int j,G4int k) const
108  {
109  G4double* p = mapPara[i][j][k];
110  if(p) return *p;
111  return 0.;
112  }
113 };
114 
115 #endif
116