source: trunk/examples/novice/N07/include/ExN07Run.hh@ 1036

Last change on this file since 1036 was 807, checked in by garnier, 17 years ago

update

File size: 4.4 KB
RevLine 
[807]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: ExN07Run.hh,v 1.6 2007/05/04 01:49:28 asaim Exp $
28// GEANT4 tag $Name: $
29//
30
31#ifndef ExN07Run_h
32#define ExN07Run_h 1
33
34#include "globals.hh"
35#include "G4Run.hh"
36
37#include "G4THitsMap.hh"
38
39class G4Event;
40
41class ExN07Run : public G4Run
42{
43 public:
44 ExN07Run();
45 virtual ~ExN07Run();
46
47 public:
48 virtual void RecordEvent(const G4Event*);
49
50 private:
51 G4double GetTotal(const G4THitsMap<G4double> &map) const;
52 G4double FindMinimum(const G4THitsMap<G4double> &map) const;
53
54 private:
55 // Maps for accumulation
56 // mapSum[i][j]
57 // i = 0 : Calor-A_abs j = 0 : total eDep
58 // i = 1 : Calor-A_gap j = 1 : number of gamma
59 // i = 2 : Calor-B_abs j = 2 : number of electron
60 // i = 3 : Calor-B_gap j = 3 : number of positron
61 // i = 4 : Calor-C_abs j = 4 : total step length for e+/e-
62 // i = 5 : Calor-C_gap j = 5 : total number of steps for e+/e-
63 G4THitsMap<G4double> mapSum[6][6];
64 G4int colIDSum[6][6];
65
66 // Maps for minimum value
67 // i = 0 : Calor-A_abs j = 0 : minimum kinE at generation for gamma
68 // i = 1 : Calor-A_gap j = 1 : minimum kinE at generation for electron
69 // i = 2 : Calor-B_abs j = 2 : minimum kinE at generation for positron
70 // i = 3 : Calor-B_gap
71 // i = 4 : Calor-C_abs
72 // i = 5 : Calor-C_gap
73 G4THitsMap<G4double> mapMin[6][3];
74 G4int colIDMin[6][3];
75
76 // Maps for accumulation in parallel world
77 // mapPara[i][j]
78 // i = 0 : Calor-AP_para j = 0 : total eDep
79 // i = 1 : Calor-BP_para j = 1 : number of gamma
80 // i = 2 : Calor-CP_para j = 2 : number of electron
81 // j = 3 : number of positron
82 // j = 4 : total step length for e+/e-
83 // j = 5 : total number of steps for e+/e-
84 G4THitsMap<G4double> mapPara[3][6];
85 G4int colIDPara[3][6];
86
87 public:
88 inline G4double GetTotalE(G4int i) const
89 { return GetTotal(mapSum[i][0]); }
90 inline G4double GetNGamma(G4int i) const
91 { return GetTotal(mapSum[i][1]); }
92 inline G4double GetNElectron(G4int i) const
93 { return GetTotal(mapSum[i][2]); }
94 inline G4double GetNPositron(G4int i) const
95 { return GetTotal(mapSum[i][3]); }
96 inline G4double GetTotalL(G4int i) const
97 { return GetTotal(mapSum[i][4]); }
98 inline G4double GetNStep(G4int i) const
99 { return GetTotal(mapSum[i][5]); }
100
101 inline G4double GetEMinGamma(G4int i) const
102 { return FindMinimum(mapMin[i][0]); }
103 inline G4double GetEMinElectron(G4int i) const
104 { return FindMinimum(mapMin[i][1]); }
105 inline G4double GetEMinPositron(G4int i) const
106 { return FindMinimum(mapMin[i][2]); }
107
108 inline G4double GetParaValue(G4int i,G4int j,G4int k) const
109 {
110 G4double* p = mapPara[i][j][k];
111 if(p) return *p;
112 return 0.;
113 }
114};
115
116#endif
117
Note: See TracBrowser for help on using the repository browser.