#include <MultipleScatteringX0Data.h>
Public Member Functions | |
float | maxEta () const |
float | minEta () const |
MultipleScatteringX0Data () | |
int | nBinsEta () const |
virtual float | sumX0atEta (float eta, float r) const |
virtual | ~MultipleScatteringX0Data () |
Private Member Functions | |
std::string | fileName () |
Private Attributes | |
TH2F * | theData |
TFile * | theFile |
Definition at line 17 of file MultipleScatteringX0Data.h.
MultipleScatteringX0Data::MultipleScatteringX0Data | ( | ) |
Definition at line 16 of file MultipleScatteringX0Data.cc.
References Exception, fileName(), lut2db_cfg::filename, theData, and theFile.
: theFile(0), theData(0) { string filename = fileName(); theFile = new TFile(filename.c_str(),"READ"); if (theFile) { theData = dynamic_cast<TH2F*> (theFile->GetKey("h100")->ReadObj()); } if (!theData) { throw cms::Exception("Data not found") << " ** MultipleScatteringX0Data ** file: " << filename <<" <-- no data found!!!"; } }
MultipleScatteringX0Data::~MultipleScatteringX0Data | ( | ) | [virtual] |
string MultipleScatteringX0Data::fileName | ( | ) | [private] |
Definition at line 40 of file MultipleScatteringX0Data.cc.
References f, and edm::FileInPath::fullPath().
Referenced by MultipleScatteringX0Data().
{ string defName="RecoTracker/TkMSParametrization/data/MultipleScatteringX0Data.root"; edm::FileInPath f(defName); return f.fullPath(); }
float MultipleScatteringX0Data::maxEta | ( | ) | const |
Definition at line 59 of file MultipleScatteringX0Data.cc.
References theData.
Referenced by MSLayersKeeperX0AtEta::init().
float MultipleScatteringX0Data::minEta | ( | ) | const |
Definition at line 53 of file MultipleScatteringX0Data.cc.
References theData.
int MultipleScatteringX0Data::nBinsEta | ( | ) | const |
Definition at line 47 of file MultipleScatteringX0Data.cc.
References theData.
Referenced by MSLayersKeeperX0AtEta::init().
float MultipleScatteringX0Data::sumX0atEta | ( | float | eta, |
float | r | ||
) | const [virtual] |
Implements SumX0AtEtaDataProvider.
Definition at line 65 of file MultipleScatteringX0Data.cc.
References theData.
{ if(!theData) return 0.; eta = fabs(eta); int ieta = theData->GetXaxis()->FindBin(eta); int irad = theData->GetYaxis()->FindBin(r); if (irad < theData->GetNbinsY()) { return theData->GetBinContent(ieta,irad); } else { float sumX0 = 0; for(int ir = theData->GetNbinsY(); ir > 0; ir--) { float val = theData->GetBinContent(ieta, ir); if (val > sumX0) sumX0 = val; } return sumX0; } }
TH2F* MultipleScatteringX0Data::theData [private] |
Definition at line 31 of file MultipleScatteringX0Data.h.
Referenced by maxEta(), minEta(), MultipleScatteringX0Data(), nBinsEta(), and sumX0atEta().
TFile* MultipleScatteringX0Data::theFile [private] |
Definition at line 30 of file MultipleScatteringX0Data.h.
Referenced by MultipleScatteringX0Data(), and ~MultipleScatteringX0Data().