CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
egammaisolation::EgammaHcalExtractor Class Reference

#include <EgammaHcalExtractor.h>

Inheritance diagram for egammaisolation::EgammaHcalExtractor:
reco::isodeposit::IsoDepositExtractor

Public Member Functions

reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
 
reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) const override
 
 EgammaHcalExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
 
 EgammaHcalExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &iC)
 
void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks) override
 
 ~EgammaHcalExtractor () override
 
- Public Member Functions inherited from reco::isodeposit::IsoDepositExtractor
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 make single IsoDeposit based on trackRef as input More...
 
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 make single IsoDeposit based on a CandidateBaseRef as input More...
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 
virtual void initEvent (const edm::Event &, const edm::EventSetup &)
 perform some constly initialization More...
 
virtual ~IsoDepositExtractor ()
 Destructor. More...
 

Private Attributes

double etLow_
 
double extRadius_
 
edm::EDGetTokenT< HBHERecHitCollectionhcalRecHitProducerToken_
 
double intRadius_
 

Detailed Description

Definition at line 36 of file EgammaHcalExtractor.h.

Constructor & Destructor Documentation

egammaisolation::EgammaHcalExtractor::EgammaHcalExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 38 of file EgammaHcalExtractor.h.

References ~EgammaHcalExtractor().

38 : EgammaHcalExtractor(par, iC) {}
EgammaHcalExtractor(const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
EgammaHcalExtractor::EgammaHcalExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector iC 
)

Definition at line 35 of file EgammaHcalExtractor.cc.

36  : extRadius_(par.getParameter<double>("extRadius")),
37  intRadius_(par.getParameter<double>("intRadius")),
38  etLow_(par.getParameter<double>("etMin")),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< HBHERecHitCollection > hcalRecHitProducerToken_
EgammaHcalExtractor::~EgammaHcalExtractor ( )
override

Definition at line 41 of file EgammaHcalExtractor.cc.

Referenced by EgammaHcalExtractor().

41 {}

Member Function Documentation

reco::IsoDeposit egammaisolation::EgammaHcalExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
inlineoverridevirtual

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

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 45 of file EgammaHcalExtractor.h.

References HltBtagPostValidation_cff::c, ev, Exception, and Skims_PA_cff::name.

Referenced by deposit().

47  {
48  throw cms::Exception("Configuration Error")
49  << "This extractor " << (typeid(this).name()) << " is not made for tracks";
50  }
reco::IsoDeposit EgammaHcalExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Candidate track 
) const
overridevirtual

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 43 of file EgammaHcalExtractor.cc.

References deposit(), CaloRecHit::detid(), CaloRecHit::energy(), PV3DBase< T, PVType, FrameType >::eta(), etLow_, JetChargeProducer_cfi::exp, extRadius_, edm::EventSetup::get(), reco::Candidate::get(), edm::Event::getByToken(), CaloGeometry::getPosition(), DetId::Hcal, hcalRecHitProducerToken_, mps_fire::i, intRadius_, PV3DBase< T, PVType, FrameType >::phi(), point, edm::ESHandle< T >::product(), SimDataFormats::CaloAnalysis::sc, CaloDualConeSelector< T >::selectCallback(), and funct::sin().

45  {
46  //Get MetaRecHit collection
47  edm::Handle<HBHERecHitCollection> hcalRecHitHandle;
48  iEvent.getByToken(hcalRecHitProducerToken_, hcalRecHitHandle);
49 
50  //Get Calo Geometry
52  iSetup.get<CaloGeometryRecord>().get(pG);
53  const CaloGeometry* caloGeom = pG.product();
55 
56  //Take the SC position
58  math::XYZPoint caloPosition = sc->position();
59  GlobalPoint point(caloPosition.x(), caloPosition.y(), caloPosition.z());
60  // needed: coneSel.select(eta,phi,hits) is not the same!
61 
62  Direction candDir(caloPosition.eta(), caloPosition.phi());
63  reco::IsoDeposit deposit(candDir);
65  double sinTheta = sin(2 * atan(exp(-sc->eta())));
66  deposit.addCandEnergy(sc->energy() * sinTheta);
67 
68  //Compute the HCAL energy behind ECAL
69  coneSel.selectCallback(point, *hcalRecHitHandle, [&](const HBHERecHit& i) {
70  const GlobalPoint& hcalHit_position = caloGeom->getPosition(i.detid());
71  double hcalHit_eta = hcalHit_position.eta();
72  double hcalHit_Et = i.energy() * sin(2 * atan(exp(-hcalHit_eta)));
73  if (hcalHit_Et > etLow_) {
74  deposit.addDeposit(Direction(hcalHit_eta, hcalHit_position.phi()), hcalHit_Et);
75  }
76  });
77 
78  return deposit;
79 }
constexpr float energy() const
Definition: CaloRecHit.h:29
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
constexpr const DetId & detid() const
Definition: CaloRecHit.h:33
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
edm::EDGetTokenT< HBHERecHitCollection > hcalRecHitProducerToken_
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
int iEvent
Definition: GenABIO.cc:224
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
T eta() const
Definition: PV3DBase.h:73
T const * product() const
Definition: ESHandle.h:86
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
void egammaisolation::EgammaHcalExtractor::fillVetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::TrackCollection tracks 
)
inlineoverridevirtual

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

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 43 of file EgammaHcalExtractor.h.

43  {
44  }

Member Data Documentation

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::EDGetTokenT<HBHERecHitCollection> egammaisolation::EgammaHcalExtractor::hcalRecHitProducerToken_
private

Definition at line 60 of file EgammaHcalExtractor.h.

Referenced by deposit().

double egammaisolation::EgammaHcalExtractor::intRadius_
private

Definition at line 57 of file EgammaHcalExtractor.h.

Referenced by deposit().