#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTEcalRecIsolationProducer.h>
Public Member Functions | |
EgammaHLTEcalRecIsolationProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~EgammaHLTEcalRecIsolationProducer () | |
Private Attributes | |
edm::ParameterSet | conf_ |
edm::InputTag | ecalBarrelRecHitCollection_ |
edm::InputTag | ecalBarrelRecHitProducer_ |
edm::InputTag | ecalEndcapRecHitCollection_ |
edm::InputTag | ecalEndcapRecHitProducer_ |
double | egIsoConeSizeInBarrel_ |
double | egIsoConeSizeInEndcap_ |
double | egIsoConeSizeOut_ |
double | egIsoEMinBarrel_ |
double | egIsoEMinEndcap_ |
double | egIsoJurassicWidth_ |
double | egIsoPtMinBarrel_ |
double | egIsoPtMinEndcap_ |
edm::InputTag | recoEcalCandidateProducer_ |
bool | subtract_ |
bool | tryBoth_ |
bool | useIsolEt_ |
Definition at line 33 of file EgammaHLTEcalRecIsolationProducer.h.
EgammaHLTEcalRecIsolationProducer::EgammaHLTEcalRecIsolationProducer | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 40 of file EgammaHLTEcalRecIsolationProducer.cc.
References conf_, ecalBarrelRecHitCollection_, ecalBarrelRecHitProducer_, ecalEndcapRecHitCollection_, ecalEndcapRecHitProducer_, egIsoConeSizeInBarrel_, egIsoConeSizeInEndcap_, egIsoConeSizeOut_, egIsoEMinBarrel_, egIsoEMinEndcap_, egIsoJurassicWidth_, egIsoPtMinBarrel_, egIsoPtMinEndcap_, edm::ParameterSet::getParameter(), recoEcalCandidateProducer_, subtract_, tryBoth_, and useIsolEt_.
00040 : conf_(config) 00041 { 00042 // use configuration file to setup input/output collection names 00043 //inputs 00044 recoEcalCandidateProducer_ = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer"); 00045 ecalBarrelRecHitProducer_ = conf_.getParameter<edm::InputTag>("ecalBarrelRecHitProducer"); 00046 ecalBarrelRecHitCollection_ = conf_.getParameter<edm::InputTag>("ecalBarrelRecHitCollection"); 00047 ecalEndcapRecHitProducer_ = conf_.getParameter<edm::InputTag>("ecalEndcapRecHitProducer"); 00048 ecalEndcapRecHitCollection_ = conf_.getParameter<edm::InputTag>("ecalEndcapRecHitCollection"); 00049 00050 //vetos 00051 egIsoPtMinBarrel_ = conf_.getParameter<double>("etMinBarrel"); 00052 egIsoEMinBarrel_ = conf_.getParameter<double>("eMinBarrel"); 00053 egIsoPtMinEndcap_ = conf_.getParameter<double>("etMinEndcap"); 00054 egIsoEMinEndcap_ = conf_.getParameter<double>("eMinEndcap"); 00055 egIsoConeSizeInBarrel_ = conf_.getParameter<double>("intRadiusBarrel"); 00056 egIsoConeSizeInEndcap_ = conf_.getParameter<double>("intRadiusEndcap"); 00057 egIsoConeSizeOut_ = conf_.getParameter<double>("extRadius"); 00058 egIsoJurassicWidth_ = conf_.getParameter<double>("jurassicWidth"); 00059 00060 00061 // options 00062 useIsolEt_ = conf_.getParameter<bool>("useIsolEt"); 00063 tryBoth_ = conf_.getParameter<bool>("tryBoth"); 00064 subtract_ = conf_.getParameter<bool>("subtract"); 00065 00066 //register your products 00067 produces < reco::RecoEcalCandidateIsolationMap >(); 00068 00069 }
EgammaHLTEcalRecIsolationProducer::~EgammaHLTEcalRecIsolationProducer | ( | ) |
void EgammaHLTEcalRecIsolationProducer::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 75 of file EgammaHLTEcalRecIsolationProducer.cc.
References begin, DetId::Ecal, ecalBarrelRecHitCollection_, ecalBarrelRecHitProducer_, ecalEndcapRecHitCollection_, ecalEndcapRecHitProducer_, egIsoConeSizeInBarrel_, egIsoConeSizeInEndcap_, egIsoConeSizeOut_, egIsoJurassicWidth_, egIsoPtMinBarrel_, egIsoPtMinEndcap_, funct::exp(), edm::EventSetup::get(), edm::Ref< C, T, F >::get(), edm::Event::getByLabel(), EgammaRecHitIsolation::getEnergySum(), EgammaRecHitIsolation::getEtSum(), edm::AssociationMap< Tag >::insert(), edm::InputTag::label(), edm::ESHandle< T >::product(), edm::Event::put(), recoEcalCandidateProducer_, funct::sin(), subtract_, tryBoth_, and useIsolEt_.
00075 { 00076 00077 // Get the RecoEcalCandidate Collection 00078 edm::Handle<reco::RecoEcalCandidateCollection> recoecalcandHandle; 00079 iEvent.getByLabel(recoEcalCandidateProducer_,recoecalcandHandle); 00080 00081 // Next get Ecal hits barrel 00082 edm::Handle<EcalRecHitCollection> ecalBarrelRecHitHandle; //EcalRecHitCollection is a typedef to 00083 iEvent.getByLabel(ecalBarrelRecHitProducer_.label(),ecalBarrelRecHitCollection_.label(), ecalBarrelRecHitHandle); 00084 00085 // Next get Ecal hits endcap 00086 edm::Handle<EcalRecHitCollection> ecalEndcapRecHitHandle; 00087 iEvent.getByLabel(ecalEndcapRecHitProducer_.label(), ecalEndcapRecHitCollection_.label(),ecalEndcapRecHitHandle); 00088 00089 //create the meta hit collections inorder that we can pass them into the isolation objects 00090 00091 EcalRecHitMetaCollection ecalBarrelHits(*ecalBarrelRecHitHandle); 00092 EcalRecHitMetaCollection ecalEndcapHits(*ecalEndcapRecHitHandle); 00093 00094 //Get Calo Geometry 00095 edm::ESHandle<CaloGeometry> pG; 00096 iSetup.get<CaloGeometryRecord>().get(pG); 00097 const CaloGeometry* caloGeom = pG.product(); 00098 00099 //prepare product 00100 reco::RecoEcalCandidateIsolationMap isoMap; 00101 00102 //create algorithm objects 00103 EgammaRecHitIsolation ecalBarrelIsol(egIsoConeSizeOut_,egIsoConeSizeInBarrel_,egIsoJurassicWidth_,egIsoPtMinBarrel_,caloGeom,&ecalBarrelHits,DetId::Ecal); 00104 EgammaRecHitIsolation ecalEndcapIsol(egIsoConeSizeOut_,egIsoConeSizeInEndcap_,egIsoJurassicWidth_,egIsoPtMinEndcap_,caloGeom,&ecalEndcapHits,DetId::Ecal); 00105 00106 00107 for (reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand= recoecalcandHandle->begin(); iRecoEcalCand!=recoecalcandHandle->end(); iRecoEcalCand++) { 00108 00109 //create reference for storage in isolation map 00110 reco::RecoEcalCandidateRef recoecalcandref(reco::RecoEcalCandidateRef(recoecalcandHandle,iRecoEcalCand -recoecalcandHandle ->begin())); 00111 00112 //ecal isolation is centered on supecluster 00113 reco::SuperClusterRef superClus = iRecoEcalCand->get<reco::SuperClusterRef>(); 00114 00115 //i need to know if its in the barrel/endcap so I get the supercluster handle to find out the detector eta 00116 //this might not be the best way, are we guaranteed that eta<1.5 is barrel 00117 //this can be safely replaced by another method which determines where the emobject is 00118 //then we either get the isolation Et or isolation Energy depending on user selection 00119 float isol =0.; 00120 00121 if(tryBoth_){ //barrel + endcap 00122 if(useIsolEt_) isol = ecalBarrelIsol.getEtSum(&(*iRecoEcalCand)) + ecalEndcapIsol.getEtSum(&(*iRecoEcalCand)); 00123 else isol = ecalBarrelIsol.getEnergySum(&(*iRecoEcalCand)) + ecalEndcapIsol.getEnergySum(&(*iRecoEcalCand)); 00124 } 00125 else if( fabs(superClus->eta())<1.479) { //barrel 00126 if(useIsolEt_) isol = ecalBarrelIsol.getEtSum(&(*iRecoEcalCand)); 00127 else isol = ecalBarrelIsol.getEnergySum(&(*iRecoEcalCand)); 00128 } 00129 else{ //endcap 00130 if(useIsolEt_) isol = ecalEndcapIsol.getEtSum(&(*iRecoEcalCand)); 00131 else isol = ecalEndcapIsol.getEnergySum(&(*iRecoEcalCand)); 00132 } 00133 00134 //we subtract off the electron energy here as well 00135 double subtractVal=0; 00136 00137 if(useIsolEt_) subtractVal = superClus.get()->rawEnergy()*sin(2*atan(exp(-superClus.get()->eta()))); 00138 else subtractVal = superClus.get()->rawEnergy(); 00139 00140 if(subtract_) isol-= subtractVal; 00141 00142 00143 00144 isoMap.insert(recoecalcandref, isol); 00145 00146 } 00147 00148 std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap)); 00149 iEvent.put(isolMap); 00150 00151 }
Definition at line 62 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer().
Definition at line 45 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
Definition at line 44 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
Definition at line 47 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
Definition at line 46 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
double EgammaHLTEcalRecIsolationProducer::egIsoConeSizeInBarrel_ [private] |
Definition at line 54 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
double EgammaHLTEcalRecIsolationProducer::egIsoConeSizeInEndcap_ [private] |
Definition at line 55 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
double EgammaHLTEcalRecIsolationProducer::egIsoConeSizeOut_ [private] |
Definition at line 53 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
double EgammaHLTEcalRecIsolationProducer::egIsoEMinBarrel_ [private] |
Definition at line 50 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer().
double EgammaHLTEcalRecIsolationProducer::egIsoEMinEndcap_ [private] |
Definition at line 52 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer().
double EgammaHLTEcalRecIsolationProducer::egIsoJurassicWidth_ [private] |
Definition at line 56 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
double EgammaHLTEcalRecIsolationProducer::egIsoPtMinBarrel_ [private] |
Definition at line 49 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
double EgammaHLTEcalRecIsolationProducer::egIsoPtMinEndcap_ [private] |
Definition at line 51 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
Definition at line 43 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
Definition at line 60 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
Definition at line 59 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().
Definition at line 58 of file EgammaHLTEcalRecIsolationProducer.h.
Referenced by EgammaHLTEcalRecIsolationProducer(), and produce().