CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
egammaisolation::EgammaTowerExtractor Class Reference
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 35 of file EgammaTowerExtractor.cc.

Member Enumeration Documentation

◆ HcalDepth

Enumerator
AllDepths 
Undefined 
Depth1 
Depth2 

Definition at line 37 of file EgammaTowerExtractor.cc.

37 { 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 40 of file EgammaTowerExtractor.cc.

40 : EgammaTowerExtractor(par, iC) {}

◆ EgammaTowerExtractor() [2/2]

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

Definition at line 41 of file EgammaTowerExtractor.cc.

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

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

◆ ~EgammaTowerExtractor()

EgammaTowerExtractor::~EgammaTowerExtractor ( )
override

Definition at line 90 of file EgammaTowerExtractor.cc.

90 {}

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 92 of file EgammaTowerExtractor.cc.

94  {
95  //Take the SC position
97  math::XYZPoint caloPosition = sc->position();
98 
99  Direction candDir(caloPosition.eta(), caloPosition.phi());
100  reco::IsoDeposit deposit(candDir);
102  deposit.addCandEnergy(sc->energy() * sin(2 * atan(exp(-sc->eta()))));
103 
104  //loop over tracks
105  for (auto const& trItr : iEvent.get(caloTowerToken)) {
106  double depEt = 0;
107  //the hcal can be seperated into different depths
108  //currently it is setup to check that the depth is valid in constructor
109  //if the depth is not valid it fails gracefully
110  //small bug fix, hadEnergyHeInnerLater returns zero for towers which are only depth 1
111  //but we want Depth1 isolation to include these so we have to manually check for this
112  if (depth_ == AllDepths)
113  depEt = trItr.hadEt();
114  else if (depth_ == Depth1)
115  depEt = trItr.ietaAbs() < 18 || trItr.ietaAbs() > 29 ? trItr.hadEt()
116  : trItr.hadEnergyHeInnerLayer() * sin(trItr.p4().theta());
117  else if (depth_ == Depth2)
118  depEt = trItr.hadEnergyHeOuterLayer() * sin(trItr.p4().theta());
119 
120  if (depEt < etLow_)
121  continue;
122 
123  Direction towerDir(trItr.eta(), trItr.phi());
124  double dR2 = candDir.deltaR2(towerDir);
125 
126  if (dR2 < extRadius2_) {
127  deposit.addDeposit(towerDir, depEt);
128  }
129 
130  } //end loop over tracks
131 
132  return deposit;
133 }

References reco::isodeposit::Direction::deltaR2(), 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 60 of file EgammaTowerExtractor.cc.

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

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 58 of file EgammaTowerExtractor.cc.

58  {
59  }

Member Data Documentation

◆ caloTowerToken

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

Definition at line 75 of file EgammaTowerExtractor.cc.

◆ depth_

int egammaisolation::EgammaTowerExtractor::depth_
private

Definition at line 76 of file EgammaTowerExtractor.cc.

Referenced by EgammaTowerExtractor().

◆ etLow_

double egammaisolation::EgammaTowerExtractor::etLow_
private

Definition at line 73 of file EgammaTowerExtractor.cc.

◆ extRadius2_

double egammaisolation::EgammaTowerExtractor::extRadius2_
private

Definition at line 71 of file EgammaTowerExtractor.cc.

Referenced by EgammaTowerExtractor().

◆ intRadius_

double egammaisolation::EgammaTowerExtractor::intRadius_
private

Definition at line 72 of file EgammaTowerExtractor.cc.

egammaisolation::EgammaTowerExtractor::Depth2
Definition: EgammaTowerExtractor.cc:37
egammaisolation::EgammaTowerExtractor::etLow_
double etLow_
Definition: EgammaTowerExtractor.cc:73
egammaisolation::EgammaTowerExtractor::extRadius2_
double extRadius2_
Definition: EgammaTowerExtractor.cc:71
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.cc:60
reco::IsoDeposit::Veto
Definition: IsoDeposit.h:59
egammaisolation::EgammaTowerExtractor::depth_
int depth_
Definition: EgammaTowerExtractor.cc:76
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.cc:40
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
egammaisolation::EgammaTowerExtractor::caloTowerToken
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken
Definition: EgammaTowerExtractor.cc:75
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
iEvent
int iEvent
Definition: GenABIO.cc:224
egammaisolation::EgammaTowerExtractor::AllDepths
Definition: EgammaTowerExtractor.cc:37
reco::IsoDeposit::addCandEnergy
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
egammaisolation::EgammaTowerExtractor::Depth1
Definition: EgammaTowerExtractor.cc:37
egammaisolation::EgammaTowerExtractor::intRadius_
double intRadius_
Definition: EgammaTowerExtractor.cc:72
reco::isodeposit::Direction
Definition: IsoDepositDirection.h:19
Exception
Definition: hltDiff.cc:245
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.cc:37
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