CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions
DetIdInfo Class Reference

#include <DetIdInfo.h>

Static Public Member Functions

static std::string info (const DetId &)
 
static std::string info (const std::set< DetId > &)
 
static std::string info (const std::vector< DetId > &)
 

Detailed Description

Description: Helper class to get human readable informationa about given DetId

Definition at line 15 of file DetIdInfo.h.

Member Function Documentation

std::string DetIdInfo::info ( const DetId id)
static

Definition at line 28 of file DetIdInfo.cc.

References DetId::Calo, CSCDetId::chamber(), MuonSubdetId::CSC, HcalDetId::depth(), MuonSubdetId::DT, DetId::Ecal, EcalBarrel, EcalEndcap, EcalLaserPnDiode, EcalPreshower, EcalTriggerTower, CSCDetId::endcap(), DetId::Hcal, HcalBarrel, HcalEmpty, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, EEDetId::ic(), CaloTowerDetId::ieta(), HcalDetId::ieta(), EBDetId::ieta(), CaloTowerDetId::iphi(), HcalDetId::iphi(), EBDetId::iphi(), EEDetId::iquadrant(), EEDetId::isc(), EEDetId::ix(), EEDetId::iy(), PXBDetId::layer(), TOBDetId::layer(), TIBDetId::layer(), CSCDetId::layer(), RPCDetId::layer(), DetId::Muon, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, RPCDetId::region(), RPCDetId::ring(), CSCDetId::ring(), RPCDetId::roll(), MuonSubdetId::RPC, DTChamberId::sector(), RPCDetId::sector(), DTChamberId::station(), RPCDetId::station(), CSCDetId::station(), HcalDetId::subdet(), RPCDetId::subsector(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, EBDetId::tower_ieta(), EBDetId::tower_iphi(), DetId::Tracker, DTChamberId::wheel(), TIDDetId::wheel(), and TECDetId::wheel().

Referenced by DetIdAssociator::buildMap(), TrackDetectorAssociator::fillHcal(), TrackDetMatchInfo::findMaxDeposition(), TrackDetectorAssociator::getTAMuonChamberMatches(), info(), and TrackDetMatchInfo::nXnEnergy().

28  {
29  std::ostringstream oss;
30 
31  oss << "DetId: " << id.rawId() << "\n";
32 
33  switch ( id.det() ) {
34 
35  case DetId::Tracker:
36  switch ( id.subdetId() ) {
38  {
39  oss <<"TIB "<<TIBDetId(id).layer();
40  }
41  break;
43  {
44  oss <<"TOB "<<TOBDetId(id).layer();
45  }
46  break;
48  {
49  oss <<"TEC "<<TECDetId(id).wheel();
50  }
51  break;
53  {
54  oss <<"TID "<<TIDDetId(id).wheel();
55  }
56  break;
58  {
59  oss <<"PixBarrel "<< PXBDetId(id).layer();
60  }
61  break;
63  {
64  oss <<"PixEndcap "<< PXBDetId(id).layer();
65  }
66  break;
67  }
68  break;
69 
70  case DetId::Muon:
71  switch ( id.subdetId() ) {
72  case MuonSubdetId::DT:
73  {
74  DTChamberId detId(id.rawId());
75  oss << "DT chamber (wheel, station, sector): "
76  << detId.wheel() << ", "
77  << detId.station() << ", "
78  << detId.sector();
79  }
80  break;
81  case MuonSubdetId::CSC:
82  {
83  CSCDetId detId(id.rawId());
84  oss << "CSC chamber (endcap, station, ring, chamber, layer): "
85  << detId.endcap() << ", "
86  << detId.station() << ", "
87  << detId.ring() << ", "
88  << detId.chamber() << ", "
89  << detId.layer();
90  }
91  break;
92  case MuonSubdetId::RPC:
93  {
94  RPCDetId detId(id.rawId());
95  oss << "RPC chamber ";
96  switch ( detId.region() ) {
97  case 0:
98  oss << "/ barrel / (wheel, station, sector, layer, subsector, roll): "
99  << detId.ring() << ", "
100  << detId.station() << ", "
101  << detId.sector() << ", "
102  << detId.layer() << ", "
103  << detId.subsector() << ", "
104  << detId.roll();
105  break;
106  case 1:
107  oss << "/ forward endcap / (wheel, station, sector, layer, subsector, roll): "
108  << detId.ring() << ", "
109  << detId.station() << ", "
110  << detId.sector() << ", "
111  << detId.layer() << ", "
112  << detId.subsector() << ", "
113  << detId.roll();
114  break;
115  case -1:
116  oss << "/ backward endcap / (wheel, station, sector, layer, subsector, roll): "
117  << detId.ring() << ", "
118  << detId.station() << ", "
119  << detId.sector() << ", "
120  << detId.layer() << ", "
121  << detId.subsector() << ", "
122  << detId.roll();
123  break;
124  }
125  }
126  break;
127  }
128  break;
129 
130  case DetId::Calo:
131  {
132  CaloTowerDetId detId( id.rawId() );
133  oss << "CaloTower (ieta, iphi): "
134  << detId.ieta() << ", "
135  << detId.iphi();
136  }
137  break;
138 
139  case DetId::Ecal:
140  switch ( id.subdetId() ) {
141  case EcalBarrel:
142  {
143  EBDetId detId(id);
144  oss << "EcalBarrel (ieta, iphi, tower_ieta, tower_iphi): "
145  << detId.ieta() << ", "
146  << detId.iphi() << ", "
147  << detId.tower_ieta() << ", "
148  << detId.tower_iphi();
149  }
150  break;
151  case EcalEndcap:
152  {
153  EEDetId detId(id);
154  oss << "EcalEndcap (ix, iy, SuperCrystal, crystal, quadrant): "
155  << detId.ix() << ", "
156  << detId.iy() << ", "
157  << detId.isc() << ", "
158  << detId.ic() << ", "
159  << detId.iquadrant();
160  }
161  break;
162  case EcalPreshower:
163  oss << "EcalPreshower";
164  break;
165  case EcalTriggerTower:
166  oss << "EcalTriggerTower";
167  break;
168  case EcalLaserPnDiode:
169  oss << "EcalLaserPnDiode";
170  break;
171  }
172  break;
173 
174  case DetId::Hcal:
175  {
176  HcalDetId detId(id);
177  switch ( detId.subdet() ) {
178  case HcalEmpty:
179  oss << "HcalEmpty ";
180  break;
181  case HcalBarrel:
182  oss << "HcalBarrel ";
183  break;
184  case HcalEndcap:
185  oss << "HcalEndcap ";
186  break;
187  case HcalOuter:
188  oss << "HcalOuter ";
189  break;
190  case HcalForward:
191  oss << "HcalForward ";
192  break;
193  case HcalTriggerTower:
194  oss << "HcalTriggerTower ";
195  break;
196  case HcalOther:
197  oss << "HcalOther ";
198  break;
199  }
200  oss << "(ieta, iphi, depth):"
201  << detId.ieta() << ", "
202  << detId.iphi() << ", "
203  << detId.depth();
204  }
205  break;
206  default :;
207  }
208  return oss.str();
209 }
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
static const int CSC
Definition: MuonSubdetId.h:13
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
static const int RPC
Definition: MuonSubdetId.h:14
static const int DT
Definition: MuonSubdetId.h:12
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50
std::string DetIdInfo::info ( const std::set< DetId > &  idSet)
static

Definition at line 212 of file DetIdInfo.cc.

References info(), AlCaHLTBitMon_QueryRunRegistry::string, and runonSM::text.

212  {
214  for(std::set<DetId>::const_iterator id = idSet.begin(); id != idSet.end(); id++)
215  {
216  text += info(*id);
217  text += "\n";
218  }
219  return text;
220 }
tuple text
Definition: runonSM.py:42
static std::string info(const DetId &)
Definition: DetIdInfo.cc:28
std::string DetIdInfo::info ( const std::vector< DetId > &  idSet)
static

Definition at line 222 of file DetIdInfo.cc.

References info(), AlCaHLTBitMon_QueryRunRegistry::string, and runonSM::text.

222  {
224  for(std::vector<DetId>::const_iterator id = idSet.begin(); id != idSet.end(); id++)
225  {
226  text += info(*id);
227  text += "\n";
228  }
229  return text;
230 }
tuple text
Definition: runonSM.py:42
static std::string info(const DetId &)
Definition: DetIdInfo.cc:28