CMS 3D CMS Logo

TrackerModule.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTMTT_TrackerModule_h
2 #define L1Trigger_TrackFindingTMTT_TrackerModule_h
3 
8 
9 #include <vector>
10 #include <set>
11 #include <array>
12 #include <map>
13 #include <cmath>
14 
15 class TrackerGeometry;
16 class TrackerTopology;
17 class PixelGeomDetUnit;
18 class PixelTopology;
19 
20 namespace tmtt {
21 
22  //=== Get info about tracker module
23 
24  class TrackerModule {
25  public:
27 
28  // Info used to define firmware module type.
29  struct ModuleTypeCfg {
30  std::vector<double> pitchVsType;
31  std::vector<double> spaceVsType;
32  std::vector<bool> barrelVsType;
33  std::vector<bool> psVsType;
34  std::vector<bool> tiltedVsType;
35  };
36 
37  // Here detId is ID of lower sensor in stacked module.
38  TrackerModule(const TrackerGeometry* trackerGeometry,
39  const TrackerTopology* trackerTopology,
40  const ModuleTypeCfg& moduleTypeCfg,
41  const DetId& detId);
42 
43  // Det ID of lower sensor in stacked module.
44  const DetId& detId() const { return detId_; }
45  unsigned int rawDetId() const { return detId_.rawId(); }
46  // Det ID of stacked module.
47  const DetId& stackedDetId() const { return stackedDetId_; }
48  unsigned int rawStackedDetId() const { return stackedDetId_.rawId(); }
49  // Tracker specific DetUnit & topology.
50  const PixelGeomDetUnit* specDet() const { return specDet_; }
51  const PixelTopology* specTopol() const { return specTopol_; }
52  // Coordinates of centre of two sensors in (r,phi,z)
53  float minR() const { return moduleMinR_; }
54  float maxR() const { return moduleMaxR_; }
55  float minPhi() const { return moduleMinPhi_; }
56  float maxPhi() const { return moduleMaxPhi_; }
57  float minZ() const { return moduleMinZ_; }
58  float maxZ() const { return moduleMaxZ_; }
59  // Polar angle of module.
60  float theta() const { return atan2(moduleMinR_, moduleMinZ_); }
61  // Which of two sensors in module is furthest from beam-line?
63  // Module type: PS or 2S?
64  bool psModule() const { return psModule_; }
65  bool barrel() const { return barrel_; }
66  // Tracker layer ID number (1-6 = barrel layer; 11-15 = endcap A disk; 21-25 = endcap B disk)
67  unsigned int layerId() const { return layerId_; }
68  // Reduced layer ID (in range 1-7), for packing into 3 bits to simplify the firmware.
69  unsigned int layerIdReduced() const { return layerIdReduced_; }
70  // Endcap ring of module (returns zero in case of barrel)
71  unsigned int endcapRing() const { return endcapRing_; }
72  // True if stub is in tilted barrel module.
73  bool tiltedBarrel() const { return tiltedBarrel_; }
74  // Angle between normal to module and beam-line along +ve z axis. (In range -PI/2 to +PI/2).
75  float tiltAngle() const { return tiltAngle_; }
76  // Width of sensitive region of sensor.
77  float sensorWidth() const { return sensorWidth_; }
78  // Sensor spacing in module
79  float sensorSpacing() const { return sensorSpacing_; }
80  // No. of strips in sensor.
81  unsigned int nStrips() const { return nStrips_; }
82  // Strip pitch (or pixel pitch along shortest axis).
83  float stripPitch() const { return stripPitch_; }
84  // Strip length (or pixel pitch along longest axis).
85  float stripLength() const { return stripLength_; }
86  // Hit resolution perpendicular to strip (or to longest pixel axis). Measures phi.
87  float sigmaPerp() const { return invRoot12 * stripPitch_; }
88  // Hit resolution parallel to strip (or to longest pixel axis). Measures r or z.
89  float sigmaPar() const { return invRoot12 * stripLength_; }
90  // Sensor pitch over separation.
91  float pitchOverSep() const { return stripPitch_ / sensorSpacing_; }
92  // "B" parameter correction for module tilt.
93  float paramB() const { return std::abs(cos(theta() - tiltAngle()) / sin(theta())); }
94  // Module type ID defined by firmware.
95  unsigned int moduleTypeID() const { return moduleTypeID_; }
96 
97  //--- Utilties
98 
99  // Calculate reduced layer ID (in range 1-7), for packing into 3 bits to simplify the firmware.
100  static unsigned int calcLayerIdReduced(unsigned int layerId);
101 
102  // Get module type ID defined by firmware.
103  unsigned int calcModuleType(float pitch, float space, bool barrel, bool tiltedBarrel, bool psModule) const;
104 
105  private:
110  float moduleMinR_;
111  float moduleMaxR_;
114  float moduleMinZ_;
115  float moduleMaxZ_;
117  bool psModule_;
118  bool barrel_;
119  unsigned int layerId_;
120  unsigned int layerIdReduced_;
121  unsigned int endcapRing_;
123  float tiltAngle_;
126  unsigned int nStrips_;
127  float stripPitch_;
129  unsigned int moduleTypeID_;
130 
132 
133  static const float invRoot12;
134  };
135 
136 } // namespace tmtt
137 #endif
float stripLength() const
Definition: TrackerModule.h:85
static unsigned int calcLayerIdReduced(unsigned int layerId)
float maxPhi() const
Definition: TrackerModule.h:56
float sigmaPerp() const
Definition: TrackerModule.h:87
unsigned int rawDetId() const
Definition: TrackerModule.h:45
bool outerModuleAtSmallerR() const
Definition: TrackerModule.h:62
const DetId & detId() const
Definition: TrackerModule.h:44
unsigned int nStrips_
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
unsigned int moduleTypeID_
unsigned int calcModuleType(float pitch, float space, bool barrel, bool tiltedBarrel, bool psModule) const
float sensorSpacing() const
Definition: TrackerModule.h:79
const PixelGeomDetUnit * specDet_
unsigned int layerId() const
Definition: TrackerModule.h:67
static const float invRoot12
std::vector< bool > tiltedVsType
Definition: TrackerModule.h:34
float maxZ() const
Definition: TrackerModule.h:58
float minZ() const
Definition: TrackerModule.h:57
bool psModule() const
Definition: TrackerModule.h:64
unsigned int rawStackedDetId() const
Definition: TrackerModule.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float tiltAngle() const
Definition: TrackerModule.h:75
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const PixelTopology * specTopol() const
Definition: TrackerModule.h:51
TrackerModule(const TrackerGeometry *trackerGeometry, const TrackerTopology *trackerTopology, const ModuleTypeCfg &moduleTypeCfg, const DetId &detId)
float minPhi() const
Definition: TrackerModule.h:55
unsigned int endcapRing() const
Definition: TrackerModule.h:71
float maxR() const
Definition: TrackerModule.h:54
unsigned int layerId_
float theta() const
Definition: TrackerModule.h:60
float minR() const
Definition: TrackerModule.h:53
Definition: DetId.h:17
=== This is the base class for the linearised chi-squared track fit algorithms.
Definition: Array2D.h:16
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
float pitchOverSep() const
Definition: TrackerModule.h:91
float sigmaPar() const
Definition: TrackerModule.h:89
std::vector< double > pitchVsType
Definition: TrackerModule.h:30
unsigned int endcapRing_
std::vector< double > spaceVsType
Definition: TrackerModule.h:31
bool barrel() const
Definition: TrackerModule.h:65
unsigned int nStrips() const
Definition: TrackerModule.h:81
ModuleTypeCfg moduleTypeCfg_
const PixelTopology * specTopol_
unsigned int moduleTypeID() const
Definition: TrackerModule.h:95
std::vector< bool > barrelVsType
Definition: TrackerModule.h:32
const DetId & stackedDetId() const
Definition: TrackerModule.h:47
unsigned int layerIdReduced() const
Definition: TrackerModule.h:69
const PixelGeomDetUnit * specDet() const
Definition: TrackerModule.h:50
float sensorWidth() const
Definition: TrackerModule.h:77
unsigned int layerIdReduced_
float paramB() const
Definition: TrackerModule.h:93
bool tiltedBarrel() const
Definition: TrackerModule.h:73
float stripPitch() const
Definition: TrackerModule.h:83