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, const TrackerTopology *tTopo)
24 {
25  string info;
26 
27  if(id.subdetId() == int(PixelSubdetector::PixelBarrel))
28  {
29  // 0 + (layer-1)<<1 + (ladder-1)%2 : 0-5
30 
31  ostringstream o;
32  o << " (" << tTopo->pxbLayer(id) << "|" << tTopo->pxbLadder(id)
33  << "|" << tTopo->pxbModule(id) << ")";
34  info += o.str();
35  }
36  else
37  {
38  // 6 + (disk-1)<<1 + (panel-1)%2
39 
40  ostringstream o;
41  o << " (" << tTopo->pxfSide(id) << "|" << tTopo->pxfDisk(id)
42  << "|" << tTopo->pxfBlade(id) << "|" << tTopo->pxfPanel(id)
43  << "|" << tTopo->pxfModule(id) << ")";
44  info += o.str();
45  }
46 
47  return info;
48 }
49 
50 /*****************************************************************************/
51 string HitInfo::getInfo(const TrackingRecHit & recHit, const TrackerTopology *tTopo)
52 {
53  DetId id(recHit.geographicalId());
54 
55  return getInfo(id, tTopo);
56 }
57 
58 /*****************************************************************************/
59 string HitInfo::getInfo(const vector<const TrackingRecHit *>& recHits, const TrackerTopology *tTopo)
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, tTopo);
67 
68  return info;
69 }
70 
71 /*****************************************************************************/
72 string HitInfo::getInfo(const PSimHit & simHit, const TrackerTopology *tTopo)
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, tTopo);
93 }
94 
static const TGPicture * info(bool iBackgroundIsBlack)
unsigned int pxfDisk(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
~HitInfo()
Definition: HitInfo.cc:18
unsigned int pxbModule(const DetId &id) const
unsigned int pxfModule(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:18
int particleType() const
Definition: PSimHit.h:85
unsigned int pxfSide(const DetId &id) const
DetId geographicalId() const
HitInfo()
Definition: HitInfo.cc:13
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
Definition: HitInfo.cc:23
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
unsigned int detUnitId() const
Definition: PSimHit.h:93