CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
EgammaL1TkIsolation Class Reference

#include <EgammaL1TkIsolation.h>

Classes

struct  TrkCuts
 

Public Member Functions

std::pair< int, double > calIsol (const double objEta, const double objPhi, const double objZ, const L1TrackCollection &l1Tks) const
 
std::pair< int, double > calIsol (const reco::TrackBase &trk, const L1TrackCollection &l1Tks) const
 
template<typename... Args>
double calIsolPt (Args &&... args) const
 
 EgammaL1TkIsolation (const edm::ParameterSet &para)
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &desc)
 
static edm::ParameterSetDescription makePSetDescription ()
 

Private Member Functions

size_t etaBinNr (double eta) const
 

Static Private Member Functions

static bool passTrkSel (const L1Track &trk, const double trkPt, const TrkCuts &cuts, const double objEta, const double objPhi, const double objZ)
 

Private Attributes

std::vector< double > etaBoundaries_
 
std::vector< TrkCutstrkCuts_
 
bool useAbsEta_
 

Detailed Description

Definition at line 13 of file EgammaL1TkIsolation.h.

Constructor & Destructor Documentation

◆ EgammaL1TkIsolation()

EgammaL1TkIsolation::EgammaL1TkIsolation ( const edm::ParameterSet para)
explicit

Definition at line 7 of file EgammaL1TkIsolation.cc.

8  : useAbsEta_(para.getParameter<bool>("useAbsEta")),
9  etaBoundaries_(para.getParameter<std::vector<double>>("etaBoundaries")) {
10  const auto& trkCutParams = para.getParameter<std::vector<edm::ParameterSet>>("trkCuts");
11  for (const auto& params : trkCutParams) {
12  trkCuts_.emplace_back(TrkCuts(params));
13  }
14  if (etaBoundaries_.size() + 1 != trkCuts_.size()) {
15  throw cms::Exception("ConfigError") << "EgammaL1TkIsolation: etaBoundaries parameters size ("
16  << etaBoundaries_.size()
17  << ") should be one less than the size of trkCuts VPSet (" << trkCuts_.size()
18  << ")";
19  }
20  if (!std::is_sorted(etaBoundaries_.begin(), etaBoundaries_.end())) {
21  throw cms::Exception("ConfigError")
22  << "EgammaL1TkIsolation: etaBoundaries parameter's entries should be in increasing value";
23  }
24 }

References etaBoundaries_, Exception, edm::ParameterSet::getParameter(), CalibrationSummaryClient_cfi::params, and trkCuts_.

Member Function Documentation

◆ calIsol() [1/2]

std::pair< int, double > EgammaL1TkIsolation::calIsol ( const double  objEta,
const double  objPhi,
const double  objZ,
const L1TrackCollection l1Tks 
) const

Definition at line 36 of file EgammaL1TkIsolation.cc.

39  {
40  double ptSum = 0.;
41  int nrTrks = 0;
42 
43  const TrkCuts& cuts = trkCuts_[etaBinNr(objEta)];
44 
45  for (const auto& trk : tracks) {
46  const float trkPt = trk.momentum().perp();
47  if (passTrkSel(trk, trkPt, cuts, objEta, objPhi, objZ)) {
48  ptSum += trkPt;
49  nrTrks++;
50  }
51  }
52  return {nrTrks, ptSum};
53 }

References cuts, etaBinNr(), passTrkSel(), tracks, and trkCuts_.

◆ calIsol() [2/2]

std::pair< int, double > EgammaL1TkIsolation::calIsol ( const reco::TrackBase trk,
const L1TrackCollection l1Tks 
) const

Definition at line 32 of file EgammaL1TkIsolation.cc.

32  {
33  return calIsol(trk.eta(), trk.phi(), trk.vz(), tracks);
34 }

References reco::TrackBase::eta(), reco::TrackBase::phi(), tracks, and reco::TrackBase::vz().

Referenced by calIsolPt(), and EgammaHLTEleL1TrackIsolProducer::produce().

◆ calIsolPt()

template<typename... Args>
double EgammaL1TkIsolation::calIsolPt ( Args &&...  args) const
inline

Definition at line 33 of file EgammaL1TkIsolation.h.

33  {
34  return calIsol(std::forward<Args>(args)...).second;
35  }

References writedatasetfile::args, and calIsol().

◆ etaBinNr()

size_t EgammaL1TkIsolation::etaBinNr ( double  eta) const
private

Definition at line 76 of file EgammaL1TkIsolation.cc.

76  {
77  if (useAbsEta_) {
78  eta = std::abs(eta);
79  }
80  auto res = std::upper_bound(etaBoundaries_.begin(), etaBoundaries_.end(), eta);
81  size_t binNr = std::distance(etaBoundaries_.begin(), res);
82  return binNr;
83 }

References funct::abs(), HLT_FULL_cff::distance, PVValHelper::eta, etaBoundaries_, pfDeepBoostedJetPreprocessParams_cfi::upper_bound, and useAbsEta_.

Referenced by calIsol().

◆ fillPSetDescription()

void EgammaL1TkIsolation::fillPSetDescription ( edm::ParameterSetDescription desc)
static

Definition at line 26 of file EgammaL1TkIsolation.cc.

26  {
27  desc.add("useAbsEta", true);
28  desc.add("etaBoundaries", std::vector{1.5});
30 }

References submitPVResolutionJobs::desc, EgammaL1TkIsolation::TrkCuts::makePSetDescription(), and trackerHitRTTI::vector.

Referenced by makePSetDescription().

◆ makePSetDescription()

static edm::ParameterSetDescription EgammaL1TkIsolation::makePSetDescription ( )
inlinestatic

◆ passTrkSel()

bool EgammaL1TkIsolation::passTrkSel ( const L1Track trk,
const double  trkPt,
const TrkCuts cuts,
const double  objEta,
const double  objPhi,
const double  objZ 
)
staticprivate

Definition at line 85 of file EgammaL1TkIsolation.cc.

90  {
91  if (trkPt > cuts.minPt && std::abs(objZ - trk.z0()) < cuts.maxDZ) {
92  const float trkEta = trk.eta();
93  const float dEta = trkEta - objEta;
94  const float dR2 = reco::deltaR2(objEta, objPhi, trkEta, trk.phi());
95  return dR2 >= cuts.minDR2 && dR2 <= cuts.maxDR2 && std::abs(dEta) >= cuts.minDEta;
96  }
97 
98  return false;
99 }

References funct::abs(), cuts, reco::deltaR2(), and HLT_FULL_cff::dEta.

Referenced by calIsol().

Member Data Documentation

◆ etaBoundaries_

std::vector<double> EgammaL1TkIsolation::etaBoundaries_
private

Definition at line 57 of file EgammaL1TkIsolation.h.

Referenced by EgammaL1TkIsolation(), and etaBinNr().

◆ trkCuts_

std::vector<TrkCuts> EgammaL1TkIsolation::trkCuts_
private

Definition at line 58 of file EgammaL1TkIsolation.h.

Referenced by calIsol(), and EgammaL1TkIsolation().

◆ useAbsEta_

bool EgammaL1TkIsolation::useAbsEta_
private

Definition at line 56 of file EgammaL1TkIsolation.h.

Referenced by etaBinNr().

writedatasetfile.args
args
Definition: writedatasetfile.py:18
pfDeepBoostedJetPreprocessParams_cfi.upper_bound
upper_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:16
cuts
const TkSoA *__restrict__ CAHitNtupletGeneratorKernelsGPU::QualityCuts cuts
Definition: CAHitNtupletGeneratorKernelsImpl.h:338
EgammaL1TkIsolation::passTrkSel
static bool passTrkSel(const L1Track &trk, const double trkPt, const TrkCuts &cuts, const double objEta, const double objPhi, const double objZ)
Definition: EgammaL1TkIsolation.cc:85
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EgammaL1TkIsolation::etaBinNr
size_t etaBinNr(double eta) const
Definition: EgammaL1TkIsolation.cc:76
EgammaL1TkIsolation::trkCuts_
std::vector< TrkCuts > trkCuts_
Definition: EgammaL1TkIsolation.h:58
reco::TrackBase::vz
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:661
PVValHelper::eta
Definition: PVValidationHelpers.h:70
EgammaL1TkIsolation::useAbsEta_
bool useAbsEta_
Definition: EgammaL1TkIsolation.h:56
reco::TrackBase::phi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
edm::ParameterSet
Definition: ParameterSet.h:47
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
res
Definition: Electron.h:6
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HLT_FULL_cff.dEta
dEta
Definition: HLT_FULL_cff.py:13702
EgammaL1TkIsolation::TrkCuts::makePSetDescription
static edm::ParameterSetDescription makePSetDescription()
Definition: EgammaL1TkIsolation.cc:64
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
EgammaL1TkIsolation::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: EgammaL1TkIsolation.cc:26
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7733
EgammaL1TkIsolation::calIsol
std::pair< int, double > calIsol(const reco::TrackBase &trk, const L1TrackCollection &l1Tks) const
Definition: EgammaL1TkIsolation.cc:32
EgammaL1TkIsolation::etaBoundaries_
std::vector< double > etaBoundaries_
Definition: EgammaL1TkIsolation.h:57