CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
l1t::L1GTSingleCollectionCut Class Reference

#include <L1GTSingleCollectionCut.h>

Public Member Functions

unsigned int atIndex (int objeta) const
 
bool checkEtadependentcuts (const P2GTCandidate &obj) const
 
bool checkObject (const P2GTCandidate &obj) const
 
 L1GTSingleCollectionCut (const edm::ParameterSet &config, const edm::ParameterSet &lutConfig, const L1GTScales &scales)
 
const edm::InputTagtag () const
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &desc)
 

Private Attributes

const std::optional< int > maxAbsEta_
 
const std::optional< int > maxEta_
 
const std::optional< int > maxIso_
 
const std::optional< int > maxPhi_
 
const std::optional< int > maxPt_
 
const std::optional< int > maxScalarSumPt_
 
const std::optional< int > maxZ0_
 
const std::optional< int > minAbsEta_
 
const std::optional< int > minEta_
 
const std::optional< int > minHwIso_
 
const std::optional< int > minPhi_
 
const std::optional< int > minPt_
 
const std::optional< int > minScalarSumPt_
 
const std::optional< int > minZ0_
 
const std::vector< unsigned int > qual_
 
const std::vector< int > regionsAbsEtaLowerBounds_
 
const std::vector< int > regionsMaxIso_
 
const std::vector< int > regionsMinPt_
 
const std::vector< unsigned int > regionsQual_
 
const L1GTScales scales_
 
const edm::InputTag tag_
 

Detailed Description

Definition at line 29 of file L1GTSingleCollectionCut.h.

Constructor & Destructor Documentation

◆ L1GTSingleCollectionCut()

l1t::L1GTSingleCollectionCut::L1GTSingleCollectionCut ( const edm::ParameterSet config,
const edm::ParameterSet lutConfig,
const L1GTScales scales 
)
inline

Definition at line 31 of file L1GTSingleCollectionCut.h.

References l1tGTDoubleObjectCond_cfi::scales.

34  : scales_(scales),
35  tag_(config.getParameter<edm::InputTag>("tag")),
36  minPt_(getOptionalParam<int, double>(
37  "minPt", config, [&scales](double value) { return scales.to_hw_pT(value); })),
38  maxPt_(getOptionalParam<int, double>(
39  "maxPt", config, [&scales](double value) { return scales.to_hw_pT(value); })),
40  minEta_(getOptionalParam<int, double>(
41  "minEta", config, [&scales](double value) { return scales.to_hw_eta(value); })),
42  maxEta_(getOptionalParam<int, double>(
43  "maxEta", config, [&scales](double value) { return scales.to_hw_eta(value); })),
44  minPhi_(getOptionalParam<int, double>(
45  "minPhi", config, [&scales](double value) { return scales.to_hw_phi(value); })),
46  maxPhi_(getOptionalParam<int, double>(
47  "maxPhi", config, [&scales](double value) { return scales.to_hw_phi(value); })),
48  minZ0_(getOptionalParam<int, double>(
49  "minZ0", config, [&scales](double value) { return scales.to_hw_z0(value); })),
50  maxZ0_(getOptionalParam<int, double>(
51  "maxZ0", config, [&scales](double value) { return scales.to_hw_z0(value); })),
52  minScalarSumPt_(getOptionalParam<int, double>(
53  "minScalarSumPt", config, [&scales](double value) { return scales.to_hw_pT(value); })),
54  maxScalarSumPt_(getOptionalParam<int, double>(
55  "maxScalarSumPt", config, [&scales](double value) { return scales.to_hw_pT(value); })),
56  qual_(config.getParameter<std::vector<unsigned int>>("qual")),
57  minAbsEta_(getOptionalParam<int, double>(
58  "minAbsEta", config, [&scales](double value) { return scales.to_hw_eta(value); })),
59  maxAbsEta_(getOptionalParam<int, double>(
60  "maxAbsEta", config, [&scales](double value) { return scales.to_hw_eta(value); })),
61  maxIso_(getOptionalParam<int, double>(
62  "maxIso", config, [&scales](double value) { return scales.to_hw_isolation(value); })),
63  minHwIso_(getOptionalParam<int>("minHwIso", config)),
64  regionsAbsEtaLowerBounds_(getParamVector<int, double>(
65  "regionsAbsEtaLowerBounds", config, [&scales](double value) { return scales.to_hw_eta(value); })),
66  regionsMinPt_(getParamVector<int, double>(
67  "regionsMinPt", config, [&scales](double value) { return scales.to_hw_pT(value); })),
68  regionsMaxIso_(getParamVector<int, double>(
69  "regionsMaxIso", config, [&scales](double value) { return scales.to_hw_isolation(value); })),
70  regionsQual_(config.getParameter<std::vector<unsigned int>>("regionsQual")) {}
const std::optional< int > maxAbsEta_
const std::optional< int > maxIso_
const std::optional< int > minPhi_
const std::vector< unsigned int > regionsQual_
const std::optional< int > maxEta_
const std::optional< int > maxPhi_
const std::vector< int > regionsAbsEtaLowerBounds_
const std::optional< int > maxScalarSumPt_
Definition: config.py:1
const std::optional< int > minAbsEta_
const std::optional< int > minEta_
const std::optional< int > minHwIso_
const std::optional< int > maxPt_
const std::vector< unsigned int > qual_
const std::optional< int > minZ0_
const std::vector< int > regionsMaxIso_
Definition: value.py:1
const std::vector< int > regionsMinPt_
const std::optional< int > maxZ0_
const std::optional< int > minPt_
const std::optional< int > minScalarSumPt_

Member Function Documentation

◆ atIndex()

unsigned int l1t::L1GTSingleCollectionCut::atIndex ( int  objeta) const
inline

Definition at line 85 of file L1GTSingleCollectionCut.h.

References funct::abs(), mps_fire::i, and regionsAbsEtaLowerBounds_.

Referenced by checkEtadependentcuts().

85  {
86  // Function that checks at which index the eta of the object is
87  // If object abs(eta) < regionsAbsEtaLowerBounds_[0] the function returns the last index,
88  // Might be undesired behaviour
89  for (unsigned int i = 0; i < regionsAbsEtaLowerBounds_.size() - 1; i++) {
90  if (std::abs(objeta) >= regionsAbsEtaLowerBounds_[i] && std::abs(objeta) < regionsAbsEtaLowerBounds_[i + 1]) {
91  return i;
92  }
93  }
94  return regionsAbsEtaLowerBounds_.size() - 1;
95  }
const std::vector< int > regionsAbsEtaLowerBounds_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ checkEtadependentcuts()

bool l1t::L1GTSingleCollectionCut::checkEtadependentcuts ( const P2GTCandidate obj) const
inline

Definition at line 72 of file L1GTSingleCollectionCut.h.

References atIndex(), l1t::L1GTScales::isolation_shift(), getGTfromDQMFile::obj, regionsMaxIso_, regionsMinPt_, regionsQual_, scales_, and funct::true.

Referenced by checkObject().

72  {
73  bool res = true;
74 
75  unsigned int index;
76  index = atIndex(obj.hwEta());
77  res &= regionsMinPt_.empty() ? true : obj.hwPT() > regionsMinPt_[index];
78  res &= regionsMaxIso_.empty()
79  ? true
80  : obj.hwIso().to_int() << scales_.isolation_shift() < regionsMaxIso_[index] * obj.hwPT().to_int();
81  res &= regionsQual_.empty() ? true : (obj.hwQual().to_uint() & regionsQual_[index]) == regionsQual_[index];
82  return res;
83  }
const std::vector< unsigned int > regionsQual_
Definition: Electron.h:6
unsigned int atIndex(int objeta) const
const std::vector< int > regionsMaxIso_
int isolation_shift() const
Definition: L1GTScales.h:76
const std::vector< int > regionsMinPt_

◆ checkObject()

bool l1t::L1GTSingleCollectionCut::checkObject ( const P2GTCandidate obj) const
inline

Definition at line 97 of file L1GTSingleCollectionCut.h.

References funct::abs(), checkEtadependentcuts(), spr::find(), l1t::L1GTScales::isolation_shift(), maxAbsEta_, maxEta_, maxIso_, maxPhi_, maxPt_, maxScalarSumPt_, maxZ0_, minAbsEta_, minEta_, minHwIso_, minPhi_, minPt_, minScalarSumPt_, minZ0_, getGTfromDQMFile::obj, qual_, regionsAbsEtaLowerBounds_, mps_fire::result, scales_, and funct::true.

Referenced by L1GTSingleObjectCond::filter(), L1GTTripleObjectCond::filter(), L1GTQuadObjectCond::filter(), and L1GTDoubleObjectCond::filter().

97  {
98  bool result = true;
99 
100  result &= minPt_ ? (obj.hwPT() > minPt_) : true;
101  result &= maxPt_ ? (obj.hwPT() < maxPt_) : true;
102 
103  result &= minEta_ ? (obj.hwEta() > minEta_) : true;
104  result &= maxEta_ ? (obj.hwEta() < maxEta_) : true;
105 
106  result &= minPhi_ ? (obj.hwPhi() > minPhi_) : true;
107  result &= maxPhi_ ? (obj.hwPhi() < maxPhi_) : true;
108 
109  result &= minZ0_ ? (obj.hwZ0() > minZ0_) : true;
110  result &= maxZ0_ ? (obj.hwZ0() < maxZ0_) : true;
111 
112  result &= minAbsEta_ ? (abs(obj.hwEta()) > minAbsEta_) : true;
113  result &= maxAbsEta_ ? (abs(obj.hwEta()) < maxAbsEta_) : true;
114 
115  result &= minScalarSumPt_ ? (obj.hwSca_sum() > minScalarSumPt_) : true;
116  result &= maxScalarSumPt_ ? (obj.hwSca_sum() < minScalarSumPt_) : true;
117 
118  result &= qual_.empty() ? true : std::find(qual_.begin(), qual_.end(), obj.hwQual().to_uint()) != qual_.end();
119  result &=
120  maxIso_ ? obj.hwIso().to_int() << scales_.isolation_shift() < maxIso_.value() * obj.hwPT().to_int() : true;
121 
122  result &= minHwIso_ ? (obj.hwIso() > minHwIso_) : true;
124  return result;
125  }
const std::optional< int > maxAbsEta_
const std::optional< int > maxIso_
bool checkEtadependentcuts(const P2GTCandidate &obj) const
const std::optional< int > minPhi_
const std::optional< int > maxEta_
const std::optional< int > maxPhi_
const std::vector< int > regionsAbsEtaLowerBounds_
const std::optional< int > maxScalarSumPt_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
const std::optional< int > minAbsEta_
const std::optional< int > minEta_
const std::optional< int > minHwIso_
const std::optional< int > maxPt_
const std::vector< unsigned int > qual_
const std::optional< int > minZ0_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int isolation_shift() const
Definition: L1GTScales.h:76
const std::optional< int > maxZ0_
const std::optional< int > minPt_
const std::optional< int > minScalarSumPt_

◆ fillPSetDescription()

static void l1t::L1GTSingleCollectionCut::fillPSetDescription ( edm::ParameterSetDescription desc)
inlinestatic

Definition at line 127 of file L1GTSingleCollectionCut.h.

References submitPVResolutionJobs::desc.

127  {
128  desc.add<edm::InputTag>("tag");
129  desc.addOptional<double>("minPt");
130  desc.addOptional<double>("maxPt");
131  desc.addOptional<double>("minEta");
132  desc.addOptional<double>("maxEta");
133  desc.addOptional<double>("minPhi");
134  desc.addOptional<double>("maxPhi");
135  desc.addOptional<double>("minZ0");
136  desc.addOptional<double>("maxZ0");
137  desc.addOptional<double>("minScalarSumPt");
138  desc.addOptional<double>("maxScalarSumPt");
139  desc.add<std::vector<unsigned int>>("qual", {});
140  desc.addOptional<double>("minAbsEta");
141  desc.addOptional<double>("maxAbsEta");
142  desc.addOptional<double>("maxIso");
143  desc.addOptional<int>("minHwIso");
144  desc.add<std::vector<double>>("regionsAbsEtaLowerBounds", {});
145  desc.add<std::vector<double>>("regionsMinPt", {});
146  desc.add<std::vector<double>>("regionsMaxIso", {});
147  desc.add<std::vector<unsigned int>>("regionsQual", {});
148  }

◆ tag()

const edm::InputTag& l1t::L1GTSingleCollectionCut::tag ( ) const
inline

Member Data Documentation

◆ maxAbsEta_

const std::optional<int> l1t::L1GTSingleCollectionCut::maxAbsEta_
private

Definition at line 167 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxEta_

const std::optional<int> l1t::L1GTSingleCollectionCut::maxEta_
private

Definition at line 158 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxIso_

const std::optional<int> l1t::L1GTSingleCollectionCut::maxIso_
private

Definition at line 168 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxPhi_

const std::optional<int> l1t::L1GTSingleCollectionCut::maxPhi_
private

Definition at line 160 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxPt_

const std::optional<int> l1t::L1GTSingleCollectionCut::maxPt_
private

Definition at line 156 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxScalarSumPt_

const std::optional<int> l1t::L1GTSingleCollectionCut::maxScalarSumPt_
private

Definition at line 164 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxZ0_

const std::optional<int> l1t::L1GTSingleCollectionCut::maxZ0_
private

Definition at line 162 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minAbsEta_

const std::optional<int> l1t::L1GTSingleCollectionCut::minAbsEta_
private

Definition at line 166 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minEta_

const std::optional<int> l1t::L1GTSingleCollectionCut::minEta_
private

Definition at line 157 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minHwIso_

const std::optional<int> l1t::L1GTSingleCollectionCut::minHwIso_
private

Definition at line 169 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minPhi_

const std::optional<int> l1t::L1GTSingleCollectionCut::minPhi_
private

Definition at line 159 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minPt_

const std::optional<int> l1t::L1GTSingleCollectionCut::minPt_
private

Definition at line 155 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minScalarSumPt_

const std::optional<int> l1t::L1GTSingleCollectionCut::minScalarSumPt_
private

Definition at line 163 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minZ0_

const std::optional<int> l1t::L1GTSingleCollectionCut::minZ0_
private

Definition at line 161 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ qual_

const std::vector<unsigned int> l1t::L1GTSingleCollectionCut::qual_
private

Definition at line 165 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ regionsAbsEtaLowerBounds_

const std::vector<int> l1t::L1GTSingleCollectionCut::regionsAbsEtaLowerBounds_
private

Definition at line 170 of file L1GTSingleCollectionCut.h.

Referenced by atIndex(), and checkObject().

◆ regionsMaxIso_

const std::vector<int> l1t::L1GTSingleCollectionCut::regionsMaxIso_
private

Definition at line 172 of file L1GTSingleCollectionCut.h.

Referenced by checkEtadependentcuts().

◆ regionsMinPt_

const std::vector<int> l1t::L1GTSingleCollectionCut::regionsMinPt_
private

Definition at line 171 of file L1GTSingleCollectionCut.h.

Referenced by checkEtadependentcuts().

◆ regionsQual_

const std::vector<unsigned int> l1t::L1GTSingleCollectionCut::regionsQual_
private

Definition at line 173 of file L1GTSingleCollectionCut.h.

Referenced by checkEtadependentcuts().

◆ scales_

const L1GTScales l1t::L1GTSingleCollectionCut::scales_
private

Definition at line 153 of file L1GTSingleCollectionCut.h.

Referenced by checkEtadependentcuts(), and checkObject().

◆ tag_

const edm::InputTag l1t::L1GTSingleCollectionCut::tag_
private

Definition at line 154 of file L1GTSingleCollectionCut.h.

Referenced by tag().