#include <EgammaTowerIsolation.h>
Public Types | |
enum | HcalDepth { AllDepths = -1, Undefined = 0, Depth1 = 1, Depth2 = 2 } |
Public Member Functions | |
EgammaTowerIsolation (float extRadiusI, float intRadiusI, float etLow, signed int depth, const CaloTowerCollection *towers) | |
double | getTowerESum (reco::SuperCluster const *sc, const std::vector< CaloTowerDetId > *detIdToExclude=0) const |
double | getTowerESum (const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=0) const |
double | getTowerEtSum (reco::SuperCluster const *sc, const std::vector< CaloTowerDetId > *detIdToExclude=0) const |
double | getTowerEtSum (const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=0) const |
Private Member Functions | |
double | getSum (bool et, reco::SuperCluster const &sc, const std::vector< CaloTowerDetId > *detIdToExclude) const |
Private Attributes | |
signed int | depth_ |
float | extRadius |
float | intRadius |
Static Private Attributes | |
static uint32_t | id15 = 0 |
static EgammaTowerIsolationNew< 1 > * | newAlgo = nullptr |
static const CaloTowerCollection * | oldTowers = nullptr |
Definition at line 200 of file EgammaTowerIsolation.h.
EgammaTowerIsolation::EgammaTowerIsolation | ( | float | extRadiusI, |
float | intRadiusI, | ||
float | etLow, | ||
signed int | depth, | ||
const CaloTowerCollection * | towers | ||
) |
Definition at line 30 of file EgammaTowerIsolation.cc.
References extRadius, id15, intRadius, newAlgo, EgammaTowerIsolationNew< NC >::nt, oldTowers, and edm::SortedCollection< T, SORT >::size().
: depth_(depth), extRadius(extRadiusI), intRadius(intRadiusI) { assert(0==etLow); // cheating (test of performance) if (newAlgo==nullptr || towers!=oldTowers || towers->size()!=newAlgo->nt || (towers->size()>15 && (*towers)[15].id()!=id15)) { delete newAlgo; newAlgo = new EgammaTowerIsolationNew<1>(&extRadius,&intRadius,*towers); oldTowers=towers; id15 = (*towers)[15].id(); } }
double EgammaTowerIsolation::getSum | ( | bool | et, |
reco::SuperCluster const & | sc, | ||
const std::vector< CaloTowerDetId > * | detIdToExclude | ||
) | const [private] |
Definition at line 51 of file EgammaTowerIsolation.cc.
References AllDepths, EgammaTowerIsolationNew< NC >::compute(), Depth1, Depth2, depth_, extRadius, EgammaTowerIsolationNew< NC >::h2, EgammaTowerIsolationNew< NC >::he, intRadius, newAlgo, and EgammaTowerIsolationNew< NC >::setRadius().
Referenced by getTowerESum(), and getTowerEtSum().
{ if (0!=detIdToExclude) assert(0==intRadius); // hack newAlgo->setRadius(&extRadius,&intRadius); EgammaTowerIsolationNew<1>::Sum sum; newAlgo->compute(et, sum, sc, (detIdToExclude==0) ? nullptr : &((*detIdToExclude).front()), (detIdToExclude==0) ? nullptr : (&(*detIdToExclude).back())+1 ); switch(depth_){ case AllDepths: return detIdToExclude==0 ? sum.he[0] : sum.heBC[0]; case Depth1: return detIdToExclude==0 ? sum.he[0]-sum.h2[0] : sum.heBC[0]-sum.h2BC[0]; case Depth2:return detIdToExclude==0 ? sum.h2[0] : sum.h2BC[0]; default: return 0; } return 0; }
double EgammaTowerIsolation::getTowerESum | ( | reco::SuperCluster const * | sc, |
const std::vector< CaloTowerDetId > * | detIdToExclude = 0 |
||
) | const [inline] |
Definition at line 223 of file EgammaTowerIsolation.h.
References getSum().
{ return getSum(false,*sc,detIdToExclude); }
double EgammaTowerIsolation::getTowerESum | ( | const reco::Candidate * | cand, |
const std::vector< CaloTowerDetId > * | detIdToExclude = 0 |
||
) | const [inline] |
Definition at line 216 of file EgammaTowerIsolation.h.
References reco::Candidate::get(), and getSum().
Referenced by ConversionTrackCandidateProducer::buildCollections(), ConvertedPhotonProducer::buildCollections(), PhotonProducer::fillPhotonCollection(), ElectronHcalHelper::hcalESumDepth1(), and ElectronHcalHelper::hcalESumDepth2().
{ reco::SuperCluster const & sc = *cand->get<reco::SuperClusterRef>().get(); return getSum(false,sc,detIdToExclude); }
double EgammaTowerIsolation::getTowerEtSum | ( | reco::SuperCluster const * | sc, |
const std::vector< CaloTowerDetId > * | detIdToExclude = 0 |
||
) | const [inline] |
Definition at line 220 of file EgammaTowerIsolation.h.
References getSum().
{ return getSum(true,*sc,detIdToExclude); }
double EgammaTowerIsolation::getTowerEtSum | ( | const reco::Candidate * | cand, |
const std::vector< CaloTowerDetId > * | detIdToExclude = 0 |
||
) | const [inline] |
Definition at line 212 of file EgammaTowerIsolation.h.
References reco::Candidate::get(), and getSum().
Referenced by PhotonIsolationCalculator::calculateHcalTowerIso(), GsfElectronAlgo::createElectron(), and EgammaHLTBcHcalIsolationProducersRegional::produce().
{ reco::SuperCluster const & sc = *cand->get<reco::SuperClusterRef>().get(); return getSum(true,sc,detIdToExclude); }
signed int EgammaTowerIsolation::depth_ [private] |
Definition at line 234 of file EgammaTowerIsolation.h.
Referenced by getSum().
float EgammaTowerIsolation::extRadius [private] |
Definition at line 235 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolation(), and getSum().
uint32_t EgammaTowerIsolation::id15 = 0 [static, private] |
Definition at line 233 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolation().
float EgammaTowerIsolation::intRadius [private] |
Definition at line 236 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolation(), and getSum().
EgammaTowerIsolationNew< 1 > * EgammaTowerIsolation::newAlgo = nullptr [static, private] |
Definition at line 231 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolation(), and getSum().
const CaloTowerCollection * EgammaTowerIsolation::oldTowers = nullptr [static, private] |
Definition at line 232 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolation().