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
tmtt::TrackerModule::endcapRing
unsigned int endcapRing() const
Definition: TrackerModule.h:71
tmtt::TrackerModule::moduleMinR_
float moduleMinR_
Definition: TrackerModule.h:110
tmtt::TrackerModule::tiltedBarrel
bool tiltedBarrel() const
Definition: TrackerModule.h:73
tmtt::TrackerModule::sensorSpacing_
float sensorSpacing_
Definition: TrackerModule.h:125
tmtt::TrackerModule::tiltAngle_
float tiltAngle_
Definition: TrackerModule.h:123
tmtt::TrackerModule::stripLength
float stripLength() const
Definition: TrackerModule.h:85
tmtt::TrackerModule::tiltedPlusZ
Definition: TrackerModule.h:26
tmtt::TrackerModule::ModuleTypeCfg
Definition: TrackerModule.h:29
TrackerTopology
Definition: TrackerTopology.h:16
tmtt::TrackerModule::pitchOverSep
float pitchOverSep() const
Definition: TrackerModule.h:91
tmtt::TrackerModule::layerId_
unsigned int layerId_
Definition: TrackerModule.h:119
tmtt::TrackerModule
Definition: TrackerModule.h:24
tmtt::TrackerModule::tiltedBarrel_
bool tiltedBarrel_
Definition: TrackerModule.h:122
tmtt::TrackerModule::endcapRing_
unsigned int endcapRing_
Definition: TrackerModule.h:121
tmtt::TrackerModule::moduleMaxR_
float moduleMaxR_
Definition: TrackerModule.h:111
tmtt::TrackerModule::moduleMaxZ_
float moduleMaxZ_
Definition: TrackerModule.h:115
tmtt::TrackerModule::specDet_
const PixelGeomDetUnit * specDet_
Definition: TrackerModule.h:108
tmtt::TrackerModule::layerIdReduced
unsigned int layerIdReduced() const
Definition: TrackerModule.h:69
tmtt::TrackerModule::maxPhi
float maxPhi() const
Definition: TrackerModule.h:56
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
tmtt::TrackerModule::moduleTypeCfg_
ModuleTypeCfg moduleTypeCfg_
Definition: TrackerModule.h:131
tmtt::TrackerModule::barrel
bool barrel() const
Definition: TrackerModule.h:65
DetId
Definition: DetId.h:17
tmtt::TrackerModule::moduleMinPhi_
float moduleMinPhi_
Definition: TrackerModule.h:112
tmtt::TrackerModule::calcModuleType
unsigned int calcModuleType(float pitch, float space, bool barrel, bool tiltedBarrel, bool psModule) const
Definition: TrackerModule.cc:129
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
tmtt::TrackerModule::calcLayerIdReduced
static unsigned int calcLayerIdReduced(unsigned int layerId)
Definition: TrackerModule.cc:104
tmtt::TrackerModule::specTopol_
const PixelTopology * specTopol_
Definition: TrackerModule.h:109
tmtt::TrackerModule::ModuleTypeCfg::tiltedVsType
std::vector< bool > tiltedVsType
Definition: TrackerModule.h:34
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
tmtt::TrackerModule::moduleMaxPhi_
float moduleMaxPhi_
Definition: TrackerModule.h:113
tmtt::TrackerModule::nStrips_
unsigned int nStrips_
Definition: TrackerModule.h:126
tmtt::TrackerModule::stackedDetId
const DetId & stackedDetId() const
Definition: TrackerModule.h:47
tmtt::TrackerModule::maxZ
float maxZ() const
Definition: TrackerModule.h:58
tmtt::TrackerModule::tiltAngle
float tiltAngle() const
Definition: TrackerModule.h:75
tmtt::TrackerModule::rawDetId
unsigned int rawDetId() const
Definition: TrackerModule.h:45
PixelTopology
Definition: PixelTopology.h:10
tmtt::TrackerModule::barrel_
bool barrel_
Definition: TrackerModule.h:118
tmtt::TrackerModule::psModule_
bool psModule_
Definition: TrackerModule.h:117
tmtt::TrackerModule::stripPitch
float stripPitch() const
Definition: TrackerModule.h:83
tmtt::TrackerModule::minR
float minR() const
Definition: TrackerModule.h:53
tmtt::TrackerModule::outerModuleAtSmallerR
bool outerModuleAtSmallerR() const
Definition: TrackerModule.h:62
tmtt::TrackerModule::stripPitch_
float stripPitch_
Definition: TrackerModule.h:127
tmtt::TrackerModule::layerIdReduced_
unsigned int layerIdReduced_
Definition: TrackerModule.h:120
tmtt::TrackerModule::moduleMinZ_
float moduleMinZ_
Definition: TrackerModule.h:114
tmtt::TrackerModule::sensorWidth_
float sensorWidth_
Definition: TrackerModule.h:124
DetSetVector.h
tmtt::TrackerModule::maxR
float maxR() const
Definition: TrackerModule.h:54
tmtt::TrackerModule::sigmaPerp
float sigmaPerp() const
Definition: TrackerModule.h:87
tmtt::TrackerModule::BarrelModuleType
BarrelModuleType
Definition: TrackerModule.h:26
tmtt::TrackerModule::stackedDetId_
DetId stackedDetId_
Definition: TrackerModule.h:107
tmtt::TrackerModule::theta
float theta() const
Definition: TrackerModule.h:60
tmtt::TrackerModule::minPhi
float minPhi() const
Definition: TrackerModule.h:55
tmtt::TrackerModule::paramB
float paramB() const
Definition: TrackerModule.h:93
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Ref.h
tmtt::TrackerModule::outerModuleAtSmallerR_
bool outerModuleAtSmallerR_
Definition: TrackerModule.h:116
DetId.h
Frameworkfwd.h
tmtt::TrackerModule::layerId
unsigned int layerId() const
Definition: TrackerModule.h:67
tmtt::TrackerModule::rawStackedDetId
unsigned int rawStackedDetId() const
Definition: TrackerModule.h:48
tmtt::TrackerModule::minZ
float minZ() const
Definition: TrackerModule.h:57
tmtt::TrackerModule::moduleTypeID_
unsigned int moduleTypeID_
Definition: TrackerModule.h:129
tmtt::TrackerModule::specTopol
const PixelTopology * specTopol() const
Definition: TrackerModule.h:51
tmtt::TrackerModule::ModuleTypeCfg::spaceVsType
std::vector< double > spaceVsType
Definition: TrackerModule.h:31
tmtt::TrackerModule::detId_
DetId detId_
Definition: TrackerModule.h:106
tmtt::TrackerModule::ModuleTypeCfg::psVsType
std::vector< bool > psVsType
Definition: TrackerModule.h:33
tmtt::TrackerModule::tiltedMinusZ
Definition: TrackerModule.h:26
tmtt::TrackerModule::specDet
const PixelGeomDetUnit * specDet() const
Definition: TrackerModule.h:50
tmtt::TrackerModule::flat
Definition: TrackerModule.h:26
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tmtt::TrackerModule::detId
const DetId & detId() const
Definition: TrackerModule.h:44
tmtt::TrackerModule::nStrips
unsigned int nStrips() const
Definition: TrackerModule.h:81
tmtt::TrackerModule::psModule
bool psModule() const
Definition: TrackerModule.h:64
tmtt
=== This is the base class for the linearised chi-squared track fit algorithms.
Definition: ChiSquaredFit4.h:6
tmtt::TrackerModule::TrackerModule
TrackerModule(const TrackerGeometry *trackerGeometry, const TrackerTopology *trackerTopology, const ModuleTypeCfg &moduleTypeCfg, const DetId &detId)
Definition: TrackerModule.cc:26
tmtt::TrackerModule::ModuleTypeCfg::barrelVsType
std::vector< bool > barrelVsType
Definition: TrackerModule.h:32
tmtt::TrackerModule::sensorSpacing
float sensorSpacing() const
Definition: TrackerModule.h:79
tmtt::TrackerModule::moduleTypeID
unsigned int moduleTypeID() const
Definition: TrackerModule.h:95
tmtt::TrackerModule::invRoot12
static const float invRoot12
Definition: TrackerModule.h:133
tmtt::TrackerModule::sigmaPar
float sigmaPar() const
Definition: TrackerModule.h:89
tmtt::TrackerModule::ModuleTypeCfg::pitchVsType
std::vector< double > pitchVsType
Definition: TrackerModule.h:30
tmtt::TrackerModule::stripLength_
float stripLength_
Definition: TrackerModule.h:128
TrackerGeometry
Definition: TrackerGeometry.h:14
tmtt::TrackerModule::sensorWidth
float sensorWidth() const
Definition: TrackerModule.h:77