CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
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 13 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 TrajectorySeedHitCandidate::init().

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

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

96  {
97  return _hashfct(*this)<_hashfct(layer);
98  }
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 284 of file TrackingLayer.cc.

References getLayerNumber(), getSideNumber(), getSubDetNumber(), eostools::move(), and contentValuesCheck::ss.

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

Definition at line 241 of file TrackingLayer.cc.

References _layerNumber, _side, _subDet, BARREL, eostools::move(), NEG_ENDCAP, POS_ENDCAP, PXB, PXD, contentValuesCheck::ss, TEC, TIB, TID, TOB, and UNKNOWN.

242 {
243  std::stringstream ss;
244  switch (_subDet)
245  {
247  ss<<"unknown";
248  break;
250  ss<<" BPix";
251  break;
253  ss<<" FPix";
254  break;
256  ss<<" TIB";
257  break;
259  ss<<" TID";
260  break;
262  ss<<" TOB";
263  break;
265  ss<<" TEC";
266  break;
267  }
268  ss << _layerNumber;
269  switch (_side)
270  {
272  break;
273  case Side:: NEG_ENDCAP:
274  ss<<"_neg";
275  break;
277  ss<< "_pos";
278  break;
279  }
280 
281  return std::move(ss.str());
282 }
def move
Definition: eostools.py:510
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==().

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