Geant4_10
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 77519 2013-11-25 10:54:57Z 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 private:
71 
72  HistoManager();
73 
74 public:
75 
76  ~HistoManager();
77 
78  void BookHisto();
79 
80  void BeginOfRun();
81  void EndOfRun();
82  void BeginOfEvent();
83  void EndOfEvent();
84  void Fill(G4int id, G4double x, G4double w);
85 
86  void ScoreNewTrack(const G4Track*);
87  void AddTargetStep(const G4Step*);
88 
89  void SetVerbose(G4int val);
90  void SetIonPhysics(const G4String&);
91 
92  inline void SetTargetMaterial(const G4Material* mat) {fMaterial = mat;};
93  inline void SetTargetLength(G4double val) {fLength = val;};
94  inline void SetNumberOfSlices(G4int val) {fNSlices = val;};
95  inline void SetNumberOfBinsE(G4int val) {fNBinsE = val;};
96 
97  inline G4double Length() const {return fLength;};
98  inline G4int NumberOfSlices() const {return fNSlices;};
99 
100  inline G4int GetVerbose() const {return fVerbose;};
101 
102  inline void SetDefaultBeamPositionFlag(G4bool f) {fBeamFlag = f;};
103  inline G4bool DefaultBeamPosition() const {return fBeamFlag;};
104 
105  inline void SetMaxEnergyDeposit(G4double val) {fEdepMax = val;};
106 
107  inline void SetPhysicsList(G4VModularPhysicsList* p) {fPhysList = p;};
108 
109 private:
110 
111  void Initialise();
112 
113  static HistoManager* fManager;
114 
115  G4VModularPhysicsList* fPhysList;
116  G4VPhysicsConstructor* fIonPhysics;
117  const G4ParticleDefinition* fPrimaryDef;
118  const G4ParticleDefinition* fNeutron;
119  const G4Material* fMaterial;
120 
121  G4double fEdepMax;
122  G4double fEdepEvt;
123  G4double fEdepSum;
124  G4double fEdepSum2;
125  G4double fLength;
126  G4double fAbsZ0;
127  G4double fPrimaryKineticEnergy;
128 
129  G4int fVerbose;
130  G4int fNBinsE;
131  G4int fNSlices;
132 
133  G4int fNevt;
134  G4int fNelec;
135  G4int fNposit;
136  G4int fNgam;
137  G4int fNcpions;
138  G4int fNpi0;
139  G4int fNkaons;
140  G4int fNmuons;
141  G4int fNions;
142  G4int fNdeut;
143  G4int fNalpha;
144  G4int fNneutron;
145  G4int fNproton;
146  G4int fNaproton;
147  G4int fNstep;
148  G4int fNHisto;
149 
150  G4bool fBeamFlag;
151 
152  Histo* fHisto;
153 };
154 
155 #endif
void AddTargetStep(const G4Step *)
void SetMaxEnergyDeposit(G4double val)
G4int NumberOfSlices() const
Definition: HistoManager.hh:98
void BookHisto()
void SetDefaultBeamPositionFlag(G4bool f)
void EndOfEvent()
void SetPhysicsList(G4VModularPhysicsList *p)
Definition: Histo.hh:56
const char * p
Definition: xmltok.h:285
void SetNumberOfBinsE(G4int val)
Definition: HistoManager.hh:95
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
TFile f
Definition: plotHisto.C:6
Float_t mat
Definition: plot.C:40
bool G4bool
Definition: G4Types.hh:79
void BeginOfEvent()
void BeginOfRun()
G4bool DefaultBeamPosition() const
G4double Length() const
Definition: HistoManager.hh:97
Definition: G4Step.hh:76
void Fill(G4int id, G4double x, G4double w)
void SetTargetMaterial(const G4Material *mat)
Definition: HistoManager.hh:92
G4int GetVerbose() const
void SetNumberOfSlices(G4int val)
Definition: HistoManager.hh:94
void ScoreNewTrack(const G4Track *aTrack)
void SetIonPhysics(const G4String &)
static HistoManager * GetPointer()
Definition: HistoManager.cc:58
double G4double
Definition: G4Types.hh:76
void SetVerbose(G4int value)
void SetTargetLength(G4double val)
Definition: HistoManager.hh:93