![]() |
![]() |
#include <RecoEgamma/EgammaIsolationAlgos/interface/EgammaRecHitIsolation.h>
Public Member Functions | |
EgammaRecHitIsolation (double extRadius, double intRadius, double etaSlice, double etLow, edm::ESHandle< CaloGeometry >, CaloRecHitMetaCollectionV *, DetId::Detector detector) | |
double | getEnergySum (const reco::Candidate *emObject) const |
double | getEtSum (const reco::Candidate *emObject) const |
~EgammaRecHitIsolation () | |
Private Member Functions | |
double | getSum_ (const reco::Candidate *, bool returnEt) const |
Private Attributes | |
CaloRecHitMetaCollectionV * | caloHits_ |
CaloDualConeSelector * | doubleConeSel_ [2] |
double | etaSlice_ |
double | etLow_ |
double | extRadius_ |
double | intRadius_ |
edm::ESHandle< CaloGeometry > | theCaloGeom_ |
Definition at line 23 of file EgammaRecHitIsolation.h.
EgammaRecHitIsolation::EgammaRecHitIsolation | ( | double | extRadius, | |
double | intRadius, | |||
double | etaSlice, | |||
double | etLow, | |||
edm::ESHandle< CaloGeometry > | theCaloGeom, | |||
CaloRecHitMetaCollectionV * | caloHits, | |||
DetId::Detector | detector | |||
) |
Definition at line 30 of file EgammaRecHitIsolation.cc.
References doubleConeSel_, DetId::Ecal, EcalBarrel, EcalEndcap, extRadius_, intRadius_, NULL, edm::ESHandle< T >::product(), and theCaloGeom_.
00036 : 00037 extRadius_(extRadius), 00038 intRadius_(intRadius), 00039 etaSlice_(etaSlice), 00040 etLow_(etLow), 00041 theCaloGeom_(theCaloGeom) , 00042 caloHits_(caloHits) 00043 { 00044 //set up the geometry and selector 00045 const CaloGeometry* caloGeom = theCaloGeom_.product(); 00046 //special case to avoid slow preshower 00047 if(detector == DetId::Ecal ){ 00048 doubleConeSel_[0] = new CaloDualConeSelector (intRadius_ ,extRadius_, caloGeom, detector, EcalEndcap); 00049 doubleConeSel_[1] = new CaloDualConeSelector (intRadius_ ,extRadius_, caloGeom, detector, EcalBarrel); 00050 }else{ 00051 doubleConeSel_[0] = new CaloDualConeSelector (intRadius_ ,extRadius_, caloGeom, detector); 00052 doubleConeSel_[1] = NULL; 00053 } 00054 }
EgammaRecHitIsolation::~EgammaRecHitIsolation | ( | ) |
Definition at line 56 of file EgammaRecHitIsolation.cc.
References doubleConeSel_, and i.
00057 { 00058 for(int i=0; i<=1 ; i++){ 00059 if(doubleConeSel_[i]){ 00060 delete doubleConeSel_[i]; 00061 } 00062 } 00063 }
double EgammaRecHitIsolation::getEnergySum | ( | const reco::Candidate * | emObject | ) | const [inline] |
Definition at line 36 of file EgammaRecHitIsolation.h.
References getSum_().
Referenced by EgammaHLTEcalRecIsolationProducer::produce(), and EgammaEcalRecHitIsolationProducer::produce().
00036 { return getSum_(emObject,false);}
double EgammaRecHitIsolation::getEtSum | ( | const reco::Candidate * | emObject | ) | const [inline] |
Definition at line 35 of file EgammaRecHitIsolation.h.
References getSum_().
Referenced by PhotonIDAlgo::calculateEcalRecHitIso(), PhotonIDAlgo::calculateHcalRecHitIso(), egammaisolation::EgammaRecHitExtractor::deposit(), egammaisolation::EgammaHcalExtractor::deposit(), egammaisolation::EgammaTrackExtractor::deposit(), EgammaHLTEcalRecIsolationProducer::produce(), and EgammaEcalRecHitIsolationProducer::produce().
00035 {return getSum_(emObject,true);}
double EgammaRecHitIsolation::getSum_ | ( | const reco::Candidate * | emObject, | |
bool | returnEt | |||
) | const [private] |
Definition at line 65 of file EgammaRecHitIsolation.cc.
References caloHits_, doubleConeSel_, HcalDataFrameFilter_impl::energySum(), eta, etaSlice_, etLow_, funct::exp(), reco::Candidate::get(), edm::Ref< C, T, F >::get(), CaloGeometry::getPosition(), i, edm::ESHandle< T >::product(), CaloDualConeSelector::select(), funct::sin(), and theCaloGeom_.
Referenced by getEnergySum(), and getEtSum().
00066 { 00067 00068 double energySum = 0.; 00069 if (caloHits_){ 00070 for(int selnr=0; selnr<=1 ; selnr++){ 00071 if(doubleConeSel_[selnr]){ 00072 //Take the SC position 00073 reco::SuperClusterRef sc = emObject->get<reco::SuperClusterRef>(); 00074 math::XYZPoint theCaloPosition = sc.get()->position(); 00075 00076 GlobalPoint pclu (theCaloPosition.x () , 00077 theCaloPosition.y () , 00078 theCaloPosition.z () ); 00079 //Compute the energy in a cone of 0.4 radius 00080 std::auto_ptr<CaloRecHitMetaCollectionV> chosen = doubleConeSel_[selnr]->select(pclu,*caloHits_); 00081 for (CaloRecHitMetaCollectionV::const_iterator i = chosen->begin () ; 00082 i!= chosen->end () ; 00083 ++i) 00084 { 00085 double eta = theCaloGeom_.product()->getPosition(i->detid()).eta(); 00086 double etaDiff = eta - pclu.eta(); 00087 // std::cout << " EgammaRecHitIsolation::getSum_ eta rec hit " << eta << " eta clus " << pclu.eta() << " diff " << etaDiff << std::endl; 00088 if ( fabs(etaDiff) < etaSlice_) continue; 00089 00090 double et = i->energy()*sin(2*atan(exp(-eta))); 00091 if ( et > etLow_){ 00092 if(returnEt) energySum+=et; 00093 else energySum+=i->energy(); 00094 } 00095 } 00096 00097 } 00098 } 00099 } 00100 return energySum; 00101 }
CaloDualConeSelector* EgammaRecHitIsolation::doubleConeSel_[2] [private] |
Definition at line 53 of file EgammaRecHitIsolation.h.
Referenced by EgammaRecHitIsolation(), getSum_(), and ~EgammaRecHitIsolation().
double EgammaRecHitIsolation::etaSlice_ [private] |
double EgammaRecHitIsolation::etLow_ [private] |
double EgammaRecHitIsolation::extRadius_ [private] |
double EgammaRecHitIsolation::intRadius_ [private] |
Definition at line 50 of file EgammaRecHitIsolation.h.
Referenced by EgammaRecHitIsolation(), and getSum_().