CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
egammaisolation::EgammaHcalExtractor Class Reference
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::ESGetToken< CaloGeometry, CaloGeometryRecordgeometryToken_
 
edm::EDGetTokenT< HBHERecHitCollectionhcalRecHitProducerToken_
 
double intRadius_
 

Detailed Description

Definition at line 41 of file EgammaHcalExtractor.cc.

Constructor & Destructor Documentation

◆ EgammaHcalExtractor() [1/2]

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

Definition at line 43 of file EgammaHcalExtractor.cc.

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

◆ EgammaHcalExtractor() [2/2]

EgammaHcalExtractor::EgammaHcalExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector iC 
)

Definition at line 79 of file EgammaHcalExtractor.cc.

80  : extRadius_(par.getParameter<double>("extRadius")),
81  intRadius_(par.getParameter<double>("intRadius")),
82  etLow_(par.getParameter<double>("etMin")),
84  geometryToken_(iC.esConsumes()) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< HBHERecHitCollection > hcalRecHitProducerToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_

◆ ~EgammaHcalExtractor()

EgammaHcalExtractor::~EgammaHcalExtractor ( )
override

Definition at line 86 of file EgammaHcalExtractor.cc.

86 {}

Member Function Documentation

◆ deposit() [1/2]

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

References Exception, and Skims_PA_cff::name.

Referenced by deposit().

52  {
53  throw cms::Exception("Configuration Error")
54  << "This extractor " << (typeid(this).name()) << " is not made for tracks";
55  }

◆ deposit() [2/2]

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

References reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), deposit(), PV3DBase< T, PVType, FrameType >::eta(), etLow_, JetChargeProducer_cfi::exp, extRadius_, geometryToken_, reco::Candidate::get(), edm::EventSetup::getData(), CaloGeometry::getPosition(), DetId::Hcal, hcalRecHitProducerToken_, eleHcalExtractorBlocks_cff::hcalRecHits, mps_fire::i, iEvent, intRadius_, PV3DBase< T, PVType, FrameType >::phi(), point, CaloDualConeSelector< T >::selectCallback(), reco::IsoDeposit::setVeto(), and funct::sin().

90  {
91  //Get MetaRecHit collection
92  auto const& hcalRecHits = iEvent.get(hcalRecHitProducerToken_);
93 
94  //Get Calo Geometry
95  const CaloGeometry* caloGeom = &iSetup.getData(geometryToken_);
97 
98  //Take the SC position
100  math::XYZPoint caloPosition = sc->position();
101  GlobalPoint point(caloPosition.x(), caloPosition.y(), caloPosition.z());
102  // needed: coneSel.select(eta,phi,hits) is not the same!
103 
104  Direction candDir(caloPosition.eta(), caloPosition.phi());
105  reco::IsoDeposit deposit(candDir);
107  double sinTheta = sin(2 * atan(exp(-sc->eta())));
108  deposit.addCandEnergy(sc->energy() * sinTheta);
109 
110  //Compute the HCAL energy behind ECAL
111  coneSel.selectCallback(point, hcalRecHits, [&](const HBHERecHit& i) {
112  const GlobalPoint& hcalHit_position = caloGeom->getPosition(i.detid());
113  double hcalHit_eta = hcalHit_position.eta();
114  double hcalHit_Et = i.energy() * sin(2 * atan(exp(-hcalHit_eta)));
115  if (hcalHit_Et > etLow_) {
116  deposit.addDeposit(Direction(hcalHit_eta, hcalHit_position.phi()), hcalHit_Et);
117  }
118  });
119 
120  return deposit;
121 }
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T eta() const
Definition: PV3DBase.h:73
edm::EDGetTokenT< HBHERecHitCollection > hcalRecHitProducerToken_
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
int iEvent
Definition: GenABIO.cc:224
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
*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

◆ fillVetos()

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

48  {
49  }

Member Data Documentation

◆ etLow_

double egammaisolation::EgammaHcalExtractor::etLow_
private

Definition at line 63 of file EgammaHcalExtractor.cc.

Referenced by deposit().

◆ extRadius_

double egammaisolation::EgammaHcalExtractor::extRadius_
private

Definition at line 61 of file EgammaHcalExtractor.cc.

Referenced by deposit().

◆ geometryToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> egammaisolation::EgammaHcalExtractor::geometryToken_
private

Definition at line 66 of file EgammaHcalExtractor.cc.

Referenced by deposit().

◆ hcalRecHitProducerToken_

edm::EDGetTokenT<HBHERecHitCollection> egammaisolation::EgammaHcalExtractor::hcalRecHitProducerToken_
private

Definition at line 65 of file EgammaHcalExtractor.cc.

Referenced by deposit().

◆ intRadius_

double egammaisolation::EgammaHcalExtractor::intRadius_
private

Definition at line 62 of file EgammaHcalExtractor.cc.

Referenced by deposit().