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

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

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

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

444  {
445  const float absEta = std::abs(eta);
446  for (size_t etaNr = 0; etaNr < etaBins_.size(); etaNr++) {
447  if (absEta < etaBins_[etaNr])
448  return etaNr;
449  }
450  return etaBins_.size();
451 }
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 431 of file TrajSeedMatcher.cc.

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

431  {
432  size_t binNr = getBinNr(scHitMatch.eta);
433  float dPhiMax = getCutValue(scHitMatch.et, dPhiHighEt_[binNr], dPhiHighEtThres_[binNr], dPhiLowEtGrad_[binNr]);
434  if (dPhiMax >= 0 && std::abs(scHitMatch.dPhi) > dPhiMax)
435  return false;
436  float dRZMax = getCutValue(scHitMatch.et, dRZHighEt_[binNr], dRZHighEtThres_[binNr], dRZLowEtGrad_[binNr]);
437  if (dRZMax >= 0 && std::abs(scHitMatch.dRZ) > dRZMax)
438  return false;
439 
440  return true;
441 }
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().