CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
TrajSeedMatcher::SeedWithInfo Class Reference

#include <TrajSeedMatcher.h>

Public Member Functions

DetId detId (size_t hitNr) const
 
float dPhiNeg (size_t hitNr) const
 
float dPhiPos (size_t hitNr) const
 
float dRZNeg (size_t hitNr) const
 
float dRZPos (size_t hitNr) const
 
const std::vector< MatchInfo > & matches () const
 
size_t nrMatchedHits () const
 
int nrValidLayers () const
 
const TrajectorySeedseed () const
 
 SeedWithInfo (const TrajectorySeed &seed, const std::vector< SCHitMatch > &posCharge, const std::vector< SCHitMatch > &negCharge, int nrValidLayers)
 
 ~SeedWithInfo ()=default
 

Private Member Functions

float getVal (size_t hitNr, float MatchInfo::*val) const
 

Private Attributes

std::vector< MatchInfomatchInfo_
 
int nrValidLayers_
 
const TrajectorySeedseed_
 

Detailed Description

Definition at line 77 of file TrajSeedMatcher.h.

Constructor & Destructor Documentation

◆ SeedWithInfo()

TrajSeedMatcher::SeedWithInfo::SeedWithInfo ( const TrajectorySeed seed,
const std::vector< SCHitMatch > &  posCharge,
const std::vector< SCHitMatch > &  negCharge,
int  nrValidLayers 
)

Definition at line 371 of file TrajSeedMatcher.cc.

376  size_t nrHitsMax = std::max(posCharge.size(), negCharge.size());
377  for (size_t hitNr = 0; hitNr < nrHitsMax; hitNr++) {
378  DetId detIdPos = hitNr < posCharge.size() ? posCharge[hitNr].detId : DetId(0);
379  float dRZPos = hitNr < posCharge.size() ? posCharge[hitNr].dRZ : std::numeric_limits<float>::max();
380  float dPhiPos = hitNr < posCharge.size() ? posCharge[hitNr].dPhi : std::numeric_limits<float>::max();
381 
382  DetId detIdNeg = hitNr < negCharge.size() ? negCharge[hitNr].detId : DetId(0);
383  float dRZNeg = hitNr < negCharge.size() ? negCharge[hitNr].dRZ : std::numeric_limits<float>::max();
384  float dPhiNeg = hitNr < negCharge.size() ? negCharge[hitNr].dPhi : std::numeric_limits<float>::max();
385 
386  if (detIdPos != detIdNeg && (detIdPos.rawId() != 0 && detIdNeg.rawId() != 0)) {
387  cms::Exception("LogicError")
388  << " error in " << __FILE__ << ", " << __LINE__
389  << " hits to be combined have different detIDs, this should not be possible and nothing good will come of it";
390  }
391  DetId detId = detIdPos.rawId() != 0 ? detIdPos : detIdNeg;
392  matchInfo_.push_back(MatchInfo(detId, dRZPos, dRZNeg, dPhiPos, dPhiNeg));
393  }
394 }

References detId(), dPhiNeg(), dPhiPos(), dRZNeg(), dRZPos(), Exception, matchInfo_, SiStripPI::max, and DetId::rawId().

◆ ~SeedWithInfo()

TrajSeedMatcher::SeedWithInfo::~SeedWithInfo ( )
default

Member Function Documentation

◆ detId()

DetId TrajSeedMatcher::SeedWithInfo::detId ( size_t  hitNr) const
inline

Definition at line 90 of file TrajSeedMatcher.h.

90 { return hitNr < matchInfo_.size() ? matchInfo_[hitNr].detId : DetId(0); }

References matchInfo_.

Referenced by SeedWithInfo().

◆ dPhiNeg()

float TrajSeedMatcher::SeedWithInfo::dPhiNeg ( size_t  hitNr) const
inline

Definition at line 89 of file TrajSeedMatcher.h.

89 { return getVal(hitNr, &MatchInfo::dPhiNeg); }

References TrajSeedMatcher::MatchInfo::dPhiNeg, and getVal().

Referenced by SeedWithInfo().

◆ dPhiPos()

float TrajSeedMatcher::SeedWithInfo::dPhiPos ( size_t  hitNr) const
inline

Definition at line 88 of file TrajSeedMatcher.h.

88 { return getVal(hitNr, &MatchInfo::dPhiPos); }

References TrajSeedMatcher::MatchInfo::dPhiPos, and getVal().

Referenced by SeedWithInfo().

◆ dRZNeg()

float TrajSeedMatcher::SeedWithInfo::dRZNeg ( size_t  hitNr) const
inline

Definition at line 87 of file TrajSeedMatcher.h.

87 { return getVal(hitNr, &MatchInfo::dRZNeg); }

References TrajSeedMatcher::MatchInfo::dRZNeg, and getVal().

Referenced by SeedWithInfo().

◆ dRZPos()

float TrajSeedMatcher::SeedWithInfo::dRZPos ( size_t  hitNr) const
inline

Definition at line 86 of file TrajSeedMatcher.h.

86 { return getVal(hitNr, &MatchInfo::dRZPos); }

References TrajSeedMatcher::MatchInfo::dRZPos, and getVal().

Referenced by SeedWithInfo().

◆ getVal()

float TrajSeedMatcher::SeedWithInfo::getVal ( size_t  hitNr,
float MatchInfo::*  val 
) const
inlineprivate

Definition at line 96 of file TrajSeedMatcher.h.

96  {
97  return hitNr < matchInfo_.size() ? matchInfo_[hitNr].*val : std::numeric_limits<float>::max();
98  }

References matchInfo_, SiStripPI::max, and heppy_batch::val.

Referenced by dPhiNeg(), dPhiPos(), dRZNeg(), and dRZPos().

◆ matches()

const std::vector<MatchInfo>& TrajSeedMatcher::SeedWithInfo::matches ( ) const
inline

Definition at line 92 of file TrajSeedMatcher.h.

92 { return matchInfo_; }

References matchInfo_.

◆ nrMatchedHits()

size_t TrajSeedMatcher::SeedWithInfo::nrMatchedHits ( ) const
inline

Definition at line 91 of file TrajSeedMatcher.h.

91 { return matchInfo_.size(); }

References matchInfo_.

◆ nrValidLayers()

int TrajSeedMatcher::SeedWithInfo::nrValidLayers ( ) const
inline

Definition at line 93 of file TrajSeedMatcher.h.

93 { return nrValidLayers_; }

References nrValidLayers_.

◆ seed()

const TrajectorySeed& TrajSeedMatcher::SeedWithInfo::seed ( ) const
inline

Definition at line 85 of file TrajSeedMatcher.h.

85 { return seed_; }

References seed_.

Member Data Documentation

◆ matchInfo_

std::vector<MatchInfo> TrajSeedMatcher::SeedWithInfo::matchInfo_
private

Definition at line 102 of file TrajSeedMatcher.h.

Referenced by detId(), getVal(), matches(), nrMatchedHits(), and SeedWithInfo().

◆ nrValidLayers_

int TrajSeedMatcher::SeedWithInfo::nrValidLayers_
private

Definition at line 103 of file TrajSeedMatcher.h.

Referenced by nrValidLayers().

◆ seed_

const TrajectorySeed& TrajSeedMatcher::SeedWithInfo::seed_
private

Definition at line 101 of file TrajSeedMatcher.h.

Referenced by seed().

TrajSeedMatcher::SeedWithInfo::detId
DetId detId(size_t hitNr) const
Definition: TrajSeedMatcher.h:90
TrajSeedMatcher::SeedWithInfo::dPhiPos
float dPhiPos(size_t hitNr) const
Definition: TrajSeedMatcher.h:88
TrajSeedMatcher::SeedWithInfo::dPhiNeg
float dPhiNeg(size_t hitNr) const
Definition: TrajSeedMatcher.h:89
DetId
Definition: DetId.h:17
TrajSeedMatcher::SeedWithInfo::nrValidLayers_
int nrValidLayers_
Definition: TrajSeedMatcher.h:103
TrajSeedMatcher::SeedWithInfo::dRZNeg
float dRZNeg(size_t hitNr) const
Definition: TrajSeedMatcher.h:87
TrajSeedMatcher::MatchInfo::dRZNeg
float dRZNeg
Definition: TrajSeedMatcher.h:70
TrajSeedMatcher::SeedWithInfo::seed
const TrajectorySeed & seed() const
Definition: TrajSeedMatcher.h:85
TrajSeedMatcher::MatchInfo::dPhiNeg
float dPhiNeg
Definition: TrajSeedMatcher.h:71
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
TrajSeedMatcher::SeedWithInfo::nrValidLayers
int nrValidLayers() const
Definition: TrajSeedMatcher.h:93
TrajSeedMatcher::SeedWithInfo::dRZPos
float dRZPos(size_t hitNr) const
Definition: TrajSeedMatcher.h:86
TrajSeedMatcher::SeedWithInfo::seed_
const TrajectorySeed & seed_
Definition: TrajSeedMatcher.h:101
TrajSeedMatcher::MatchInfo::dRZPos
float dRZPos
Definition: TrajSeedMatcher.h:70
heppy_batch.val
val
Definition: heppy_batch.py:351
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
TrajSeedMatcher::SeedWithInfo::getVal
float getVal(size_t hitNr, float MatchInfo::*val) const
Definition: TrajSeedMatcher.h:96
Exception
Definition: hltDiff.cc:246
TrajSeedMatcher::SeedWithInfo::matchInfo_
std::vector< MatchInfo > matchInfo_
Definition: TrajSeedMatcher.h:102
TrajSeedMatcher::MatchInfo::dPhiPos
float dPhiPos
Definition: TrajSeedMatcher.h:71