QwGeant4
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 //
26 /// \file hadronic/Hadr00/include/HistoManager.hh
27 /// \brief Definition of the HistoManager class
28 //
29 // $Id$
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 //
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 G4ParticleDefinition;
59 
61 {
62 public:
63 
64  static HistoManager* GetPointer();
65 
66 private:
67 
68  HistoManager();
69 
70 public:
71 
72  ~HistoManager();
73 
74  void BeginOfRun();
75  void EndOfRun();
76 
77  void SetVerbose(G4int val);
78 
79  inline void SetParticleName(const G4String&);
80  inline void SetElementName(const G4String&);
81 
82  inline void SetNumberOfBinsE(G4int val);
83  inline void SetNumberOfBinsP(G4int val);
84 
85  inline void SetMinKinEnergy(G4double val);
86  inline void SetMaxKinEnergy(G4double val);
87 
88  inline void SetMinMomentum(G4double val);
89  inline void SetMaxMomentum(G4double val);
90 
91  inline G4int GetVerbose() const;
92 
93 private:
94 
96 
98 
99  const G4ParticleDefinition* fNeutron;
100 
101  G4String fParticleName;
102  G4String fElementName;
103 
104  G4double fMinKinEnergy;
105  G4double fMaxKinEnergy;
106  G4double fMinMomentum;
107  G4double fMaxMomentum;
108 
109  G4int fVerbose;
110  G4int fBinsE;
111  G4int fBinsP;
112 
114 };
115 
116 inline void HistoManager::SetParticleName(const G4String& name)
117 {
118  fParticleName = name;
119 }
120 
121 inline void HistoManager::SetElementName(const G4String& name)
122 {
123  fElementName = name;
124 }
125 
126 inline void HistoManager::SetNumberOfBinsE(G4int val)
127 {
128  if(val>0) { fBinsE = val; }
129 }
130 
131 inline void HistoManager::SetNumberOfBinsP(G4int val)
132 {
133  if(val>0) { fBinsP = val; }
134 }
135 
136 inline void HistoManager::SetMinKinEnergy(G4double val)
137 {
138  if(val>0 && val<fMaxKinEnergy) { fMinKinEnergy = val; }
139 }
140 
141 inline void HistoManager::SetMaxKinEnergy(G4double val)
142 {
143  if(val>fMinKinEnergy) { fMaxKinEnergy = val; }
144 }
145 
146 inline void HistoManager::SetMinMomentum(G4double val)
147 {
148  if(val>0 && val<fMaxMomentum) { fMinMomentum = val; }
149 }
150 
151 inline void HistoManager::SetMaxMomentum(G4double val)
152 {
153  if(val>fMinMomentum) { fMaxMomentum = val; }
154 }
155 
156 inline G4int HistoManager::GetVerbose() const
157 {
158  return fVerbose;
159 }
160 
161 #endif
void SetParticleName(const G4String &)
void SetNumberOfBinsP(G4int val)
void SetMaxKinEnergy(G4double val)
G4bool fIsInitialised
G4String fElementName
void BeginOfRun()
Definition: Histo.hh:56
G4double fMinKinEnergy
void SetMinMomentum(G4double val)
void SetMaxMomentum(G4double val)
const G4ParticleDefinition * fNeutron
Definition: HistoManager.hh:99
G4double fMinMomentum
G4double fMaxMomentum
G4double fMaxKinEnergy
void SetVerbose(G4int val)
G4String fParticleName
G4int GetVerbose() const
void SetMinKinEnergy(G4double val)
Histo * fHisto
Definition: HistoManager.hh:97
static HistoManager * GetPointer()
Definition: HistoManager.cc:70
static HistoManager * fManager
Definition: HistoManager.hh:95
void SetElementName(const G4String &)
void SetNumberOfBinsE(G4int val)