Geant4  10.02.p03
Histo Class Reference

#include <Histo.hh>

Collaboration diagram for Histo:

Public Member Functions

 Histo ()
 
 ~Histo ()
 
void Book ()
 
void Save ()
 
void Add1D (const G4String &, const G4String &, G4int nb, G4double x1, G4double x2, G4double u=1.)
 
void SetHisto1D (G4int, G4int, G4double, G4double, G4double)
 
void Activate (G4int, G4bool)
 
void Fill (G4int, G4double, G4double)
 
void ScaleH1 (G4int, G4double)
 
void AddTuple (const G4String &)
 
void AddTupleI (const G4String &)
 
void AddTupleF (const G4String &)
 
void AddTupleD (const G4String &)
 
void FillTupleI (G4int, G4int)
 
void FillTupleF (G4int, G4float)
 
void FillTupleD (G4int, G4double)
 
void AddRow ()
 
void SetFileName (const G4String &)
 
void SetFileType (const G4String &)
 
void SetVerbose (G4int val)
 
G4bool IsActive () const
 
 Histo ()
 
 ~Histo ()
 
void Book ()
 
void Save ()
 
void Add1D (const G4String &, const G4String &, G4int nb, G4double x1, G4double x2, G4double u=1.)
 
void SetHisto1D (G4int, G4int, G4double, G4double, G4double)
 
void Activate (G4int, G4bool)
 
void Fill (G4int, G4double, G4double)
 
void ScaleH1 (G4int, G4double)
 
void AddTuple (const G4String &)
 
void AddTupleI (const G4String &)
 
void AddTupleF (const G4String &)
 
void AddTupleD (const G4String &)
 
void FillTupleI (G4int, G4int)
 
void FillTupleF (G4int, G4float)
 
void FillTupleD (G4int, G4double)
 
void AddRow ()
 
void SetFileName (const G4String &)
 
void SetFileType (const G4String &)
 
void SetVerbose (G4int val)
 
G4bool IsActive () const
 
 Histo ()
 
 ~Histo ()
 
void Book ()
 
void Save ()
 
void Add1D (const G4String &, const G4String &, G4int nb, G4double x1, G4double x2, G4double u=1.)
 
void SetHisto1D (G4int, G4int, G4double, G4double, G4double)
 
void Activate (G4int, G4bool)
 
void Fill (G4int, G4double, G4double)
 
void ScaleH1 (G4int, G4double)
 
void AddTuple (const G4String &)
 
void AddTupleI (const G4String &)
 
void AddTupleF (const G4String &)
 
void AddTupleD (const G4String &)
 
void FillTupleI (G4int, G4int)
 
void FillTupleF (G4int, G4float)
 
void FillTupleD (G4int, G4double)
 
void AddRow ()
 
void SetFileName (const G4String &)
 
void SetFileType (const G4String &)
 
void SetVerbose (G4int val)
 
G4bool IsActive () const
 
 Histo ()
 
 ~Histo ()
 
void Book ()
 
void Save ()
 
void Add1D (const G4String &, const G4String &, G4int nb, G4double x1, G4double x2, G4double u=1.)
 
void SetHisto1D (G4int, G4int, G4double, G4double, G4double)
 
void Activate (G4int, G4bool)
 
void Fill (G4int, G4double, G4double)
 
void ScaleH1 (G4int, G4double)
 
void AddTuple (const G4String &)
 
void AddTupleI (const G4String &)
 
void AddTupleF (const G4String &)
 
void AddTupleD (const G4String &)
 
void FillTupleI (G4int, G4int)
 
void FillTupleF (G4int, G4float)
 
void FillTupleD (G4int, G4double)
 
void AddRow ()
 
void SetFileName (const G4String &)
 
void SetFileType (const G4String &)
 
void SetVerbose (G4int val)
 
G4bool IsActive () const
 
 Histo ()
 
 ~Histo ()
 
void BeginOfHisto ()
 
void EndOfHisto ()
 
void ScoreNewTrack (const G4Track *aTrack)
 
void AddPhantomStep (G4double e, G4double r1, G4double z1, G4double r2, G4double z2, G4double r0, G4double z0)
 
void AddPhantomGamma (G4double e, G4double r)
 
void SetHistoName (const G4String &name)
 
void AddStepInTarget ()
 
void SetVerbose (G4int val)
 
G4int GetVerbose () const
 
void SetNumberDivZ (G4int val)
 
G4int GetNumberDivZ () const
 
void SetNumberDivR (G4int val)
 
G4int GetNumberDivR () const
 
void SetNumberDivE (G4int val)
 
void SetAbsorberZ (G4double val)
 
void SetAbsorberR (G4double val)
 
void SetScoreZ (G4double val)
 
void SetMaxEnergy (G4double val)
 
G4double GetMaxEnergy () const
 
void SetCheckVolume (G4VPhysicalVolume *v)
 
void SetGasVolume (G4VPhysicalVolume *v)
 
void SetPhantom (G4VPhysicalVolume *v)
 
void SetTarget1 (G4VPhysicalVolume *v)
 
void SetTarget2 (G4VPhysicalVolume *v)
 

Static Public Member Functions

static HistoGetPointer ()
 

Private Member Functions

void BookHisto ()
 
void AddPhantomPhoton (const G4DynamicParticle *)
 
void AddTargetPhoton (const G4DynamicParticle *)
 
void AddPhantomElectron (const G4DynamicParticle *)
 
void AddTargetElectron (const G4DynamicParticle *)
 
void AddPhoton (const G4DynamicParticle *)
 
void AddElectron (const G4DynamicParticle *)
 
void AddPositron (const G4DynamicParticle *)
 

Private Attributes

G4RootAnalysisManagerfManager = 0
 
HistoMessengerfMessenger
 
G4String fHistName
 
G4String fHistType
 
G4String fTupleName
 
G4String fTupleTitle
 
G4int fNHisto
 
G4int fVerbose
 
G4bool fDefaultAct
 
G4bool fHistoActive
 
G4bool fNtupleActive
 
std::vector< G4intfHisto
 
std::vector< G4intfTupleI
 
std::vector< G4intfTupleF
 
std::vector< G4intfTupleD
 
std::vector< G4intfBins
 
std::vector< G4boolfActive
 
std::vector< G4doublefXmin
 
std::vector< G4doublefXmax
 
std::vector< G4doublefUnit
 
std::vector< G4StringfIds
 
std::vector< G4StringfTitles
 
std::vector< G4StringfNtupleI
 
std::vector< G4StringfNtupleF
 
std::vector< G4StringfNtupleD
 
G4VAnalysisManagerfManager
 
G4RootAnalysisManagerfAnalysisManager
 
const G4ParticleDefinitionfGamma
 
const G4ParticleDefinitionfElectron
 
const G4ParticleDefinitionfPositron
 
G4VPhysicalVolumefCheckVolume
 
G4VPhysicalVolumefGasVolume
 
G4VPhysicalVolumefPhantom
 
G4VPhysicalVolumefTarget1
 
G4VPhysicalVolumefTarget2
 
G4int fNBinsZ
 
G4int fNBinsR
 
G4int fNBinsE
 
G4int fScoreBin
 
G4double fScoreZ
 
G4double fAbsorberZ
 
G4double fAbsorberR
 
G4double fMaxEnergy
 
G4double fStepZ
 
G4double fStepR
 
G4double fStepE
 
G4double fNormZ
 
G4double fSumR
 
G4int fNevt
 
G4int fNelec
 
G4int fNposit
 
G4int fNgam
 
G4int fNstep
 
G4int fNgamPh
 
G4int fNgamTar
 
G4int fNeTar
 
G4int fNePh
 
G4int fNstepTarget
 
G4DataVector fVolumeR
 
G4DataVector fGammaE
 
G4DataVector fEdep
 

Static Private Attributes

static HistofManager
 

Detailed Description

Definition at line 56 of file electromagnetic/TestEm9/include/Histo.hh.

Constructor & Destructor Documentation

◆ Histo() [1/5]

Histo::Histo ( )

Definition at line 51 of file electromagnetic/TestEm9/src/Histo.cc.

Here is the caller graph for this function:

◆ ~Histo() [1/5]

Histo::~Histo ( )

Definition at line 70 of file electromagnetic/TestEm9/src/Histo.cc.

71 {
72  delete fMessenger;
73  delete fManager;
74 }
G4RootAnalysisManager * fManager
Here is the caller graph for this function:

◆ Histo() [2/5]

Histo::Histo ( )

◆ ~Histo() [2/5]

Histo::~Histo ( )

◆ Histo() [3/5]

Histo::Histo ( )

◆ ~Histo() [3/5]

Histo::~Histo ( )

◆ Histo() [4/5]

Histo::Histo ( )

◆ ~Histo() [4/5]

Histo::~Histo ( )

◆ Histo() [5/5]

Histo::Histo ( )

◆ ~Histo() [5/5]

Histo::~Histo ( )

Member Function Documentation

◆ Activate() [1/4]

void Histo::Activate ( G4int  i,
G4bool  val 
)

Definition at line 207 of file electromagnetic/TestEm9/src/Histo.cc.

208 {
209  if(fVerbose > 1) {
210  G4cout << "Histo::Activate: Histogram: #" << i << " "
211  << val << G4endl;
212  }
213  if(i>=0 && i<fNHisto) {
214  fActive[i] = val;
215  if(val) { fHistoActive = true; }
216  }
217 }
std::vector< G4bool > fActive
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

◆ Activate() [2/4]

void Histo::Activate ( G4int  ,
G4bool   
)

◆ Activate() [3/4]

void Histo::Activate ( G4int  ,
G4bool   
)

◆ Activate() [4/4]

void Histo::Activate ( G4int  ,
G4bool   
)

◆ Add1D() [1/4]

void Histo::Add1D ( const G4String id,
const G4String name,
G4int  nb,
G4double  x1,
G4double  x2,
G4double  u = 1. 
)

Definition at line 161 of file electromagnetic/TestEm9/src/Histo.cc.

163 {
164  if(fVerbose > 0) {
165  G4cout << "Histo::Add1D: New histogram will be booked: #" << id
166  << " <" << name
167  << " " << nb << " " << x1 << " " << x2 << " " << u
168  << G4endl;
169  }
170  ++fNHisto;
171  x1 /= u;
172  x2 /= u;
173  fActive.push_back(fDefaultAct);
174  fBins.push_back(nb);
175  fXmin.push_back(x1);
176  fXmax.push_back(x2);
177  fUnit.push_back(u);
178  fIds.push_back(id);
179  fTitles.push_back(name);
180  fHisto.push_back(-1);
181 }
Double_t x2[nxs]
std::vector< G4bool > fActive
std::vector< G4String > fIds
std::vector< G4String > fTitles
std::vector< G4double > fXmin
G4GLOB_DLL std::ostream G4cout
Double_t x1[nxs]
std::vector< G4int > fBins
std::vector< G4double > fUnit
#define G4endl
Definition: G4ios.hh:61
std::vector< G4int > fHisto
std::vector< G4double > fXmax

◆ Add1D() [2/4]

void Histo::Add1D ( const G4String ,
const G4String ,
G4int  nb,
G4double  x1,
G4double  x2,
G4double  u = 1. 
)

◆ Add1D() [3/4]

void Histo::Add1D ( const G4String ,
const G4String ,
G4int  nb,
G4double  x1,
G4double  x2,
G4double  u = 1. 
)

◆ Add1D() [4/4]

void Histo::Add1D ( const G4String ,
const G4String ,
G4int  nb,
G4double  x1,
G4double  x2,
G4double  u = 1. 
)

◆ AddElectron()

void Histo::AddElectron ( const G4DynamicParticle )
inlineprivate

Definition at line 127 of file medical/GammaTherapy/include/Histo.hh.

Here is the caller graph for this function:

◆ AddPhantomElectron()

void Histo::AddPhantomElectron ( const G4DynamicParticle p)
private

Definition at line 336 of file medical/GammaTherapy/src/Histo.cc.

337 {
338  ++fNePh;
339  if(fAnalysisManager) {
341  }
342 }
G4RootAnalysisManager * fAnalysisManager
static const double MeV
Definition: G4SIunits.hh:211
G4double GetKineticEnergy() const
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
std::vector< G4int > fHisto
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddPhantomGamma()

void Histo::AddPhantomGamma ( G4double  e,
G4double  r 
)

Definition at line 399 of file medical/GammaTherapy/src/Histo.cc.

400 {
401  e /= MeV;
402  fSumR += e;
403  G4int bin = (G4int)(e/fStepE);
404  if(bin >= fNBinsE) { bin = fNBinsE-1; }
405  fGammaE[bin] += e;
406  G4int bin1 = (G4int)(r/fStepR);
407  if(bin1 >= fNBinsR) { bin1 = fNBinsR-1; }
408  if(fAnalysisManager) {
409  fAnalysisManager->FillH1(fHisto[6],e,1.0);
411  }
412 }
G4RootAnalysisManager * fAnalysisManager
static const double MeV
Definition: G4SIunits.hh:211
float bin[41]
Definition: plottest35.C:14
int G4int
Definition: G4Types.hh:78
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
std::vector< G4int > fHisto
Here is the call graph for this function:

◆ AddPhantomPhoton()

void Histo::AddPhantomPhoton ( const G4DynamicParticle )
private

Definition at line 319 of file medical/GammaTherapy/src/Histo.cc.

320 {
321  ++fNgamPh;
322 }
Here is the caller graph for this function:

◆ AddPhantomStep()

void Histo::AddPhantomStep ( G4double  e,
G4double  r1,
G4double  z1,
G4double  r2,
G4double  z2,
G4double  r0,
G4double  z0 
)

Definition at line 416 of file medical/GammaTherapy/src/Histo.cc.

419 {
420  ++fNstep;
421  G4int nzbin = (G4int)(z0/fStepZ);
422  if(fVerbose > 1) {
423  G4cout << "Histo: edep(MeV)= " << edep/MeV << " at binz= " << nzbin
424  << " r1= " << r1 << " z1= " << z1
425  << " r2= " << r2 << " z2= " << z2
426  << " r0= " << r0 << " z0= " << z0
427  << G4endl;
428  }
429  if(nzbin == fScoreBin) {
430  G4int bin = (G4int)(r0/fStepR);
431  if(bin >= fNBinsR) { bin = fNBinsR-1; }
432  double w = edep*fVolumeR[bin];
433  fEdep[bin] += w;
434  if(fAnalysisManager) {
438  }
439  }
440  G4int bin1 = (G4int)(z1/fStepZ);
441  if(bin1 >= fNBinsZ) { bin1 = fNBinsZ-1; }
442  G4int bin2 = (G4int)(z2/fStepZ);
443  if(bin2 >= fNBinsZ) { bin2 = fNBinsZ-1; }
444  if(bin1 == bin2) {
445  if(fAnalysisManager) {
447  if(r1 < fStepR) {
448  G4double w = edep;
449  if(r2 > fStepR) { w *= (fStepR - r1)/(r2 - r1); }
451  }
452  }
453  } else {
454  G4int bin;
455 
456  if(bin2 < bin1) {
457  bin = bin2;
458  G4double z = z2;
459  bin2 = bin1;
460  z2 = z1;
461  bin1 = bin;
462  z1 = z;
463  }
464  G4double zz1 = z1;
465  G4double zz2 = (bin1+1)*fStepZ;
466  G4double rr1 = r1;
467  G4double dz = z2 - z1;
468  G4double dr = r2 - r1;
469  G4double rr2 = r1 + dr*(zz2-zz1)/dz;
470  for(bin=bin1; bin<=bin2; bin++) {
471  if(fAnalysisManager) {
472  G4double de = edep*(zz2 - zz1)/dz;
473  G4double zf = (zz1+zz2)*0.5;
474  { fAnalysisManager->FillH1(fHisto[3],zf,de); }
475  if(rr1 < fStepR) {
476  G4double w = de;
477  if(rr2 > fStepR) w *= (fStepR - rr1)/(rr2 - rr1);
478  { fAnalysisManager->FillH1(fHisto[4],zf,w); }
479  }
480  }
481  zz1 = zz2;
482  zz2 = std::min(z2, zz1+fStepZ);
483  rr1 = rr2;
484  rr2 = rr1 + dr*(zz2 - zz1)/dz;
485  }
486  }
487 }
G4RootAnalysisManager * fAnalysisManager
static const double MeV
Definition: G4SIunits.hh:211
float bin[41]
Definition: plottest35.C:14
int G4int
Definition: G4Types.hh:78
Double_t edep
G4GLOB_DLL std::ostream G4cout
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
#define G4endl
Definition: G4ios.hh:61
std::vector< G4int > fHisto
double G4double
Definition: G4Types.hh:76
const G4double r0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddPhoton()

void Histo::AddPhoton ( const G4DynamicParticle )
inlineprivate

Definition at line 126 of file medical/GammaTherapy/include/Histo.hh.

Here is the caller graph for this function:

◆ AddPositron()

void Histo::AddPositron ( const G4DynamicParticle )
inlineprivate

Definition at line 128 of file medical/GammaTherapy/include/Histo.hh.

Here is the caller graph for this function:

◆ AddRow() [1/4]

void Histo::AddRow ( )

◆ AddRow() [2/4]

void Histo::AddRow ( )

◆ AddRow() [3/4]

void Histo::AddRow ( )

Definition at line 342 of file electromagnetic/TestEm9/src/Histo.cc.

343 {
344  if(!fNtupleActive) { return; }
346 }
G4RootAnalysisManager * fManager
Here is the call graph for this function:

◆ AddRow() [4/4]

void Histo::AddRow ( )

◆ AddStepInTarget()

void Histo::AddStepInTarget ( )
inline

◆ AddTargetElectron()

void Histo::AddTargetElectron ( const G4DynamicParticle p)
private

Definition at line 326 of file medical/GammaTherapy/src/Histo.cc.

327 {
328  ++fNeTar;
329  if(fAnalysisManager) {
331  }
332 }
G4RootAnalysisManager * fAnalysisManager
static const double MeV
Definition: G4SIunits.hh:211
G4double GetKineticEnergy() const
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
std::vector< G4int > fHisto
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddTargetPhoton()

void Histo::AddTargetPhoton ( const G4DynamicParticle p)
private

Definition at line 309 of file medical/GammaTherapy/src/Histo.cc.

310 {
311  ++fNgamTar;
312  if(fAnalysisManager) {
314  }
315 }
G4RootAnalysisManager * fAnalysisManager
static const double MeV
Definition: G4SIunits.hh:211
G4double GetKineticEnergy() const
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
std::vector< G4int > fHisto
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddTuple() [1/4]

void Histo::AddTuple ( const G4String w1)

Definition at line 254 of file electromagnetic/TestEm9/src/Histo.cc.

255 {
256  fTupleTitle = w1;
257 }

◆ AddTuple() [2/4]

void Histo::AddTuple ( const G4String )

◆ AddTuple() [3/4]

void Histo::AddTuple ( const G4String )

◆ AddTuple() [4/4]

void Histo::AddTuple ( const G4String )

◆ AddTupleD() [1/4]

void Histo::AddTupleD ( const G4String )

◆ AddTupleD() [2/4]

void Histo::AddTupleD ( const G4String w1)

Definition at line 279 of file electromagnetic/TestEm9/src/Histo.cc.

280 {
281  fNtupleActive = true;
282  fNtupleD.push_back(w1);
283  fTupleD.push_back(-1);
284 }
std::vector< G4int > fTupleD
std::vector< G4String > fNtupleD

◆ AddTupleD() [3/4]

void Histo::AddTupleD ( const G4String )

◆ AddTupleD() [4/4]

void Histo::AddTupleD ( const G4String )

◆ AddTupleF() [1/4]

void Histo::AddTupleF ( const G4String )

◆ AddTupleF() [2/4]

void Histo::AddTupleF ( const G4String w1)

Definition at line 270 of file electromagnetic/TestEm9/src/Histo.cc.

271 {
272  fNtupleActive = true;
273  fNtupleF.push_back(w1);
274  fTupleF.push_back(-1);
275 }
std::vector< G4int > fTupleF
std::vector< G4String > fNtupleF

◆ AddTupleF() [3/4]

void Histo::AddTupleF ( const G4String )

◆ AddTupleF() [4/4]

void Histo::AddTupleF ( const G4String )

◆ AddTupleI() [1/4]

void Histo::AddTupleI ( const G4String )

◆ AddTupleI() [2/4]

void Histo::AddTupleI ( const G4String w1)

Definition at line 261 of file electromagnetic/TestEm9/src/Histo.cc.

262 {
263  fNtupleActive = true;
264  fNtupleI.push_back(w1);
265  fTupleI.push_back(-1);
266 }
std::vector< G4String > fNtupleI
std::vector< G4int > fTupleI

◆ AddTupleI() [3/4]

void Histo::AddTupleI ( const G4String )

◆ AddTupleI() [4/4]

void Histo::AddTupleI ( const G4String )

◆ BeginOfHisto()

void Histo::BeginOfHisto ( )

Definition at line 107 of file medical/GammaTherapy/src/Histo.cc.

108 {
109  G4cout << "### Histo start initialisation nHisto= " << fNHisto << G4endl;
110 
112  fNeTar = fNePh = fNstepTarget = 0;
113  fSumR = 0.0;
114  if(fNBinsR>1000) { SetNumberDivR(40); }
115 
119  fScoreBin = (G4int)(fScoreZ/fStepZ + 0.5);
120 
121  G4cout << " "<< fNBinsR << " bins R stepR= " << fStepR/mm << " mm "
122  << G4endl;
123  G4cout << " "<< fNBinsZ << " bins Z stepZ= " << fStepZ/mm << " mm "
124  << G4endl;
125  G4cout << " "<< fNBinsE << " bins E stepE= " << fStepE/MeV << " MeV "
126  << G4endl;
127  G4cout << " "<< fScoreBin << "-th bin in Z is used for R distribution"
128  << G4endl;
129 
130  fVolumeR.resize(fNBinsR);
131  fEdep.resize(fNBinsR, 0.0);
132  fGammaE.resize(fNBinsE, 0.0);
133 
134  G4double r1 = 0.0;
135  G4double r2 = fStepR;
136  for(G4int i=0; i<fNBinsR; ++i) {
137  fVolumeR[i] = cm*cm/(pi*(r2*r2 - r1*r1));
138  r1 = r2;
139  r2 += fStepR;
140  }
141 
142  if(fHistName != "") {
143  if(!fAnalysisManager) {
145  BookHisto();
146  }
147  if(fVerbose > 0) {
148  G4cout << "Histo: Histograms are booked and run has been started"
149  << G4endl;
150  }
151  } else if(fVerbose > 0) {
152  G4cout << "Histo: Histograms are not booked because file name is not set"
153  << G4endl;
154  }
155 }
void SetNumberDivR(G4int val)
static const double cm
Definition: G4SIunits.hh:118
G4RootAnalysisManager * fAnalysisManager
static const double MeV
Definition: G4SIunits.hh:211
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
static const double pi
Definition: G4SIunits.hh:74
static G4RootAnalysisManager * Instance()
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:

◆ Book() [1/4]

void Histo::Book ( )

◆ Book() [2/4]

void Histo::Book ( )

◆ Book() [3/4]

void Histo::Book ( )

Definition at line 78 of file electromagnetic/TestEm9/src/Histo.cc.

79 {
80  if(!(fHistoActive || fNtupleActive)) { return; }
81 
82  // Always creating analysis manager
84 
85  // Creating a tree mapped to a new hbook file.
86  G4String nam = fHistName + "." + fHistType;
87 
88  // Open file histogram file
89  if(!fManager->OpenFile(nam)) {
90  G4cout << "Histo::Book: ERROR open file <" << nam << ">" << G4endl;
91  fHistoActive = false;
92  fNtupleActive = false;
93  return;
94  }
95  G4cout << "### Histo::Save: Opended file <" << nam << "> for "
96  << fNHisto << " histograms " << G4endl;
97 
98  // Creating an 1-dimensional histograms in the root directory of the tree
99  for(G4int i=0; i<fNHisto; ++i) {
100  if(fActive[i]) {
101  G4String ss = "h" + fIds[i];
102  fHisto[i] =
103  fManager->CreateH1(ss, fTitles[i], fBins[i], fXmin[i], fXmax[i]);
104  if(fVerbose > 0) {
105  G4cout << "Created histogram #" << i << " id= " << fHisto[i]
106  << " " << ss << " " << fTitles[i] << G4endl;
107  }
108  }
109  }
110  // Creating a tuple factory, whose tuples will be handled by the tree
111  if(fNtupleActive) {
113  G4int i;
114  G4int n = fNtupleI.size();
115  for(i=0; i<n; ++i) {
116  if(fTupleI[i] == -1) {
118  }
119  }
120  n = fNtupleF.size();
121  for(i=0; i<n; ++i) {
122  if(fTupleF[i] == -1) {
124  }
125  }
126  n = fNtupleD.size();
127  for(i=0; i<n; ++i) {
128  if(fTupleD[i] == -1) {
130  }
131  }
132  }
133 }
G4int CreateNtupleIColumn(const G4String &name)
G4int CreateH1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
std::vector< G4int > fTupleF
G4int CreateNtuple(const G4String &name, const G4String &title)
std::vector< G4int > fTupleD
std::vector< G4String > fNtupleI
std::vector< G4bool > fActive
int G4int
Definition: G4Types.hh:78
G4bool OpenFile(const G4String &fileName="")
std::vector< G4String > fIds
std::vector< G4String > fTitles
std::vector< G4double > fXmin
Char_t n[5]
std::vector< G4String > fNtupleD
G4GLOB_DLL std::ostream G4cout
std::vector< G4int > fBins
std::vector< G4int > fTupleI
std::vector< G4String > fNtupleF
G4int CreateNtupleFColumn(const G4String &name)
static G4RootAnalysisManager * Instance()
#define G4endl
Definition: G4ios.hh:61
G4int CreateNtupleDColumn(const G4String &name)
std::vector< G4int > fHisto
G4RootAnalysisManager * fManager
std::vector< G4double > fXmax
Here is the call graph for this function:

◆ Book() [4/4]

void Histo::Book ( )

◆ BookHisto()

void Histo::BookHisto ( )
private

Definition at line 256 of file medical/GammaTherapy/src/Histo.cc.

257 {
258  G4String nam = fHistName + ".root";
259 
260  if(!fAnalysisManager->OpenFile(nam)) {
261  G4cout << "Histo::bookHisto: ERROR open file <" << nam << ">" << G4endl;
262  G4Exception ("Histo::BookHisto()", "hist01", FatalException,
263  "Cannot open ROOT file.");
264  }
265  G4cout << "### Histo::Save: Opended file <" << nam << "> for "
266  << fNHisto << " histograms " << G4endl;
267 
268  // Creating an 1-dimensional histograms in the root directory of the tree
269  fHisto[0] = fAnalysisManager->CreateH1("10",
270  "Energy deposit at radius (mm) normalised on 1st channel",
271  fNBinsR, 0., fAbsorberR/mm);
272 
273  fHisto[1] = fAnalysisManager->CreateH1("11",
274  "Energy deposit at radius (mm) normalised to integral",
275  fNBinsR, 0., fAbsorberR/mm);
276 
277  fHisto[2] = fAnalysisManager->CreateH1("12",
278  "Energy deposit (MeV/kg/electron) at radius (mm)",
279  fNBinsR, 0., fAbsorberR/mm);
280 
281  fHisto[3] = fAnalysisManager->CreateH1("13",
282  "Energy profile (MeV/kg/electron) over Z (mm)",fNBinsZ,0.,fAbsorberZ/mm);
283 
284  fHisto[4] = fAnalysisManager->CreateH1("14",
285  "Energy profile (MeV/kg/electron) over Z (mm) at Central Voxel",
286  fNBinsZ, 0., fAbsorberZ/mm);
287 
288  fHisto[5] = fAnalysisManager->CreateH1("15",
289  "Energy (MeV) of fGamma produced in the target",
290  fNBinsE, 0., fMaxEnergy/MeV);
291 
292  fHisto[6] = fAnalysisManager->CreateH1("16",
293  "Energy (MeV) of fGamma before phantom",fNBinsE,0.,fMaxEnergy/MeV);
294 
295  fHisto[7] = fAnalysisManager->CreateH1("17",
296  "Energy (MeV) of electrons produced in phantom",fNBinsE,0.,fMaxEnergy/MeV);
297 
298  fHisto[8] = fAnalysisManager->CreateH1("18",
299  "Energy (MeV) of electrons produced in target",fNBinsE,0.,fMaxEnergy/MeV);
300 
301  fHisto[9] = fAnalysisManager->CreateH1("19",
302  "Gamma Energy Fluence (MeV/cm2) at radius(mm) in front of phantom",
303  fNBinsR, 0., fAbsorberR/mm);
304 
305 }
G4RootAnalysisManager * fAnalysisManager
static const double MeV
Definition: G4SIunits.hh:211
G4int CreateH1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
G4bool OpenFile(const G4String &fileName="")
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
std::vector< G4int > fHisto
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndOfHisto()

void Histo::EndOfHisto ( )

Definition at line 159 of file medical/GammaTherapy/src/Histo.cc.

160 {
161 
162  G4cout << "Histo: End of run actions are started" << G4endl;
163 
164  // average
165 
166  G4cout<<"========================================================"<<G4endl;
168  if(fNevt > 0) { x = 1.0/x; }
169  G4double xe = x*(G4double)fNelec;
170  G4double xg = x*(G4double)fNgam;
171  G4double xp = x*(G4double)fNposit;
172  G4double xs = x*(G4double)fNstep;
173  G4double xph= x*(G4double)fNgamPh;
175  G4double xgt= x*(G4double)fNgamTar;
176  G4double xet= x*(G4double)fNeTar;
177  G4double xphe= x*(G4double)fNePh;
178 
179  G4cout << "Number of events "
180  << std::setprecision(8) << fNevt <<G4endl;
181  G4cout
182  << std::setprecision(4) << "Average number of e- "
183  << xe << G4endl;
184  G4cout
185  << std::setprecision(4) << "Average number of gamma "
186  << xg << G4endl;
187  G4cout
188  << std::setprecision(4) << "Average number of e+ "
189  << xp << G4endl;
190  G4cout
191  << std::setprecision(4) << "Average number of steps in the phantom "
192  << xs << G4endl;
193  G4cout
194  << std::setprecision(4) << "Average number of e- steps in the target "
195  << xes << G4endl;
196  G4cout
197  << std::setprecision(4) << "Average number of g produced in the target "
198  << xgt << G4endl;
199  G4cout
200  << std::setprecision(4) << "Average number of e- produced in the target "
201  << xet << G4endl;
202  G4cout
203  << std::setprecision(4) << "Average number of g produced in the phantom "
204  << xph << G4endl;
205  G4cout
206  << std::setprecision(4) << "Average number of e- produced in the phantom "
207  << xphe << G4endl;
208  G4cout
209  << std::setprecision(4) << "Total fGamma fluence in front of the phantom "
210  << x*fSumR/MeV << " MeV " << G4endl;
211  G4cout<<"========================================================"<<G4endl;
212  G4cout<<G4endl;
213  G4cout<<G4endl;
214 
215  G4double sum = 0.0;
216  for(G4int i=0; i<fNBinsR; i++) {
217  fEdep[i] *= x;
218  sum += fEdep[i];
219  }
220 
221  if(fAnalysisManager) {
222 
223  // normalise histograms
224  for(G4int i=0; i<fNHisto; i++) {
225  fAnalysisManager->GetH1(fHisto[i])->scale(x);
226  }
227  G4double nr = fEdep[0];
228  if(nr > 0.0) { nr = 1./nr; }
229  fAnalysisManager->GetH1(fHisto[0])->scale(nr);
230 
231  nr = sum*fStepR;
232  if(nr > 0.0) { nr = 1./nr; }
233  fAnalysisManager->GetH1(fHisto[1])->scale(nr);
234 
236  ->scale(1000.0*cm3/(pi*fAbsorberR*fAbsorberR*fStepZ));
238  ->scale(1000.0*cm3*fVolumeR[0]/fStepZ);
239 
240  // Write histogram file
241  if(!fAnalysisManager->Write()) {
242  G4Exception ("Histo::Save()", "hist01", FatalException,
243  "Cannot write ROOT file.");
244  }
245  G4cout << "### Histo::Save: Histograms are saved" << G4endl;
246  if(fAnalysisManager->CloseFile() && fVerbose > 0) {
247  G4cout << " File is closed" << G4endl;
248  }
249  delete fAnalysisManager;
250  fAnalysisManager = 0;
251  }
252 }
G4RootAnalysisManager * fAnalysisManager
static const double MeV
Definition: G4SIunits.hh:211
tools::histo::h1d * GetH1(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
static const double cm3
Definition: G4SIunits.hh:120
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static const double pi
Definition: G4SIunits.hh:74
#define G4endl
Definition: G4ios.hh:61
std::vector< G4int > fHisto
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ Fill() [1/4]

void Histo::Fill ( G4int  ,
G4double  ,
G4double   
)

◆ Fill() [2/4]

void Histo::Fill ( G4int  i,
G4double  x,
G4double  w 
)

Definition at line 221 of file electromagnetic/TestEm9/src/Histo.cc.

222 {
223  if(!fHistoActive) { return; }
224  if(fVerbose > 1) {
225  G4cout << "Histo::Fill: Histogram: #" << i << " at x= " << x
226  << " weight= " << w
227  << G4endl;
228  }
229  if(i>=0 && i<fNHisto) {
230  if(fActive[i]) { fManager->FillH1(fHisto[i], x/fUnit[i], w); }
231  } else {
232  G4cout << "Histo::Fill: WARNING! wrong histogram index " << i << G4endl;
233  }
234 }
std::vector< G4bool > fActive
G4GLOB_DLL std::ostream G4cout
std::vector< G4double > fUnit
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
#define G4endl
Definition: G4ios.hh:61
std::vector< G4int > fHisto
G4RootAnalysisManager * fManager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Fill() [3/4]

void Histo::Fill ( G4int  ,
G4double  ,
G4double   
)

◆ Fill() [4/4]

void Histo::Fill ( G4int  ,
G4double  ,
G4double   
)

◆ FillTupleD() [1/4]

void Histo::FillTupleD ( G4int  ,
G4double   
)

◆ FillTupleD() [2/4]

void Histo::FillTupleD ( G4int  ,
G4double   
)

◆ FillTupleD() [3/4]

void Histo::FillTupleD ( G4int  ,
G4double   
)

◆ FillTupleD() [4/4]

void Histo::FillTupleD ( G4int  i,
G4double  x 
)

Definition at line 324 of file electromagnetic/TestEm9/src/Histo.cc.

325 {
326  if(!fNtupleActive) { return; }
327  G4int n = fNtupleD.size();
328  if(i >= 0 && i < n) {
329  if(fVerbose > 1) {
330  G4cout << "Histo::FillTupleD: i= " << i << " id= " << fTupleD[i]
331  << " <" << fNtupleD[i] << "> = " << x << G4endl;
332  }
334  } else {
335  G4cout << "Histo::FillTupleD: WARNING! wrong ntuple index "
336  << i << G4endl;
337  }
338 }
std::vector< G4int > fTupleD
int G4int
Definition: G4Types.hh:78
Char_t n[5]
std::vector< G4String > fNtupleD
G4GLOB_DLL std::ostream G4cout
G4bool FillNtupleDColumn(G4int id, G4double value)
#define G4endl
Definition: G4ios.hh:61
G4RootAnalysisManager * fManager
Here is the call graph for this function:

◆ FillTupleF() [1/4]

void Histo::FillTupleF ( G4int  ,
G4float   
)

◆ FillTupleF() [2/4]

void Histo::FillTupleF ( G4int  ,
G4float   
)

◆ FillTupleF() [3/4]

void Histo::FillTupleF ( G4int  i,
G4float  x 
)

Definition at line 306 of file electromagnetic/TestEm9/src/Histo.cc.

307 {
308  if(!fNtupleActive) { return; }
309  G4int n = fNtupleF.size();
310  if(i >= 0 && i < n) {
311  if(fVerbose > 1) {
312  G4cout << "Histo::FillTupleF: i= " << i << " id= " << fTupleF[i]
313  << " <" << fNtupleF[i] << "> = " << x << G4endl;
314  }
316  } else {
317  G4cout << "Histo::FillTupleF: WARNING! wrong ntuple index "
318  << i << G4endl;
319  }
320 }
std::vector< G4int > fTupleF
int G4int
Definition: G4Types.hh:78
G4bool FillNtupleFColumn(G4int id, G4float value)
Char_t n[5]
G4GLOB_DLL std::ostream G4cout
std::vector< G4String > fNtupleF
#define G4endl
Definition: G4ios.hh:61
G4RootAnalysisManager * fManager
Here is the call graph for this function:

◆ FillTupleF() [4/4]

void Histo::FillTupleF ( G4int  ,
G4float   
)

◆ FillTupleI() [1/4]

void Histo::FillTupleI ( G4int  ,
G4int   
)

◆ FillTupleI() [2/4]

void Histo::FillTupleI ( G4int  i,
G4int  x 
)

Definition at line 288 of file electromagnetic/TestEm9/src/Histo.cc.

289 {
290  if(!fNtupleActive) { return; }
291  G4int n = fNtupleI.size();
292  if(i >= 0 && i < n) {
293  if(fVerbose > 1) {
294  G4cout << "Histo::FillTupleI: i= " << i << " id= " << fTupleI[i]
295  << " <" << fNtupleI[i] << "> = " << x << G4endl;
296  }
298  } else {
299  G4cout << "Histo::FillTupleI: WARNING! wrong ntuple index "
300  << i << G4endl;
301  }
302 }
std::vector< G4String > fNtupleI
int G4int
Definition: G4Types.hh:78
Char_t n[5]
G4bool FillNtupleIColumn(G4int id, G4int value)
G4GLOB_DLL std::ostream G4cout
std::vector< G4int > fTupleI
#define G4endl
Definition: G4ios.hh:61
G4RootAnalysisManager * fManager
Here is the call graph for this function:

◆ FillTupleI() [3/4]

void Histo::FillTupleI ( G4int  ,
G4int   
)

◆ FillTupleI() [4/4]

void Histo::FillTupleI ( G4int  ,
G4int   
)

◆ GetMaxEnergy()

G4double Histo::GetMaxEnergy ( ) const
inline

Definition at line 109 of file medical/GammaTherapy/include/Histo.hh.

109 { return fMaxEnergy;};

◆ GetNumberDivR()

G4int Histo::GetNumberDivR ( ) const
inline

Definition at line 100 of file medical/GammaTherapy/include/Histo.hh.

100 { return fNBinsR; };

◆ GetNumberDivZ()

G4int Histo::GetNumberDivZ ( ) const
inline

Definition at line 97 of file medical/GammaTherapy/include/Histo.hh.

97 { return fNBinsZ; };

◆ GetPointer()

Histo * Histo::GetPointer ( )
static

Definition at line 59 of file medical/GammaTherapy/src/Histo.cc.

60 {
61  if(!fManager) {
62  static Histo manager;
63  fManager = &manager;
64  }
65  return fManager;
66 }
G4RootAnalysisManager * fManager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetVerbose()

G4int Histo::GetVerbose ( ) const
inline

Definition at line 94 of file medical/GammaTherapy/include/Histo.hh.

Here is the caller graph for this function:

◆ IsActive() [1/4]

G4bool Histo::IsActive ( ) const
inline

Definition at line 108 of file hadronic/Hadr02/include/Histo.hh.

108 { return fHistoActive; };

◆ IsActive() [2/4]

G4bool Histo::IsActive ( ) const
inline

Definition at line 108 of file electromagnetic/TestEm9/include/Histo.hh.

108 { return fHistoActive; };

◆ IsActive() [3/4]

G4bool Histo::IsActive ( ) const
inline

Definition at line 108 of file hadronic/Hadr01/include/Histo.hh.

108 { return fHistoActive; };

◆ IsActive() [4/4]

G4bool Histo::IsActive ( ) const
inline

Definition at line 108 of file exoticphysics/monopole/include/Histo.hh.

108 { return fHistoActive; };

◆ Save() [1/4]

void Histo::Save ( )

◆ Save() [2/4]

void Histo::Save ( )

◆ Save() [3/4]

void Histo::Save ( )

Definition at line 137 of file electromagnetic/TestEm9/src/Histo.cc.

138 {
139  if(!(fHistoActive || fNtupleActive)) { return; }
140 
141  // Creating a tree mapped to a new hbook file.
142  G4String nam = fHistName + "." + fHistType;
143 
144  // Write histogram file
145  if(!fManager->Write()) {
146  G4Exception ("Histo::Save()", "hist01", FatalException,
147  "Cannot write ROOT file.");
148  }
149  if(fVerbose > 0) {
150  G4cout << "### Histo::Save: Histograms and Ntuples are saved" << G4endl;
151  }
152  if(fManager->CloseFile() && fVerbose > 0) {
153  G4cout << " File is closed" << G4endl;
154  }
156  fManager = 0;
157 }
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4RootAnalysisManager * Instance()
#define G4endl
Definition: G4ios.hh:61
G4RootAnalysisManager * fManager
Here is the call graph for this function:

◆ Save() [4/4]

void Histo::Save ( )

◆ ScaleH1() [1/4]

void Histo::ScaleH1 ( G4int  ,
G4double   
)

◆ ScaleH1() [2/4]

void Histo::ScaleH1 ( G4int  ,
G4double   
)

◆ ScaleH1() [3/4]

void Histo::ScaleH1 ( G4int  ,
G4double   
)

◆ ScaleH1() [4/4]

void Histo::ScaleH1 ( G4int  i,
G4double  x 
)

Definition at line 238 of file electromagnetic/TestEm9/src/Histo.cc.

239 {
240  if(!fHistoActive) { return; }
241  if(fVerbose > 0) {
242  G4cout << "Histo::Scale: Histogram: #"
243  << i << " by factor " << x << G4endl;
244  }
245  if(i>=0 && i<fNHisto) {
246  if(fActive[i]) { fManager->GetH1(fHisto[i])->scale(x); }
247  } else {
248  G4cout << "Histo::Scale: WARNING! wrong histogram index " << i << G4endl;
249  }
250 }
tools::histo::h1d * GetH1(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
std::vector< G4bool > fActive
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
std::vector< G4int > fHisto
G4RootAnalysisManager * fManager
Here is the call graph for this function:

◆ ScoreNewTrack()

void Histo::ScoreNewTrack ( const G4Track *  aTrack)

Definition at line 346 of file medical/GammaTherapy/src/Histo.cc.

347 {
348  //Save primary parameters
349  const G4ParticleDefinition* particle = aTrack->GetParticleDefinition();
350  G4int pid = aTrack->GetParentID();
351  G4VPhysicalVolume* pv = aTrack->GetVolume();
352  const G4DynamicParticle* dp = aTrack->GetDynamicParticle();
353 
354  //primary particle
355  if(0 == pid) {
356 
357  ++fNevt;
358  if(1 < fVerbose) {
359  G4ThreeVector pos = aTrack->GetVertexPosition();
360  G4ThreeVector dir = aTrack->GetMomentumDirection();
361  G4cout << "TrackingAction: Primary "
362  << particle->GetParticleName()
363  << " Ekin(MeV)= "
364  << aTrack->GetKineticEnergy()/MeV
365  << "; pos= " << pos << "; dir= " << dir << G4endl;
366  }
367 
368  // secondary electron
369  } else if (0 < pid && particle == fElectron) {
370  if(1 < fVerbose) {
371  G4cout << "TrackingAction: Secondary electron " << G4endl;
372  }
373  AddElectron(dp);
374  if(pv == fPhantom) { AddPhantomElectron(dp); }
375  else if(pv == fTarget1 || pv == fTarget2) { AddTargetElectron(dp); }
376 
377  // secondary positron
378  } else if (0 < pid && particle == fPositron) {
379  if(1 < fVerbose) {
380  G4cout << "TrackingAction: Secondary positron " << G4endl;
381  }
382  AddPositron(dp);
383 
384  // secondary gamma
385  } else if (0 < pid && particle == fGamma) {
386  if(1 < fVerbose) {
387  G4cout << "TrackingAction: Secondary gamma; parentID= " << pid
388  << " E= " << aTrack->GetKineticEnergy() << G4endl;
389  }
390  AddPhoton(dp);
391  if(pv == fPhantom) { AddPhantomPhoton(dp); }
392  else if(pv == fTarget1 || pv == fTarget2) { AddTargetPhoton(dp); }
393 
394  }
395 }
void AddPhantomPhoton(const G4DynamicParticle *)
static const double MeV
Definition: G4SIunits.hh:211
G4VPhysicalVolume * fTarget2
G4VPhysicalVolume * fPhantom
void AddElectron(const G4DynamicParticle *)
G4VPhysicalVolume * fTarget1
TDirectory * dir
int G4int
Definition: G4Types.hh:78
const G4ParticleDefinition * fGamma
void AddPhoton(const G4DynamicParticle *)
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * fElectron
const G4ParticleDefinition * fPositron
void AddTargetElectron(const G4DynamicParticle *)
void AddTargetPhoton(const G4DynamicParticle *)
#define G4endl
Definition: G4ios.hh:61
void AddPositron(const G4DynamicParticle *)
void AddPhantomElectron(const G4DynamicParticle *)
static const G4double pos
Here is the call graph for this function:

◆ SetAbsorberR()

void Histo::SetAbsorberR ( G4double  val)
inline

Definition at line 105 of file medical/GammaTherapy/include/Histo.hh.

105 { fAbsorberR = val; };

◆ SetAbsorberZ()

void Histo::SetAbsorberZ ( G4double  val)
inline

Definition at line 104 of file medical/GammaTherapy/include/Histo.hh.

104 { fAbsorberZ = val; };

◆ SetCheckVolume()

void Histo::SetCheckVolume ( G4VPhysicalVolume v)
inline

Definition at line 111 of file medical/GammaTherapy/include/Histo.hh.

111 { fCheckVolume = v;};
G4VPhysicalVolume * fCheckVolume

◆ SetFileName() [1/4]

void Histo::SetFileName ( const G4String )

◆ SetFileName() [2/4]

void Histo::SetFileName ( const G4String )

◆ SetFileName() [3/4]

void Histo::SetFileName ( const G4String nam)

Definition at line 350 of file electromagnetic/TestEm9/src/Histo.cc.

351 {
352  fHistName = nam;
353  fHistoActive = true;
354 }
Here is the caller graph for this function:

◆ SetFileName() [4/4]

void Histo::SetFileName ( const G4String )

◆ SetFileType() [1/4]

void Histo::SetFileType ( const G4String )

◆ SetFileType() [2/4]

void Histo::SetFileType ( const G4String )

◆ SetFileType() [3/4]

void Histo::SetFileType ( const G4String )

◆ SetFileType() [4/4]

void Histo::SetFileType ( const G4String nam)

Definition at line 358 of file electromagnetic/TestEm9/src/Histo.cc.

359 {
360  // format other than ROOT is not tested
361  if(nam == "root" || nam == "ROOT" ) { fHistType = "root"; }
362  else if(nam == "xml" || nam == "XML") { fHistType = "xml"; }
363  else if(nam == "ascii" || nam == "ASCII" ||
364  nam == "Csv" || nam == "csv" || nam == "CSV")
365  { fHistType = "ascii"; }
366 }
Here is the caller graph for this function:

◆ SetGasVolume()

void Histo::SetGasVolume ( G4VPhysicalVolume v)
inline

Definition at line 112 of file medical/GammaTherapy/include/Histo.hh.

112 { fGasVolume = v;};
G4VPhysicalVolume * fGasVolume

◆ SetHisto1D() [1/4]

void Histo::SetHisto1D ( G4int  ,
G4int  ,
G4double  ,
G4double  ,
G4double   
)

◆ SetHisto1D() [2/4]

void Histo::SetHisto1D ( G4int  ,
G4int  ,
G4double  ,
G4double  ,
G4double   
)

◆ SetHisto1D() [3/4]

void Histo::SetHisto1D ( G4int  i,
G4int  nb,
G4double  x1,
G4double  x2,
G4double  u 
)

Definition at line 185 of file electromagnetic/TestEm9/src/Histo.cc.

186 {
187  if(i>=0 && i<fNHisto) {
188  if(fVerbose > 0) {
189  G4cout << "Histo::SetHisto1D: #" << i
190  << " " << nb << " " << x1 << " " << x2 << " " << u
191  << G4endl;
192  }
193  fBins[i] = nb;
194  fXmin[i] = x1;
195  fXmax[i] = x2;
196  fUnit[i] = u;
197  fActive[i] = true;
198  fHistoActive = true;
199  } else {
200  G4cout << "Histo::SetHisto1D: WARNING! wrong histogram index "
201  << i << G4endl;
202  }
203 }
Double_t x2[nxs]
std::vector< G4bool > fActive
std::vector< G4double > fXmin
G4GLOB_DLL std::ostream G4cout
Double_t x1[nxs]
std::vector< G4int > fBins
std::vector< G4double > fUnit
#define G4endl
Definition: G4ios.hh:61
std::vector< G4double > fXmax
Here is the caller graph for this function:

◆ SetHisto1D() [4/4]

void Histo::SetHisto1D ( G4int  ,
G4int  ,
G4double  ,
G4double  ,
G4double   
)

◆ SetHistoName()

void Histo::SetHistoName ( const G4String name)
inline

Definition at line 90 of file medical/GammaTherapy/include/Histo.hh.

90 { fHistName = name; };
G4String name
Definition: TRTMaterials.hh:40

◆ SetMaxEnergy()

void Histo::SetMaxEnergy ( G4double  val)
inline

Definition at line 108 of file medical/GammaTherapy/include/Histo.hh.

108 { fMaxEnergy = val; };

◆ SetNumberDivE()

void Histo::SetNumberDivE ( G4int  val)
inline

Definition at line 102 of file medical/GammaTherapy/include/Histo.hh.

102 { fNBinsE = val; };

◆ SetNumberDivR()

void Histo::SetNumberDivR ( G4int  val)
inline

Definition at line 99 of file medical/GammaTherapy/include/Histo.hh.

99 { fNBinsR = val; };
Here is the caller graph for this function:

◆ SetNumberDivZ()

void Histo::SetNumberDivZ ( G4int  val)
inline

Definition at line 96 of file medical/GammaTherapy/include/Histo.hh.

96 { fNBinsZ = val; };

◆ SetPhantom()

void Histo::SetPhantom ( G4VPhysicalVolume v)
inline

Definition at line 113 of file medical/GammaTherapy/include/Histo.hh.

113 { fPhantom = v; };
G4VPhysicalVolume * fPhantom

◆ SetScoreZ()

void Histo::SetScoreZ ( G4double  val)
inline

Definition at line 106 of file medical/GammaTherapy/include/Histo.hh.

106 { fScoreZ = val; };

◆ SetTarget1()

void Histo::SetTarget1 ( G4VPhysicalVolume v)
inline

Definition at line 114 of file medical/GammaTherapy/include/Histo.hh.

114 { fTarget1 = v; };
G4VPhysicalVolume * fTarget1

◆ SetTarget2()

void Histo::SetTarget2 ( G4VPhysicalVolume v)
inline

Definition at line 115 of file medical/GammaTherapy/include/Histo.hh.

115 { fTarget2 = v; };
G4VPhysicalVolume * fTarget2
Here is the call graph for this function:

◆ SetVerbose() [1/5]

void Histo::SetVerbose ( G4int  val)
inline

Definition at line 93 of file medical/GammaTherapy/include/Histo.hh.

◆ SetVerbose() [2/5]

void Histo::SetVerbose ( G4int  val)
inline

Definition at line 106 of file hadronic/Hadr02/include/Histo.hh.

106 { fVerbose = val; };

◆ SetVerbose() [3/5]

void Histo::SetVerbose ( G4int  val)
inline

Definition at line 106 of file exoticphysics/monopole/include/Histo.hh.

106 { fVerbose = val; };

◆ SetVerbose() [4/5]

void Histo::SetVerbose ( G4int  val)
inline

Definition at line 106 of file hadronic/Hadr01/include/Histo.hh.

106 { fVerbose = val; };

◆ SetVerbose() [5/5]

void Histo::SetVerbose ( G4int  val)
inline

Definition at line 106 of file electromagnetic/TestEm9/include/Histo.hh.

106 { fVerbose = val; };

Member Data Documentation

◆ fAbsorberR

G4double Histo::fAbsorberR
private

Definition at line 154 of file medical/GammaTherapy/include/Histo.hh.

◆ fAbsorberZ

G4double Histo::fAbsorberZ
private

Definition at line 153 of file medical/GammaTherapy/include/Histo.hh.

◆ fActive

std::vector< G4bool > Histo::fActive
private

Definition at line 130 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fAnalysisManager

G4RootAnalysisManager* Histo::fAnalysisManager
private

Definition at line 132 of file medical/GammaTherapy/include/Histo.hh.

◆ fBins

std::vector< G4int > Histo::fBins
private

Definition at line 129 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fCheckVolume

G4VPhysicalVolume* Histo::fCheckVolume
private

Definition at line 138 of file medical/GammaTherapy/include/Histo.hh.

◆ fDefaultAct

G4bool Histo::fDefaultAct
private

Definition at line 121 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fEdep

G4DataVector Histo::fEdep
private

Definition at line 177 of file medical/GammaTherapy/include/Histo.hh.

◆ fElectron

const G4ParticleDefinition* Histo::fElectron
private

Definition at line 135 of file medical/GammaTherapy/include/Histo.hh.

◆ fGamma

const G4ParticleDefinition* Histo::fGamma
private

Definition at line 134 of file medical/GammaTherapy/include/Histo.hh.

◆ fGammaE

G4DataVector Histo::fGammaE
private

Definition at line 176 of file medical/GammaTherapy/include/Histo.hh.

◆ fGasVolume

G4VPhysicalVolume* Histo::fGasVolume
private

Definition at line 139 of file medical/GammaTherapy/include/Histo.hh.

◆ fHistName

G4String Histo::fHistName
private

Definition at line 115 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fHisto

std::vector< G4int > Histo::fHisto
private

Definition at line 125 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fHistoActive

G4bool Histo::fHistoActive
private

Definition at line 122 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fHistType

G4String Histo::fHistType
private

Definition at line 116 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fIds

std::vector< G4String > Histo::fIds
private

Definition at line 134 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fManager [1/3]

Histo * Histo::fManager = 0
private

Definition at line 108 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fManager [2/3]

G4VAnalysisManager* Histo::fManager
private

Definition at line 108 of file hadronic/Hadr02/include/Histo.hh.

◆ fManager [3/3]

Histo* Histo::fManager
staticprivate

Definition at line 128 of file medical/GammaTherapy/include/Histo.hh.

◆ fMaxEnergy

G4double Histo::fMaxEnergy
private

Definition at line 156 of file medical/GammaTherapy/include/Histo.hh.

◆ fMessenger

HistoMessenger * Histo::fMessenger
private

Definition at line 113 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fNBinsE

G4int Histo::fNBinsE
private

Definition at line 149 of file medical/GammaTherapy/include/Histo.hh.

◆ fNBinsR

G4int Histo::fNBinsR
private

Definition at line 148 of file medical/GammaTherapy/include/Histo.hh.

◆ fNBinsZ

G4int Histo::fNBinsZ
private

Definition at line 147 of file medical/GammaTherapy/include/Histo.hh.

◆ fNelec

G4int Histo::fNelec
private

Definition at line 165 of file medical/GammaTherapy/include/Histo.hh.

◆ fNePh

G4int Histo::fNePh
private

Definition at line 172 of file medical/GammaTherapy/include/Histo.hh.

◆ fNeTar

G4int Histo::fNeTar
private

Definition at line 171 of file medical/GammaTherapy/include/Histo.hh.

◆ fNevt

G4int Histo::fNevt
private

Definition at line 164 of file medical/GammaTherapy/include/Histo.hh.

◆ fNgam

G4int Histo::fNgam
private

Definition at line 167 of file medical/GammaTherapy/include/Histo.hh.

◆ fNgamPh

G4int Histo::fNgamPh
private

Definition at line 169 of file medical/GammaTherapy/include/Histo.hh.

◆ fNgamTar

G4int Histo::fNgamTar
private

Definition at line 170 of file medical/GammaTherapy/include/Histo.hh.

◆ fNHisto

G4int Histo::fNHisto
private

Definition at line 119 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fNormZ

G4double Histo::fNormZ
private

Definition at line 161 of file medical/GammaTherapy/include/Histo.hh.

◆ fNposit

G4int Histo::fNposit
private

Definition at line 166 of file medical/GammaTherapy/include/Histo.hh.

◆ fNstep

G4int Histo::fNstep
private

Definition at line 168 of file medical/GammaTherapy/include/Histo.hh.

◆ fNstepTarget

G4int Histo::fNstepTarget
private

Definition at line 173 of file medical/GammaTherapy/include/Histo.hh.

◆ fNtupleActive

G4bool Histo::fNtupleActive
private

Definition at line 123 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fNtupleD

std::vector< G4String > Histo::fNtupleD
private

Definition at line 138 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fNtupleF

std::vector< G4String > Histo::fNtupleF
private

Definition at line 137 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fNtupleI

std::vector< G4String > Histo::fNtupleI
private

Definition at line 136 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fPhantom

G4VPhysicalVolume* Histo::fPhantom
private

Definition at line 140 of file medical/GammaTherapy/include/Histo.hh.

◆ fPositron

const G4ParticleDefinition* Histo::fPositron
private

Definition at line 136 of file medical/GammaTherapy/include/Histo.hh.

◆ fScoreBin

G4int Histo::fScoreBin
private

Definition at line 150 of file medical/GammaTherapy/include/Histo.hh.

◆ fScoreZ

G4double Histo::fScoreZ
private

Definition at line 152 of file medical/GammaTherapy/include/Histo.hh.

◆ fStepE

G4double Histo::fStepE
private

Definition at line 160 of file medical/GammaTherapy/include/Histo.hh.

◆ fStepR

G4double Histo::fStepR
private

Definition at line 159 of file medical/GammaTherapy/include/Histo.hh.

◆ fStepZ

G4double Histo::fStepZ
private

Definition at line 158 of file medical/GammaTherapy/include/Histo.hh.

◆ fSumR

G4double Histo::fSumR
private

Definition at line 162 of file medical/GammaTherapy/include/Histo.hh.

◆ fTarget1

G4VPhysicalVolume* Histo::fTarget1
private

Definition at line 141 of file medical/GammaTherapy/include/Histo.hh.

◆ fTarget2

G4VPhysicalVolume* Histo::fTarget2
private

Definition at line 142 of file medical/GammaTherapy/include/Histo.hh.

◆ fTitles

std::vector< G4String > Histo::fTitles
private

Definition at line 135 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fTupleD

std::vector< G4int > Histo::fTupleD
private

Definition at line 128 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fTupleF

std::vector< G4int > Histo::fTupleF
private

Definition at line 127 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fTupleI

std::vector< G4int > Histo::fTupleI
private

Definition at line 126 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fTupleName

G4String Histo::fTupleName
private

Definition at line 117 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fTupleTitle

G4String Histo::fTupleTitle
private

Definition at line 118 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fUnit

std::vector< G4double > Histo::fUnit
private

Definition at line 133 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fVerbose

G4int Histo::fVerbose
private

Definition at line 120 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fVolumeR

G4DataVector Histo::fVolumeR
private

Definition at line 175 of file medical/GammaTherapy/include/Histo.hh.

◆ fXmax

std::vector< G4double > Histo::fXmax
private

Definition at line 132 of file electromagnetic/TestEm9/include/Histo.hh.

◆ fXmin

std::vector< G4double > Histo::fXmin
private

Definition at line 131 of file electromagnetic/TestEm9/include/Histo.hh.


The documentation for this class was generated from the following files: