source: trunk/examples/extended/hadronic/Hadr01/include/HistoManager.hh@ 1036

Last change on this file since 1036 was 807, checked in by garnier, 17 years ago

update

File size: 4.9 KB
Line 
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// $Id: HistoManager.hh,v 1.8 2007/05/16 11:43:30 vnivanch Exp $
27// GEANT4 tag $Name: $
28//
29//---------------------------------------------------------------------------
30//
31// ClassName: HistoManager
32//
33// Description: Singleton class to hold parameters and build histograms.
34// User cannot access to the constructor.
35// The pointer of the only existing object can be got via
36// HistoManager::GetPointer() static method.
37// The first invokation of this static method makes
38// the singleton object.
39//
40// Author: V.Ivanchenko 27/09/00
41//
42// Modified:
43// 04.06.2006 Adoptation of hadr01 (V.Ivanchenko)
44// 03.10.2006 Add csFlag (V.Ivanchenko)
45// 16.11.2006 Add beamFlag (V.Ivanchenko)
46//
47//----------------------------------------------------------------------------
48//
49
50#ifndef HistoManager_h
51#define HistoManager_h 1
52
53#include "globals.hh"
54#include "G4Material.hh"
55#include "G4Element.hh"
56
57//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
58
59class Histo;
60class G4Track;
61class G4Step;
62class G4ParticleDefinition;
63
64class HistoManager
65{
66public:
67
68 static HistoManager* GetPointer();
69
70private:
71
72 HistoManager();
73
74public:
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 void AddLeakingParticle(const G4Track*);
89
90 void SetTargetLength(G4double val) {length = val;};
91 void SetNumberOfSlices(G4int val) {nSlices = val;};
92 void SetNumberOfBinsE(G4int val) {nBinsE = val;};
93
94 G4double Length() const {return length;};
95 G4int NumberOfSlices() const {return nSlices;};
96
97 void SetVerbose(G4int val);
98 G4int GetVerbose() const {return verbose;};
99
100 void SetDefaultBeamPositionFlag(G4bool f) {beamFlag = f;};
101 G4bool DefaultBeamPosition() const {return beamFlag;};
102
103 void SetTargetMaterial(const G4Material* mat);
104 const G4Material* TargetMaterial() const {return material;};
105 const G4Element* TargetElement() const {return elm;};
106
107 G4double CurrentKinEnergy() {return currentKinEnergy;};
108 const G4ParticleDefinition* CurrentParticle() {return currentDef;};
109
110 void SetMaxEnergyDeposit(G4double val) {edepMax = val;};
111
112private:
113
114 static HistoManager* fManager;
115
116 const G4ParticleDefinition* primaryDef;
117 const G4ParticleDefinition* currentDef;
118 const G4ParticleDefinition* neutron;
119 const G4Material* material;
120 G4Element* elm;
121
122 G4double edepMax;
123 G4double edepEvt;
124 G4double edepSum;
125 G4double edepSum2;
126 G4double beamEnergy;
127 G4double length;
128 G4double absZ0;
129 G4double primaryKineticEnergy;
130 G4double currentKinEnergy;
131
132 G4int verbose;
133 G4int nBinsE;
134 G4int nSlices;
135
136 G4int n_evt;
137 G4int n_elec;
138 G4int n_posit;
139 G4int n_gam;
140 G4int n_prot_leak;
141 G4int n_pion_leak;
142 G4int n_cpions;
143 G4int n_pi0;
144 G4int n_kaons;
145 G4int n_muons;
146 G4int n_ions;
147 G4int n_deut;
148 G4int n_alpha;
149 G4int n_neutron;
150 G4int n_proton;
151 G4int n_aproton;
152 G4int n_neu_forw;
153 G4int n_neu_leak;
154 G4int n_neu_back;
155 G4int n_step;
156 G4int nHisto;
157
158 G4bool beamFlag;
159
160 Histo* histo;
161};
162
163#endif
Note: See TracBrowser for help on using the repository browser.