#include <EgammaTowerIsolation.h>
Public Types | |
enum | HcalDepth { AllDepths = -1, Undefined = 0, Depth1 = 1, Depth2 = 2 } |
Public Member Functions | |
EgammaTowerIsolation (double extRadius, double intRadius, double etLow, signed int depth, const CaloTowerCollection *) | |
int | getNumberTracks (const reco::Candidate *) const |
double | getTowerESum (const reco::Candidate *, const std::vector< CaloTowerDetId > *detIdToExclude=0) const |
double | getTowerESum (const reco::SuperCluster *, const std::vector< CaloTowerDetId > *detIdToExclude=0) const |
double | getTowerEtSum (const reco::SuperCluster *, const std::vector< CaloTowerDetId > *detIdToExclude=0) const |
double | getTowerEtSum (const reco::Candidate *, const std::vector< CaloTowerDetId > *detIdToExclude=0) const |
~EgammaTowerIsolation () | |
Private Attributes | |
signed int | depth_ |
double | etLow_ |
double | extRadius_ |
double | intRadius_ |
const CaloTowerCollection * | towercollection_ |
Definition at line 26 of file EgammaTowerIsolation.h.
EgammaTowerIsolation::EgammaTowerIsolation | ( | double | extRadius, |
double | intRadius, | ||
double | etLow, | ||
signed int | depth, | ||
const CaloTowerCollection * | towercollection | ||
) |
Definition at line 27 of file EgammaTowerIsolation.cc.
: extRadius_(extRadius), intRadius_(intRadius), etLow_(etLow), depth_(depth), towercollection_(towercollection) { }
EgammaTowerIsolation::~EgammaTowerIsolation | ( | ) |
Definition at line 40 of file EgammaTowerIsolation.cc.
{ }
int EgammaTowerIsolation::getNumberTracks | ( | const reco::Candidate * | ) | const |
double EgammaTowerIsolation::getTowerESum | ( | const reco::SuperCluster * | sc, |
const std::vector< CaloTowerDetId > * | detIdToExclude = 0 |
||
) | const |
Definition at line 107 of file EgammaTowerIsolation.cc.
References AllDepths, edm::SortedCollection< T, SORT >::begin(), HLTFastRecoForTau_cff::deltaEta, SiPixelRawToDigiRegional_cfi::deltaPhi, Depth1, Depth2, depth_, edm::SortedCollection< T, SORT >::end(), reco::CaloCluster::eta(), etLow_, Exception, extRadius_, spr::find(), intRadius_, M_PI, reco::CaloCluster::phi(), funct::sin(), towercollection_, and Geom::twoPi().
{ double candEta=sc->eta(); double candPhi=sc->phi(); double eSum =0.; //loop over towers for(CaloTowerCollection::const_iterator trItr = towercollection_->begin(); trItr != towercollection_->end(); ++trItr){ // skip the towers to exclude if( detIdToExclude ) { std::vector<CaloTowerDetId>::const_iterator itcheck=find(detIdToExclude->begin(),detIdToExclude->end(),trItr->id()); if (itcheck != detIdToExclude->end()) continue; } double this_e=0; switch(depth_){ case AllDepths: this_e = trItr->hadEnergy();break; case Depth1: this_e = trItr->ietaAbs()<18 || trItr->ietaAbs()>29 ? trItr->hadEnergy() : trItr->hadEnergyHeInnerLayer();break; case Depth2: this_e = trItr->hadEnergyHeOuterLayer();break; default: throw cms::Exception("Configuration Error") << "EgammaTowerIsolation: Depth " << depth_ << " not known. "; break; } if ( this_e*sin(trItr->p4().theta()) < etLow_ ) continue ; double towerEta=trItr->eta(); double towerPhi=trItr->phi(); double twoPi= 2*M_PI; if(towerPhi<0) towerPhi+=twoPi; if(candPhi<0) candPhi+=twoPi; double deltaPhi=fabs(towerPhi-candPhi); if(deltaPhi>twoPi) deltaPhi-=twoPi; if(deltaPhi>M_PI) deltaPhi=twoPi-deltaPhi; double deltaEta = towerEta - candEta; double dr = deltaEta*deltaEta + deltaPhi*deltaPhi; if( dr < extRadius_*extRadius_ && dr >= intRadius_*intRadius_ ) { eSum += this_e; } }//end loop over tracks return eSum; }
double EgammaTowerIsolation::getTowerESum | ( | const reco::Candidate * | photon, |
const std::vector< CaloTowerDetId > * | detIdToExclude = 0 |
||
) | const |
Definition at line 102 of file EgammaTowerIsolation.cc.
References reco::Candidate::get(), and edm::Ref< C, T, F >::get().
Referenced by ConversionTrackCandidateProducer::buildCollections(), ConvertedPhotonProducer::buildCollections(), PhotonProducer::fillPhotonCollection(), ElectronHcalHelper::hcalESumDepth1(), and ElectronHcalHelper::hcalESumDepth2().
{ return getTowerESum( photon->get<reco::SuperClusterRef>().get(), detIdToExclude ); }
double EgammaTowerIsolation::getTowerEtSum | ( | const reco::SuperCluster * | sc, |
const std::vector< CaloTowerDetId > * | detIdToExclude = 0 |
||
) | const |
Definition at line 52 of file EgammaTowerIsolation.cc.
References AllDepths, edm::SortedCollection< T, SORT >::begin(), HLTFastRecoForTau_cff::deltaEta, SiPixelRawToDigiRegional_cfi::deltaPhi, Depth1, Depth2, depth_, edm::SortedCollection< T, SORT >::end(), reco::CaloCluster::eta(), etLow_, Exception, extRadius_, spr::find(), intRadius_, M_PI, reco::CaloCluster::phi(), funct::sin(), towercollection_, and Geom::twoPi().
{ double candEta=sc->eta(); double candPhi=sc->phi(); double ptSum =0.; //loop over towers for(CaloTowerCollection::const_iterator trItr = towercollection_->begin(); trItr != towercollection_->end(); ++trItr){ // skip the towers to exclude if ( detIdToExclude ) { std::vector<CaloTowerDetId>::const_iterator itcheck=find(detIdToExclude->begin(),detIdToExclude->end(),trItr->id()); if (itcheck != detIdToExclude->end()) continue; } double this_pt=0; switch(depth_){ case AllDepths: this_pt = trItr->hadEt();break; case Depth1: this_pt = trItr->ietaAbs()<18 || trItr->ietaAbs()>29 ? trItr->hadEt() : trItr->hadEnergyHeInnerLayer()*sin(trItr->p4().theta());break; case Depth2: this_pt = trItr->hadEnergyHeOuterLayer()*sin(trItr->p4().theta());break; default: throw cms::Exception("Configuration Error") << "EgammaTowerIsolation: Depth " << depth_ << " not known. "; break; } if ( this_pt < etLow_ ) continue ; double towerEta=trItr->eta(); double towerPhi=trItr->phi(); double twoPi= 2*M_PI; if(towerPhi<0) towerPhi+=twoPi; if(candPhi<0) candPhi+=twoPi; double deltaPhi=fabs(towerPhi-candPhi); if(deltaPhi>twoPi) deltaPhi-=twoPi; if(deltaPhi>M_PI) deltaPhi=twoPi-deltaPhi; double deltaEta = towerEta - candEta; double dr = deltaEta*deltaEta + deltaPhi*deltaPhi; if( dr < extRadius_*extRadius_ && dr >= intRadius_*intRadius_ ) { ptSum += this_pt ; } }//end loop over tracks return ptSum ; }
double EgammaTowerIsolation::getTowerEtSum | ( | const reco::Candidate * | photon, |
const std::vector< CaloTowerDetId > * | detIdToExclude = 0 |
||
) | const |
Definition at line 47 of file EgammaTowerIsolation.cc.
References reco::Candidate::get(), and edm::Ref< C, T, F >::get().
Referenced by PhotonIsolationCalculator::calculateHcalTowerIso(), GsfElectronAlgo::createElectron(), and EgammaHLTBcHcalIsolationProducersRegional::produce().
{ return getTowerEtSum( photon->get<reco::SuperClusterRef>().get(), detIdToExclude ); }
signed int EgammaTowerIsolation::depth_ [private] |
Definition at line 53 of file EgammaTowerIsolation.h.
Referenced by getTowerESum(), and getTowerEtSum().
double EgammaTowerIsolation::etLow_ [private] |
Definition at line 52 of file EgammaTowerIsolation.h.
Referenced by getTowerESum(), and getTowerEtSum().
double EgammaTowerIsolation::extRadius_ [private] |
Definition at line 50 of file EgammaTowerIsolation.h.
Referenced by getTowerESum(), and getTowerEtSum().
double EgammaTowerIsolation::intRadius_ [private] |
Definition at line 51 of file EgammaTowerIsolation.h.
Referenced by getTowerESum(), and getTowerEtSum().
const CaloTowerCollection* EgammaTowerIsolation::towercollection_ [private] |
Definition at line 55 of file EgammaTowerIsolation.h.
Referenced by getTowerESum(), and getTowerEtSum().