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 
11 
12 namespace reco {
14  {
15  public:
17  public:
19  DeDxHitInfoContainer(const float charge, const float pathlength, const DetId& detId, const LocalPoint& pos)
20  : charge_(charge), pathlength_(pathlength), detId_(detId), pos_(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  private:
28  float charge_;
30  float pathlength_;
34  };
35 
36  typedef std::vector<DeDxHitInfo::DeDxHitInfoContainer> DeDxHitInfoContainerCollection;
37 
38  public:
40  size_t size() const {return infos_.size();}
41  float charge(size_t i) const {return infos_[i].charge();}
42  float pathlength(size_t i) const {return infos_[i].pathlength();}
43  DetId detId(size_t i) const {return infos_[i].detId();}
44  const LocalPoint pos(size_t i) const {return infos_[i].pos();}
45  const SiPixelCluster* pixelCluster(size_t i) const {
46  size_t P=0; bool isPixel=false; bool isFirst = true;
47  for(size_t j=0;j<=i&&j<infos_.size();j++){
49  if (isFirst) isFirst = false;
50  else P++;
51  isPixel=true;
52  }
53  else{
54  isPixel=false;
55  }
56  }
57  if(isPixel && pixelClusters_.size() > P){
58  return &(pixelClusters_[P]);
59  }
60  return nullptr;
61  }
62  const SiStripCluster* stripCluster(size_t i) const {
63  size_t S=0; bool isStrip=false; bool isFirst = true;
64  for(size_t j=0;j<=i&&j<infos_.size();j++){
66  if (isFirst) {isFirst = false;}
67  else S++;
68  isStrip=true;
69  }
70  else{
71  isStrip=false;
72  }
73  }
74  if(isStrip && stripClusters_.size() > S){
75  return &(stripClusters_[S]);
76  }
77  return NULL;
78  }
79  const std::vector<SiStripCluster>& stripClusters() const {return stripClusters_;}
80  const std::vector<SiPixelCluster>& pixelClusters() const {return pixelClusters_;}
81 
82  void addHit(const float charge, const float pathlength, const DetId& detId, const LocalPoint& pos, const SiStripCluster& stripCluster){
83  infos_.push_back(DeDxHitInfoContainer(charge, pathlength, detId, pos));
84  stripClusters_.push_back(stripCluster);
85  }
86  void addHit(const float charge, const float pathlength, const DetId& detId, const LocalPoint& pos, const SiPixelCluster& pixelCluster){
87  infos_.push_back(DeDxHitInfoContainer(charge, pathlength, detId, pos));
88  pixelClusters_.push_back(pixelCluster);
89  }
90 
91  private:
92  std::vector<DeDxHitInfoContainer> infos_;
93  std::vector<SiStripCluster> stripClusters_;
94  std::vector<SiPixelCluster> pixelClusters_;
95  };
96 
97  typedef std::vector<DeDxHitInfo> DeDxHitInfoCollection;
102 }
103 
104 #endif
DeDxHitInfoContainer(const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos)
Definition: DeDxHitInfo.h:19
float pathlength_
path length inside a module
Definition: DeDxHitInfo.h:30
float charge(size_t i) const
Definition: DeDxHitInfo.h:41
#define NULL
Definition: scimark2.h:8
edm::RefProd< DeDxHitInfoCollection > DeDxHitInfoRefProd
Definition: DeDxHitInfo.h:99
std::vector< SiStripCluster > stripClusters_
Definition: DeDxHitInfo.h:93
edm::Ref< DeDxHitInfoCollection > DeDxHitInfoRef
Definition: DeDxHitInfo.h:98
const LocalPoint pos(size_t i) const
Definition: DeDxHitInfo.h:44
std::vector< SiPixelCluster > pixelClusters_
Definition: DeDxHitInfo.h:94
edm::Association< DeDxHitInfoCollection > DeDxHitInfoAss
Definition: DeDxHitInfo.h:101
float charge_
total cluster charge
Definition: DeDxHitInfo.h:28
double f[11][100]
void addHit(const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos, const SiStripCluster &stripCluster)
Definition: DeDxHitInfo.h:82
std::vector< DeDxHitInfo::DeDxHitInfoContainer > DeDxHitInfoContainerCollection
Definition: DeDxHitInfo.h:36
const SiPixelCluster * pixelCluster(size_t i) const
Definition: DeDxHitInfo.h:45
const std::vector< SiStripCluster > & stripClusters() const
Definition: DeDxHitInfo.h:79
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
isFirst
Definition: cuy.py:417
Definition: DetId.h:18
std::vector< DeDxHitInfo > DeDxHitInfoCollection
Definition: DeDxHitInfo.h:97
size_t size() const
Definition: DeDxHitInfo.h:40
std::pair< OmniClusterRef, TrackingParticleRef > P
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
edm::RefVector< DeDxHitInfoCollection > DeDxHitInfoRefVector
Definition: DeDxHitInfo.h:100
Pixel cluster – collection of neighboring pixels above threshold.
fixed size matrix
float pathlength(size_t i) const
Definition: DeDxHitInfo.h:42
bool isPixel(HitType hitType)
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::LocalCoordinateSystemTag > LocalPoint
point in local coordinate system
Definition: Point3D.h:15
std::vector< DeDxHitInfoContainer > infos_
Definition: DeDxHitInfo.h:92
void addHit(const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos, const SiPixelCluster &pixelCluster)
Definition: DeDxHitInfo.h:86
const LocalPoint & pos() const
Definition: DeDxHitInfo.h:25
const SiStripCluster * stripCluster(size_t i) const
Definition: DeDxHitInfo.h:62
DetId detId(size_t i) const
Definition: DeDxHitInfo.h:43
const std::vector< SiPixelCluster > & pixelClusters() const
Definition: DeDxHitInfo.h:80