CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
TrackingLayer Class Reference

#include <TrackingLayer.h>

Classes

struct  eqfct
 
struct  hashfct
 

Public Types

enum  Det {
  Det::UNKNOWN, Det::PXB, Det::PXD, Det::TIB,
  Det::TID, Det::TOB, Det::TEC
}
 
enum  Side { Side::BARREL, Side::NEG_ENDCAP, Side::POS_ENDCAP }
 

Public Member Functions

unsigned int getLayerNumber () const
 
TrackingLayer::Side getSide () const
 
unsigned int getSideNumber () const
 
TrackingLayer::Det getSubDet () const
 
unsigned int getSubDetNumber () const
 
bool operator!= (const TrackingLayer &layer) const
 
bool operator< (const TrackingLayer &layer) const
 
bool operator== (const TrackingLayer &layer) const
 
std::string toIdString () const
 
std::string toString () const
 
 TrackingLayer ()
 

Static Public Member Functions

static TrackingLayer createFromDetId (const DetId &detId, const TrackerTopology &trackerTopology)
 
static TrackingLayer createFromString (std::string layerSpecification)
 

Public Attributes

unsigned int _layerNumber
 
Side _side
 
Det _subDet
 

Static Public Attributes

static const eqfct _eqfct
 
static const hashfct _hashfct
 

Detailed Description

Definition at line 9 of file TrackingLayer.h.

Member Enumeration Documentation

enum TrackingLayer::Det
strong
Enumerator
UNKNOWN 
PXB 
PXD 
TIB 
TID 
TOB 
TEC 

Definition at line 36 of file TrackingLayer.h.

36  {
37  UNKNOWN,
38  PXB, //pixel barrel
39  PXD, //pixel disk
40  TIB, //tracker inner barrel
41  TID, //tracker inner disk
42  TOB, //tracker outer barrel
43  TEC //tracker endcap
44  };
0: Unidentified isolated particle
Definition: ParticleCode.h:19
enum TrackingLayer::Side
strong
Enumerator
BARREL 
NEG_ENDCAP 
POS_ENDCAP 

Definition at line 45 of file TrackingLayer.h.

45  {
46  BARREL, NEG_ENDCAP, POS_ENDCAP
47  };

Constructor & Destructor Documentation

TrackingLayer::TrackingLayer ( )

Member Function Documentation

TrackingLayer TrackingLayer::createFromDetId ( const DetId detId,
const TrackerTopology trackerTopology 
)
static

Definition at line 14 of file TrackingLayer.cc.

References _layerNumber, _side, _subDet, BARREL, Exception, NEG_ENDCAP, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, POS_ENDCAP, TrackerTopology::print(), PXB, TrackerTopology::pxbLayer(), PXD, TrackerTopology::pxfDisk(), TrackerTopology::pxfSide(), DetId::subdetId(), StripSubdetector::TEC, TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), StripSubdetector::TOB, TOB, and TrackerTopology::tobLayer().

Referenced by TrackCandidateProducer::produce().

18 {
19  TrackingLayer trackingLayer;
20  uint32_t subdet=detId.subdetId();
21  //BPix
22  if ( subdet == PixelSubdetector::PixelBarrel )
23  {
24  trackingLayer._subDet=TrackingLayer::Det::PXB;
25  trackingLayer._side=TrackingLayer::Side::BARREL;
26  trackingLayer._layerNumber = trackerTopology.pxbLayer(detId);
27  }
28  //FPix
29  else if ( subdet == PixelSubdetector::PixelEndcap )
30  {
31  trackingLayer._subDet=TrackingLayer::Det::PXD;
32  if(trackerTopology.pxfSide(detId)==1)
33  {
35  }
36  else if(trackerTopology.pxfSide(detId)==2)
37  {
39  }
40  else
41  {
42  throw cms::Exception("FastSimulation/Tracking") <<"Tracker hit for seeding in FPix seems neither on positive nor on negative disk side: "<<trackerTopology.print(detId).c_str();
43  }
44  trackingLayer._layerNumber = trackerTopology.pxfDisk(detId);
45  }
46  //TIB
47  else if ( subdet == StripSubdetector::TIB )
48  {
49  trackingLayer._subDet=TrackingLayer::Det::TIB;
50  trackingLayer._side=TrackingLayer::Side::BARREL;
51  trackingLayer._layerNumber = trackerTopology.tibLayer(detId);
52  }
53  //TID
54  else if ( subdet == StripSubdetector::TID )
55  {
56  trackingLayer._subDet=TrackingLayer::Det::TID;
57  if(trackerTopology.tidSide(detId)==1)
58  {
60  }
61  else if(trackerTopology.tidSide(detId)==2)
62  {
64  }
65  else
66  {
67  throw cms::Exception("FastSimulation/Tracking") <<"Tracker hit for seeding in TID seems neither on positive nor on negative disk side: "<<trackerTopology.print(detId).c_str();
68  }
69  trackingLayer._layerNumber = trackerTopology.tidWheel(detId);
70  }
71  //TOB
72  else if ( subdet == StripSubdetector::TOB )
73  {
74  trackingLayer._subDet=TrackingLayer::Det::TOB;
75  trackingLayer._side=TrackingLayer::Side::BARREL;
76  trackingLayer._layerNumber = trackerTopology.tobLayer(detId);
77  }
78  //TEC
79  else if ( subdet == StripSubdetector::TEC )
80  {
81  trackingLayer._subDet=TrackingLayer::Det::TEC;
82  if(trackerTopology.tecSide(detId)==1)
83  {
85  }
86  else if(trackerTopology.tecSide(detId)==2)
87  {
89  }
90  else
91  {
92  throw cms::Exception("FastSimulation/Tracking") <<"Tracker hit for seeding in TEC seems neither on positive nor on negative disk side: "<<trackerTopology.print(detId).c_str();
93  }
94  trackingLayer._layerNumber = trackerTopology.tecWheel(detId);
95  }
96  else
97  {
98  throw cms::Exception("FastSimulation/Tracking") << "Cannot determine seeding layer from DetId:"<<trackerTopology.print(detId).c_str()<<std::endl;
99  }
100  //std::cout<<"LayerSpec::createFromDetId: "<<trackerTopology.print(detId).c_str()<<", parsed="<<seedingLayer.print().c_str()<<std::endl;
101  return trackingLayer;
102 }
unsigned int tibLayer(const DetId &id) const
unsigned int pxfDisk(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
std::string print(DetId detid) const
unsigned int tidSide(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
unsigned int _layerNumber
Definition: TrackingLayer.h:54
unsigned int pxbLayer(const DetId &id) const
unsigned int pxfSide(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
TrackingLayer TrackingLayer::createFromString ( std::string  layerSpecification)
static

Definition at line 104 of file TrackingLayer.cc.

References _layerNumber, _side, _subDet, BARREL, Exception, NEG_ENDCAP, POS_ENDCAP, PXB, PXD, TEC, TIB, TID, and TOB.

Referenced by TrajectorySeedProducer::TrajectorySeedProducer().

105 {
106  TrackingLayer trackingLayer;
107  if (layerSpecification.substr(0,4)=="BPix" )
108  {
109  trackingLayer._subDet=TrackingLayer::Det::PXB;
110  trackingLayer._side=TrackingLayer::Side::BARREL;
111  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4,1).c_str());
112  }
113  else if (layerSpecification.substr(0,4)=="FPix" )
114  {
115  trackingLayer._subDet=TrackingLayer::Det::PXD;
116  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4,1).c_str());
117  if(layerSpecification.substr(layerSpecification.size()-3)=="pos")
118  {
119  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
120  }
121  else if (layerSpecification.substr(layerSpecification.size()-3)=="neg")
122  {
123  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
124  }
125  else
126  {
127  throw cms::Exception("FastSimulation/Tracking/python")
128  <<"FPix seeding layer configuration '"<<layerSpecification.c_str()<<"' does not specify the side correctly!";
129  }
130 
131  }
132  else if (layerSpecification.substr(0,3)=="TIB")
133  {
134  trackingLayer._subDet=TrackingLayer::Det::TIB;
135  trackingLayer._side=TrackingLayer::Side::BARREL;
136  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(3,1).c_str());
137  }
138  else if (layerSpecification.substr(0,4)=="MTIB")
139  {
140  trackingLayer._subDet=TrackingLayer::Det::TIB;
141  trackingLayer._side=TrackingLayer::Side::BARREL;
142  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4,1).c_str());
143  }
144 
145  else if (layerSpecification.substr(0,3)=="TID")
146  {
147  trackingLayer._subDet=TrackingLayer::Det::TID;
148  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(3,1).c_str());
149  if (layerSpecification.substr(layerSpecification.size()-3)=="pos")
150  {
151  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
152  }
153  else if (layerSpecification.substr(layerSpecification.size()-3)=="neg")
154  {
155  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
156  }
157  else
158  {
159  throw cms::Exception("FastSimulation/Tracking/python")
160  <<"TID seeding layer configuration '"<<layerSpecification.c_str()<<"' does not specify the side correctly!";
161  }
162  }
163  else if (layerSpecification.substr(0,4)=="MTID")
164  {
165  trackingLayer._subDet=TrackingLayer::Det::TID;
166  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4,1).c_str());
167  if (layerSpecification.substr(layerSpecification.size()-3)=="pos")
168  {
169  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
170  }
171  else if (layerSpecification.substr(layerSpecification.size()-3)=="neg")
172  {
173  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
174  }
175  else
176  {
177  throw cms::Exception("FastSimulation/Tracking/python")
178  <<"MTID seeding layer configuration '"<<layerSpecification.c_str()<<"' does not specify the side correctly!";
179  }
180  }
181  else if (layerSpecification.substr(0,3)=="TOB" )
182  {
183  trackingLayer._subDet=TrackingLayer::Det::TOB;
184  trackingLayer._side=TrackingLayer::Side::BARREL;
185  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(3,1).c_str());
186  }
187  else if (layerSpecification.substr(0,4)=="MTOB" )
188  {
189  trackingLayer._subDet=TrackingLayer::Det::TOB;
190  trackingLayer._side=TrackingLayer::Side::BARREL;
191  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4,1).c_str());
192  }
193  else if (layerSpecification.substr(0,3)=="TEC" )
194  {
195  trackingLayer._subDet=TrackingLayer::Det::TEC;
196  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(3,1).c_str());
197  if (layerSpecification.substr(layerSpecification.size()-3)=="pos")
198  {
199  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
200  }
201  else if (layerSpecification.substr(layerSpecification.size()-3)=="neg")
202  {
203  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
204  }
205  else
206  {
207  throw cms::Exception("FastSimulation/Tracking/python")
208  <<"TEC seeding layer configuration '"<<layerSpecification.c_str()<<"' does not specify the side correctly!";
209  }
210 
211 
212  }
213  else if (layerSpecification.substr(0,4)=="MTEC" )
214  {
215  trackingLayer._subDet=TrackingLayer::Det::TEC;
216  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4,1).c_str());
217  if (layerSpecification.substr(layerSpecification.size()-3)=="pos")
218  {
219  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
220  }
221  else if (layerSpecification.substr(layerSpecification.size()-3)=="neg")
222  {
223  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
224  }
225  else
226  {
227  throw cms::Exception("FastSimulation/Tracking/python")
228  <<"MTEC seeding layer configuration '"<<layerSpecification.c_str()<<"' does not specify the side correctly!";
229  }
230  }
231  else
232  {
233  throw cms::Exception("FastSimulation/Tracking/python")
234  << "Bad data naming in seeding layer configuration."
235  << "no case sensitive name of ['BPix','FPix','TIB','MTIB','TID','MTID','TOB','TEC','MTEC'] matches '"<<layerSpecification.c_str()<<"'";
236  }
237  //std::cout<<"LayerSpec::createFromString: "<<layerSpecification.c_str()<<", parsed="<<seedingLayer.print().c_str()<<std::endl;
238 
239  return trackingLayer;
240 }
unsigned int _layerNumber
Definition: TrackingLayer.h:54
unsigned int TrackingLayer::getLayerNumber ( ) const
inline
TrackingLayer::Side TrackingLayer::getSide ( ) const
inline

Definition at line 70 of file TrackingLayer.h.

References _side.

71  {
72  return _side;
73  }
unsigned int TrackingLayer::getSideNumber ( ) const
inline

Definition at line 80 of file TrackingLayer.h.

References _side.

Referenced by TrackingLayer::hashfct::operator()(), TrackingLayer::eqfct::operator()(), and toIdString().

81  {
82  return static_cast<unsigned int>(_side);
83  }
TrackingLayer::Det TrackingLayer::getSubDet ( ) const
inline

Definition at line 65 of file TrackingLayer.h.

References _subDet.

66  {
67  return _subDet;
68  }
unsigned int TrackingLayer::getSubDetNumber ( ) const
inline

Definition at line 75 of file TrackingLayer.h.

References _subDet.

Referenced by TrackingLayer::hashfct::operator()(), TrackingLayer::eqfct::operator()(), TrajectorySeedHitCandidate::subDetId(), and toIdString().

76  {
77  return static_cast<unsigned int>(_subDet);
78  }
bool TrackingLayer::operator!= ( const TrackingLayer layer) const
inline

Definition at line 95 of file TrackingLayer.h.

References _eqfct.

96  {
97  return not _eqfct(*this, layer);
98  }
static const eqfct _eqfct
Definition: TrackingLayer.h:52
bool TrackingLayer::operator< ( const TrackingLayer layer) const
inline

Definition at line 100 of file TrackingLayer.h.

References _hashfct, AlCaHLTBitMon_QueryRunRegistry::string, toIdString(), and toString().

101  {
102  return _hashfct(*this)<_hashfct(layer);
103  }
static const hashfct _hashfct
Definition: TrackingLayer.h:53
bool TrackingLayer::operator== ( const TrackingLayer layer) const
inline

Definition at line 90 of file TrackingLayer.h.

References _eqfct.

91  {
92  return _eqfct(*this, layer);
93  }
static const eqfct _eqfct
Definition: TrackingLayer.h:52
std::string TrackingLayer::toIdString ( ) const

Definition at line 285 of file TrackingLayer.cc.

References getLayerNumber(), getSideNumber(), and getSubDetNumber().

Referenced by operator<().

286 {
287  std::stringstream ss;
288  ss<<getSubDetNumber()<<":"<<getLayerNumber()<<":"<<getSideNumber();
289  return ss.str();
290 }
unsigned int getSubDetNumber() const
Definition: TrackingLayer.h:75
unsigned int getLayerNumber() const
Definition: TrackingLayer.h:85
unsigned int getSideNumber() const
Definition: TrackingLayer.h:80
std::string TrackingLayer::toString ( ) const

Definition at line 242 of file TrackingLayer.cc.

References _layerNumber, _side, _subDet, BARREL, NEG_ENDCAP, POS_ENDCAP, PXB, PXD, TEC, TIB, TID, TOB, and UNKNOWN.

Referenced by operator<().

243 {
244  std::stringstream ss;
245  switch (_subDet)
246  {
248  ss<<"unknown";
249  break;
251  ss<<" BPix";
252  break;
254  ss<<" FPix";
255  break;
257  ss<<" TIB";
258  break;
260  ss<<" TID";
261  break;
263  ss<<" TOB";
264  break;
266  ss<<" TEC";
267  break;
268  }
269  ss << _layerNumber;
270  switch (_side)
271  {
273  break;
274  case Side:: NEG_ENDCAP:
275  ss<<"_neg";
276  break;
278  ss<< "_pos";
279  break;
280  }
281 
282  return ss.str();
283 }
unsigned int _layerNumber
Definition: TrackingLayer.h:54

Member Data Documentation

const TrackingLayer::eqfct TrackingLayer::_eqfct
static

Definition at line 52 of file TrackingLayer.h.

Referenced by operator!=(), and operator==().

const hashfct TrackingLayer::_hashfct
static

Definition at line 53 of file TrackingLayer.h.

Referenced by operator<().

unsigned int TrackingLayer::_layerNumber

Definition at line 54 of file TrackingLayer.h.

Referenced by createFromDetId(), createFromString(), getLayerNumber(), and toString().

Side TrackingLayer::_side

Definition at line 51 of file TrackingLayer.h.

Referenced by createFromDetId(), createFromString(), getSide(), getSideNumber(), and toString().

Det TrackingLayer::_subDet