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 {
15  {
16  public:
18  public:
20  DeDxHitInfoContainer(const float charge, const float pathlength, const DetId& detId, const LocalPoint& pos)
21  : charge_(charge), pathlength_(pathlength), detId_(detId), pos_(pos) {}
22 
23  float charge() const {return charge_;}
24  float pathlength() const {return pathlength_;}
25  const DetId& detId() const {return detId_;}
26  const LocalPoint& pos() const {return pos_;}
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; bool isPixel=false; bool isFirst = true;
48  for(size_t j=0;j<=i&&j<infos_.size();j++){
50  if (isFirst) isFirst = false;
51  else P++;
52  isPixel=true;
53  }
54  else{
55  isPixel=false;
56  }
57  }
58  if(isPixel && pixelClusters_.size() > P){
59  return &(pixelClusters_[P]);
60  }
61  return nullptr;
62  }
63  const SiStripCluster* stripCluster(size_t i) const {
64  size_t S=0; bool isStrip=false; bool isFirst = true;
65  for(size_t j=0;j<=i&&j<infos_.size();j++){
67  if (isFirst) {isFirst = false;}
68  else S++;
69  isStrip=true;
70  }
71  else{
72  isStrip=false;
73  }
74  }
75  if(isStrip && stripClusters_.size() > S){
76  return &(stripClusters_[S]);
77  }
78  return NULL;
79  }
80  const std::vector<SiStripCluster>& stripClusters() const {return stripClusters_;}
81  const std::vector<SiPixelCluster>& pixelClusters() const {return pixelClusters_;}
82 
83  void addHit(const float charge, const float pathlength, const DetId& detId, const LocalPoint& pos, const SiStripCluster& stripCluster){
84  infos_.push_back(DeDxHitInfoContainer(charge, pathlength, detId, pos));
85  stripClusters_.push_back(stripCluster);
86  }
87  void addHit(const float charge, const float pathlength, const DetId& detId, const LocalPoint& pos, const SiPixelCluster& pixelCluster){
88  infos_.push_back(DeDxHitInfoContainer(charge, pathlength, detId, pos));
89  pixelClusters_.push_back(pixelCluster);
90  }
91 
92  private:
93  std::vector<DeDxHitInfoContainer> infos_;
94  std::vector<SiStripCluster> stripClusters_;
95  std::vector<SiPixelCluster> pixelClusters_;
96  };
97 
98  typedef std::vector<DeDxHitInfo> DeDxHitInfoCollection;
103 }
104 
105 #endif
DeDxHitInfoContainer(const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos)
Definition: DeDxHitInfo.h:20
float pathlength_
path length inside a module
Definition: DeDxHitInfo.h:31
float charge(size_t i) const
Definition: DeDxHitInfo.h:42
#define NULL
Definition: scimark2.h:8
edm::RefProd< DeDxHitInfoCollection > DeDxHitInfoRefProd
Definition: DeDxHitInfo.h:100
std::vector< SiStripCluster > stripClusters_
Definition: DeDxHitInfo.h:94
edm::Ref< DeDxHitInfoCollection > DeDxHitInfoRef
Definition: DeDxHitInfo.h:99
const LocalPoint pos(size_t i) const
Definition: DeDxHitInfo.h:45
std::vector< SiPixelCluster > pixelClusters_
Definition: DeDxHitInfo.h:95
edm::Association< DeDxHitInfoCollection > DeDxHitInfoAss
Definition: DeDxHitInfo.h:102
float charge_
total cluster charge
Definition: DeDxHitInfo.h:29
double f[11][100]
void addHit(const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos, const SiStripCluster &stripCluster)
Definition: DeDxHitInfo.h:83
std::vector< DeDxHitInfo::DeDxHitInfoContainer > DeDxHitInfoContainerCollection
Definition: DeDxHitInfo.h:37
const SiPixelCluster * pixelCluster(size_t i) const
Definition: DeDxHitInfo.h:46
const std::vector< SiStripCluster > & stripClusters() const
Definition: DeDxHitInfo.h:80
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:98
size_t size() const
Definition: DeDxHitInfo.h:41
std::pair< OmniClusterRef, TrackingParticleRef > P
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
edm::RefVector< DeDxHitInfoCollection > DeDxHitInfoRefVector
Definition: DeDxHitInfo.h:101
Pixel cluster – collection of neighboring pixels above threshold.
fixed size matrix
float pathlength(size_t i) const
Definition: DeDxHitInfo.h:43
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:93
void addHit(const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos, const SiPixelCluster &pixelCluster)
Definition: DeDxHitInfo.h:87
const LocalPoint & pos() const
Definition: DeDxHitInfo.h:26
const SiStripCluster * stripCluster(size_t i) const
Definition: DeDxHitInfo.h:63
DetId detId(size_t i) const
Definition: DeDxHitInfo.h:44
const std::vector< SiPixelCluster > & pixelClusters() const
Definition: DeDxHitInfo.h:81