ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HistoManager.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file HistoManager.hh
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 //
30 //---------------------------------------------------------------------------
31 //
32 // ClassName: HistoManager
33 //
34 // Description: Singleton class to hold parameters and build histograms.
35 // User cannot access to the constructor.
36 // The pointer of the only existing object can be got via
37 // HistoManager::GetPointer() static method.
38 // The first invokation of this static method makes
39 // the singleton object.
40 //
41 // Author: V.Ivanchenko 03/03/2011
42 //
43 // Modified:
44 //
45 //----------------------------------------------------------------------------
46 //
47 
48 #ifndef HistoManager_h
49 #define HistoManager_h 1
50 
51 #include "globals.hh"
52 #include "G4Material.hh"
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
55 
56 class Histo;
57 class G4Track;
58 class G4Step;
62 
63 class HistoManager
64 {
65 public:
66 
67  static HistoManager* GetPointer();
68 
69  ~HistoManager();
70 
71  void BookHisto();
72 
73  void BeginOfRun();
74  void EndOfRun();
75  void BeginOfEvent();
76  void EndOfEvent();
77  void Fill(G4int id, G4double x, G4double w);
78 
79  void ScoreNewTrack(const G4Track*);
80  void AddTargetStep(const G4Step*);
81 
82  void SetVerbose(G4int val);
83  void SetIonPhysics(const G4String&);
84 
85  inline void SetTargetMaterial(const G4Material* mat) {fMaterial = mat;};
86  inline void SetTargetLength(G4double val) {fLength = val;};
87  inline void SetNumberOfSlices(G4int val) {fNSlices = val;};
88  inline void SetNumberOfBinsE(G4int val) {fNBinsE = val;};
89 
90  inline G4double Length() const {return fLength;};
91  inline G4int NumberOfSlices() const {return fNSlices;};
92 
93  inline G4int GetVerbose() const {return fVerbose;};
94 
96  inline G4bool DefaultBeamPosition() const {return fBeamFlag;};
97 
98  inline void SetMaxEnergyDeposit(G4double val) {fEdepMax = val;};
99 
101 
102 private:
103  HistoManager();
104 
105  void Initialise();
106 
107  static HistoManager* fManager;
108 
114 
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 fNcpions;
132  G4int fNpi0;
133  G4int fNkaons;
134  G4int fNmuons;
135  G4int fNions;
136  G4int fNdeut;
137  G4int fNalpha;
139  G4int fNproton;
141  G4int fNstep;
142  G4int fNHisto;
143 
145 
146  Histo* fHisto;
147 };
148 
149 #endif