#include <JetResolution.h>
Public Member Functions | |
void | initialize (const std::string &fileName, bool doGaussian=false) |
JetResolution () | |
JetResolution (const std::string &fileName, bool doGaussian=false) | |
const std::string & | name () const |
TF1 * | parameter (const std::string ¶meterName, const std::vector< float > &x) |
TF1 * | parameterEta (const std::string ¶meterName, float eta) |
double | parameterEtaEval (const std::string ¶meterName, float eta, float pt) |
const JetCorrectorParameters & | parameters (int i) const |
TF1 * | resolution (const std::vector< float > &x, const std::vector< float > &y) const |
TF1 * | resolutionEtaPt (float eta, float pt) const |
virtual | ~JetResolution () |
Private Attributes | |
std::string | name_ |
std::vector< TF1 * > | parameterFncs_ |
std::vector < JetCorrectorParameters * > | parameters_ |
TF1 * | resolutionFnc_ |
Definition at line 13 of file JetResolution.h.
JetResolution::JetResolution | ( | ) |
Definition at line 41 of file JetResolution.cc.
References resolutionFnc_.
: resolutionFnc_(0) { resolutionFnc_ = new TF1(); }
JetResolution::JetResolution | ( | const std::string & | fileName, |
bool | doGaussian = false |
||
) |
JetResolution::~JetResolution | ( | ) | [virtual] |
Definition at line 57 of file JetResolution.cc.
References i, parameterFncs_, parameters_, and resolutionFnc_.
{ delete resolutionFnc_; for (unsigned i=0;i<parameterFncs_.size();i++) delete parameterFncs_[i]; for (unsigned i=0;i<parameters_.size();i++) delete parameters_[i]; }
void JetResolution::initialize | ( | const std::string & | fileName, |
bool | doGaussian = false |
||
) |
const std::string& JetResolution::name | ( | ) | const [inline] |
TF1* JetResolution::parameter | ( | const std::string & | parameterName, |
const std::vector< float > & | x | ||
) |
Referenced by parameterEta().
TF1 * JetResolution::parameterEta | ( | const std::string & | parameterName, |
float | eta | ||
) |
Definition at line 146 of file JetResolution.cc.
References parameter(), and x.
Referenced by main().
{ vector<float> x; x.push_back(eta); return parameter(parameterName,x); }
double JetResolution::parameterEtaEval | ( | const std::string & | parameterName, |
float | eta, | ||
float | pt | ||
) |
Definition at line 182 of file JetResolution.cc.
References newFWLiteAna::bin, JetCorrectorParameters::binIndex(), JetCorrectorParameters::definitions(), cuy::ii, N, parameterFncs_, parameters_, JetCorrectorParameters::record(), JetCorrectorParameters::size(), and AlCaHLTBitMon_QueryRunRegistry::string.
{ TF1* func(0); JetCorrectorParameters* params(0); for (std::vector<TF1*>::size_type ifunc = 0; ifunc < parameterFncs_.size(); ++ifunc) { std::string fncname = parameterFncs_[ifunc]->GetName(); if ( !(fncname.find("f"+parameterName) == 0) ) continue; params = parameters_[ifunc]; func = (TF1*)parameterFncs_[ifunc]; break; } if (!func) edm::LogError("ParameterNotFound") << "JetResolution::parameterEtaEval(): no parameter \"" << parameterName << "\" found" << std::endl; std::vector<float> etas; etas.push_back(eta); int bin = params->binIndex(etas); if ( !(0 <= bin && bin < (int)params->size() ) ) edm::LogError("ParameterNotFound") << "JetResolution::parameterEtaEval(): bin out of range: " << bin << std::endl; const std::vector<float>& pars = params->record(bin).parameters(); int N = params->definitions().nParVar(); for (unsigned ii = 2*N; ii < pars.size(); ++ii) { func->SetParameter(ii-2*N, pars[ii]); } return func->Eval(pt); }
const JetCorrectorParameters& JetResolution::parameters | ( | int | i | ) | const [inline] |
Definition at line 40 of file JetResolution.h.
References i, and parameters_.
{ return *(parameters_[i]); }
TF1* JetResolution::resolution | ( | const std::vector< float > & | x, |
const std::vector< float > & | y | ||
) | const |
Referenced by resolutionEtaPt().
TF1 * JetResolution::resolutionEtaPt | ( | float | eta, |
float | pt | ||
) | const |
Definition at line 115 of file JetResolution.cc.
References resolution(), x, and detailsBasic3DVector::y.
Referenced by main().
{ vector<float> x; x.push_back(eta); vector<float> y; y.push_back(pt); return resolution(x,y); }
std::string JetResolution::name_ [private] |
Definition at line 47 of file JetResolution.h.
Referenced by name().
std::vector<TF1*> JetResolution::parameterFncs_ [private] |
Definition at line 49 of file JetResolution.h.
Referenced by PFClusterAlgo::parameter(), parameterEtaEval(), hitfit::LeptonTranslatorBase< AElectron >::resolution(), and ~JetResolution().
std::vector<JetCorrectorParameters*> JetResolution::parameters_ [private] |
Definition at line 50 of file JetResolution.h.
Referenced by PFClusterAlgo::parameter(), parameterEtaEval(), parameters(), hitfit::LeptonTranslatorBase< AElectron >::resolution(), and ~JetResolution().
TF1* JetResolution::resolutionFnc_ [mutable, private] |
Definition at line 48 of file JetResolution.h.
Referenced by JetResolution(), hitfit::LeptonTranslatorBase< AElectron >::resolution(), and ~JetResolution().