CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
TrajSeedMatcher::MatchingCutsV2 Class Reference

#include <TrajSeedMatcher.h>

Inheritance diagram for TrajSeedMatcher::MatchingCutsV2:
TrajSeedMatcher::MatchingCuts

Public Member Functions

 MatchingCutsV2 (const edm::ParameterSet &pset)
 
bool operator() (const SCHitMatch &scHitMatch) const override
 
- Public Member Functions inherited from TrajSeedMatcher::MatchingCuts
 MatchingCuts ()
 
virtual ~MatchingCuts ()
 

Private Member Functions

size_t getBinNr (float eta) const
 
float getCutValue (float et, float highEt, float highEtThres, float lowEtGrad) const
 

Private Attributes

std::vector< double > dPhiHighEt_
 
std::vector< double > dPhiHighEtThres_
 
std::vector< double > dPhiLowEtGrad_
 
std::vector< double > dRZHighEt_
 
std::vector< double > dRZHighEtThres_
 
std::vector< double > dRZLowEtGrad_
 
std::vector< double > etaBins_
 

Detailed Description

Definition at line 129 of file TrajSeedMatcher.h.

Constructor & Destructor Documentation

◆ MatchingCutsV2()

TrajSeedMatcher::MatchingCutsV2::MatchingCutsV2 ( const edm::ParameterSet pset)
explicit

Definition at line 432 of file TrajSeedMatcher.cc.

433  : dPhiHighEt_(pset.getParameter<std::vector<double> >("dPhiMaxHighEt")),
434  dPhiHighEtThres_(pset.getParameter<std::vector<double> >("dPhiMaxHighEtThres")),
435  dPhiLowEtGrad_(pset.getParameter<std::vector<double> >("dPhiMaxLowEtGrad")),
436  dRZHighEt_(pset.getParameter<std::vector<double> >("dRZMaxHighEt")),
437  dRZHighEtThres_(pset.getParameter<std::vector<double> >("dRZMaxHighEtThres")),
438  dRZLowEtGrad_(pset.getParameter<std::vector<double> >("dRZMaxLowEtGrad")),
439  etaBins_(pset.getParameter<std::vector<double> >("etaBins")) {
440  auto binSizeCheck = [](size_t sizeEtaBins, const std::vector<double>& vec, const std::string& name) {
441  if (vec.size() != sizeEtaBins + 1) {
442  throw cms::Exception("InvalidConfig")
443  << " when constructing TrajSeedMatcher::MatchingCutsV2 " << name << " has " << vec.size()
444  << " bins, it should be equal to #bins of etaBins+1" << sizeEtaBins + 1;
445  }
446  };
447  binSizeCheck(etaBins_.size(), dPhiHighEt_, "dPhiMaxHighEt");
448  binSizeCheck(etaBins_.size(), dPhiHighEtThres_, "dPhiMaxHighEtThres");
449  binSizeCheck(etaBins_.size(), dPhiLowEtGrad_, "dPhiMaxLowEtGrad");
450  binSizeCheck(etaBins_.size(), dRZHighEt_, "dRZMaxHighEt");
451  binSizeCheck(etaBins_.size(), dRZHighEtThres_, "dRZMaxHighEtThres");
452  binSizeCheck(etaBins_.size(), dRZLowEtGrad_, "dRZMaxLowEtGrad");
453 }

References dPhiHighEt_, dPhiHighEtThres_, dPhiLowEtGrad_, dRZHighEt_, dRZHighEtThres_, dRZLowEtGrad_, etaBins_, Exception, Skims_PA_cff::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Function Documentation

◆ getBinNr()

size_t TrajSeedMatcher::MatchingCutsV2::getBinNr ( float  eta) const
private

Definition at line 468 of file TrajSeedMatcher.cc.

468  {
469  const float absEta = std::abs(eta);
470  for (size_t etaNr = 0; etaNr < etaBins_.size(); etaNr++) {
471  if (absEta < etaBins_[etaNr])
472  return etaNr;
473  }
474  return etaBins_.size();
475 }

References funct::abs(), and PVValHelper::eta.

◆ getCutValue()

float TrajSeedMatcher::MatchingCutsV2::getCutValue ( float  et,
float  highEt,
float  highEtThres,
float  lowEtGrad 
) const
inlineprivate

Definition at line 136 of file TrajSeedMatcher.h.

136  {
137  return highEt + std::min(0.f, et - highEtThres) * lowEtGrad;
138  }

References EgHLTOffHistBins_cfi::et, f, gedPhotons_cfi::highEt, and min().

◆ operator()()

bool TrajSeedMatcher::MatchingCutsV2::operator() ( const SCHitMatch scHitMatch) const
overridevirtual

Implements TrajSeedMatcher::MatchingCuts.

Definition at line 455 of file TrajSeedMatcher.cc.

455  {
456  size_t binNr = getBinNr(scHitMatch.eta);
457  float dPhiMax = getCutValue(scHitMatch.et, dPhiHighEt_[binNr], dPhiHighEtThres_[binNr], dPhiLowEtGrad_[binNr]);
458  if (dPhiMax >= 0 && std::abs(scHitMatch.dPhi) > dPhiMax)
459  return false;
460  float dRZMax = getCutValue(scHitMatch.et, dRZHighEt_[binNr], dRZHighEtThres_[binNr], dRZLowEtGrad_[binNr]);
461  if (dRZMax >= 0 && std::abs(scHitMatch.dRZ) > dRZMax)
462  return false;
463 
464  return true;
465 }

References funct::abs(), TrajSeedMatcher::SCHitMatch::dPhi, CSCSegmentAlgorithmRU_cfi::dPhiMax, TrajSeedMatcher::SCHitMatch::dRZ, TrajSeedMatcher::SCHitMatch::et, and TrajSeedMatcher::SCHitMatch::eta.

Member Data Documentation

◆ dPhiHighEt_

std::vector<double> TrajSeedMatcher::MatchingCutsV2::dPhiHighEt_
private

Definition at line 141 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ dPhiHighEtThres_

std::vector<double> TrajSeedMatcher::MatchingCutsV2::dPhiHighEtThres_
private

Definition at line 141 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ dPhiLowEtGrad_

std::vector<double> TrajSeedMatcher::MatchingCutsV2::dPhiLowEtGrad_
private

Definition at line 141 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ dRZHighEt_

std::vector<double> TrajSeedMatcher::MatchingCutsV2::dRZHighEt_
private

Definition at line 142 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ dRZHighEtThres_

std::vector<double> TrajSeedMatcher::MatchingCutsV2::dRZHighEtThres_
private

Definition at line 142 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ dRZLowEtGrad_

std::vector<double> TrajSeedMatcher::MatchingCutsV2::dRZLowEtGrad_
private

Definition at line 142 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ etaBins_

std::vector<double> TrajSeedMatcher::MatchingCutsV2::etaBins_
private

Definition at line 143 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

TrajSeedMatcher::MatchingCutsV2::getBinNr
size_t getBinNr(float eta) const
Definition: TrajSeedMatcher.cc:468
TrajSeedMatcher::MatchingCutsV2::getCutValue
float getCutValue(float et, float highEt, float highEtThres, float lowEtGrad) const
Definition: TrajSeedMatcher.h:136
TrajSeedMatcher::MatchingCutsV2::dRZHighEtThres_
std::vector< double > dRZHighEtThres_
Definition: TrajSeedMatcher.h:142
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
min
T min(T a, T b)
Definition: MathUtil.h:58
TrajSeedMatcher::MatchingCutsV2::etaBins_
std::vector< double > etaBins_
Definition: TrajSeedMatcher.h:143
TrajSeedMatcher::MatchingCutsV2::dPhiHighEtThres_
std::vector< double > dPhiHighEtThres_
Definition: TrajSeedMatcher.h:141
gedPhotons_cfi.highEt
highEt
Definition: gedPhotons_cfi.py:50
TrajSeedMatcher::MatchingCutsV2::dPhiLowEtGrad_
std::vector< double > dPhiLowEtGrad_
Definition: TrajSeedMatcher.h:141
PVValHelper::eta
Definition: PVValidationHelpers.h:69
TrajSeedMatcher::MatchingCutsV2::dPhiHighEt_
std::vector< double > dPhiHighEt_
Definition: TrajSeedMatcher.h:141
TrajSeedMatcher::MatchingCutsV2::dRZHighEt_
std::vector< double > dRZHighEt_
Definition: TrajSeedMatcher.h:142
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
TrajSeedMatcher::MatchingCutsV2::dRZLowEtGrad_
std::vector< double > dRZLowEtGrad_
Definition: TrajSeedMatcher.h:142
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CSCSegmentAlgorithmRU_cfi.dPhiMax
dPhiMax
Definition: CSCSegmentAlgorithmRU_cfi.py:10
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27