CMS 3D CMS Logo

egammaisolation::EgammaHcalExtractor Class Reference

#include <RecoEgamma/EgammaIsolationAlgos/plugins/EgammaHcalExtractor.h>

Inheritance diagram for egammaisolation::EgammaHcalExtractor:

reco::isodeposit::IsoDepositExtractor

List of all members.

Public Member Functions

virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) const
 make single IsoDeposit based on a candidate as input purely virtual: have to implement in concrete implementations
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations
 EgammaHcalExtractor (const edm::ParameterSet &par)
virtual void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks)
 fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op !
virtual ~EgammaHcalExtractor ()

Private Attributes

edm::InputTag barrelEcalHitsTag_
edm::InputTag endcapEcalHitsTag_
double etLow_
double extRadius_
edm::InputTag hcalRecHitProducer_
double intRadius_
double minCandEt_
std::vector< double > paramForIsolBarrel_
std::vector< double > paramForIsolEndcap_


Detailed Description

Definition at line 38 of file EgammaHcalExtractor.h.


Constructor & Destructor Documentation

EgammaHcalExtractor::EgammaHcalExtractor ( const edm::ParameterSet par  ) 

Definition at line 35 of file EgammaHcalExtractor.cc.

References edm::ParameterSet::getParameter(), paramForIsolBarrel_, and paramForIsolEndcap_.

00035                                                                       :
00036     minCandEt_(par.getParameter<double>("minCandEt")),
00037     extRadius_(par.getParameter<double>("extRadius")),
00038     intRadius_(par.getParameter<double>("intRadius")),
00039     etLow_(par.getParameter<double>("etMin")),
00040     barrelEcalHitsTag_(par.getParameter<edm::InputTag>("barrelEcalHits")),
00041     endcapEcalHitsTag_(par.getParameter<edm::InputTag>("endcapEcalHits")),
00042     hcalRecHitProducer_(par.getParameter<edm::InputTag>("hcalRecHits")) { 
00043 
00044     paramForIsolBarrel_.push_back(par.getParameter<double>("checkIsoExtRBarrel"));
00045     paramForIsolBarrel_.push_back(par.getParameter<double>("checkIsoInnRBarrel"));
00046     paramForIsolBarrel_.push_back(par.getParameter<double>("checkIsoEtaStripBarrel"));
00047     paramForIsolBarrel_.push_back(par.getParameter<double>("checkIsoEtRecHitBarrel"));
00048     paramForIsolBarrel_.push_back(par.getParameter<double>("checkIsoEtCutBarrel"));
00049 
00050     paramForIsolEndcap_.push_back(par.getParameter<double>("checkIsoExtREndcap"));
00051     paramForIsolEndcap_.push_back(par.getParameter<double>("checkIsoInnREndcap"));
00052     paramForIsolEndcap_.push_back(par.getParameter<double>("checkIsoEtaStripEndcap"));
00053     paramForIsolEndcap_.push_back(par.getParameter<double>("checkIsoEtRecHitEndcap"));
00054     paramForIsolEndcap_.push_back(par.getParameter<double>("checkIsoEtCutEndcap"));
00055 }

EgammaHcalExtractor::~EgammaHcalExtractor (  )  [virtual]

Definition at line 57 of file EgammaHcalExtractor.cc.

00057 {}


Member Function Documentation

reco::IsoDeposit EgammaHcalExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Candidate track 
) const [virtual]

make single IsoDeposit based on a candidate as input purely virtual: have to implement in concrete implementations

Reimplemented from reco::isodeposit::IsoDepositExtractor.

Definition at line 59 of file EgammaHcalExtractor.cc.

References funct::abs(), barrelEcalHitsTag_, deposit(), DetId::Ecal, endcapEcalHitsTag_, PV3DBase< T, PVType, FrameType >::eta(), etLow_, funct::exp(), extRadius_, edm::EventSetup::get(), reco::Candidate::get(), edm::Event::getByLabel(), EgammaRecHitIsolation::getEtSum(), CaloGeometry::getPosition(), DetId::Hcal, hcalRecHitProducer_, i, intRadius_, minCandEt_, paramForIsolBarrel_, paramForIsolEndcap_, PV3DBase< T, PVType, FrameType >::phi(), edm::ESHandle< T >::product(), CaloDualConeSelector::select(), and funct::sin().

00060                                                                             {
00061 
00062     //Get MetaRecHit collection
00063     edm::Handle<HBHERecHitCollection> hcalRecHitHandle;
00064     iEvent.getByLabel(hcalRecHitProducer_, hcalRecHitHandle);
00065     HBHERecHitMetaCollection mhbhe =  HBHERecHitMetaCollection(*hcalRecHitHandle); 
00066 
00067     //Get Calo Geometry
00068     edm::ESHandle<CaloGeometry> pG;
00069     iSetup.get<CaloGeometryRecord>().get(pG);
00070     const CaloGeometry* caloGeom = pG.product();
00071     CaloDualConeSelector coneSel(intRadius_, extRadius_, caloGeom, DetId::Hcal);
00072 
00073     //Get barrel ECAL RecHits for Iso checking
00074     edm::Handle<EcalRecHitCollection> barrelEcalRecHitsH;
00075     iEvent.getByLabel(barrelEcalHitsTag_, barrelEcalRecHitsH);
00076 
00077     //Get endcap ECAL RecHits for Iso checking
00078     edm::Handle<EcalRecHitCollection> endcapEcalRecHitsH;
00079     iEvent.getByLabel(endcapEcalHitsTag_, endcapEcalRecHitsH);
00080 
00081     //Take the SC position
00082     reco::SuperClusterRef sc = emObject.get<reco::SuperClusterRef>();
00083     math::XYZPoint caloPosition = sc->position();
00084     GlobalPoint point(caloPosition.x(), caloPosition.y() , caloPosition.z());
00085     // needed: coneSel.select(eta,phi,hits) is not the same!
00086 
00087     Direction candDir(caloPosition.eta(), caloPosition.phi());
00088     reco::IsoDeposit deposit( candDir );
00089     deposit.setVeto( reco::IsoDeposit::Veto(candDir, intRadius_) ); 
00090     double sinTheta = sin(2*atan(exp(-sc->eta())));
00091     deposit.addCandEnergy(sc->energy()*sinTheta);
00092 
00093     std::auto_ptr<CaloRecHitMetaCollectionV> ecalRecHits(0);
00094     double extRadius, innRadius, etaStrip, minEtRecHit, isolEtCut;
00095     if( abs(sc->eta()) < 1.5 ) {
00096         extRadius   = paramForIsolBarrel_[0];
00097         innRadius   = paramForIsolBarrel_[1];
00098         etaStrip    = paramForIsolBarrel_[2];
00099         minEtRecHit = paramForIsolBarrel_[3];
00100         isolEtCut   = paramForIsolBarrel_[4];
00101         ecalRecHits = std::auto_ptr<CaloRecHitMetaCollectionV>(new EcalRecHitMetaCollection(*barrelEcalRecHitsH));
00102     } else {
00103         extRadius   = paramForIsolEndcap_[0];
00104         innRadius   = paramForIsolEndcap_[1];
00105         etaStrip    = paramForIsolEndcap_[2];
00106         minEtRecHit = paramForIsolEndcap_[3];
00107         isolEtCut   = paramForIsolEndcap_[4];
00108         ecalRecHits = std::auto_ptr<CaloRecHitMetaCollectionV>(new EcalRecHitMetaCollection(*endcapEcalRecHitsH));
00109     }
00110 
00111     EgammaRecHitIsolation candIso(extRadius,innRadius,etaStrip,minEtRecHit,pG,&(*ecalRecHits),DetId::Ecal);
00112     if ( sc->energy()*sinTheta < minCandEt_ || candIso.getEtSum(&emObject) > isolEtCut ) {
00113         deposit.addDeposit( Direction(caloPosition.eta(), caloPosition.phi()+0.15), 10000 );
00114         deposit.addDeposit( Direction(caloPosition.eta(), caloPosition.phi()+0.25), 100000 );
00115     } else {
00116         //Compute the HCAL energy behind ECAL
00117         std::auto_ptr<CaloRecHitMetaCollectionV> chosen = coneSel.select(point, mhbhe);
00118         for (CaloRecHitMetaCollectionV::const_iterator i = chosen->begin (), ed = chosen->end() ; 
00119                 i!= ed; ++i) {
00120             const  GlobalPoint & hcalHit_position = caloGeom->getPosition(i->detid());
00121             double hcalHit_eta = hcalHit_position.eta();
00122             double hcalHit_Et = i->energy()*sin(2*atan(exp(-hcalHit_eta)));
00123             if ( hcalHit_Et > etLow_) {
00124                 deposit.addDeposit( Direction(hcalHit_eta, hcalHit_position.phi()), hcalHit_Et);
00125             }
00126         }
00127     }
00128 
00129     return deposit;
00130 }

virtual reco::IsoDeposit egammaisolation::EgammaHcalExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const [inline, virtual]

make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 46 of file EgammaHcalExtractor.h.

References Exception, and name.

Referenced by deposit().

00047                                                                             {
00048             throw cms::Exception("Configuration Error") << 
00049                      "This extractor " << (typeid(this).name()) << " is not made for tracks";
00050          }

virtual void egammaisolation::EgammaHcalExtractor::fillVetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::TrackCollection tracks 
) [inline, virtual]

fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op !

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 44 of file EgammaHcalExtractor.h.

00045                                                                      { }


Member Data Documentation

edm::InputTag egammaisolation::EgammaHcalExtractor::barrelEcalHitsTag_ [private]

Definition at line 60 of file EgammaHcalExtractor.h.

Referenced by deposit().

edm::InputTag egammaisolation::EgammaHcalExtractor::endcapEcalHitsTag_ [private]

Definition at line 61 of file EgammaHcalExtractor.h.

Referenced by deposit().

double egammaisolation::EgammaHcalExtractor::etLow_ [private]

Definition at line 58 of file EgammaHcalExtractor.h.

Referenced by deposit().

double egammaisolation::EgammaHcalExtractor::extRadius_ [private]

Definition at line 56 of file EgammaHcalExtractor.h.

Referenced by deposit().

edm::InputTag egammaisolation::EgammaHcalExtractor::hcalRecHitProducer_ [private]

Definition at line 62 of file EgammaHcalExtractor.h.

Referenced by deposit().

double egammaisolation::EgammaHcalExtractor::intRadius_ [private]

Definition at line 57 of file EgammaHcalExtractor.h.

Referenced by deposit().

double egammaisolation::EgammaHcalExtractor::minCandEt_ [private]

Definition at line 55 of file EgammaHcalExtractor.h.

Referenced by deposit().

std::vector<double> egammaisolation::EgammaHcalExtractor::paramForIsolBarrel_ [private]

Definition at line 65 of file EgammaHcalExtractor.h.

Referenced by deposit(), and EgammaHcalExtractor().

std::vector<double> egammaisolation::EgammaHcalExtractor::paramForIsolEndcap_ [private]

Definition at line 66 of file EgammaHcalExtractor.h.

Referenced by deposit(), and EgammaHcalExtractor().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:46:44 2009 for CMSSW by  doxygen 1.5.4