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