14 TFile * myFile = TFile::Open( myDataFile.fullPath().c_str() );
17 auto obj = myFile->Get( histogramName.c_str() );
22 <<
"Histogram \"" << histogramName
23 <<
"\" not found in file \"" << fileName
26 h3_ =
new TH3F( *((TH3F*)
obj) );
36 float r = simE / genE;
41 && genE >
h3_->GetXaxis()->GetXmin()
42 && genE <
h3_->GetXaxis()->GetXmax()
43 && genEta >
h3_->GetYaxis()->GetXmin()
44 && genEta <
h3_->GetYaxis()->GetXmax()
45 && r <
h3_->GetZaxis()->GetXmax()
46 && r >
h3_->GetZaxis()->GetXmax() ) {
48 scale =
h3_->Interpolate( genE, genEta, r );
52 int binE =
h3_->GetXaxis()->FindFixBin( genE );
53 int binEta =
h3_->GetYaxis()->FindFixBin( genEta );
56 auto binWidthR =
h3_->GetZaxis()->GetBinWidth(0);
57 int binRup =
h3_->GetZaxis()->FindFixBin( r + binWidthR/2. );
58 int binRdn =
h3_->GetZaxis()->FindFixBin( r - binWidthR/2. );
60 auto scaleUp =
h3_->GetBinContent( binE, binEta, binRup );
61 auto scaleDn =
h3_->GetBinContent( binE, binEta, binRdn );
64 auto Rdn =
h3_->GetZaxis()->GetBinCenter( binRdn );
65 scale = scaleDn + (scaleUp-scaleDn) * ( r - Rdn ) / binWidthR;
T getUntrackedParameter(std::string const &, T const &) const
KKCorrectionFactors(const edm::ParameterSet &pset)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
float getScale(float genEnergy, float genEta, float simEnergy) const