CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 pitchOverSep() const
Definition: TrackerModule.h:91
static unsigned int calcLayerIdReduced(unsigned int layerId)
unsigned int rawDetId() const
Definition: TrackerModule.h:45
bool tiltedBarrel() const
Definition: TrackerModule.h:73
unsigned int moduleTypeID() const
Definition: TrackerModule.h:95
unsigned int layerIdReduced() const
Definition: TrackerModule.h:69
float stripPitch() const
Definition: TrackerModule.h:83
unsigned int nStrips_
float theta() const
Definition: TrackerModule.h:60
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
unsigned int moduleTypeID_
bool barrel() const
Definition: TrackerModule.h:65
const PixelGeomDetUnit * specDet_
static const float invRoot12
std::vector< bool > tiltedVsType
Definition: TrackerModule.h:34
float sensorSpacing() const
Definition: TrackerModule.h:79
unsigned int calcModuleType(float pitch, float space, bool barrel, bool tiltedBarrel, bool psModule) const
float maxPhi() const
Definition: TrackerModule.h:56
float minZ() const
Definition: TrackerModule.h:57
float sigmaPar() const
Definition: TrackerModule.h:89
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float maxR() const
Definition: TrackerModule.h:54
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int layerId() const
Definition: TrackerModule.h:67
const DetId & detId() const
Definition: TrackerModule.h:44
TrackerModule(const TrackerGeometry *trackerGeometry, const TrackerTopology *trackerTopology, const ModuleTypeCfg &moduleTypeCfg, const DetId &detId)
float minR() const
Definition: TrackerModule.h:53
unsigned int layerId_
bool psModule() const
Definition: TrackerModule.h:64
Definition: DetId.h:17
float sigmaPerp() const
Definition: TrackerModule.h:87
float maxZ() const
Definition: TrackerModule.h:58
std::vector< double > pitchVsType
Definition: TrackerModule.h:30
float stripLength() const
Definition: TrackerModule.h:85
const PixelTopology * specTopol() const
Definition: TrackerModule.h:51
unsigned int endcapRing_
std::vector< double > spaceVsType
Definition: TrackerModule.h:31
unsigned int nStrips() const
Definition: TrackerModule.h:81
float sensorWidth() const
Definition: TrackerModule.h:77
unsigned int endcapRing() const
Definition: TrackerModule.h:71
float paramB() const
Definition: TrackerModule.h:93
float tiltAngle() const
Definition: TrackerModule.h:75
ModuleTypeCfg moduleTypeCfg_
const PixelTopology * specTopol_
std::vector< bool > barrelVsType
Definition: TrackerModule.h:32
const DetId & stackedDetId() const
Definition: TrackerModule.h:47
bool outerModuleAtSmallerR() const
Definition: TrackerModule.h:62
unsigned int rawStackedDetId() const
Definition: TrackerModule.h:48
float minPhi() const
Definition: TrackerModule.h:55
unsigned int layerIdReduced_
const PixelGeomDetUnit * specDet() const
Definition: TrackerModule.h:50