Generic container class. More...
#include <JetPlusTrackCorrector.h>
Public Types | |
typedef std::pair< uint16_t, double > | Pair |
Public Member Functions | |
void | addE (uint32_t eta_bin, uint32_t pt_bin, double energy) |
Efficiency (const jpt::Map &response, const jpt::Map &efficiency, const jpt::Map &leakage) | |
bool | empty () const |
double | inConeCorr (uint32_t eta_bin, uint32_t pt_bin) const |
uint32_t | nEtaBins () const |
uint32_t | nPtBins () const |
uint16_t | nTrks (uint32_t eta_bin, uint32_t pt_bin) const |
double | outOfConeCorr (uint32_t eta_bin, uint32_t pt_bin) const |
void | print () const |
void | reset () |
uint32_t | size () const |
Private Types | |
typedef std::vector< Pair > | VPair |
typedef std::vector< VPair > | VVPair |
Private Member Functions | |
bool | check (uint32_t eta_bin, uint32_t pt_bin, std::string name="check") const |
Efficiency () | |
double | meanE (uint32_t eta_bin, uint32_t pt_bin) const |
double | sumE (uint32_t eta_bin, uint32_t pt_bin) const |
Private Attributes | |
VVPair | data_ |
const jpt::Map & | efficiency_ |
const jpt::Map & | leakage_ |
const jpt::Map & | response_ |
Generic container class.
Definition at line 87 of file JetPlusTrackCorrector.h.
typedef std::pair<uint16_t,double> jpt::Efficiency::Pair |
Definition at line 95 of file JetPlusTrackCorrector.h.
typedef std::vector<Pair> jpt::Efficiency::VPair [private] |
Definition at line 122 of file JetPlusTrackCorrector.h.
typedef std::vector<VPair> jpt::Efficiency::VVPair [private] |
Definition at line 123 of file JetPlusTrackCorrector.h.
Efficiency::Efficiency | ( | const jpt::Map & | response, |
const jpt::Map & | efficiency, | ||
const jpt::Map & | leakage | ||
) |
Definition at line 1651 of file JetPlusTrackCorrector.cc.
References reset().
: response_(response), efficiency_(efficiency), leakage_(leakage) { reset(); }
jpt::Efficiency::Efficiency | ( | ) | [private] |
void Efficiency::addE | ( | uint32_t | eta_bin, |
uint32_t | pt_bin, | ||
double | energy | ||
) |
Definition at line 1711 of file JetPlusTrackCorrector.cc.
References check(), data_, and relval_parameters_module::energy.
Referenced by JetPlusTrackCorrector::calculateCorr().
bool Efficiency::check | ( | uint32_t | eta_bin, |
uint32_t | pt_bin, | ||
std::string | name = "check" |
||
) | const [private] |
Definition at line 1720 of file JetPlusTrackCorrector.cc.
References data_.
Referenced by addE(), inConeCorr(), meanE(), nTrks(), outOfConeCorr(), and sumE().
{ if ( eta_bin < data_.size() && pt_bin < ( data_.empty() ? 0 : data_[0].size() ) ) { return true; } else { // edm::LogWarning("JetPlusTrackCorrector") // << "[jpt::Efficiency::" << method << "]" // << " Trying to access element (" << eta_bin << "," << pt_bin << ")" // << " of a vector with size (" << data_.size() << "," << ( data_.empty() ? 0 : data_[0].size() ) << ")" // << "!"; return false; } }
bool jpt::Efficiency::empty | ( | void | ) | const [inline] |
double Efficiency::inConeCorr | ( | uint32_t | eta_bin, |
uint32_t | pt_bin | ||
) | const |
Definition at line 1663 of file JetPlusTrackCorrector.cc.
References check(), leakage_, outOfConeCorr(), response_, and jpt::Map::value().
Referenced by JetPlusTrackCorrector::pionEfficiency().
double Efficiency::meanE | ( | uint32_t | eta_bin, |
uint32_t | pt_bin | ||
) | const [private] |
Definition at line 1701 of file JetPlusTrackCorrector.cc.
References check(), data_, and tmp.
Referenced by outOfConeCorr().
uint32_t jpt::Efficiency::nEtaBins | ( | ) | const [inline] |
Definition at line 132 of file JetPlusTrackCorrector.h.
References jpt::Map::nEtaBins(), and response_.
uint32_t jpt::Efficiency::nPtBins | ( | ) | const [inline] |
Definition at line 133 of file JetPlusTrackCorrector.h.
References jpt::Map::nPtBins(), and response_.
uint16_t Efficiency::nTrks | ( | uint32_t | eta_bin, |
uint32_t | pt_bin | ||
) | const |
Definition at line 1685 of file JetPlusTrackCorrector.cc.
References check(), and data_.
Referenced by outOfConeCorr(), and JetPlusTrackCorrector::pionEfficiency().
double Efficiency::outOfConeCorr | ( | uint32_t | eta_bin, |
uint32_t | pt_bin | ||
) | const |
Definition at line 1673 of file JetPlusTrackCorrector.cc.
References check(), interpolateCardsSimple::eff, efficiency_, timingPdfMaker::mean, meanE(), nTrks(), and jpt::Map::value().
Referenced by inConeCorr(), and JetPlusTrackCorrector::pionEfficiency().
{ if ( check(eta_bin,pt_bin,__func__) ) { uint16_t ntrks = nTrks( eta_bin, pt_bin ); double mean = meanE( eta_bin, pt_bin ); double eff = ( 1. - efficiency_.value( eta_bin, pt_bin ) ) / efficiency_.value( eta_bin, pt_bin ); if ( !ntrks ) { return 0.; } return ( ntrks * eff * mean ); } else { return 0.; } }
void Efficiency::print | ( | void | ) | const |
Definition at line 1741 of file JetPlusTrackCorrector.cc.
References efficiency_, edm::isDebugEnabled(), leakage_, LogTrace, jpt::Map::print(), and response_.
{ if ( edm::isDebugEnabled() ) { std::stringstream ss; ss << "[jpt::Efficiency::" << __func__ << "]" << " Contents of maps:" << std::endl; ss << "Response map: " << std::endl; response_.print(ss); ss << "Efficiency map: " << std::endl; efficiency_.print(ss); ss << "Leakage map: " << std::endl; leakage_.print(ss); LogTrace("JetPlusTrackCorrector") << ss.str(); } }
void Efficiency::reset | ( | void | ) |
Definition at line 1734 of file JetPlusTrackCorrector.cc.
References data_, jpt::Map::nEtaBins(), jpt::Map::nPtBins(), and response_.
Referenced by JetPlusTrackCorrector::calculateCorr(), and Efficiency().
uint32_t jpt::Efficiency::size | ( | void | ) | const [inline] |
double Efficiency::sumE | ( | uint32_t | eta_bin, |
uint32_t | pt_bin | ||
) | const [private] |
VVPair jpt::Efficiency::data_ [private] |
const jpt::Map& jpt::Efficiency::efficiency_ [private] |
Definition at line 127 of file JetPlusTrackCorrector.h.
Referenced by outOfConeCorr(), and print().
const jpt::Map& jpt::Efficiency::leakage_ [private] |
Definition at line 128 of file JetPlusTrackCorrector.h.
Referenced by inConeCorr(), and print().
const jpt::Map& jpt::Efficiency::response_ [private] |
Definition at line 126 of file JetPlusTrackCorrector.h.
Referenced by inConeCorr(), nEtaBins(), nPtBins(), print(), and reset().