CMS 3D CMS Logo

DeDxHitInfo.h
Go to the documentation of this file.
1 #ifndef DeDxHitInfo_H
2 #define DeDxHitInfo_H
3 #include <vector>
4 
12 
13 namespace reco {
14  class DeDxHitInfo {
15  public:
17  public:
19  DeDxHitInfoContainer(const float charge, const float pathlength, const DetId& detId, const LocalPoint& pos)
21 
22  float charge() const { return charge_; }
23  float pathlength() const { return pathlength_; }
24  const DetId& detId() const { return detId_; }
25  const LocalPoint& pos() const { return pos_; }
26 
27  private:
29  float charge_;
31  float pathlength_;
35  };
36 
37  typedef std::vector<DeDxHitInfo::DeDxHitInfoContainer> DeDxHitInfoContainerCollection;
38 
39  public:
41  size_t size() const { return infos_.size(); }
42  float charge(size_t i) const { return infos_[i].charge(); }
43  float pathlength(size_t i) const { return infos_[i].pathlength(); }
44  DetId detId(size_t i) const { return infos_[i].detId(); }
45  const LocalPoint pos(size_t i) const { return infos_[i].pos(); }
46  const SiPixelCluster* pixelCluster(size_t i) const {
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  }
66  const SiStripCluster* stripCluster(size_t i) const {
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  }
86  const std::vector<SiStripCluster>& stripClusters() const { return stripClusters_; }
87  const std::vector<SiPixelCluster>& pixelClusters() const { return pixelClusters_; }
88 
89  void addHit(const float charge,
90  const float pathlength,
91  const DetId& detId,
92  const LocalPoint& pos,
95  stripClusters_.push_back(stripCluster);
96  }
97  void addHit(const float charge,
98  const float pathlength,
99  const DetId& detId,
100  const LocalPoint& pos,
101  const SiPixelCluster& pixelCluster) {
103  pixelClusters_.push_back(pixelCluster);
104  }
105 
106  private:
107  std::vector<DeDxHitInfoContainer> infos_;
108  std::vector<SiStripCluster> stripClusters_;
109  std::vector<SiPixelCluster> pixelClusters_;
110  };
111 
112  typedef std::vector<DeDxHitInfo> DeDxHitInfoCollection;
117 } // namespace reco
118 
119 #endif
edm::RefProd
Definition: EDProductfwd.h:25
reco::DeDxHitInfo::detId
DetId detId(size_t i) const
Definition: DeDxHitInfo.h:44
mps_fire.i
i
Definition: mps_fire.py:355
reco::DeDxHitInfo::DeDxHitInfoContainer::detId
const DetId & detId() const
Definition: DeDxHitInfo.h:24
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
reco::DeDxHitInfo::addHit
void addHit(const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos, const SiPixelCluster &pixelCluster)
Definition: DeDxHitInfo.h:97
pos
Definition: PixelAliasList.h:18
SiPixelCluster.h
reco::DeDxHitInfo::DeDxHitInfoContainer::charge_
float charge_
total cluster charge
Definition: DeDxHitInfo.h:29
SiStripDetId.h
reco::DeDxHitInfo::stripClusters
const std::vector< SiStripCluster > & stripClusters() const
Definition: DeDxHitInfo.h:86
edm::RefVector
Definition: EDProductfwd.h:27
SiPixelCluster
Pixel cluster – collection of neighboring pixels above threshold.
Definition: SiPixelCluster.h:27
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
Association.h
cuy.isFirst
isFirst
Definition: cuy.py:419
reco::DeDxHitInfo::charge
float charge(size_t i) const
Definition: DeDxHitInfo.h:42
edm::Ref
Definition: AssociativeIterator.h:58
DetId
Definition: DetId.h:17
reco::DeDxHitInfo::stripCluster
const SiStripCluster * stripCluster(size_t i) const
Definition: DeDxHitInfo.h:66
reco::DeDxHitInfo::DeDxHitInfoContainer::charge
float charge() const
Definition: DeDxHitInfo.h:22
reco::DeDxHitInfoAss
edm::Association< DeDxHitInfoCollection > DeDxHitInfoAss
Definition: DeDxHitInfo.h:116
reco::DeDxHitInfo::pathlength
float pathlength(size_t i) const
Definition: DeDxHitInfo.h:43
reco::DeDxHitInfoRefProd
edm::RefProd< DeDxHitInfoCollection > DeDxHitInfoRefProd
Definition: DeDxHitInfo.h:114
reco::DeDxHitInfo::pixelClusters
const std::vector< SiPixelCluster > & pixelClusters() const
Definition: DeDxHitInfo.h:87
reco::DeDxHitInfo::DeDxHitInfoContainer::pos_
LocalPoint pos_
hit position
Definition: DeDxHitInfo.h:34
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
reco::DeDxHitInfo::DeDxHitInfoContainer::DeDxHitInfoContainer
DeDxHitInfoContainer(const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos)
Definition: DeDxHitInfo.h:19
reco::DeDxHitInfoCollection
std::vector< DeDxHitInfo > DeDxHitInfoCollection
Definition: DeDxHitInfo.h:112
reco::DeDxHitInfo
Definition: DeDxHitInfo.h:14
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
reco::DeDxHitInfo::DeDxHitInfoContainer::detId_
DetId detId_
Definition: DeDxHitInfo.h:32
reco::DeDxHitInfo::DeDxHitInfoContainer::DeDxHitInfoContainer
DeDxHitInfoContainer()
Definition: DeDxHitInfo.h:18
SiStripCluster.h
RefVector.h
fastTrackerRecHitType::isPixel
bool isPixel(HitType hitType)
Definition: FastTrackerRecHit.h:37
reco::DeDxHitInfoRef
edm::Ref< DeDxHitInfoCollection > DeDxHitInfoRef
Definition: DeDxHitInfo.h:113
reco::DeDxHitInfo::pixelCluster
const SiPixelCluster * pixelCluster(size_t i) const
Definition: DeDxHitInfo.h:46
math::LocalPoint
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::LocalCoordinateSystemTag > LocalPoint
point in local coordinate system
Definition: Point3D.h:15
reco::DeDxHitInfoRefVector
edm::RefVector< DeDxHitInfoCollection > DeDxHitInfoRefVector
Definition: DeDxHitInfo.h:115
edm::Association
Definition: Association.h:18
reco::DeDxHitInfo::size
size_t size() const
Definition: DeDxHitInfo.h:41
reco::DeDxHitInfo::DeDxHitInfoContainer::pos
const LocalPoint & pos() const
Definition: DeDxHitInfo.h:25
reco::DeDxHitInfo::DeDxHitInfo
DeDxHitInfo()
Definition: DeDxHitInfo.h:40
reco::DeDxHitInfo::stripClusters_
std::vector< SiStripCluster > stripClusters_
Definition: DeDxHitInfo.h:108
reco::DeDxHitInfo::DeDxHitInfoContainerCollection
std::vector< DeDxHitInfo::DeDxHitInfoContainer > DeDxHitInfoContainerCollection
Definition: DeDxHitInfo.h:37
reco::DeDxHitInfo::DeDxHitInfoContainer::pathlength
float pathlength() const
Definition: DeDxHitInfo.h:23
DetId.h
LocalPoint.h
reco::DeDxHitInfo::DeDxHitInfoContainer::pathlength_
float pathlength_
path length inside a module
Definition: DeDxHitInfo.h:31
SiStripDetId::TIB
static constexpr auto TIB
Definition: SiStripDetId.h:37
reco::DeDxHitInfo::pos
const LocalPoint pos(size_t i) const
Definition: DeDxHitInfo.h:45
S
Definition: CSCDBL1TPParametersExtended.h:16
reco::DeDxHitInfo::DeDxHitInfoContainer
Definition: DeDxHitInfo.h:16
reco::DeDxHitInfo::infos_
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:107
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
P
std::pair< OmniClusterRef, TrackingParticleRef > P
Definition: BDHadronTrackMonitoringAnalyzer.cc:202
SiStripCluster
Definition: SiStripCluster.h:9
reco::DeDxHitInfo::addHit
void addHit(const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos, const SiStripCluster &stripCluster)
Definition: DeDxHitInfo.h:89
reco::DeDxHitInfo::pixelClusters_
std::vector< SiPixelCluster > pixelClusters_
Definition: DeDxHitInfo.h:109