CMS 3D CMS Logo

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

#include <L1GTSingleCollectionCut.h>

Public Member Functions

bool checkObject (const P2GTCandidate &obj) const
 
bool checkPrimaryVertices (const P2GTCandidate &obj, const P2GTCandidateCollection &primVertCol) 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 Member Functions

unsigned int atIndex (int objeta) const
 
bool checkEtaDependentCuts (const P2GTCandidate &obj) const
 

Private Attributes

const std::optional< int > maxAbsEta_
 
const std::optional< int > maxEta_
 
const std::optional< int > maxIsolationPt_
 
const std::optional< int > maxPhi_
 
const std::optional< int > maxPrimVertDz_
 
const std::optional< int > maxPt_
 
const std::optional< unsigned int > maxQualityScore_
 
const std::optional< int > maxRelIsolationPt_
 
const std::optional< int > maxScalarSumPt_
 
const std::optional< int > maxZ0_
 
const std::optional< int > minAbsEta_
 
const std::optional< int > minEta_
 
const std::optional< int > minIsolationPt_
 
const std::optional< int > minPhi_
 
const std::optional< int > minPrimVertDz_
 
const std::optional< int > minPt_
 
const std::optional< unsigned int > minQualityScore_
 
const std::optional< int > minRelIsolationPt_
 
const std::optional< int > minScalarSumPt_
 
const std::optional< int > minZ0_
 
const std::optional< unsigned int > primVertex_
 
const std::optional< unsigned int > qualityFlags_
 
const std::vector< int > regionsAbsEtaLowerBounds_
 
const std::vector< int > regionsMaxRelIsolationPt_
 
const std::vector< int > regionsMinPt_
 
const std::vector< unsigned int > regionsQualityFlags_
 
const L1GTScales scales_
 
const edm::InputTag tag_
 

Detailed Description

Definition at line 31 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 33 of file L1GTSingleCollectionCut.h.

References l1tGTDoubleObjectCond_cfi::scales.

36  : scales_(scales),
37  tag_(config.getParameter<edm::InputTag>("tag")),
38  minPt_(getOptionalParam<int, double>(
39  "minPt", config, [&scales](double value) { return scales.to_hw_pT_floor(value); })),
40  maxPt_(getOptionalParam<int, double>(
41  "maxPt", config, [&scales](double value) { return scales.to_hw_pT_ceil(value); })),
42  minEta_(getOptionalParam<int, double>(
43  "minEta", config, [&scales](double value) { return scales.to_hw_eta_floor(value); })),
44  maxEta_(getOptionalParam<int, double>(
45  "maxEta", config, [&scales](double value) { return scales.to_hw_eta_ceil(value); })),
46  minPhi_(getOptionalParam<int, double>(
47  "minPhi", config, [&scales](double value) { return scales.to_hw_phi_floor(value); })),
48  maxPhi_(getOptionalParam<int, double>(
49  "maxPhi", config, [&scales](double value) { return scales.to_hw_phi_ceil(value); })),
50  minZ0_(getOptionalParam<int, double>(
51  "minZ0", config, [&scales](double value) { return scales.to_hw_z0_floor(value); })),
52  maxZ0_(getOptionalParam<int, double>(
53  "maxZ0", config, [&scales](double value) { return scales.to_hw_z0_ceil(value); })),
54  minScalarSumPt_(getOptionalParam<int, double>(
55  "minScalarSumPt", config, [&scales](double value) { return scales.to_hw_pT_floor(value); })),
56  maxScalarSumPt_(getOptionalParam<int, double>(
57  "maxScalarSumPt", config, [&scales](double value) { return scales.to_hw_pT_ceil(value); })),
58  minQualityScore_(getOptionalParam<unsigned int>("minQualityScore", config)),
59  maxQualityScore_(getOptionalParam<unsigned int>("maxQualityScore", config)),
60  qualityFlags_(getOptionalParam<unsigned int>("qualityFlags", config)),
61  minAbsEta_(getOptionalParam<int, double>(
62  "minAbsEta", config, [&scales](double value) { return scales.to_hw_eta_floor(value); })),
63  maxAbsEta_(getOptionalParam<int, double>(
64  "maxAbsEta", config, [&scales](double value) { return scales.to_hw_eta_ceil(value); })),
65  minIsolationPt_(getOptionalParam<int, double>(
66  "minRelIsolationPt", config, [&scales](double value) { return scales.to_hw_isolationPT_floor(value); })),
67  maxIsolationPt_(getOptionalParam<int, double>(
68  "maxRelIsolationPt", config, [&scales](double value) { return scales.to_hw_isolationPT_ceil(value); })),
69  minRelIsolationPt_(getOptionalParam<int, double>(
70  "minRelIsolationPt",
71  config,
72  [&scales](double value) { return scales.to_hw_relative_isolationPT_floor(value); })),
73  maxRelIsolationPt_(getOptionalParam<int, double>(
74  "maxRelIsolationPt",
75  config,
76  [&scales](double value) { return scales.to_hw_relative_isolationPT_ceil(value); })),
77  regionsAbsEtaLowerBounds_(getParamVector<int, double>(
78  "regionsAbsEtaLowerBounds", config, [&scales](double value) { return scales.to_hw_eta_ceil(value); })),
79  regionsMinPt_(getParamVector<int, double>(
80  "regionsMinPt", config, [&scales](double value) { return scales.to_hw_pT_floor(value); })),
81  regionsMaxRelIsolationPt_(getParamVector<int, double>(
82  "regionsMaxRelIsolationPt",
83  config,
84  [&scales](double value) { return scales.to_hw_relative_isolationPT_ceil(value); })),
85  regionsQualityFlags_(config.getParameter<std::vector<unsigned int>>("regionsQualityFlags")),
86  minPrimVertDz_(getOptionalParam<int, double>(
87  "minPrimVertDz", config, [&scales](double value) { return scales.to_hw_z0_floor(value); })),
88  maxPrimVertDz_(getOptionalParam<int, double>(
89  "maxPrimVertDz", config, [&scales](double value) { return scales.to_hw_z0_ceil(value); })),
90  primVertex_(getOptionalParam<unsigned int>("primVertex", config)) {}
const std::optional< int > maxAbsEta_
const std::optional< unsigned int > maxQualityScore_
const std::optional< int > maxRelIsolationPt_
const std::vector< int > regionsMaxRelIsolationPt_
const std::optional< int > minPhi_
const std::optional< unsigned int > primVertex_
const std::optional< int > minPrimVertDz_
const std::vector< unsigned int > regionsQualityFlags_
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< unsigned int > qualityFlags_
const std::optional< int > minAbsEta_
const std::optional< int > minRelIsolationPt_
const std::optional< int > minEta_
const std::optional< int > maxPt_
const std::optional< int > maxPrimVertDz_
const std::optional< int > minZ0_
const std::optional< int > maxIsolationPt_
Definition: value.py:1
const std::optional< unsigned int > minQualityScore_
const std::vector< int > regionsMinPt_
const std::optional< int > minIsolationPt_
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
inlineprivate

Definition at line 203 of file L1GTSingleCollectionCut.h.

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

Referenced by checkEtaDependentCuts().

203  {
204  // Function that checks at which index the eta of the object is
205  // If object abs(eta) < regionsAbsEtaLowerBounds_[0] the function returns the last index,
206  // Might be undesired behaviour
207  for (unsigned int i = 0; i < regionsAbsEtaLowerBounds_.size() - 1; i++) {
208  if (std::abs(objeta) >= regionsAbsEtaLowerBounds_[i] && std::abs(objeta) < regionsAbsEtaLowerBounds_[i + 1]) {
209  return i;
210  }
211  }
212  return regionsAbsEtaLowerBounds_.size() - 1;
213  }
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
inlineprivate

Definition at line 187 of file L1GTSingleCollectionCut.h.

References atIndex(), getGTfromDQMFile::obj, regionsMaxRelIsolationPt_, regionsMinPt_, regionsQualityFlags_, l1t::L1GTScales::RELATIVE_ISOLATION_RESOLUTION, and funct::true.

Referenced by checkObject().

187  {
188  bool res = true;
189 
190  unsigned int index;
191  index = atIndex(obj.hwEta());
192  res &= regionsMinPt_.empty() ? true : obj.hwPT() > regionsMinPt_[index];
193  res &= regionsMaxRelIsolationPt_.empty()
194  ? true
195  : obj.hwIsolationPT().to_int64() << L1GTScales::RELATIVE_ISOLATION_RESOLUTION <
196  static_cast<int64_t>(regionsMaxRelIsolationPt_[index]) * obj.hwPT().to_int64();
197  res &= regionsQualityFlags_.empty()
198  ? true
199  : (obj.hwQualityFlags().to_uint() & regionsQualityFlags_[index]) == regionsQualityFlags_[index];
200  return res;
201  }
const std::vector< int > regionsMaxRelIsolationPt_
const std::vector< unsigned int > regionsQualityFlags_
Definition: Electron.h:6
unsigned int atIndex(int objeta) const
static constexpr int RELATIVE_ISOLATION_RESOLUTION
Definition: L1GTScales.h:12
const std::vector< int > regionsMinPt_

◆ checkObject()

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

Definition at line 92 of file L1GTSingleCollectionCut.h.

References funct::abs(), checkEtaDependentCuts(), maxAbsEta_, maxEta_, maxIsolationPt_, maxPhi_, maxPt_, maxQualityScore_, maxRelIsolationPt_, maxScalarSumPt_, maxZ0_, minAbsEta_, minEta_, minIsolationPt_, minPhi_, minPt_, minQualityScore_, minRelIsolationPt_, minScalarSumPt_, minZ0_, getGTfromDQMFile::obj, qualityFlags_, regionsAbsEtaLowerBounds_, l1t::L1GTScales::RELATIVE_ISOLATION_RESOLUTION, mps_fire::result, and funct::true.

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

92  {
93  bool result = true;
94 
95  result &= minPt_ ? (obj.hwPT() > minPt_) : true;
96  result &= maxPt_ ? (obj.hwPT() < maxPt_) : true;
97 
98  result &= minEta_ ? (obj.hwEta() > minEta_) : true;
99  result &= maxEta_ ? (obj.hwEta() < maxEta_) : true;
100 
101  result &= minPhi_ ? (obj.hwPhi() > minPhi_) : true;
102  result &= maxPhi_ ? (obj.hwPhi() < maxPhi_) : true;
103 
104  result &= minZ0_ ? (obj.hwZ0() > minZ0_) : true;
105  result &= maxZ0_ ? (obj.hwZ0() < maxZ0_) : true;
106 
107  result &= minAbsEta_ ? (abs(obj.hwEta()) > minAbsEta_) : true;
108  result &= maxAbsEta_ ? (abs(obj.hwEta()) < maxAbsEta_) : true;
109 
110  result &= minScalarSumPt_ ? (obj.hwScalarSumPT() > minScalarSumPt_) : true;
111  result &= maxScalarSumPt_ ? (obj.hwScalarSumPT() < maxScalarSumPt_) : true;
112 
113  result &= minQualityScore_ ? (obj.hwQualityScore() > minQualityScore_) : true;
114  result &= maxQualityScore_ ? (obj.hwQualityScore() < maxQualityScore_) : true;
115  result &= qualityFlags_ ? (obj.hwQualityFlags().to_uint() & qualityFlags_.value()) == qualityFlags_ : true;
116 
117  result &= minIsolationPt_ ? (obj.hwIsolationPT() > minIsolationPt_) : true;
118  result &= maxIsolationPt_ ? (obj.hwIsolationPT() < maxIsolationPt_) : true;
119 
120  result &= minRelIsolationPt_ ? obj.hwIsolationPT().to_int64() << L1GTScales::RELATIVE_ISOLATION_RESOLUTION >
121  static_cast<int64_t>(minRelIsolationPt_.value()) * obj.hwPT().to_int64()
122  : true;
123  result &= maxRelIsolationPt_ ? obj.hwIsolationPT().to_int64() << L1GTScales::RELATIVE_ISOLATION_RESOLUTION <
124  static_cast<int64_t>(maxRelIsolationPt_.value()) * obj.hwPT().to_int64()
125  : true;
126 
128  return result;
129  }
const std::optional< int > maxAbsEta_
const std::optional< unsigned int > maxQualityScore_
const std::optional< int > maxRelIsolationPt_
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_
const std::optional< unsigned int > qualityFlags_
const std::optional< int > minAbsEta_
const std::optional< int > minRelIsolationPt_
const std::optional< int > minEta_
const std::optional< int > maxPt_
const std::optional< int > minZ0_
const std::optional< int > maxIsolationPt_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const std::optional< unsigned int > minQualityScore_
static constexpr int RELATIVE_ISOLATION_RESOLUTION
Definition: L1GTScales.h:12
const std::optional< int > minIsolationPt_
const std::optional< int > maxZ0_
const std::optional< int > minPt_
const std::optional< int > minScalarSumPt_

◆ checkPrimaryVertices()

bool l1t::L1GTSingleCollectionCut::checkPrimaryVertices ( const P2GTCandidate obj,
const P2GTCandidateCollection primVertCol 
) const
inline

Definition at line 131 of file L1GTSingleCollectionCut.h.

References funct::abs(), Exception, maxPrimVertDz_, minPrimVertDz_, getGTfromDQMFile::obj, primVertex_, and mps_fire::result.

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

131  {
132  if (!minPrimVertDz_ && !maxPrimVertDz_) {
133  return true;
134  } else {
135  if (!primVertex_) {
136  throw cms::Exception("Configuration")
137  << "When a min/max primary vertex cut is set the primary vertex to cut\n"
138  << "on has to be specified with with config parameter \'primVertex\'. ";
139  }
140  if (primVertex_ < primVertCol.size()) {
141  uint32_t dZ = abs(obj.hwZ0() - primVertCol[primVertex_.value()].hwZ0());
142 
143  bool result = true;
144  result &= minPrimVertDz_ ? dZ > minPrimVertDz_ : true;
145  result &= maxPrimVertDz_ ? dZ < maxPrimVertDz_ : true;
146  return result;
147  } else {
148  return false;
149  }
150  }
151  }
const std::optional< unsigned int > primVertex_
const std::optional< int > minPrimVertDz_
const std::optional< int > maxPrimVertDz_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ fillPSetDescription()

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

Definition at line 153 of file L1GTSingleCollectionCut.h.

References submitPVResolutionJobs::desc.

153  {
154  desc.add<edm::InputTag>("tag");
155  desc.addOptional<double>("minPt");
156  desc.addOptional<double>("maxPt");
157  desc.addOptional<double>("minEta");
158  desc.addOptional<double>("maxEta");
159  desc.addOptional<double>("minPhi");
160  desc.addOptional<double>("maxPhi");
161  desc.addOptional<double>("minZ0");
162  desc.addOptional<double>("maxZ0");
163  desc.addOptional<double>("minScalarSumPt");
164  desc.addOptional<double>("maxScalarSumPt");
165  desc.addOptional<unsigned int>("minQualityScore");
166  desc.addOptional<unsigned int>("maxQualityScore");
167  desc.addOptional<unsigned int>("qualityFlags");
168  desc.add<std::vector<unsigned int>>("regions", {});
169  desc.addOptional<double>("minAbsEta");
170  desc.addOptional<double>("maxAbsEta");
171  desc.addOptional<double>("minIsolationPt");
172  desc.addOptional<double>("maxIsolationPt");
173  desc.addOptional<double>("minRelIsolationPt");
174  desc.addOptional<double>("maxRelIsolationPt");
175  desc.add<std::vector<double>>("regionsAbsEtaLowerBounds", {});
176  desc.add<std::vector<double>>("regionsMinPt", {});
177  desc.add<std::vector<double>>("regionsMaxRelIsolationPt", {});
178  desc.add<std::vector<unsigned int>>("regionsQualityFlags", {});
179  desc.addOptional<double>("minPrimVertDz");
180  desc.addOptional<double>("maxPrimVertDz");
181  desc.addOptional<unsigned int>("primVertex");
182  }

◆ tag()

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

Member Data Documentation

◆ maxAbsEta_

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

Definition at line 232 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxEta_

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

Definition at line 221 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxIsolationPt_

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

Definition at line 234 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxPhi_

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

Definition at line 223 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxPrimVertDz_

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

Definition at line 242 of file L1GTSingleCollectionCut.h.

Referenced by checkPrimaryVertices().

◆ maxPt_

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

Definition at line 219 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxQualityScore_

const std::optional<unsigned int> l1t::L1GTSingleCollectionCut::maxQualityScore_
private

Definition at line 229 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxRelIsolationPt_

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

Definition at line 236 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxScalarSumPt_

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

Definition at line 227 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ maxZ0_

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

Definition at line 225 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minAbsEta_

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

Definition at line 231 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minEta_

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

Definition at line 220 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minIsolationPt_

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

Definition at line 233 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minPhi_

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

Definition at line 222 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minPrimVertDz_

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

Definition at line 241 of file L1GTSingleCollectionCut.h.

Referenced by checkPrimaryVertices().

◆ minPt_

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

Definition at line 218 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minQualityScore_

const std::optional<unsigned int> l1t::L1GTSingleCollectionCut::minQualityScore_
private

Definition at line 228 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minRelIsolationPt_

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

Definition at line 235 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minScalarSumPt_

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

Definition at line 226 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ minZ0_

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

Definition at line 224 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ primVertex_

const std::optional<unsigned int> l1t::L1GTSingleCollectionCut::primVertex_
private

Definition at line 243 of file L1GTSingleCollectionCut.h.

Referenced by checkPrimaryVertices().

◆ qualityFlags_

const std::optional<unsigned int> l1t::L1GTSingleCollectionCut::qualityFlags_
private

Definition at line 230 of file L1GTSingleCollectionCut.h.

Referenced by checkObject().

◆ regionsAbsEtaLowerBounds_

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

Definition at line 237 of file L1GTSingleCollectionCut.h.

Referenced by atIndex(), and checkObject().

◆ regionsMaxRelIsolationPt_

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

Definition at line 239 of file L1GTSingleCollectionCut.h.

Referenced by checkEtaDependentCuts().

◆ regionsMinPt_

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

Definition at line 238 of file L1GTSingleCollectionCut.h.

Referenced by checkEtaDependentCuts().

◆ regionsQualityFlags_

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

Definition at line 240 of file L1GTSingleCollectionCut.h.

Referenced by checkEtaDependentCuts().

◆ scales_

const L1GTScales l1t::L1GTSingleCollectionCut::scales_
private

Definition at line 216 of file L1GTSingleCollectionCut.h.

◆ tag_

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

Definition at line 217 of file L1GTSingleCollectionCut.h.

Referenced by tag().