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 L1TMuonDQMOffline_cfi::cuts, etaBinNr(), passTrkSel(), PDWG_EXOHSCP_cff::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(), PDWG_EXOHSCP_cff::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_2018_cff::distance, PVValHelper::eta, etaBoundaries_, cuda_std::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 edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addVPSet(), and EgammaL1TkIsolation::TrkCuts::makePSetDescription().

Referenced by makePSetDescription().

◆ makePSetDescription()

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

Definition at line 18 of file EgammaL1TkIsolation.h.

18  {
20  fillPSetDescription(desc);
21  return desc;
22  }

References fillPSetDescription().

Referenced by EgammaHLTEleL1TrackIsolProducer::fillDescriptions().

◆ 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(), L1TMuonDQMOffline_cfi::cuts, reco::deltaR2(), and HLT_2018_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
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
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
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
HLT_2018_cff.dEta
dEta
Definition: HLT_2018_cff.py:12289
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:632
cuda_std::upper_bound
__host__ constexpr __device__ RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
Definition: cudastdAlgorithm.h:45
PVValHelper::eta
Definition: PVValidationHelpers.h:69
EgammaL1TkIsolation::useAbsEta_
bool useAbsEta_
Definition: EgammaL1TkIsolation.h:56
reco::TrackBase::phi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:620
edm::ParameterSet
Definition: ParameterSet.h:36
edm::ParameterSetDescription::addVPSet
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
Definition: ParameterSetDescription.h:149
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:623
res
Definition: Electron.h:6
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EgammaL1TkIsolation::TrkCuts::makePSetDescription
static edm::ParameterSetDescription makePSetDescription()
Definition: EgammaL1TkIsolation.cc:64
Exception
Definition: hltDiff.cc:246
L1TMuonDQMOffline_cfi.cuts
cuts
Definition: L1TMuonDQMOffline_cfi.py:41
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
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