CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HitInfo.cc
Go to the documentation of this file.
1 // !!
3 
6 
9 
10 #include <sstream>
11 using namespace std;
12 
13 /*****************************************************************************/
15 {
16 }
17 
18 /*****************************************************************************/
20 {
21 }
22 
23 /*****************************************************************************/
24 string HitInfo::getInfo(const DetId & id)
25 {
26  std::string info;
27 
28  if(id.subdetId() == int(PixelSubdetector::PixelBarrel))
29  {
30  // 0 + (layer-1)<<1 + (ladder-1)%2 : 0-5
31  PXBDetId pid(id);
32  ostringstream o;
33  o << " (" << pid.layer() << "|" << pid.ladder()
34  << "|" << pid.module() << ")";
35  info += o.str();
36  }
37  else
38  {
39  // 6 + (disk-1)<<1 + (panel-1)%2
40  PXFDetId pid(id);
41  ostringstream o;
42  o << " (" << pid.side() << "|" << pid.disk()
43  << "|" << pid.blade() << "|" << pid.panel()
44  << "|" << pid.module() << ")";
45  info += o.str();
46  }
47 
48  return info;
49 }
50 
51 /*****************************************************************************/
52 string HitInfo::getInfo(const TrackingRecHit & recHit)
53 {
54  DetId id(recHit.geographicalId());
55 
56  return getInfo(id);
57 }
58 
59 /*****************************************************************************/
60 string HitInfo::getInfo(std::vector<const TrackingRecHit *> recHits)
61 {
62  std::string info;
63 
64  for(std::vector<const TrackingRecHit *>::const_iterator
65  recHit = recHits.begin();
66  recHit!= recHits.end(); recHit++)
67  info += getInfo(**recHit);
68 
69  return info;
70 }
71 
72 /*****************************************************************************/
73 string HitInfo::getInfo(const PSimHit & simHit)
74 {
75  std::string info;
76 
77  DetId id = DetId(simHit.detUnitId());
78 
79  {
80  ostringstream o;
81  o << simHit.particleType();
82 
83  info += " | pid=" + o.str();
84  }
85 
86  {
87  ostringstream o;
88 // o << theTracker->idToDet(id)->subDetector();
89  o << id.subdetId();
90 
91  info += " | " + o.str();
92  }
93 
94  return info + getInfo(id);;
95 }
96 
static std::string getInfo(const DetId &id)
Definition: HitInfo.cc:24
unsigned int panel() const
panel id
Definition: PXFDetId.h:52
~HitInfo()
Definition: HitInfo.cc:19
unsigned int ladder() const
ladder id
Definition: PXBDetId.h:39
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
unsigned int blade() const
blade id
Definition: PXFDetId.h:48
unsigned int module() const
det id
Definition: PXBDetId.h:43
unsigned int module() const
det id
Definition: PXFDetId.h:56
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
Definition: DetId.h:20
int particleType() const
Definition: PSimHit.h:85
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
DetId geographicalId() const
HitInfo()
Definition: HitInfo.cc:14
unsigned int detUnitId() const
Definition: PSimHit.h:93