CMS 3D CMS Logo

Public Member Functions | Private Attributes

egammaisolation::EgammaHcalExtractor Class Reference

#include <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::Track &track) const
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) const
 EgammaHcalExtractor (const edm::ParameterSet &par)
virtual void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks)
virtual ~EgammaHcalExtractor ()

Private Attributes

double etLow_
double extRadius_
edm::InputTag hcalRecHitProducer_
double intRadius_

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.

                                                                      :
    extRadius_(par.getParameter<double>("extRadius")),
    intRadius_(par.getParameter<double>("intRadius")),
    etLow_(par.getParameter<double>("etMin")),
    hcalRecHitProducer_(par.getParameter<edm::InputTag>("hcalRecHits")) { 
}
EgammaHcalExtractor::~EgammaHcalExtractor ( ) [virtual]

Definition at line 42 of file EgammaHcalExtractor.cc.

{}

Member Function Documentation

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 mergeVDriftHistosByStation::name.

Referenced by deposit().

                                                                            {
            throw cms::Exception("Configuration Error") << 
                     "This extractor " << (typeid(this).name()) << " is not made for tracks";
         }
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 44 of file EgammaHcalExtractor.cc.

References deposit(), PV3DBase< T, PVType, FrameType >::eta(), etLow_, create_public_lumi_plots::exp, extRadius_, edm::EventSetup::get(), reco::Candidate::get(), edm::Event::getByLabel(), CaloGeometry::getPosition(), DetId::Hcal, hcalRecHitProducer_, i, intRadius_, PV3DBase< T, PVType, FrameType >::phi(), point, edm::ESHandle< T >::product(), CaloDualConeSelector::select(), and funct::sin().

                                                                            {

    //Get MetaRecHit collection
    edm::Handle<HBHERecHitCollection> hcalRecHitHandle;
    iEvent.getByLabel(hcalRecHitProducer_, hcalRecHitHandle);
    HBHERecHitMetaCollection mhbhe =  HBHERecHitMetaCollection(*hcalRecHitHandle); 

    //Get Calo Geometry
    edm::ESHandle<CaloGeometry> pG;
    iSetup.get<CaloGeometryRecord>().get(pG);
    const CaloGeometry* caloGeom = pG.product();
    CaloDualConeSelector coneSel(intRadius_, extRadius_, caloGeom, DetId::Hcal);

    //Take the SC position
    reco::SuperClusterRef sc = emObject.get<reco::SuperClusterRef>();
    math::XYZPoint caloPosition = sc->position();
    GlobalPoint point(caloPosition.x(), caloPosition.y() , caloPosition.z());
    // needed: coneSel.select(eta,phi,hits) is not the same!

    Direction candDir(caloPosition.eta(), caloPosition.phi());
    reco::IsoDeposit deposit( candDir );
    deposit.setVeto( reco::IsoDeposit::Veto(candDir, intRadius_) ); 
    double sinTheta = sin(2*atan(exp(-sc->eta())));
    deposit.addCandEnergy(sc->energy()*sinTheta);

    //Compute the HCAL energy behind ECAL
    std::auto_ptr<CaloRecHitMetaCollectionV> chosen = coneSel.select(point, mhbhe);
    for (CaloRecHitMetaCollectionV::const_iterator i = chosen->begin (), ed = chosen->end() ; 
            i!= ed; ++i) {
        const  GlobalPoint & hcalHit_position = caloGeom->getPosition(i->detid());
        double hcalHit_eta = hcalHit_position.eta();
        double hcalHit_Et = i->energy()*sin(2*atan(exp(-hcalHit_eta)));
        if ( hcalHit_Et > etLow_) {
            deposit.addDeposit( Direction(hcalHit_eta, hcalHit_position.phi()), hcalHit_Et);
        }
    }

    return deposit;
}
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.

                                                                     { }

Member Data Documentation

Definition at line 57 of file EgammaHcalExtractor.h.

Referenced by deposit().

Definition at line 55 of file EgammaHcalExtractor.h.

Referenced by deposit().

Definition at line 59 of file EgammaHcalExtractor.h.

Referenced by deposit().

Definition at line 56 of file EgammaHcalExtractor.h.

Referenced by deposit().