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

Constructor & Destructor Documentation

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

Definition at line 409 of file TrajSeedMatcher.cc.

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

414  size_t nrHitsMax = std::max(posCharge.size(), negCharge.size());
415  for (size_t hitNr = 0; hitNr < nrHitsMax; hitNr++) {
416  DetId detIdPos = hitNr < posCharge.size() ? posCharge[hitNr].detId() : DetId(0);
417  float dRZPos = hitNr < posCharge.size() ? posCharge[hitNr].dRZ() : std::numeric_limits<float>::max();
418  float dPhiPos = hitNr < posCharge.size() ? posCharge[hitNr].dPhi() : std::numeric_limits<float>::max();
419 
420  DetId detIdNeg = hitNr < negCharge.size() ? negCharge[hitNr].detId() : DetId(0);
421  float dRZNeg = hitNr < negCharge.size() ? negCharge[hitNr].dRZ() : std::numeric_limits<float>::max();
422  float dPhiNeg = hitNr < negCharge.size() ? negCharge[hitNr].dPhi() : std::numeric_limits<float>::max();
423 
424  if (detIdPos != detIdNeg && (detIdPos.rawId() != 0 && detIdNeg.rawId() != 0)) {
425  cms::Exception("LogicError")
426  << " error in " << __FILE__ << ", " << __LINE__
427  << " hits to be combined have different detIDs, this should not be possible and nothing good will come of it";
428  }
429  DetId detId = detIdPos.rawId() != 0 ? detIdPos : detIdNeg;
430  matchInfo_.push_back(MatchInfo(detId, dRZPos, dRZNeg, dPhiPos, dPhiNeg));
431  }
432 }
DetId detId(size_t hitNr) const
float dRZPos(size_t hitNr) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< MatchInfo > matchInfo_
float dPhiPos(size_t hitNr) const
Definition: DetId.h:17
float dRZNeg(size_t hitNr) const
const TrajectorySeed & seed_
float dPhiNeg(size_t hitNr) const
TrajSeedMatcher::SeedWithInfo::~SeedWithInfo ( )
default

Member Function Documentation

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

Definition at line 124 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

124 { return hitNr < matchInfo_.size() ? matchInfo_[hitNr].detId : DetId(0); }
std::vector< MatchInfo > matchInfo_
Definition: DetId.h:17
float TrajSeedMatcher::SeedWithInfo::dPhiNeg ( size_t  hitNr) const
inline

Definition at line 123 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

123 { return getVal(hitNr, &MatchInfo::dPhiNeg); }
float getVal(size_t hitNr, float MatchInfo::*val) const
float TrajSeedMatcher::SeedWithInfo::dPhiPos ( size_t  hitNr) const
inline

Definition at line 122 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

122 { return getVal(hitNr, &MatchInfo::dPhiPos); }
float getVal(size_t hitNr, float MatchInfo::*val) const
float TrajSeedMatcher::SeedWithInfo::dRZNeg ( size_t  hitNr) const
inline

Definition at line 121 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

121 { return getVal(hitNr, &MatchInfo::dRZNeg); }
float getVal(size_t hitNr, float MatchInfo::*val) const
float TrajSeedMatcher::SeedWithInfo::dRZPos ( size_t  hitNr) const
inline

Definition at line 120 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

120 { return getVal(hitNr, &MatchInfo::dRZPos); }
float getVal(size_t hitNr, float MatchInfo::*val) const
float TrajSeedMatcher::SeedWithInfo::getVal ( size_t  hitNr,
float MatchInfo::*  val 
) const
inlineprivate

Definition at line 130 of file TrajSeedMatcher.h.

References SiStripPI::max.

130  {
131  return hitNr < matchInfo_.size() ? matchInfo_[hitNr].*val : std::numeric_limits<float>::max();
132  }
std::vector< MatchInfo > matchInfo_
const std::vector<MatchInfo>& TrajSeedMatcher::SeedWithInfo::matches ( ) const
inline

Definition at line 126 of file TrajSeedMatcher.h.

126 { return matchInfo_; }
std::vector< MatchInfo > matchInfo_
size_t TrajSeedMatcher::SeedWithInfo::nrMatchedHits ( ) const
inline

Definition at line 125 of file TrajSeedMatcher.h.

125 { return matchInfo_.size(); }
std::vector< MatchInfo > matchInfo_
int TrajSeedMatcher::SeedWithInfo::nrValidLayers ( ) const
inline

Definition at line 127 of file TrajSeedMatcher.h.

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

Definition at line 119 of file TrajSeedMatcher.h.

119 { return seed_; }
const TrajectorySeed & seed_

Member Data Documentation

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

Definition at line 136 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

int TrajSeedMatcher::SeedWithInfo::nrValidLayers_
private

Definition at line 137 of file TrajSeedMatcher.h.

const TrajectorySeed& TrajSeedMatcher::SeedWithInfo::seed_
private

Definition at line 135 of file TrajSeedMatcher.h.