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

Last change on this file since 1235 was 1230, checked in by garnier, 15 years ago

update to geant4.9.3

File size: 5.0 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.9 2009/08/28 09:21:34 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-03-cand-01 $
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 edepEM;
125  G4double edepPI;
126  G4double edepP;
127  G4double edepSum;
128  G4double edepSum2;
129  G4double beamEnergy;
130  G4double length;
131  G4double absZ0;
132  G4double primaryKineticEnergy;
133  G4double currentKinEnergy;
134 
135  G4int verbose;
136  G4int nBinsE;
137  G4int nSlices;
138
139  G4int n_evt;
140  G4int n_elec;
141  G4int n_posit;
142  G4int n_gam;
143  G4int n_prot_leak;
144  G4int n_pion_leak;
145  G4int n_cpions;
146  G4int n_pi0;
147  G4int n_kaons;
148  G4int n_muons;
149  G4int n_ions;
150  G4int n_deut;
151  G4int n_alpha;
152  G4int n_neutron;
153  G4int n_proton;
154  G4int n_aproton;
155  G4int n_neu_forw;
156  G4int n_neu_leak;
157  G4int n_neu_back;
158  G4int n_step;
159  G4int nHisto;
160
161  G4bool beamFlag;
162
163  Histo* histo;
164};
165
166#endif
Note: See TracBrowser for help on using the repository browser.