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

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

Referenced by TrajSeedMatcher::SCHitMatch::SCHitMatch().

389  :
391 {
392  size_t nrHitsMax = std::max(posCharge.size(),negCharge.size());
393  for(size_t hitNr=0;hitNr<nrHitsMax;hitNr++){
394  DetId detIdPos = hitNr<posCharge.size() ? posCharge[hitNr].detId() : DetId(0);
395  float dRZPos = hitNr<posCharge.size() ? posCharge[hitNr].dRZ() : std::numeric_limits<float>::max();
396  float dPhiPos = hitNr<posCharge.size() ? posCharge[hitNr].dPhi() : std::numeric_limits<float>::max();
397 
398  DetId detIdNeg = hitNr<negCharge.size() ? negCharge[hitNr].detId() : DetId(0);
399  float dRZNeg = hitNr<negCharge.size() ? negCharge[hitNr].dRZ() : std::numeric_limits<float>::max();
400  float dPhiNeg = hitNr<negCharge.size() ? negCharge[hitNr].dPhi() : std::numeric_limits<float>::max();
401 
402  if(detIdPos!=detIdNeg && (detIdPos.rawId()!=0 && detIdNeg.rawId()!=0)){
403  cms::Exception("LogicError")<<" error in "<<__FILE__<<", "<<__LINE__<<" hits to be combined have different detIDs, this should not be possible and nothing good will come of it";
404  }
405  DetId detId = detIdPos.rawId()!=0 ? detIdPos : detIdNeg;
406  matchInfo_.push_back(MatchInfo(detId,dRZPos,dRZNeg,dPhiPos,dPhiNeg));
407  }
408 }
DetId detId(size_t hitNr) const
float dRZPos(size_t hitNr) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::vector< MatchInfo > matchInfo_
float dPhiPos(size_t hitNr) const
Definition: DetId.h:18
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 155 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

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

Definition at line 154 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

154 {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 153 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

153 {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 152 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

152 {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 151 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

151 {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 160 of file TrajSeedMatcher.h.

References hpstanc_transforms::max.

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

Definition at line 157 of file TrajSeedMatcher.h.

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

Definition at line 156 of file TrajSeedMatcher.h.

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

Definition at line 158 of file TrajSeedMatcher.h.

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

Definition at line 150 of file TrajSeedMatcher.h.

150 {return seed_;}
const TrajectorySeed & seed_

Member Data Documentation

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

Definition at line 166 of file TrajSeedMatcher.h.

Referenced by SeedWithInfo().

int TrajSeedMatcher::SeedWithInfo::nrValidLayers_
private

Definition at line 167 of file TrajSeedMatcher.h.

const TrajectorySeed& TrajSeedMatcher::SeedWithInfo::seed_
private

Definition at line 165 of file TrajSeedMatcher.h.