CMS 3D CMS Logo

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

#include <EgammaTowerExtractor.h>

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

Public Types

enum  HcalDepth { AllDepths = -1, Undefined = 0, Depth1 = 1, Depth2 = 2 }
 

Public Member Functions

reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) const override
 
reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
 
 EgammaTowerExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
 
 EgammaTowerExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &iC)
 
void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks) override
 
 ~EgammaTowerExtractor () override
 
- Public Member Functions inherited from reco::isodeposit::IsoDepositExtractor
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 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 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 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 void initEvent (const edm::Event &, const edm::EventSetup &)
 perform some constly initialization More...
 
virtual ~IsoDepositExtractor ()
 Destructor. More...
 

Private Attributes

edm::EDGetTokenT< CaloTowerCollectioncaloTowerToken
 
int depth_
 
double etLow_
 
double extRadius2_
 
double intRadius_
 

Detailed Description

Definition at line 34 of file EgammaTowerExtractor.h.

Member Enumeration Documentation

◆ HcalDepth

Enumerator
AllDepths 
Undefined 
Depth1 
Depth2 

Definition at line 36 of file EgammaTowerExtractor.h.

36 { AllDepths = -1, Undefined = 0, Depth1 = 1, Depth2 = 2 };

Constructor & Destructor Documentation

◆ EgammaTowerExtractor() [1/2]

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

Definition at line 39 of file EgammaTowerExtractor.h.

39 : EgammaTowerExtractor(par, iC) {}

◆ EgammaTowerExtractor() [2/2]

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

Definition at line 40 of file EgammaTowerExtractor.h.

41  : extRadius2_(par.getParameter<double>("extRadius")),
42  intRadius_(par.getParameter<double>("intRadius")),
43  etLow_(par.getParameter<double>("etMin")),
45  depth_(par.getParameter<int>("hcalDepth")) {
47  //lets just check we have a valid depth
48  //should we throw an exception or just warn and then fail gracefully later?
49  if (depth_ != AllDepths && depth_ != Depth1 && depth_ != Depth2) {
50  throw cms::Exception("Configuration Error")
51  << "hcalDepth passed to EgammaTowerExtractor is invalid " << std::endl;
52  }
53  }

References AllDepths, Depth1, Depth2, depth_, Exception, and extRadius2_.

◆ ~EgammaTowerExtractor()

EgammaTowerExtractor::~EgammaTowerExtractor ( )
override

Definition at line 30 of file EgammaTowerExtractor.cc.

30 {}

Member Function Documentation

◆ deposit() [1/2]

reco::IsoDeposit EgammaTowerExtractor::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 32 of file EgammaTowerExtractor.cc.

34  {
35  edm::Handle<CaloTowerCollection> towercollectionH;
36  iEvent.getByToken(caloTowerToken, towercollectionH);
37 
38  //Take the SC position
40  math::XYZPoint caloPosition = sc->position();
41 
42  Direction candDir(caloPosition.eta(), caloPosition.phi());
43  reco::IsoDeposit deposit(candDir);
45  deposit.addCandEnergy(sc->energy() * sin(2 * atan(exp(-sc->eta()))));
46 
47  //loop over tracks
48  for (CaloTowerCollection::const_iterator trItr = towercollectionH->begin(), trEnd = towercollectionH->end();
49  trItr != trEnd;
50  ++trItr) {
51  double depEt = 0;
52  //the hcal can be seperated into different depths
53  //currently it is setup to check that the depth is valid in constructor
54  //if the depth is not valid it fails gracefully
55  //small bug fix, hadEnergyHeInnerLater returns zero for towers which are only depth 1
56  //but we want Depth1 isolation to include these so we have to manually check for this
57  if (depth_ == AllDepths)
58  depEt = trItr->hadEt();
59  else if (depth_ == Depth1)
60  depEt = trItr->ietaAbs() < 18 || trItr->ietaAbs() > 29
61  ? trItr->hadEt()
62  : trItr->hadEnergyHeInnerLayer() * sin(trItr->p4().theta());
63  else if (depth_ == Depth2)
64  depEt = trItr->hadEnergyHeOuterLayer() * sin(trItr->p4().theta());
65 
66  if (depEt < etLow_)
67  continue;
68 
69  Direction towerDir(trItr->eta(), trItr->phi());
70  double dR2 = candDir.deltaR2(towerDir);
71 
72  if (dR2 < extRadius2_) {
73  deposit.addDeposit(towerDir, depEt);
74  }
75 
76  } //end loop over tracks
77 
78  return deposit;
79 }

References edm::SortedCollection< T, SORT >::begin(), reco::isodeposit::Direction::deltaR2(), edm::SortedCollection< T, SORT >::end(), JetChargeProducer_cfi::exp, reco::Candidate::get(), iEvent, and funct::sin().

◆ deposit() [2/2]

reco::IsoDeposit egammaisolation::EgammaTowerExtractor::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 59 of file EgammaTowerExtractor.h.

61  {
62  throw cms::Exception("Configuration Error")
63  << "This extractor " << (typeid(this).name()) << " is not made for tracks";
64  }

References Exception, and Skims_PA_cff::name.

◆ fillVetos()

void egammaisolation::EgammaTowerExtractor::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 57 of file EgammaTowerExtractor.h.

57  {
58  }

Member Data Documentation

◆ caloTowerToken

edm::EDGetTokenT<CaloTowerCollection> egammaisolation::EgammaTowerExtractor::caloTowerToken
private

Definition at line 74 of file EgammaTowerExtractor.h.

◆ depth_

int egammaisolation::EgammaTowerExtractor::depth_
private

Definition at line 75 of file EgammaTowerExtractor.h.

Referenced by EgammaTowerExtractor().

◆ etLow_

double egammaisolation::EgammaTowerExtractor::etLow_
private

Definition at line 72 of file EgammaTowerExtractor.h.

◆ extRadius2_

double egammaisolation::EgammaTowerExtractor::extRadius2_
private

Definition at line 70 of file EgammaTowerExtractor.h.

Referenced by EgammaTowerExtractor().

◆ intRadius_

double egammaisolation::EgammaTowerExtractor::intRadius_
private

Definition at line 71 of file EgammaTowerExtractor.h.

egammaisolation::EgammaTowerExtractor::Depth2
Definition: EgammaTowerExtractor.h:36
edm::SortedCollection< CaloTower >::const_iterator
std::vector< CaloTower >::const_iterator const_iterator
Definition: SortedCollection.h:80
egammaisolation::EgammaTowerExtractor::etLow_
double etLow_
Definition: EgammaTowerExtractor.h:72
egammaisolation::EgammaTowerExtractor::extRadius2_
double extRadius2_
Definition: EgammaTowerExtractor.h:70
reco::IsoDeposit::addDeposit
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
edm::SortedCollection< CaloTower >
egammaisolation::EgammaTowerExtractor::deposit
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
Definition: EgammaTowerExtractor.h:59
reco::IsoDeposit::Veto
Definition: IsoDeposit.h:59
egammaisolation::EgammaTowerExtractor::depth_
int depth_
Definition: EgammaTowerExtractor.h:75
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref< SuperClusterCollection >
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
reco::isodeposit::Direction::deltaR2
double deltaR2(const Direction &dir2) const
Definition: IsoDepositDirection.h:46
egammaisolation::EgammaTowerExtractor::EgammaTowerExtractor
EgammaTowerExtractor(const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
Definition: EgammaTowerExtractor.h:39
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
egammaisolation::EgammaTowerExtractor::caloTowerToken
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken
Definition: EgammaTowerExtractor.h:74
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
iEvent
int iEvent
Definition: GenABIO.cc:224
egammaisolation::EgammaTowerExtractor::AllDepths
Definition: EgammaTowerExtractor.h:36
reco::IsoDeposit::addCandEnergy
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
egammaisolation::EgammaTowerExtractor::Depth1
Definition: EgammaTowerExtractor.h:36
egammaisolation::EgammaTowerExtractor::intRadius_
double intRadius_
Definition: EgammaTowerExtractor.h:71
reco::isodeposit::Direction
Definition: IsoDepositDirection.h:19
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
reco::IsoDeposit
Definition: IsoDeposit.h:49
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
egammaisolation::EgammaTowerExtractor::Undefined
Definition: EgammaTowerExtractor.h:36
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
edm::InputTag
Definition: InputTag.h:15
reco::IsoDeposit::setVeto
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82