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