#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 |
double | getTowerESum (const reco::SuperCluster *) const |
double | getTowerEtSum (const reco::SuperCluster *) const |
double | getTowerEtSum (const reco::Candidate *) const |
~EgammaTowerIsolation () | |
Private Attributes | |
signed int | depth_ |
double | etLow_ |
double | extRadius_ |
double | intRadius_ |
const CaloTowerCollection * | towercollection_ |
Definition at line 25 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 |
Definition at line 102 of file EgammaTowerIsolation.cc.
References AllDepths, edm::SortedCollection< T, SORT >::begin(), Geom::deltaPhi(), Depth1, Depth2, depth_, edm::SortedCollection< T, SORT >::end(), reco::CaloCluster::eta(), etLow_, Exception, extRadius_, intRadius_, M_PI, reco::CaloCluster::phi(), reco::CaloCluster::position(), funct::sin(), towercollection_, and Geom::twoPi().
{ math::XYZPoint theCaloPosition = sc->position(); double candEta=sc->eta(); double candPhi=sc->phi(); double eSum =0.; //loop over tracks for(CaloTowerCollection::const_iterator trItr = towercollection_->begin(); trItr != towercollection_->end(); ++trItr){ 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 |
Definition at line 97 of file EgammaTowerIsolation.cc.
References reco::Candidate::get(), and edm::Ref< C, T, F >::get().
Referenced by ConversionTrackCandidateProducer::buildCollections(), ConvertedPhotonProducer::buildCollections(), PFPhotonTranslator::createPhotons(), PhotonProducer::fillPhotonCollection(), ElectronHcalHelper::hcalESumDepth1(), and ElectronHcalHelper::hcalESumDepth2().
{ return getTowerESum( photon->get<reco::SuperClusterRef>().get() ); }
double EgammaTowerIsolation::getTowerEtSum | ( | const reco::SuperCluster * | sc | ) | const |
Definition at line 52 of file EgammaTowerIsolation.cc.
References AllDepths, edm::SortedCollection< T, SORT >::begin(), Geom::deltaPhi(), Depth1, Depth2, depth_, edm::SortedCollection< T, SORT >::end(), reco::CaloCluster::eta(), etLow_, Exception, extRadius_, intRadius_, M_PI, reco::CaloCluster::phi(), reco::CaloCluster::position(), funct::sin(), towercollection_, and Geom::twoPi().
{ math::XYZPoint theCaloPosition = sc->position(); double candEta=sc->eta(); double candPhi=sc->phi(); double ptSum =0.; //loop over tracks for(CaloTowerCollection::const_iterator trItr = towercollection_->begin(); trItr != towercollection_->end(); ++trItr){ 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 |
Definition at line 47 of file EgammaTowerIsolation.cc.
References reco::Candidate::get(), and edm::Ref< C, T, F >::get().
Referenced by PhotonIsolationCalculator::calculateHcalTowerIso(), and GsfElectronAlgo::createElectron().
{ return getTowerEtSum( photon->get<reco::SuperClusterRef>().get() ); }
signed int EgammaTowerIsolation::depth_ [private] |
Definition at line 52 of file EgammaTowerIsolation.h.
Referenced by getTowerESum(), and getTowerEtSum().
double EgammaTowerIsolation::etLow_ [private] |
Definition at line 51 of file EgammaTowerIsolation.h.
Referenced by getTowerESum(), and getTowerEtSum().
double EgammaTowerIsolation::extRadius_ [private] |
Definition at line 49 of file EgammaTowerIsolation.h.
Referenced by getTowerESum(), and getTowerEtSum().
double EgammaTowerIsolation::intRadius_ [private] |
Definition at line 50 of file EgammaTowerIsolation.h.
Referenced by getTowerESum(), and getTowerEtSum().
const CaloTowerCollection* EgammaTowerIsolation::towercollection_ [private] |
Definition at line 54 of file EgammaTowerIsolation.h.
Referenced by getTowerESum(), and getTowerEtSum().