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 81073 2014-05-20 10:23:13Z 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 //
46 //----------------------------------------------------------------------------
47 //
48 
49 #ifndef HistoManager_h
50 #define HistoManager_h 1
51 
52 #include "globals.hh"
53 #include "G4Material.hh"
54 
55 #include "g4root.hh"
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
58 
59 class Histo;
62 
63 class HistoManager
64 {
65 public:
66 
67  HistoManager();
68 
69  ~HistoManager();
70 
71  void BeginOfRun();
72  void EndOfRun();
73 
74  void SetVerbose(G4int val);
75 
76  inline void SetParticleName(const G4String&);
77  inline void SetElementName(const G4String&);
78 
79  inline void SetNumberOfBinsE(G4int val);
80  inline void SetNumberOfBinsP(G4int val);
81 
82  inline void SetMinKinEnergy(G4double val);
83  inline void SetMaxKinEnergy(G4double val);
84 
85  inline void SetMinMomentum(G4double val);
86  inline void SetMaxMomentum(G4double val);
87 
88  inline void SetHistoName(G4String& val);
89 
90  inline void SetTargetMaterial(const G4Material* p);
91 
92 private:
93 
94  HistoManagerMessenger* fMessenger;
95  G4AnalysisManager* fAnalysisManager;
96 
97  const G4ParticleDefinition* fNeutron;
98  const G4Material* fTargetMaterial;
99 
100  G4String fParticleName;
101  G4String fElementName;
102 
103  G4double fMinKinEnergy;
104  G4double fMaxKinEnergy;
105  G4double fMinMomentum;
106  G4double fMaxMomentum;
107 
108  G4int fVerbose;
109  G4int fBinsE;
110  G4int fBinsP;
111 
112  G4String fHistoName;
113 };
114 
116 {
117  fParticleName = name;
118 }
119 
121 {
122  fElementName = name;
123 }
124 
126 {
127  if(val>0) { fBinsE = val; }
128 }
129 
131 {
132  if(val>0) { fBinsP = val; }
133 }
134 
136 {
137  if(val>0 && val<fMaxKinEnergy) { fMinKinEnergy = val; }
138 }
139 
141 {
142  if(val>fMinKinEnergy) { fMaxKinEnergy = val; }
143 }
144 
146 {
147  if(val>0 && val<fMaxMomentum) { fMinMomentum = val; }
148 }
149 
151 {
152  if(val>fMinMomentum) { fMaxMomentum = val; }
153 }
154 
156 {
157  fHistoName = val;
158 }
159 
161 {
162  fTargetMaterial = p;
163 }
164 
165 #endif
const XML_Char * name
Definition: expat.h:151
Definition: Histo.hh:56
const char * p
Definition: xmltok.h:285
void SetMinMomentum(G4double val)
void SetNumberOfBinsE(G4int val)
int G4int
Definition: G4Types.hh:78
void BeginOfRun()
void SetMaxMomentum(G4double val)
void SetMaxKinEnergy(G4double val)
void SetMinKinEnergy(G4double val)
void SetElementName(const G4String &)
void SetTargetMaterial(const G4Material *p)
void SetVerbose(G4int val)
Definition: HistoManager.hh:95
void SetHistoName(G4String &val)
void SetParticleName(const G4String &)
double G4double
Definition: G4Types.hh:76
void SetNumberOfBinsP(G4int val)