Geant4  10.03.p02
 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 81932 2014-06-06 15:39:45Z 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 03/03/2011
43 //
44 // Modified:
45 //
46 //----------------------------------------------------------------------------
47 //
48 
49 #ifndef HistoManager_h
50 #define HistoManager_h 1
51 
52 #include "globals.hh"
53 #include "G4Material.hh"
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
56 
57 class Histo;
58 class G4Track;
59 class G4Step;
63 
64 class HistoManager
65 {
66 public:
67 
68  static HistoManager* GetPointer();
69 
70  ~HistoManager();
71 
72  void BookHisto();
73 
74  void BeginOfRun();
75  void EndOfRun();
76  void BeginOfEvent();
77  void EndOfEvent();
78  void Fill(G4int id, G4double x, G4double w);
79 
80  void ScoreNewTrack(const G4Track*);
81  void AddTargetStep(const G4Step*);
82 
83  void SetVerbose(G4int val);
84  void SetIonPhysics(const G4String&);
85 
86  inline void SetTargetMaterial(const G4Material* mat) {fMaterial = mat;};
87  inline void SetTargetLength(G4double val) {fLength = val;};
88  inline void SetNumberOfSlices(G4int val) {fNSlices = val;};
89  inline void SetNumberOfBinsE(G4int val) {fNBinsE = val;};
90 
91  inline G4double Length() const {return fLength;};
92  inline G4int NumberOfSlices() const {return fNSlices;};
93 
94  inline G4int GetVerbose() const {return fVerbose;};
95 
96  inline void SetDefaultBeamPositionFlag(G4bool f) {fBeamFlag = f;};
97  inline G4bool DefaultBeamPosition() const {return fBeamFlag;};
98 
99  inline void SetMaxEnergyDeposit(G4double val) {fEdepMax = val;};
100 
101  inline void SetPhysicsList(G4VModularPhysicsList* p) {fPhysList = p;};
102 
103 private:
104  HistoManager();
105 
106  void Initialise();
107 
108  static HistoManager* fManager;
109 
110  G4VModularPhysicsList* fPhysList;
111  G4VPhysicsConstructor* fIonPhysics;
112  const G4ParticleDefinition* fPrimaryDef;
113  const G4ParticleDefinition* fNeutron;
114  const G4Material* fMaterial;
115 
116  G4double fEdepMax;
117  G4double fEdepEvt;
118  G4double fEdepSum;
119  G4double fEdepSum2;
120  G4double fLength;
121  G4double fAbsZ0;
122  G4double fPrimaryKineticEnergy;
123 
124  G4int fVerbose;
125  G4int fNBinsE;
126  G4int fNSlices;
127 
128  G4int fNevt;
129  G4int fNelec;
130  G4int fNposit;
131  G4int fNgam;
132  G4int fNcpions;
133  G4int fNpi0;
134  G4int fNkaons;
135  G4int fNmuons;
136  G4int fNions;
137  G4int fNdeut;
138  G4int fNalpha;
139  G4int fNneutron;
140  G4int fNproton;
141  G4int fNaproton;
142  G4int fNstep;
143  G4int fNHisto;
144 
145  G4bool fBeamFlag;
146 
147  Histo* fHisto;
148 };
149 
150 #endif
void AddTargetStep(const G4Step *)
void SetMaxEnergyDeposit(G4double val)
Definition: HistoManager.hh:99
G4int NumberOfSlices() const
Definition: HistoManager.hh:92
void BookHisto()
void SetDefaultBeamPositionFlag(G4bool f)
Definition: HistoManager.hh:96
void EndOfEvent()
void SetPhysicsList(G4VModularPhysicsList *p)
Definition: Histo.hh:56
const char * p
Definition: xmltok.h:285
void SetNumberOfBinsE(G4int val)
Definition: HistoManager.hh:89
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
void BeginOfEvent()
void BeginOfRun()
G4bool DefaultBeamPosition() const
Definition: HistoManager.hh:97
G4double Length() const
Definition: HistoManager.hh:91
Definition: G4Step.hh:76
void Fill(G4int id, G4double x, G4double w)
void SetTargetMaterial(const G4Material *mat)
Definition: HistoManager.hh:86
G4int GetVerbose() const
Definition: HistoManager.hh:94
void SetNumberOfSlices(G4int val)
Definition: HistoManager.hh:88
void ScoreNewTrack(const G4Track *aTrack)
void SetVerbose(G4int val)
Definition: HistoManager.hh:95
void SetIonPhysics(const G4String &)
static HistoManager * GetPointer()
Definition: HistoManager.cc:64
double G4double
Definition: G4Types.hh:76
void SetTargetLength(G4double val)
Definition: HistoManager.hh:87