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

Constructor & Destructor Documentation

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

Definition at line 444 of file TrajSeedMatcher.cc.

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

444  :
445  dPhiHighEt_(pset.getParameter<std::vector<double> >("dPhiMaxHighEt")),
446  dPhiHighEtThres_(pset.getParameter<std::vector<double> >("dPhiMaxHighEtThres")),
447  dPhiLowEtGrad_(pset.getParameter<std::vector<double> >("dPhiMaxLowEtGrad")),
448  dRZHighEt_(pset.getParameter<std::vector<double> >("dRZMaxHighEt")),
449  dRZHighEtThres_(pset.getParameter<std::vector<double> >("dRZMaxHighEtThres")),
450  dRZLowEtGrad_(pset.getParameter<std::vector<double> >("dRZMaxLowEtGrad")),
451  etaBins_(pset.getParameter<std::vector<double> >("etaBins"))
452 {
453  auto binSizeCheck = [](size_t sizeEtaBins,const std::vector<double>& vec,const std::string& name){
454  if(vec.size()!=sizeEtaBins+1){
455  throw cms::Exception("InvalidConfig")<<" when constructing TrajSeedMatcher::MatchingCutsV2 "<< name<<" has "<<vec.size()<<" bins, it should be equal to #bins of etaBins+1"<<sizeEtaBins+1;
456  }
457  };
458  binSizeCheck(etaBins_.size(),dPhiHighEt_,"dPhiMaxHighEt");
459  binSizeCheck(etaBins_.size(),dPhiHighEtThres_,"dPhiMaxHighEtThres");
460  binSizeCheck(etaBins_.size(),dPhiLowEtGrad_,"dPhiMaxLowEtGrad");
461  binSizeCheck(etaBins_.size(),dRZHighEt_,"dRZMaxHighEt");
462  binSizeCheck(etaBins_.size(),dRZHighEtThres_,"dRZMaxHighEtThres");
463  binSizeCheck(etaBins_.size(),dRZLowEtGrad_,"dRZMaxLowEtGrad");
464 }
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 478 of file TrajSeedMatcher.cc.

References funct::abs(), and etaBins_.

Referenced by operator()().

479 {
480  const float absEta = std::abs(eta);
481  for(size_t etaNr=0;etaNr<etaBins_.size();etaNr++){
482  if(absEta<etaBins_[etaNr]) return etaNr;
483  }
484  return etaBins_.size();
485 }
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 197 of file TrajSeedMatcher.h.

References f, and min().

Referenced by operator()().

197  {
198  return highEt + std::min(0.f,et-highEtThres)*lowEtGrad;
199  }
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
et
define resolution functions of each parameter
bool TrajSeedMatcher::MatchingCutsV2::operator() ( const SCHitMatch scHitMatch) const
overridevirtual

Implements TrajSeedMatcher::MatchingCuts.

Definition at line 466 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().

467 {
468  size_t binNr=getBinNr(scHitMatch.eta());
469  float dPhiMax = getCutValue(scHitMatch.et(),dPhiHighEt_[binNr],dPhiHighEtThres_[binNr],dPhiLowEtGrad_[binNr]);
470  if(dPhiMax>=0 && std::abs(scHitMatch.dPhi()) > dPhiMax) return false;
471  float dRZMax = getCutValue(scHitMatch.et(),dRZHighEt_[binNr],dRZHighEtThres_[binNr],dRZLowEtGrad_[binNr]);
472  if(dRZMax>=0 && std::abs(scHitMatch.dRZ()) > dRZMax) return false;
473 
474  return true;
475 }
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 201 of file TrajSeedMatcher.h.

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

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

Definition at line 201 of file TrajSeedMatcher.h.

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

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

Definition at line 201 of file TrajSeedMatcher.h.

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

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

Definition at line 202 of file TrajSeedMatcher.h.

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

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

Definition at line 202 of file TrajSeedMatcher.h.

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

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

Definition at line 202 of file TrajSeedMatcher.h.

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

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

Definition at line 203 of file TrajSeedMatcher.h.

Referenced by getBinNr(), and MatchingCutsV2().