Geant4 VMC Version 6.6
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
TG4CrossSectionManager.h
Go to the documentation of this file.
1#ifndef TG4_CROSS_SECTION_MANAGER_H
2#define TG4_CROSS_SECTION_MANAGER_H
3
4//------------------------------------------------
5// The Geant4 Virtual Monte Carlo package
6// Copyright (C) 2007 - 2014 Ivana Hrivnacova
7// All rights reserved.
8//
9// For the licensing terms see geant4_vmc/LICENSE.
10// Contact: root-vmc@cern.ch
11//-------------------------------------------------
12
17
19#include "TG4CrossSectionType.h"
20#include "TG4Verbose.h"
21
22#include <G4UserRunAction.hh>
23#include <globals.hh>
24
26class G4Element;
27
28class TObjArray;
29
65
67{
68 public:
71
72 // methods
73 TObjArray* MakeHistograms();
74
75 G4double GetCrossSection(TG4CrossSectionType type) const;
76 void PrintCrossSections() const;
78
79 void SetParticleName(const G4String& name);
80 void SetElementName(const G4String& name);
81
82 void SetNumberOfBinsE(G4int val);
83 void SetNumberOfBinsP(G4int val);
84
85 void SetMinKinEnergy(G4double val);
86 void SetMaxKinEnergy(G4double val);
87
88 void SetMinMomentum(G4double val);
89 void SetMaxMomentum(G4double val);
90
91 void SetLabel(const G4String& label);
92
93 void SetKinEnergy(G4double val);
94 void SetMomentum(G4double val);
95
96 void SetMakeHistograms(G4bool makeHistograms);
97 G4bool IsMakeHistograms() const;
98
99 private:
104
105 // methods
106 const G4ParticleDefinition* GetParticle() const;
107 const G4Element* GetElement() const;
108 G4double GetMomentum() const;
109
110 void CreateHistograms();
111 void FillHistograms();
112
113 // static data members
114 static const G4String fgkDefaultParticleName;
115 static const G4String fgkDefaultElementName;
116 static const G4double
118 static const G4double
120 static const G4double fgkDefaultMinMomentum;
121 static const G4double fgkDefaultMaxMomentum;
122 static const G4int fgkDefaultNofBinsE;
123 static const G4int fgkDefaultNofBinsP;
124 static const G4double fgkDefaultKinEnergy;
125
126 // data members
128 TObjArray* fHistograms;
129 G4String fParticleName;
130 G4String fElementName;
131 G4double fMinKinEnergy;
132 G4double fMaxKinEnergy;
133 G4double fMinMomentum;
134 G4double fMaxMomentum;
135 G4int fNofBinsE;
136 G4int fNofBinsP;
137 G4String fLabel;
138 G4double fKinEnergy;
141};
142
143// inline functions
144
145inline void TG4CrossSectionManager::SetParticleName(const G4String& name)
146{
148 fParticleName = name;
149}
150
151inline void TG4CrossSectionManager::SetElementName(const G4String& name)
152{
154 fElementName = name;
155}
156
158{
160 fMinKinEnergy = val;
161}
162
164{
166 fMaxKinEnergy = val;
167}
168
170{
172 fMinMomentum = val;
173}
174
176{
178 fMaxMomentum = val;
179}
180
182{
184 fNofBinsE = val;
185}
186
188{
190 fNofBinsP = val;
191}
192
193inline void TG4CrossSectionManager::SetLabel(const G4String& label)
194{
197 fLabel = label;
198}
199
201{
203 fKinEnergy = val;
204}
205
206inline void TG4CrossSectionManager::SetMakeHistograms(G4bool makeHistograms)
207{
209 fMakeHistograms = makeHistograms;
210}
211
213{
215 return fMakeHistograms;
216}
217
218#endif // TG4_CROSS_SECTION_MANAGER_H
Definition of the TG4CrossSectionMessenger class.
Definition of the enumeration TG4CrossSectionType.
Definition of the TG4Verbose class.
void SetLabel(const G4String &label)
void SetMakeHistograms(G4bool makeHistograms)
G4double GetCrossSection(TG4CrossSectionType type) const
G4String fLabel
the histogram label
TG4CrossSectionManager(const TG4CrossSectionManager &right)
Not implemented.
G4String fParticleName
particle name
static const G4double fgkDefaultMaxMomentum
default maximum momentum
void SetMinMomentum(G4double val)
void PrintCrossSection(TG4CrossSectionType type) const
void SetParticleName(const G4String &name)
G4double fMaxMomentum
maximum momentum (histogram range)
G4double fMinMomentum
minimum momentum (histogram range)
void SetMinKinEnergy(G4double val)
void SetMaxMomentum(G4double val)
G4int fNofBinsE
number of bins in kinetic energy
static const G4String fgkDefaultParticleName
default particle name
TG4CrossSectionManager & operator=(const TG4CrossSectionManager &right)
Not implemented.
TG4CrossSectionMessenger fMessenger
messenger
static const G4int fgkDefaultNofBinsE
defualt number of bins in energy
static const G4String fgkDefaultElementName
default element name
G4String fElementName
element name
G4bool fIsInitialised
info if histograms are created
static const G4int fgkDefaultNofBinsP
defualt number of bins in momentum
G4double fMinKinEnergy
minimum kinetic energy (histogram range)
TObjArray * fHistograms
array of histograms
static const G4double fgkDefaultMinMomentum
default minimum momentum
const G4Element * GetElement() const
void SetElementName(const G4String &name)
static const G4double fgkDefaultMinKinEnergy
default minimum kinetic energy
const G4ParticleDefinition * GetParticle() const
static const G4double fgkDefaultMaxKinEnergy
default maximum kinetic energy
G4double fMaxKinEnergy
maximum kinetic energy( histogram range)
G4int fNofBinsP
number of bins in momentum
void SetMaxKinEnergy(G4double val)
G4double fKinEnergy
current kinetic energy
static const G4double fgkDefaultKinEnergy
defualt kinetic energy
G4bool fMakeHistograms
option to make histograms (for ecternal use)
Messenger class that defines commands for TG4CrossSectionManager.
TG4Verbose(const G4String &cmdName)
TG4CrossSectionType
Enumeration for cross section types.