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

Constructor & Destructor Documentation

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

Definition at line 470 of file TrajSeedMatcher.cc.

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

471  : dPhiHighEt_(pset.getParameter<std::vector<double> >("dPhiMaxHighEt")),
472  dPhiHighEtThres_(pset.getParameter<std::vector<double> >("dPhiMaxHighEtThres")),
473  dPhiLowEtGrad_(pset.getParameter<std::vector<double> >("dPhiMaxLowEtGrad")),
474  dRZHighEt_(pset.getParameter<std::vector<double> >("dRZMaxHighEt")),
475  dRZHighEtThres_(pset.getParameter<std::vector<double> >("dRZMaxHighEtThres")),
476  dRZLowEtGrad_(pset.getParameter<std::vector<double> >("dRZMaxLowEtGrad")),
477  etaBins_(pset.getParameter<std::vector<double> >("etaBins")) {
478  auto binSizeCheck = [](size_t sizeEtaBins, const std::vector<double>& vec, const std::string& name) {
479  if (vec.size() != sizeEtaBins + 1) {
480  throw cms::Exception("InvalidConfig")
481  << " when constructing TrajSeedMatcher::MatchingCutsV2 " << name << " has " << vec.size()
482  << " bins, it should be equal to #bins of etaBins+1" << sizeEtaBins + 1;
483  }
484  };
485  binSizeCheck(etaBins_.size(), dPhiHighEt_, "dPhiMaxHighEt");
486  binSizeCheck(etaBins_.size(), dPhiHighEtThres_, "dPhiMaxHighEtThres");
487  binSizeCheck(etaBins_.size(), dPhiLowEtGrad_, "dPhiMaxLowEtGrad");
488  binSizeCheck(etaBins_.size(), dRZHighEt_, "dRZMaxHighEt");
489  binSizeCheck(etaBins_.size(), dRZHighEtThres_, "dRZMaxHighEtThres");
490  binSizeCheck(etaBins_.size(), dRZLowEtGrad_, "dRZMaxLowEtGrad");
491 }
T getParameter(std::string const &) const
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

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

Definition at line 506 of file TrajSeedMatcher.cc.

References funct::abs(), and etaBins_.

Referenced by operator()().

506  {
507  const float absEta = std::abs(eta);
508  for (size_t etaNr = 0; etaNr < etaBins_.size(); etaNr++) {
509  if (absEta < etaBins_[etaNr])
510  return etaNr;
511  }
512  return etaBins_.size();
513 }
std::vector< double > etaBins_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float TrajSeedMatcher::MatchingCutsV2::getCutValue ( float  et,
float  highEt,
float  highEtThres,
float  lowEtGrad 
) const
inlineprivate

Definition at line 170 of file TrajSeedMatcher.h.

References f, and min().

Referenced by operator()().

170  {
171  return highEt + std::min(0.f, et - highEtThres) * lowEtGrad;
172  }
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
bool TrajSeedMatcher::MatchingCutsV2::operator() ( const SCHitMatch scHitMatch) const
overridevirtual

Implements TrajSeedMatcher::MatchingCuts.

Definition at line 493 of file TrajSeedMatcher.cc.

References funct::abs(), TrajSeedMatcher::SCHitMatch::dPhi(), dPhiHighEt_, dPhiHighEtThres_, dPhiLowEtGrad_, CSCSegmentAlgorithmRU_cfi::dPhiMax, TrajSeedMatcher::SCHitMatch::dRZ(), dRZHighEt_, dRZHighEtThres_, dRZLowEtGrad_, TrajSeedMatcher::SCHitMatch::et(), TrajSeedMatcher::SCHitMatch::eta(), getBinNr(), and getCutValue().

493  {
494  size_t binNr = getBinNr(scHitMatch.eta());
495  float dPhiMax = getCutValue(scHitMatch.et(), dPhiHighEt_[binNr], dPhiHighEtThres_[binNr], dPhiLowEtGrad_[binNr]);
496  if (dPhiMax >= 0 && std::abs(scHitMatch.dPhi()) > dPhiMax)
497  return false;
498  float dRZMax = getCutValue(scHitMatch.et(), dRZHighEt_[binNr], dRZHighEtThres_[binNr], dRZLowEtGrad_[binNr]);
499  if (dRZMax >= 0 && std::abs(scHitMatch.dRZ()) > dRZMax)
500  return false;
501 
502  return true;
503 }
std::vector< double > dRZLowEtGrad_
std::vector< double > dPhiLowEtGrad_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< double > dPhiHighEt_
size_t getBinNr(float eta) const
std::vector< double > dPhiHighEtThres_
std::vector< double > dRZHighEtThres_
std::vector< double > dRZHighEt_
float getCutValue(float et, float highEt, float highEtThres, float lowEtGrad) const

Member Data Documentation

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

Definition at line 175 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2(), and operator()().

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

Definition at line 175 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2(), and operator()().

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

Definition at line 175 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2(), and operator()().

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

Definition at line 176 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2(), and operator()().

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

Definition at line 176 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2(), and operator()().

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

Definition at line 176 of file TrajSeedMatcher.h.

Referenced by MatchingCutsV2(), and operator()().

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

Definition at line 177 of file TrajSeedMatcher.h.

Referenced by getBinNr(), and MatchingCutsV2().