19#ifndef BDSOUTPUTROOTEVENTHISTOGRAMS_H
20#define BDSOUTPUTROOTEVENTHISTOGRAMS_H
26#include <boost/histogram.hpp>
35#include "BDSBH4DBase.hh"
54 std::vector<TH2D*>& histogram2DIn,
55 std::vector<TH3D*>& histogram3DIn,
56 std::vector<BDSBH4DBase*>& histograms4DIn);
61 int nbins,
double xmin,
double xmax);
64 G4int Create1DHistogram(G4String name, G4String title,
65 G4int nbins, G4double xmin, G4double xmax);
66 G4int Create1DHistogram(G4String name, G4String title,
67 std::vector<double>& edges);
68 G4int Create2DHistogram(G4String name, G4String title,
69 G4int nxbins, G4double xmin, G4double xmax,
70 G4int nybins, G4double ymin, G4double ymax);
71 G4int Create2DHistogram(G4String name, G4String title,
72 std::vector<double>& xedges,
73 std::vector<double>& yedges);
74 G4int Create3DHistogram(G4String name, G4String title,
75 G4int nxbins, G4double xmin, G4double xmax,
76 G4int nybins, G4double ymin, G4double ymax,
77 G4int nzbins, G4double zmin, G4double zmax);
78 G4int Create3DHistogram(G4String name, G4String title,
79 std::vector<double>& xedges,
80 std::vector<double>& yedges,
81 std::vector<double>& zedges);
82 G4int Create4DHistogram(
const G4String& name,
83 const G4String& title,
84 const G4String& eScale,
85 const std::vector<double>& eBinsEdges,
86 unsigned int nxbins, G4double xmin, G4double xmax,
87 unsigned int nybins, G4double ymin, G4double ymax,
88 unsigned int nzbins, G4double zmin, G4double zmax,
89 unsigned int nebins, G4double emin, G4double emax);
91 void Fill1DHistogram(G4int histoId, G4double value, G4double weight = 1.0);
92 void Fill2DHistogram(G4int histoId, G4double xValue, G4double yValue, G4double weight = 1.0);
93 void Fill3DHistogram(G4int histoId, G4double xValue, G4double yValue, G4double zValue, G4double weight = 1.0);
94 void Fill4DHistogram(G4int histoId, G4double xValue, G4double yValue, G4double zvalue, G4double eValue);
102 void Set4DHistogramBinContent(G4int histoId,
111 TH3D* otherHistogram);
112 void AccumulateHistogram4D(G4int histoId,
116 virtual void Flush();
136 std::vector<TH1D*> histograms1D;
137 std::vector<TH2D*> histograms2D;
138 std::vector<TH3D*> histograms3D;
139 std::vector<BDSBH4DBase*> histograms4D;
Base class for the 4D histogram classes.
Holder for a set of histograms to be stored.
std::vector< BDSBH4DBase * > & Get4DHistograms()
Accessors.
std::vector< TH2D * > & Get2DHistograms()
Accessors.
std::vector< TH3D * > & Get3DHistograms()
Accessors.
TH2D * Get2DHistogram(int iHisto) const
Accessors.
virtual void Flush()
Flush the contents.
std::vector< TH1D * > & Get1DHistograms()
Accessors.
void AccumulateHistogram3D(G4int histoId, TH3D *otherHistogram)
Add the values from one supplied 3D histogram to another. Uses TH3-Add().
BDSBH4DBase * Get4DHistogram(int iHisto) const
Accessors.
TH1D * Get1DHistogram(int iHisto) const
Accessors.
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.
void Fill(const BDSOutputROOTEventHistograms *rhs)
Copy (using the TH->Clone) method from another instance.
void FillSimple(const BDSOutputROOTEventHistograms *rhs)
Copy (without using the TH->Clone) method from another instance. (Quicker).
void Set3DHistogramBinContent(G4int histoId, G4int globalBinID, G4double value)
TH3D * Get3DHistogram(int iHisto) const
Accessors.