BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Private Member Functions | Private Attributes
BDSOutputROOTEventHistograms Class Reference

Holder for a set of histograms to be stored. More...

#include <BDSOutputROOTEventHistograms.hh>

Inheritance diagram for BDSOutputROOTEventHistograms:
Inheritance graph
Collaboration diagram for BDSOutputROOTEventHistograms:
Collaboration graph

Public Member Functions

 BDSOutputROOTEventHistograms (const BDSOutputROOTEventHistograms &h)
 
BDSOutputROOTEventHistogramsoperator= (const BDSOutputROOTEventHistograms &)=delete
 
 BDSOutputROOTEventHistograms (std::vector< TH1D * > &histogram1DIn, std::vector< TH2D * > &histogram2DIn, std::vector< TH3D * > &histogram3DIn, std::vector< BDSBH4DBase * > &histograms4DIn)
 
int Create1DHistogramSTD (std::string name, std::string title, int nbins, double xmin, double xmax)
 Interface function to create a 1D histogram using only standard types. More...
 
G4int Create1DHistogram (G4String name, G4String title, G4int nbins, G4double xmin, G4double xmax)
 
G4int Create1DHistogram (G4String name, G4String title, std::vector< double > &edges)
 
G4int Create2DHistogram (G4String name, G4String title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax)
 
G4int Create2DHistogram (G4String name, G4String title, std::vector< double > &xedges, std::vector< double > &yedges)
 
G4int Create3DHistogram (G4String name, G4String title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4int nzbins, G4double zmin, G4double zmax)
 
G4int Create3DHistogram (G4String name, G4String title, std::vector< double > &xedges, std::vector< double > &yedges, std::vector< double > &zedges)
 
G4int Create4DHistogram (const G4String &name, const G4String &title, const G4String &eScale, const std::vector< double > &eBinsEdges, unsigned int nxbins, G4double xmin, G4double xmax, unsigned int nybins, G4double ymin, G4double ymax, unsigned int nzbins, G4double zmin, G4double zmax, unsigned int nebins, G4double emin, G4double emax)
 
void Fill1DHistogram (G4int histoId, G4double value, G4double weight=1.0)
 
void Fill2DHistogram (G4int histoId, G4double xValue, G4double yValue, G4double weight=1.0)
 
void Fill3DHistogram (G4int histoId, G4double xValue, G4double yValue, G4double zValue, G4double weight=1.0)
 
void Fill4DHistogram (G4int histoId, G4double xValue, G4double yValue, G4double zvalue, G4double eValue)
 
void Set3DHistogramBinContent (G4int histoId, G4int globalBinID, G4double value)
 
void Set4DHistogramBinContent (G4int histoId, G4int x, G4int y, G4int z, G4int e, G4double value)
 
void AccumulateHistogram3D (G4int histoId, TH3D *otherHistogram)
 Add the values from one supplied 3D histogram to another. Uses TH3-Add(). More...
 
void AccumulateHistogram4D (G4int histoId, BDSBH4DBase *otherHistogram)
 
virtual void Flush ()
 Flush the contents. More...
 
void Fill (const BDSOutputROOTEventHistograms *rhs)
 Copy (using the TH->Clone) method from another instance. More...
 
void FillSimple (const BDSOutputROOTEventHistograms *rhs)
 Copy (without using the TH->Clone) method from another instance. (Quicker). More...
 
std::vector< TH1D * > & Get1DHistograms ()
 Accessors. More...
 
std::vector< TH2D * > & Get2DHistograms ()
 Accessors. More...
 
std::vector< TH3D * > & Get3DHistograms ()
 Accessors. More...
 
std::vector< BDSBH4DBase * > & Get4DHistograms ()
 Accessors. More...
 
TH1D * Get1DHistogram (int iHisto) const
 Accessors. More...
 
TH2D * Get2DHistogram (int iHisto) const
 Accessors. More...
 
TH3D * Get3DHistogram (int iHisto) const
 Accessors. More...
 
BDSBH4DBaseGet4DHistogram (int iHisto) const
 Accessors. More...
 

Private Member Functions

 ClassDef (BDSOutputROOTEventHistograms, 3)
 

Private Attributes

std::vector< TH1D * > histograms1D
 
std::vector< TH2D * > histograms2D
 
std::vector< TH3D * > histograms3D
 
std::vector< BDSBH4DBase * > histograms4D
 

Detailed Description

Holder for a set of histograms to be stored.

Author
Stewart Boogert

Definition at line 47 of file BDSOutputROOTEventHistograms.hh.

Constructor & Destructor Documentation

◆ BDSOutputROOTEventHistograms() [1/2]

BDSOutputROOTEventHistograms::BDSOutputROOTEventHistograms ( const BDSOutputROOTEventHistograms h)

Definition at line 42 of file BDSOutputROOTEventHistograms.cc.

◆ BDSOutputROOTEventHistograms() [2/2]

BDSOutputROOTEventHistograms::BDSOutputROOTEventHistograms ( std::vector< TH1D * > &  histogram1DIn,
std::vector< TH2D * > &  histogram2DIn,
std::vector< TH3D * > &  histogram3DIn,
std::vector< BDSBH4DBase * > &  histograms4DIn 
)

Definition at line 48 of file BDSOutputROOTEventHistograms.cc.

◆ ~BDSOutputROOTEventHistograms()

BDSOutputROOTEventHistograms::~BDSOutputROOTEventHistograms ( )
virtual

Definition at line 58 of file BDSOutputROOTEventHistograms.cc.

Member Function Documentation

◆ AccumulateHistogram3D()

void BDSOutputROOTEventHistograms::AccumulateHistogram3D ( G4int  histoId,
TH3D *  otherHistogram 
)

Add the values from one supplied 3D histogram to another. Uses TH3-Add().

Definition at line 304 of file BDSOutputROOTEventHistograms.cc.

Referenced by BDSOutput::FillScorerHitsIndividual().

Here is the caller graph for this function:

◆ AccumulateHistogram4D()

void BDSOutputROOTEventHistograms::AccumulateHistogram4D ( G4int  histoId,
BDSBH4DBase otherHistogram 
)

Definition at line 310 of file BDSOutputROOTEventHistograms.cc.

◆ Create1DHistogram() [1/2]

G4int BDSOutputROOTEventHistograms::Create1DHistogram ( G4String  name,
G4String  title,
G4int  nbins,
G4double  xmin,
G4double  xmax 
)

Definition at line 100 of file BDSOutputROOTEventHistograms.cc.

◆ Create1DHistogram() [2/2]

G4int BDSOutputROOTEventHistograms::Create1DHistogram ( G4String  name,
G4String  title,
std::vector< double > &  edges 
)

Definition at line 107 of file BDSOutputROOTEventHistograms.cc.

◆ Create1DHistogramSTD()

int BDSOutputROOTEventHistograms::Create1DHistogramSTD ( std::string  name,
std::string  title,
int  nbins,
double  xmin,
double  xmax 
)

Interface function to create a 1D histogram using only standard types.

Definition at line 91 of file BDSOutputROOTEventHistograms.cc.

◆ Create2DHistogram() [1/2]

G4int BDSOutputROOTEventHistograms::Create2DHistogram ( G4String  name,
G4String  title,
G4int  nxbins,
G4double  xmin,
G4double  xmax,
G4int  nybins,
G4double  ymin,
G4double  ymax 
)

Definition at line 121 of file BDSOutputROOTEventHistograms.cc.

◆ Create2DHistogram() [2/2]

G4int BDSOutputROOTEventHistograms::Create2DHistogram ( G4String  name,
G4String  title,
std::vector< double > &  xedges,
std::vector< double > &  yedges 
)

Definition at line 129 of file BDSOutputROOTEventHistograms.cc.

◆ Create3DHistogram() [1/2]

G4int BDSOutputROOTEventHistograms::Create3DHistogram ( G4String  name,
G4String  title,
G4int  nxbins,
G4double  xmin,
G4double  xmax,
G4int  nybins,
G4double  ymin,
G4double  ymax,
G4int  nzbins,
G4double  zmin,
G4double  zmax 
)

Definition at line 148 of file BDSOutputROOTEventHistograms.cc.

◆ Create3DHistogram() [2/2]

G4int BDSOutputROOTEventHistograms::Create3DHistogram ( G4String  name,
G4String  title,
std::vector< double > &  xedges,
std::vector< double > &  yedges,
std::vector< double > &  zedges 
)

Definition at line 160 of file BDSOutputROOTEventHistograms.cc.

◆ Create4DHistogram()

G4int BDSOutputROOTEventHistograms::Create4DHistogram ( const G4String &  name,
const G4String &  title,
const G4String &  eScale,
const std::vector< double > &  eBinsEdges,
unsigned int  nxbins,
G4double  xmin,
G4double  xmax,
unsigned int  nybins,
G4double  ymin,
G4double  ymax,
unsigned int  nzbins,
G4double  zmin,
G4double  zmax,
unsigned int  nebins,
G4double  emin,
G4double  emax 
)

Definition at line 185 of file BDSOutputROOTEventHistograms.cc.

◆ Fill()

void BDSOutputROOTEventHistograms::Fill ( const BDSOutputROOTEventHistograms rhs)

Copy (using the TH->Clone) method from another instance.

Definition at line 72 of file BDSOutputROOTEventHistograms.cc.

◆ Fill1DHistogram()

void BDSOutputROOTEventHistograms::Fill1DHistogram ( G4int  histoId,
G4double  value,
G4double  weight = 1.0 
)

Definition at line 236 of file BDSOutputROOTEventHistograms.cc.

◆ Fill2DHistogram()

void BDSOutputROOTEventHistograms::Fill2DHistogram ( G4int  histoId,
G4double  xValue,
G4double  yValue,
G4double  weight = 1.0 
)

Definition at line 243 of file BDSOutputROOTEventHistograms.cc.

◆ Fill3DHistogram()

void BDSOutputROOTEventHistograms::Fill3DHistogram ( G4int  histoId,
G4double  xValue,
G4double  yValue,
G4double  zValue,
G4double  weight = 1.0 
)

Definition at line 251 of file BDSOutputROOTEventHistograms.cc.

◆ Fill4DHistogram()

void BDSOutputROOTEventHistograms::Fill4DHistogram ( G4int  histoId,
G4double  xValue,
G4double  yValue,
G4double  zvalue,
G4double  eValue 
)

Definition at line 261 of file BDSOutputROOTEventHistograms.cc.

◆ FillSimple()

void BDSOutputROOTEventHistograms::FillSimple ( const BDSOutputROOTEventHistograms rhs)

Copy (without using the TH->Clone) method from another instance. (Quicker).

Definition at line 61 of file BDSOutputROOTEventHistograms.cc.

Referenced by Event::Fill().

Here is the caller graph for this function:

◆ Flush()

void BDSOutputROOTEventHistograms::Flush ( )
virtual

Flush the contents.

Definition at line 318 of file BDSOutputROOTEventHistograms.cc.

Referenced by BDSOutputStructures::ClearStructuresEventLevel(), and Event::Flush().

Here is the caller graph for this function:

◆ Get1DHistogram()

TH1D * BDSOutputROOTEventHistograms::Get1DHistogram ( int  iHisto) const
inline

Accessors.

Definition at line 129 of file BDSOutputROOTEventHistograms.hh.

Referenced by BDSOutput::CopyFromHistToHist1D().

Here is the caller graph for this function:

◆ Get1DHistograms()

std::vector< TH1D * > & BDSOutputROOTEventHistograms::Get1DHistograms ( )
inline

Accessors.

Definition at line 125 of file BDSOutputROOTEventHistograms.hh.

Referenced by HistogramMeanFromFile::Accumulate(), and HistogramMeanFromFile::HistogramMeanFromFile().

Here is the caller graph for this function:

◆ Get2DHistogram()

TH2D * BDSOutputROOTEventHistograms::Get2DHistogram ( int  iHisto) const
inline

Accessors.

Definition at line 130 of file BDSOutputROOTEventHistograms.hh.

◆ Get2DHistograms()

std::vector< TH2D * > & BDSOutputROOTEventHistograms::Get2DHistograms ( )
inline

Accessors.

Definition at line 126 of file BDSOutputROOTEventHistograms.hh.

Referenced by HistogramMeanFromFile::Accumulate(), and HistogramMeanFromFile::HistogramMeanFromFile().

Here is the caller graph for this function:

◆ Get3DHistogram()

TH3D * BDSOutputROOTEventHistograms::Get3DHistogram ( int  iHisto) const
inline

Accessors.

Definition at line 131 of file BDSOutputROOTEventHistograms.hh.

Referenced by BDSOutput::FillScorerHitsIndividual().

Here is the caller graph for this function:

◆ Get3DHistograms()

std::vector< TH3D * > & BDSOutputROOTEventHistograms::Get3DHistograms ( )
inline

Accessors.

Definition at line 127 of file BDSOutputROOTEventHistograms.hh.

Referenced by HistogramMeanFromFile::Accumulate(), and HistogramMeanFromFile::HistogramMeanFromFile().

Here is the caller graph for this function:

◆ Get4DHistogram()

BDSBH4DBase * BDSOutputROOTEventHistograms::Get4DHistogram ( int  iHisto) const
inline

Accessors.

Definition at line 132 of file BDSOutputROOTEventHistograms.hh.

Referenced by BDSOutput::FillScorerHitsIndividual().

Here is the caller graph for this function:

◆ Get4DHistograms()

std::vector< BDSBH4DBase * > & BDSOutputROOTEventHistograms::Get4DHistograms ( )
inline

Accessors.

Definition at line 128 of file BDSOutputROOTEventHistograms.hh.

Referenced by HistogramMeanFromFile::Accumulate(), and HistogramMeanFromFile::HistogramMeanFromFile().

Here is the caller graph for this function:

◆ Set3DHistogramBinContent()

void BDSOutputROOTEventHistograms::Set3DHistogramBinContent ( G4int  histoId,
G4int  globalBinID,
G4double  value 
)

Set the value of a bin by (ROOT!!) global bin index. Note the TH3 function should be used to get ROOT's idea of a global bin index.

Definition at line 280 of file BDSOutputROOTEventHistograms.cc.

Referenced by BDSOutput::FillScorerHitsIndividual().

Here is the caller graph for this function:

◆ Set4DHistogramBinContent()

void BDSOutputROOTEventHistograms::Set4DHistogramBinContent ( G4int  histoId,
G4int  x,
G4int  y,
G4int  z,
G4int  e,
G4double  value 
)

Definition at line 288 of file BDSOutputROOTEventHistograms.cc.

Field Documentation

◆ histograms1D

std::vector<TH1D*> BDSOutputROOTEventHistograms::histograms1D
private

Definition at line 136 of file BDSOutputROOTEventHistograms.hh.

◆ histograms2D

std::vector<TH2D*> BDSOutputROOTEventHistograms::histograms2D
private

Definition at line 137 of file BDSOutputROOTEventHistograms.hh.

◆ histograms3D

std::vector<TH3D*> BDSOutputROOTEventHistograms::histograms3D
private

Definition at line 138 of file BDSOutputROOTEventHistograms.hh.

◆ histograms4D

std::vector<BDSBH4DBase*> BDSOutputROOTEventHistograms::histograms4D
private

Definition at line 139 of file BDSOutputROOTEventHistograms.hh.


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