CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | 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 SiStripCluster &stripCluster)
 
void addHit (const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos, 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
 

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 37 of file DeDxHitInfo.h.

Constructor & Destructor Documentation

◆ DeDxHitInfo()

reco::DeDxHitInfo::DeDxHitInfo ( )
inline

Definition at line 40 of file DeDxHitInfo.h.

40 {}

Member Function Documentation

◆ addHit() [1/2]

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

Definition at line 89 of file DeDxHitInfo.h.

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

Referenced by DeDxHitInfoProducer::processHit().

93  {
94  infos_.push_back(DeDxHitInfoContainer(charge, pathlength, detId, pos));
95  stripClusters_.push_back(stripCluster);
96  }
float pathlength(size_t i) const
Definition: DeDxHitInfo.h:43
std::vector< SiStripCluster > stripClusters_
Definition: DeDxHitInfo.h:108
const SiStripCluster * stripCluster(size_t i) const
Definition: DeDxHitInfo.h:66
DetId detId(size_t i) const
Definition: DeDxHitInfo.h:44
float charge(size_t i) const
Definition: DeDxHitInfo.h:42
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:107

◆ addHit() [2/2]

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

Definition at line 97 of file DeDxHitInfo.h.

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

101  {
102  infos_.push_back(DeDxHitInfoContainer(charge, pathlength, detId, pos));
103  pixelClusters_.push_back(pixelCluster);
104  }
float pathlength(size_t i) const
Definition: DeDxHitInfo.h:43
std::vector< SiPixelCluster > pixelClusters_
Definition: DeDxHitInfo.h:109
DetId detId(size_t i) const
Definition: DeDxHitInfo.h:44
const SiPixelCluster * pixelCluster(size_t i) const
Definition: DeDxHitInfo.h:46
float charge(size_t i) const
Definition: DeDxHitInfo.h:42
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:107

◆ charge()

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

Definition at line 42 of file DeDxHitInfo.h.

References mps_fire::i, and infos_.

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

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

◆ detId()

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

Definition at line 44 of file DeDxHitInfo.h.

References mps_fire::i, and infos_.

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

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

◆ pathlength()

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

Definition at line 43 of file DeDxHitInfo.h.

References mps_fire::i, and infos_.

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

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

◆ pixelCluster()

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

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

46  {
47  size_t P = 0;
48  bool isPixel = false;
49  bool isFirst = true;
50  for (size_t j = 0; j <= i && j < infos_.size(); j++) {
51  if (detId(j).subdetId() < SiStripDetId::TIB) {
52  if (isFirst)
53  isFirst = false;
54  else
55  P++;
56  isPixel = true;
57  } else {
58  isPixel = false;
59  }
60  }
61  if (isPixel && pixelClusters_.size() > P) {
62  return &(pixelClusters_[P]);
63  }
64  return nullptr;
65  }
std::vector< SiPixelCluster > pixelClusters_
Definition: DeDxHitInfo.h:109
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:44
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:107

◆ pixelClusters()

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

Definition at line 87 of file DeDxHitInfo.h.

References pixelClusters_.

87 { return pixelClusters_; }
std::vector< SiPixelCluster > pixelClusters_
Definition: DeDxHitInfo.h:109

◆ pos()

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

Definition at line 45 of file DeDxHitInfo.h.

References mps_fire::i, and infos_.

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

◆ size()

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

◆ stripCluster()

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

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

66  {
67  size_t S = 0;
68  bool isStrip = false;
69  bool isFirst = true;
70  for (size_t j = 0; j <= i && j < infos_.size(); j++) {
71  if (detId(j).subdetId() >= SiStripDetId::TIB) {
72  if (isFirst) {
73  isFirst = false;
74  } else
75  S++;
76  isStrip = true;
77  } else {
78  isStrip = false;
79  }
80  }
81  if (isStrip && stripClusters_.size() > S) {
82  return &(stripClusters_[S]);
83  }
84  return nullptr;
85  }
std::vector< SiStripCluster > stripClusters_
Definition: DeDxHitInfo.h:108
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:44
isFirst
Definition: cuy.py:418
static constexpr auto TIB
Definition: SiStripDetId.h:37
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:107

◆ stripClusters()

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

Definition at line 86 of file DeDxHitInfo.h.

References stripClusters_.

86 { return stripClusters_; }
std::vector< SiStripCluster > stripClusters_
Definition: DeDxHitInfo.h:108

Member Data Documentation

◆ infos_

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

Definition at line 107 of file DeDxHitInfo.h.

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

◆ pixelClusters_

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

Definition at line 109 of file DeDxHitInfo.h.

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

◆ stripClusters_

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

Definition at line 108 of file DeDxHitInfo.h.

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