Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HistoManager.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: HistoManager.hh 100811 2016-11-02 15:05:20Z gcosmo $
30 //
31 //---------------------------------------------------------------------------
32 //
33 // ClassName: HistoManager
34 //
35 // Description: Singleton class to hold parameters and build histograms.
36 // User cannot access to the constructor.
37 // The pointer of the only existing object can be got via
38 // HistoManager::GetPointer() static method.
39 // The first invokation of this static method makes
40 // the singleton object.
41 //
42 // Author: V.Ivanchenko 27/09/00
43 //
44 // Modified:
45 // 04.06.2006 Adoptation of Hadr01 (V.Ivanchenko)
46 // 03.10.2006 Add csFlag (V.Ivanchenko)
47 // 16.11.2006 Add beamFlag (V.Ivanchenko)
48 //
49 //----------------------------------------------------------------------------
50 //
51 
52 #ifndef HistoManager_h
53 #define HistoManager_h 1
54 
55 #include "globals.hh"
56 #include "G4Material.hh"
57 #include "G4Element.hh"
58 
59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
60 
61 class Histo;
62 class G4Track;
63 class G4Step;
65 
66 class HistoManager
67 {
68 public:
69 
70  static HistoManager* GetPointer();
71 
72 private:
73 
74  HistoManager();
75 
76 public:
77 
78  ~HistoManager();
79 
80  void BookHisto();
81 
82  void BeginOfRun();
83  void EndOfRun();
84  void BeginOfEvent();
85  void EndOfEvent();
86  void Fill(G4int id, G4double x, G4double w);
87 
88  void ScoreNewTrack(const G4Track*);
89  void AddTargetStep(const G4Step*);
90  void AddLeakingParticle(const G4Track*);
91 
92  void SetVerbose(G4int val);
93 
94  inline void SetTargetLength(G4double val) {fLength = val;};
95  inline void SetNumberOfSlices(G4int val) {fNSlices = val;};
96  inline void SetNumberOfBinsE(G4int val) {fNBinsE = val;};
97  inline void SetDefaultBeamPositionFlag(G4bool f) {fBeamFlag = f;};
98  inline void SetMaxEnergyDeposit(G4double val) {fEdepMax = val;};
99 
100  inline G4double Length() const {return fLength;};
101  inline G4bool DefaultBeamPosition() const {return fBeamFlag;};
102  inline G4int NumberOfSlices() const {return fNSlices;};
103  inline G4int GetVerbose() const {return fVerbose;};
104 
105 private:
106 
107  static HistoManager* fManager;
108 
109  const G4ParticleDefinition* fPrimaryDef;
110  const G4ParticleDefinition* fNeutron;
111 
112  G4double fEdepMax;
113  G4double fEdepEvt;
114  G4double fEdepEM;
115  G4double fEdepPI;
116  G4double fEdepP;
117  G4double fEdepSum;
118  G4double fEdepSum2;
119  G4double fLength;
120  G4double fAbsZ0;
121  G4double fPrimaryKineticEnergy;
122 
123  G4int fVerbose;
124  G4int fNBinsE;
125  G4int fNSlices;
126 
127  G4int fNevt;
128  G4int fNelec;
129  G4int fNposit;
130  G4int fNgam;
131  G4int fNprot_leak;
132  G4int fNpiofNleak;
133  G4int fNcpions;
134  G4int fNpi0;
135  G4int fNkaons;
136  G4int fNmuons;
137  G4int fNions;
138  G4int fNdeut;
139  G4int fNalpha;
140  G4int fNneutron;
141  G4int fNproton;
142  G4int fNaproton;
143  G4int fNneu_forw;
144  G4int fNneu_leak;
145  G4int fNneu_back;
146  G4int fNstep;
147  G4int fNHisto;
148 
149  G4bool fBeamFlag;
150  G4bool fHistoBooked;
151 
152  Histo* fHisto;
153 };
154 
155 #endif
void AddTargetStep(const G4Step *)
void SetMaxEnergyDeposit(G4double val)
Definition: HistoManager.hh:98
G4int NumberOfSlices() const
void BookHisto()
void SetDefaultBeamPositionFlag(G4bool f)
Definition: HistoManager.hh:97
void EndOfEvent()
Definition: Histo.hh:56
void SetNumberOfBinsE(G4int val)
Definition: HistoManager.hh:96
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
void AddLeakingParticle(const G4Track *)
bool G4bool
Definition: G4Types.hh:79
void BeginOfEvent()
void BeginOfRun()
G4bool DefaultBeamPosition() const
G4double Length() const
Definition: G4Step.hh:76
void Fill(G4int id, G4double x, G4double w)
G4int GetVerbose() const
void SetNumberOfSlices(G4int val)
Definition: HistoManager.hh:95
void ScoreNewTrack(const G4Track *aTrack)
void SetVerbose(G4int val)
Definition: HistoManager.hh:95
static HistoManager * GetPointer()
Definition: HistoManager.cc:64
double G4double
Definition: G4Types.hh:76
void SetTargetLength(G4double val)
Definition: HistoManager.hh:94