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 106 of file TrajSeedMatcher.h.

Constructor & Destructor Documentation

◆ MatchingCutsV2()

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

Definition at line 411 of file TrajSeedMatcher.cc.

412  : dPhiHighEt_(pset.getParameter<std::vector<double> >("dPhiMaxHighEt")),
413  dPhiHighEtThres_(pset.getParameter<std::vector<double> >("dPhiMaxHighEtThres")),
414  dPhiLowEtGrad_(pset.getParameter<std::vector<double> >("dPhiMaxLowEtGrad")),
415  dRZHighEt_(pset.getParameter<std::vector<double> >("dRZMaxHighEt")),
416  dRZHighEtThres_(pset.getParameter<std::vector<double> >("dRZMaxHighEtThres")),
417  dRZLowEtGrad_(pset.getParameter<std::vector<double> >("dRZMaxLowEtGrad")),
418  etaBins_(pset.getParameter<std::vector<double> >("etaBins")) {
419  auto binSizeCheck = [](size_t sizeEtaBins, const std::vector<double>& vec, const std::string& name) {
420  if (vec.size() != sizeEtaBins + 1) {
421  throw cms::Exception("InvalidConfig")
422  << " when constructing TrajSeedMatcher::MatchingCutsV2 " << name << " has " << vec.size()
423  << " bins, it should be equal to #bins of etaBins+1" << sizeEtaBins + 1;
424  }
425  };
426  binSizeCheck(etaBins_.size(), dPhiHighEt_, "dPhiMaxHighEt");
427  binSizeCheck(etaBins_.size(), dPhiHighEtThres_, "dPhiMaxHighEtThres");
428  binSizeCheck(etaBins_.size(), dPhiLowEtGrad_, "dPhiMaxLowEtGrad");
429  binSizeCheck(etaBins_.size(), dRZHighEt_, "dRZMaxHighEt");
430  binSizeCheck(etaBins_.size(), dRZHighEtThres_, "dRZMaxHighEtThres");
431  binSizeCheck(etaBins_.size(), dRZLowEtGrad_, "dRZMaxLowEtGrad");
432 }

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 447 of file TrajSeedMatcher.cc.

447  {
448  const float absEta = std::abs(eta);
449  for (size_t etaNr = 0; etaNr < etaBins_.size(); etaNr++) {
450  if (absEta < etaBins_[etaNr])
451  return etaNr;
452  }
453  return etaBins_.size();
454 }

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

◆ getCutValue()

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

Definition at line 113 of file TrajSeedMatcher.h.

113  {
114  return highEt + std::min(0.f, et - highEtThres) * lowEtGrad;
115  }

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 434 of file TrajSeedMatcher.cc.

434  {
435  size_t binNr = getBinNr(scHitMatch.eta);
436  float dPhiMax = getCutValue(scHitMatch.et, dPhiHighEt_[binNr], dPhiHighEtThres_[binNr], dPhiLowEtGrad_[binNr]);
437  if (dPhiMax >= 0 && std::abs(scHitMatch.dPhi) > dPhiMax)
438  return false;
439  float dRZMax = getCutValue(scHitMatch.et, dRZHighEt_[binNr], dRZHighEtThres_[binNr], dRZLowEtGrad_[binNr]);
440  if (dRZMax >= 0 && std::abs(scHitMatch.dRZ) > dRZMax)
441  return false;
442 
443  return true;
444 }

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 118 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ dPhiHighEtThres_

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

Definition at line 118 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ dPhiLowEtGrad_

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

Definition at line 118 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ dRZHighEt_

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

Definition at line 119 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ dRZHighEtThres_

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

Definition at line 119 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ dRZLowEtGrad_

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

Definition at line 119 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

◆ etaBins_

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

Definition at line 120 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2().

TrajSeedMatcher::MatchingCutsV2::getBinNr
size_t getBinNr(float eta) const
Definition: TrajSeedMatcher.cc:447
TrajSeedMatcher::MatchingCutsV2::getCutValue
float getCutValue(float et, float highEt, float highEtThres, float lowEtGrad) const
Definition: TrajSeedMatcher.h:113
TrajSeedMatcher::MatchingCutsV2::dRZHighEtThres_
std::vector< double > dRZHighEtThres_
Definition: TrajSeedMatcher.h:119
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:120
TrajSeedMatcher::MatchingCutsV2::dPhiHighEtThres_
std::vector< double > dPhiHighEtThres_
Definition: TrajSeedMatcher.h:118
gedPhotons_cfi.highEt
highEt
Definition: gedPhotons_cfi.py:50
TrajSeedMatcher::MatchingCutsV2::dPhiLowEtGrad_
std::vector< double > dPhiLowEtGrad_
Definition: TrajSeedMatcher.h:118
PVValHelper::eta
Definition: PVValidationHelpers.h:70
TrajSeedMatcher::MatchingCutsV2::dPhiHighEt_
std::vector< double > dPhiHighEt_
Definition: TrajSeedMatcher.h:118
TrajSeedMatcher::MatchingCutsV2::dRZHighEt_
std::vector< double > dRZHighEt_
Definition: TrajSeedMatcher.h:119
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:119
Exception
Definition: hltDiff.cc:245
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:9
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27