CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
reco::DeDxHitInfo Class Reference

#include <DeDxHitInfo.h>

Classes

class  DeDxHitInfoContainer
 

Public Types

typedef std::vector< DeDxHitInfo::DeDxHitInfoContainerDeDxHitInfoContainerCollection
 

Public Member Functions

void addHit (const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos, const uint8_t &type, const SiStripCluster &stripCluster)
 
void addHit (const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos, const uint8_t &type, const SiPixelCluster &pixelCluster)
 
float charge (size_t i) const
 
 DeDxHitInfo ()
 
DetId detId (size_t i) const
 
float pathlength (size_t i) const
 
const SiPixelClusterpixelCluster (size_t i) const
 
const std::vector< SiPixelCluster > & pixelClusters () const
 
const LocalPoint pos (size_t i) const
 
size_t size () const
 
const SiStripClusterstripCluster (size_t i) const
 
const std::vector< SiStripCluster > & stripClusters () const
 
const uint8_t type (size_t i) const
 

Static Public Attributes

static constexpr int Calibration = 2
 
static constexpr int Compatible = 1
 
static constexpr int Complete = 0
 

Private Attributes

std::vector< DeDxHitInfoContainerinfos_
 
std::vector< SiPixelClusterpixelClusters_
 
std::vector< SiStripClusterstripClusters_
 

Detailed Description

Definition at line 14 of file DeDxHitInfo.h.

Member Typedef Documentation

◆ DeDxHitInfoContainerCollection

Definition at line 41 of file DeDxHitInfo.h.

Constructor & Destructor Documentation

◆ DeDxHitInfo()

reco::DeDxHitInfo::DeDxHitInfo ( )
inline

Definition at line 44 of file DeDxHitInfo.h.

44 {}

Member Function Documentation

◆ addHit() [1/2]

void reco::DeDxHitInfo::addHit ( const float  charge,
const float  pathlength,
const DetId detId,
const LocalPoint pos,
const uint8_t &  type,
const SiStripCluster stripCluster 
)
inline

Definition at line 94 of file DeDxHitInfo.h.

References charge(), detId(), infos_, pathlength(), stripCluster(), and stripClusters_.

Referenced by DeDxHitInfoProducer::processHit(), and DeDxHitInfoProducer::processRec().

99  {
100  infos_.push_back(DeDxHitInfoContainer(charge, pathlength, detId, pos, type));
101  stripClusters_.push_back(stripCluster);
102  }
float pathlength(size_t i) const
Definition: DeDxHitInfo.h:47
std::vector< SiStripCluster > stripClusters_
Definition: DeDxHitInfo.h:115
const SiStripCluster * stripCluster(size_t i) const
Definition: DeDxHitInfo.h:71
DetId detId(size_t i) const
Definition: DeDxHitInfo.h:48
float charge(size_t i) const
Definition: DeDxHitInfo.h:46
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:114

◆ addHit() [2/2]

void reco::DeDxHitInfo::addHit ( const float  charge,
const float  pathlength,
const DetId detId,
const LocalPoint pos,
const uint8_t &  type,
const SiPixelCluster pixelCluster 
)
inline

Definition at line 103 of file DeDxHitInfo.h.

References charge(), detId(), infos_, pathlength(), pixelCluster(), and pixelClusters_.

108  {
109  infos_.push_back(DeDxHitInfoContainer(charge, pathlength, detId, pos, type));
110  pixelClusters_.push_back(pixelCluster);
111  }
float pathlength(size_t i) const
Definition: DeDxHitInfo.h:47
std::vector< SiPixelCluster > pixelClusters_
Definition: DeDxHitInfo.h:116
DetId detId(size_t i) const
Definition: DeDxHitInfo.h:48
const SiPixelCluster * pixelCluster(size_t i) const
Definition: DeDxHitInfo.h:51
float charge(size_t i) const
Definition: DeDxHitInfo.h:46
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:114

◆ charge()

float reco::DeDxHitInfo::charge ( size_t  i) const
inline

Definition at line 46 of file DeDxHitInfo.h.

References mps_fire::i, and infos_.

Referenced by addHit(), dEdxHitAnalyzer::analyze(), pat::PATIsolatedTrackProducer::getDeDx(), dEdxHitAnalyzer::harmonic2(), and DeDxHitInfoProducer::produce().

46 { return infos_[i].charge(); }
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:114

◆ detId()

DetId reco::DeDxHitInfo::detId ( size_t  i) const
inline

Definition at line 48 of file DeDxHitInfo.h.

References mps_fire::i, and infos_.

Referenced by addHit(), dEdxHitAnalyzer::analyze(), dEdxHitAnalyzer::harmonic2(), pixelCluster(), DeDxHitInfoProducer::produce(), and stripCluster().

48 { return infos_[i].detId(); }
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:114

◆ pathlength()

float reco::DeDxHitInfo::pathlength ( size_t  i) const
inline

Definition at line 47 of file DeDxHitInfo.h.

References mps_fire::i, and infos_.

Referenced by addHit(), pat::PATIsolatedTrackProducer::getDeDx(), dEdxHitAnalyzer::harmonic2(), and DeDxHitInfoProducer::produce().

47 { return infos_[i].pathlength(); }
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:114

◆ pixelCluster()

const SiPixelCluster* reco::DeDxHitInfo::pixelCluster ( size_t  i) const
inline

Definition at line 51 of file DeDxHitInfo.h.

References detId(), mps_fire::i, infos_, cuy::isFirst, fastTrackerRecHitType::isPixel(), dqmiolumiharvest::j, pixelClusters_, DetId::subdetId(), and SiStripDetId::TIB.

Referenced by addHit(), and pat::PATIsolatedTrackProducer::getDeDx().

51  {
52  size_t P = 0;
53  bool isPixel = false;
54  bool isFirst = true;
55  for (size_t j = 0; j <= i && j < infos_.size(); j++) {
56  if (detId(j).subdetId() < SiStripDetId::TIB) {
57  if (isFirst)
58  isFirst = false;
59  else
60  P++;
61  isPixel = true;
62  } else {
63  isPixel = false;
64  }
65  }
66  if (isPixel && pixelClusters_.size() > P) {
67  return &(pixelClusters_[P]);
68  }
69  return nullptr;
70  }
std::vector< SiPixelCluster > pixelClusters_
Definition: DeDxHitInfo.h:116
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
DetId detId(size_t i) const
Definition: DeDxHitInfo.h:48
isFirst
Definition: cuy.py:418
std::pair< OmniClusterRef, TrackingParticleRef > P
static constexpr auto TIB
Definition: SiStripDetId.h:37
bool isPixel(HitType hitType)
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:114

◆ pixelClusters()

const std::vector<SiPixelCluster>& reco::DeDxHitInfo::pixelClusters ( ) const
inline

Definition at line 92 of file DeDxHitInfo.h.

References pixelClusters_.

92 { return pixelClusters_; }
std::vector< SiPixelCluster > pixelClusters_
Definition: DeDxHitInfo.h:116

◆ pos()

const LocalPoint reco::DeDxHitInfo::pos ( size_t  i) const
inline

Definition at line 49 of file DeDxHitInfo.h.

References mps_fire::i, and infos_.

49 { return infos_[i].pos(); }
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:114

◆ size()

size_t reco::DeDxHitInfo::size ( void  ) const
inline

◆ stripCluster()

const SiStripCluster* reco::DeDxHitInfo::stripCluster ( size_t  i) const
inline

Definition at line 71 of file DeDxHitInfo.h.

References detId(), mps_fire::i, infos_, cuy::isFirst, dqmiolumiharvest::j, stripClusters_, DetId::subdetId(), and SiStripDetId::TIB.

Referenced by addHit(), pat::PATIsolatedTrackProducer::getDeDx(), and DeDxHitInfoProducer::produce().

71  {
72  size_t S = 0;
73  bool isStrip = false;
74  bool isFirst = true;
75  for (size_t j = 0; j <= i && j < infos_.size(); j++) {
76  if (detId(j).subdetId() >= SiStripDetId::TIB) {
77  if (isFirst) {
78  isFirst = false;
79  } else
80  S++;
81  isStrip = true;
82  } else {
83  isStrip = false;
84  }
85  }
86  if (isStrip && stripClusters_.size() > S) {
87  return &(stripClusters_[S]);
88  }
89  return nullptr;
90  }
std::vector< SiStripCluster > stripClusters_
Definition: DeDxHitInfo.h:115
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
DetId detId(size_t i) const
Definition: DeDxHitInfo.h:48
isFirst
Definition: cuy.py:418
static constexpr auto TIB
Definition: SiStripDetId.h:37
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:114

◆ stripClusters()

const std::vector<SiStripCluster>& reco::DeDxHitInfo::stripClusters ( ) const
inline

Definition at line 91 of file DeDxHitInfo.h.

References stripClusters_.

91 { return stripClusters_; }
std::vector< SiStripCluster > stripClusters_
Definition: DeDxHitInfo.h:115

◆ type()

const uint8_t reco::DeDxHitInfo::type ( size_t  i) const
inline

Definition at line 50 of file DeDxHitInfo.h.

References mps_fire::i, and infos_.

50 { return infos_[i].type(); }
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:114

Member Data Documentation

◆ Calibration

constexpr int reco::DeDxHitInfo::Calibration = 2
static

◆ Compatible

constexpr int reco::DeDxHitInfo::Compatible = 1
static

◆ Complete

constexpr int reco::DeDxHitInfo::Complete = 0
static

◆ infos_

std::vector<DeDxHitInfoContainer> reco::DeDxHitInfo::infos_
private

Definition at line 114 of file DeDxHitInfo.h.

Referenced by addHit(), charge(), detId(), pathlength(), pixelCluster(), pos(), size(), stripCluster(), and type().

◆ pixelClusters_

std::vector<SiPixelCluster> reco::DeDxHitInfo::pixelClusters_
private

Definition at line 116 of file DeDxHitInfo.h.

Referenced by addHit(), pixelCluster(), and pixelClusters().

◆ stripClusters_

std::vector<SiStripCluster> reco::DeDxHitInfo::stripClusters_
private

Definition at line 115 of file DeDxHitInfo.h.

Referenced by addHit(), stripCluster(), and stripClusters().