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::Track &track) const override
 
reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) 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::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

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

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(const edm::ParameterSet &par, edm::ConsumesCollector &&iC)

◆ EgammaTowerExtractor() [2/2]

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

Definition at line 41 of file EgammaTowerExtractor.cc.

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

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  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken

◆ ~EgammaTowerExtractor()

EgammaTowerExtractor::~EgammaTowerExtractor ( )
override

Definition at line 90 of file EgammaTowerExtractor.cc.

90 {}

Member Function Documentation

◆ deposit() [1/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.

References Exception, and mergeVDriftHistosByStation::name.

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

◆ deposit() [2/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.

References ALPAKA_ACCELERATOR_NAMESPACE::dR2(), JetChargeProducer_cfi::exp, reco::Candidate::get(), iEvent, and funct::sin().

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 }
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
int iEvent
Definition: GenABIO.cc:224
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
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:226
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override

◆ 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.