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

◆ Det

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

Definition at line 28 of file TrackingLayer.h.

28  {
29  UNKNOWN,
30  PXB, //pixel barrel
31  PXD, //pixel disk
32  TIB, //tracker inner barrel
33  TID, //tracker inner disk
34  TOB, //tracker outer barrel
35  TEC //tracker endcap
36  };

◆ Side

enum TrackingLayer::Side
strong
Enumerator
BARREL 
NEG_ENDCAP 
POS_ENDCAP 

Definition at line 37 of file TrackingLayer.h.

37 { BARREL, NEG_ENDCAP, POS_ENDCAP };

Constructor & Destructor Documentation

◆ TrackingLayer()

TrackingLayer::TrackingLayer ( )

Definition at line 7 of file TrackingLayer.cc.

Member Function Documentation

◆ createFromDetId()

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

Definition at line 9 of file TrackingLayer.cc.

9  {
10  TrackingLayer trackingLayer;
11  uint32_t subdet = detId.subdetId();
12  //BPix
13  if (subdet == PixelSubdetector::PixelBarrel) {
14  trackingLayer._subDet = TrackingLayer::Det::PXB;
15  trackingLayer._side = TrackingLayer::Side::BARREL;
16  trackingLayer._layerNumber = trackerTopology.pxbLayer(detId);
17  }
18  //FPix
19  else if (subdet == PixelSubdetector::PixelEndcap) {
20  trackingLayer._subDet = TrackingLayer::Det::PXD;
21  if (trackerTopology.pxfSide(detId) == 1) {
22  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
23  } else if (trackerTopology.pxfSide(detId) == 2) {
24  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
25  } else {
26  throw cms::Exception("FastSimulation/Tracking")
27  << "Tracker hit for seeding in FPix seems neither on positive nor on negative disk side: "
28  << trackerTopology.print(detId).c_str();
29  }
30  trackingLayer._layerNumber = trackerTopology.pxfDisk(detId);
31  }
32  //TIB
33  else if (subdet == StripSubdetector::TIB) {
34  trackingLayer._subDet = TrackingLayer::Det::TIB;
35  trackingLayer._side = TrackingLayer::Side::BARREL;
36  trackingLayer._layerNumber = trackerTopology.tibLayer(detId);
37  }
38  //TID
39  else if (subdet == StripSubdetector::TID) {
40  trackingLayer._subDet = TrackingLayer::Det::TID;
41  if (trackerTopology.tidSide(detId) == 1) {
42  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
43  } else if (trackerTopology.tidSide(detId) == 2) {
44  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
45  } else {
46  throw cms::Exception("FastSimulation/Tracking")
47  << "Tracker hit for seeding in TID seems neither on positive nor on negative disk side: "
48  << trackerTopology.print(detId).c_str();
49  }
50  trackingLayer._layerNumber = trackerTopology.tidWheel(detId);
51  }
52  //TOB
53  else if (subdet == StripSubdetector::TOB) {
54  trackingLayer._subDet = TrackingLayer::Det::TOB;
55  trackingLayer._side = TrackingLayer::Side::BARREL;
56  trackingLayer._layerNumber = trackerTopology.tobLayer(detId);
57  }
58  //TEC
59  else if (subdet == StripSubdetector::TEC) {
60  trackingLayer._subDet = TrackingLayer::Det::TEC;
61  if (trackerTopology.tecSide(detId) == 1) {
62  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
63  } else if (trackerTopology.tecSide(detId) == 2) {
64  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
65  } else {
66  throw cms::Exception("FastSimulation/Tracking")
67  << "Tracker hit for seeding in TEC seems neither on positive nor on negative disk side: "
68  << trackerTopology.print(detId).c_str();
69  }
70  trackingLayer._layerNumber = trackerTopology.tecWheel(detId);
71  } else {
72  throw cms::Exception("FastSimulation/Tracking")
73  << "Cannot determine seeding layer from DetId:" << trackerTopology.print(detId).c_str() << std::endl;
74  }
75  //std::cout<<"LayerSpec::createFromDetId: "<<trackerTopology.print(detId).c_str()<<", parsed="<<seedingLayer.print().c_str()<<std::endl;
76  return trackingLayer;
77 }

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().

◆ createFromString()

TrackingLayer TrackingLayer::createFromString ( std::string  layerSpecification)
static

Definition at line 79 of file TrackingLayer.cc.

79  {
80  TrackingLayer trackingLayer;
81  if (layerSpecification.substr(0, 4) == "BPix") {
82  trackingLayer._subDet = TrackingLayer::Det::PXB;
83  trackingLayer._side = TrackingLayer::Side::BARREL;
84  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4, 1).c_str());
85  } else if (layerSpecification.substr(0, 4) == "FPix") {
86  trackingLayer._subDet = TrackingLayer::Det::PXD;
87  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4, 1).c_str());
88  if (layerSpecification.substr(layerSpecification.size() - 3) == "pos") {
89  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
90  } else if (layerSpecification.substr(layerSpecification.size() - 3) == "neg") {
91  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
92  } else {
93  throw cms::Exception("FastSimulation/Tracking/python")
94  << "FPix seeding layer configuration '" << layerSpecification.c_str()
95  << "' does not specify the side correctly!";
96  }
97 
98  } else if (layerSpecification.substr(0, 3) == "TIB") {
99  trackingLayer._subDet = TrackingLayer::Det::TIB;
100  trackingLayer._side = TrackingLayer::Side::BARREL;
101  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(3, 1).c_str());
102  } else if (layerSpecification.substr(0, 4) == "MTIB") {
103  trackingLayer._subDet = TrackingLayer::Det::TIB;
104  trackingLayer._side = TrackingLayer::Side::BARREL;
105  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4, 1).c_str());
106  }
107 
108  else if (layerSpecification.substr(0, 3) == "TID") {
109  trackingLayer._subDet = TrackingLayer::Det::TID;
110  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(3, 1).c_str());
111  if (layerSpecification.substr(layerSpecification.size() - 3) == "pos") {
112  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
113  } else if (layerSpecification.substr(layerSpecification.size() - 3) == "neg") {
114  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
115  } else {
116  throw cms::Exception("FastSimulation/Tracking/python")
117  << "TID seeding layer configuration '" << layerSpecification.c_str()
118  << "' does not specify the side correctly!";
119  }
120  } else if (layerSpecification.substr(0, 4) == "MTID") {
121  trackingLayer._subDet = TrackingLayer::Det::TID;
122  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4, 1).c_str());
123  if (layerSpecification.substr(layerSpecification.size() - 3) == "pos") {
124  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
125  } else if (layerSpecification.substr(layerSpecification.size() - 3) == "neg") {
126  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
127  } else {
128  throw cms::Exception("FastSimulation/Tracking/python")
129  << "MTID seeding layer configuration '" << layerSpecification.c_str()
130  << "' does not specify the side correctly!";
131  }
132  } else if (layerSpecification.substr(0, 3) == "TOB") {
133  trackingLayer._subDet = TrackingLayer::Det::TOB;
134  trackingLayer._side = TrackingLayer::Side::BARREL;
135  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(3, 1).c_str());
136  } else if (layerSpecification.substr(0, 4) == "MTOB") {
137  trackingLayer._subDet = TrackingLayer::Det::TOB;
138  trackingLayer._side = TrackingLayer::Side::BARREL;
139  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4, 1).c_str());
140  } else if (layerSpecification.substr(0, 3) == "TEC") {
141  trackingLayer._subDet = TrackingLayer::Det::TEC;
142  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(3, 1).c_str());
143  if (layerSpecification.substr(layerSpecification.size() - 3) == "pos") {
144  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
145  } else if (layerSpecification.substr(layerSpecification.size() - 3) == "neg") {
146  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
147  } else {
148  throw cms::Exception("FastSimulation/Tracking/python")
149  << "TEC seeding layer configuration '" << layerSpecification.c_str()
150  << "' does not specify the side correctly!";
151  }
152 
153  } else if (layerSpecification.substr(0, 4) == "MTEC") {
154  trackingLayer._subDet = TrackingLayer::Det::TEC;
155  trackingLayer._layerNumber = std::atoi(layerSpecification.substr(4, 1).c_str());
156  if (layerSpecification.substr(layerSpecification.size() - 3) == "pos") {
157  trackingLayer._side = TrackingLayer::Side::POS_ENDCAP;
158  } else if (layerSpecification.substr(layerSpecification.size() - 3) == "neg") {
159  trackingLayer._side = TrackingLayer::Side::NEG_ENDCAP;
160  } else {
161  throw cms::Exception("FastSimulation/Tracking/python")
162  << "MTEC seeding layer configuration '" << layerSpecification.c_str()
163  << "' does not specify the side correctly!";
164  }
165  } else {
166  throw cms::Exception("FastSimulation/Tracking/python")
167  << "Bad data naming in seeding layer configuration."
168  << "no case sensitive name of ['BPix','FPix','TIB','MTIB','TID','MTID','TOB','TEC','MTEC'] matches '"
169  << layerSpecification.c_str() << "'";
170  }
171  //std::cout<<"LayerSpec::createFromString: "<<layerSpecification.c_str()<<", parsed="<<seedingLayer.print().c_str()<<std::endl;
172 
173  return trackingLayer;
174 }

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

Referenced by TrajectorySeedProducer::TrajectorySeedProducer().

◆ getLayerNumber()

unsigned int TrackingLayer::getLayerNumber ( ) const
inline

◆ getSide()

TrackingLayer::Side TrackingLayer::getSide ( ) const
inline

Definition at line 53 of file TrackingLayer.h.

53 { return _side; }

References _side.

◆ getSideNumber()

unsigned int TrackingLayer::getSideNumber ( ) const
inline

Definition at line 57 of file TrackingLayer.h.

57 { return static_cast<unsigned int>(_side); }

References _side.

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

◆ getSubDet()

TrackingLayer::Det TrackingLayer::getSubDet ( ) const
inline

Definition at line 51 of file TrackingLayer.h.

51 { return _subDet; }

References _subDet.

◆ getSubDetNumber()

unsigned int TrackingLayer::getSubDetNumber ( ) const
inline

Definition at line 55 of file TrackingLayer.h.

55 { return static_cast<unsigned int>(_subDet); }

References _subDet.

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

◆ operator!=()

bool TrackingLayer::operator!= ( const TrackingLayer layer) const
inline

Definition at line 63 of file TrackingLayer.h.

63 { return not _eqfct(*this, layer); }

References _eqfct.

◆ operator<()

bool TrackingLayer::operator< ( const TrackingLayer layer) const
inline

Definition at line 65 of file TrackingLayer.h.

65 { return _hashfct(*this) < _hashfct(layer); }

References _hashfct.

◆ operator==()

bool TrackingLayer::operator== ( const TrackingLayer layer) const
inline

Definition at line 61 of file TrackingLayer.h.

61 { return _eqfct(*this, layer); }

References _eqfct.

◆ toIdString()

std::string TrackingLayer::toIdString ( ) const

Definition at line 216 of file TrackingLayer.cc.

216  {
217  std::stringstream ss;
218  ss << getSubDetNumber() << ":" << getLayerNumber() << ":" << getSideNumber();
219  return ss.str();
220 }

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

◆ toString()

std::string TrackingLayer::toString ( ) const

Definition at line 176 of file TrackingLayer.cc.

176  {
177  std::stringstream ss;
178  switch (_subDet) {
180  ss << "unknown";
181  break;
183  ss << " BPix";
184  break;
186  ss << " FPix";
187  break;
189  ss << " TIB";
190  break;
192  ss << " TID";
193  break;
195  ss << " TOB";
196  break;
198  ss << " TEC";
199  break;
200  }
201  ss << _layerNumber;
202  switch (_side) {
204  break;
205  case Side::NEG_ENDCAP:
206  ss << "_neg";
207  break;
209  ss << "_pos";
210  break;
211  }
212 
213  return ss.str();
214 }

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

Member Data Documentation

◆ _eqfct

const TrackingLayer::eqfct TrackingLayer::_eqfct
static

Definition at line 41 of file TrackingLayer.h.

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

◆ _hashfct

const hashfct TrackingLayer::_hashfct
static

Definition at line 42 of file TrackingLayer.h.

Referenced by operator<().

◆ _layerNumber

unsigned int TrackingLayer::_layerNumber

Definition at line 43 of file TrackingLayer.h.

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

◆ _side

Side TrackingLayer::_side

Definition at line 40 of file TrackingLayer.h.

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

◆ _subDet

Det TrackingLayer::_subDet
SectorBuilder_Tib_cff.TIB
TIB
Definition: SectorBuilder_Tib_cff.py:16
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
TrackerTopology::pxfSide
unsigned int pxfSide(const DetId &id) const
Definition: TrackerTopology.h:192
TrackingLayer::Det::PXB
SectorBuilder_Tec_cff.TEC
TEC
Definition: SectorBuilder_Tec_cff.py:16
TrackingLayer::Side::POS_ENDCAP
TrackingLayer::Det::TEC
BARREL
Definition: ElectronIdentifier.h:38
TrackingLayer::_layerNumber
unsigned int _layerNumber
Definition: TrackingLayer.h:43
TrackingLayer::_eqfct
static const eqfct _eqfct
Definition: TrackingLayer.h:41
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
TrackingLayer::Side::BARREL
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
TrackingLayer::Det::TOB
TrackingLayer::getSideNumber
unsigned int getSideNumber() const
Definition: TrackingLayer.h:57
TrackingLayer::Side::NEG_ENDCAP
TrackingLayer::_hashfct
static const hashfct _hashfct
Definition: TrackingLayer.h:42
TrackerTopology::print
std::string print(DetId detid) const
Definition: TrackerTopology.cc:252
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
TrackingLayer::getSubDetNumber
unsigned int getSubDetNumber() const
Definition: TrackingLayer.h:55
TrackingLayer::Det::TID
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
TrackingLayer::Det::UNKNOWN
TrackingLayer::_side
Side _side
Definition: TrackingLayer.h:40
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
TrackingLayer::_subDet
Det _subDet
Definition: TrackingLayer.h:39
TrackingLayer::Det::PXD
SiStripSubdetector::UNKNOWN
Definition: SiStripEnums.h:5
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
TrackingLayer
Definition: TrackingLayer.h:9
Exception
Definition: hltDiff.cc:246
SectorBuilder_Tid_cff.TID
TID
Definition: SectorBuilder_Tid_cff.py:16
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
TrackingLayer::getLayerNumber
unsigned int getLayerNumber() const
Definition: TrackingLayer.h:59
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
SectorBuilder_Tob_cff.TOB
TOB
Definition: SectorBuilder_Tob_cff.py:16
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
TrackingLayer::Det::TIB
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184