19 #include "Utilities/func/MathUtil.h" 22 #include "TGeoManager.h" 34 : fEmptyLongHist(0), fEmptyTransHist(0)
44 for (
int iXYRegion = 0; iXYRegion <
kNumXYRegion; iXYRegion++) {
45 for (
int iEnergyBin = 0; iEnergyBin <
kNumEnergyBin; iEnergyBin++) {
84 TFile* fDistFile =
new TFile(filePath.c_str(),
"READ");
95 if(h->GetEntries() == 0){
105 (h->GetNbinsX() != ret->GetNbinsX() ||
106 h->GetXaxis()->GetXmin() != ret->GetXaxis()->GetXmin() ||
107 h->GetXaxis()->GetXmax() != ret->GetXaxis()->GetXmax())){
108 std::cout <<
"Error in DedxDistribution::TH1DToTH1F. " 109 <<
"Cached empty " << (trans ?
"transverse" :
"longitudinal")
110 <<
" histogram binning does not match loaded histogram. " 111 << ret->GetNbinsX() <<
" bins from " 112 << ret->GetXaxis()->GetXmin() <<
" to " 113 << ret->GetXaxis()->GetXmax() <<
" vs " 114 << h->GetNbinsX() <<
" bins from " 115 << h->GetXaxis()->GetXmin() <<
" to " 116 << h->GetXaxis()->GetXmax() <<
std::endl;
129 TH1F*
ret =
new TH1F(h->GetName(),
132 h->GetXaxis()->GetXmin(),
133 h->GetXaxis()->GetXmax());
136 for(
int i = 0;
i < h->GetNbinsX() + 2; ++
i){
137 ret->SetBinContent(
i, h->GetBinContent(
i));
142 ret->SetEntries(h->GetEntries());
143 ret->SetDirectory(0);
149 if(ret->GetEntries() == 0){
178 for (
int iXYRegion = 0; iXYRegion <
kNumXYRegion; iXYRegion++) {
179 for (
int iEnergyBin = 0; iEnergyBin <
kNumEnergyBin; iEnergyBin++) {
186 for (
int iXYRegion = 0; iXYRegion <
kNumXYRegion; iXYRegion++) {
187 for (
int iEnergyBin = 0; iEnergyBin <
kNumEnergyBin; iEnergyBin++) {
190 sprintf(cht,
"ht_%d_%d_%d", iXYRegion, iEnergyBin, iPlane);
206 for (
int iXYRegion = 0; iXYRegion <
kNumXYRegion; iXYRegion++) {
207 for (
int iEnergyBin = 0; iEnergyBin <
kNumEnergyBin; iEnergyBin++) {
210 sprintf(cht,
"httrans_%d_%d_%d", iXYRegion, iEnergyBin, iPlane);
void Initialize(const fhicl::ParameterSet &pset, std::string fileNameFclTag)
Load the histogram files.
void LoadHistFromFile(std::string filePath)
static const int kNumTransversePlane
Number of "transverse" planes considered for dE/dx histograms ("planes" transverse to shower axis)...
unsigned fHtExpPlane[kNumXYRegion][kNumEnergyBin]
Need to look up what this in in JM's code and give it a more descriptive name (expected hits...
This is a helper class for ParticleIDAlg that provides a tidy structure in which to hold the dE/dx hi...
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
TH1F * GetLongitudinalPlaneHitDedxHist(int iXYRegion, int iEnergyBin, int iLongitudinalPlane)
Longitudinal plane hit dE/dx.
static const int kNumXYRegion
Number of XY regions into which detector is divided for dE/dx histograms.
TH1F * TH1DToTH1F(TH1D *h, bool trans)
T get(std::string const &key) const
bool LoadDedxHistograms(TFile *fDistFile)
Load all of the histograms from the file into arrays of TH1F* objects. The details of handling the hi...
static const int kNumEnergyBin
Number of energy bins into which detector is divided for dE/dx histograms.
TH1F * fTransversePlaneCellDedx[kNumXYRegion][kNumEnergyBin][kNumTransversePlane]
Transverse plane hit dE/dx.
Build slid::LID objects to store electron ID, if asked for, otherwise, calculate LID info and make av...
static const int kNumLongitudinalPlane
Number of longitudinal planes considered for dE/dx histograms.
TH1F * GetTransversePlaneCellDedxHist(int iXYRegion, int iEnergyBin, int iTransversePlane)
Transverse plane hit dE/dx ("planes" transverse to shower axis).
TH1F * fLongitudinalPlaneHitDedx[kNumXYRegion][kNumEnergyBin][kNumLongitudinalPlane]
Longitudinal plane hit dE/dx.