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.

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

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 }
std::vector< double > dRZLowEtGrad_
std::vector< double > dPhiLowEtGrad_
std::vector< double > etaBins_
std::vector< double > dPhiHighEt_
std::vector< double > dPhiHighEtThres_
std::vector< double > dRZHighEtThres_
std::vector< double > dRZHighEt_

Member Function Documentation

◆ getBinNr()

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

Definition at line 447 of file TrajSeedMatcher.cc.

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

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 }
std::vector< double > etaBins_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ getCutValue()

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

Definition at line 113 of file TrajSeedMatcher.h.

References EgHLTOffHistBins_cfi::et, f, gedPhotons_cfi::highEt, and SiStripPI::min.

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

◆ operator()()

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

Implements TrajSeedMatcher::MatchingCuts.

Definition at line 434 of file TrajSeedMatcher.cc.

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

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 }
std::vector< double > dRZLowEtGrad_
std::vector< double > dPhiLowEtGrad_
float getCutValue(float et, float highEt, float highEtThres, float lowEtGrad) const
size_t getBinNr(float eta) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< double > dPhiHighEt_
std::vector< double > dPhiHighEtThres_
std::vector< double > dRZHighEtThres_
std::vector< double > dRZHighEt_

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().