File indexing completed on 2024-04-06 12:21:49
0001 #ifndef L1Trigger_TrackFindingTMTT_TrackerModule_h
0002 #define L1Trigger_TrackFindingTMTT_TrackerModule_h
0003
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include "DataFormats/Common/interface/Ref.h"
0006 #include "DataFormats/Common/interface/DetSetVector.h"
0007 #include "FWCore/Framework/interface/Frameworkfwd.h"
0008
0009 #include <vector>
0010 #include <set>
0011 #include <array>
0012 #include <map>
0013 #include <cmath>
0014
0015 class TrackerGeometry;
0016 class TrackerTopology;
0017 class PixelGeomDetUnit;
0018 class PixelTopology;
0019
0020 namespace tmtt {
0021
0022
0023
0024 class TrackerModule {
0025 public:
0026 enum BarrelModuleType { tiltedMinusZ = 1, tiltedPlusZ = 2, flat = 3 };
0027
0028
0029 struct ModuleTypeCfg {
0030 std::vector<double> pitchVsType;
0031 std::vector<double> spaceVsType;
0032 std::vector<bool> barrelVsType;
0033 std::vector<bool> psVsType;
0034 std::vector<bool> tiltedVsType;
0035 };
0036
0037
0038 TrackerModule(const TrackerGeometry* trackerGeometry,
0039 const TrackerTopology* trackerTopology,
0040 const ModuleTypeCfg& moduleTypeCfg,
0041 const DetId& detId);
0042
0043
0044 const DetId& detId() const { return detId_; }
0045 unsigned int rawDetId() const { return detId_.rawId(); }
0046
0047 const DetId& stackedDetId() const { return stackedDetId_; }
0048 unsigned int rawStackedDetId() const { return stackedDetId_.rawId(); }
0049
0050 const PixelGeomDetUnit* specDet() const { return specDet_; }
0051 const PixelTopology* specTopol() const { return specTopol_; }
0052
0053 float minR() const { return moduleMinR_; }
0054 float maxR() const { return moduleMaxR_; }
0055 float minPhi() const { return moduleMinPhi_; }
0056 float maxPhi() const { return moduleMaxPhi_; }
0057 float minZ() const { return moduleMinZ_; }
0058 float maxZ() const { return moduleMaxZ_; }
0059
0060 float theta() const { return atan2(moduleMinR_, moduleMinZ_); }
0061
0062 bool outerModuleAtSmallerR() const { return outerModuleAtSmallerR_; }
0063
0064 bool psModule() const { return psModule_; }
0065 bool barrel() const { return barrel_; }
0066
0067 unsigned int layerId() const { return layerId_; }
0068
0069 unsigned int layerIdReduced() const { return layerIdReduced_; }
0070
0071 unsigned int endcapRing() const { return endcapRing_; }
0072
0073 bool tiltedBarrel() const { return tiltedBarrel_; }
0074
0075 float tiltAngle() const { return tiltAngle_; }
0076
0077 float sensorWidth() const { return sensorWidth_; }
0078
0079 float sensorSpacing() const { return sensorSpacing_; }
0080
0081 unsigned int nStrips() const { return nStrips_; }
0082
0083 float stripPitch() const { return stripPitch_; }
0084
0085 float stripLength() const { return stripLength_; }
0086
0087 float sigmaPerp() const { return invRoot12 * stripPitch_; }
0088
0089 float sigmaPar() const { return invRoot12 * stripLength_; }
0090
0091 float pitchOverSep() const { return stripPitch_ / sensorSpacing_; }
0092
0093 float paramB() const { return std::abs(cos(theta() - tiltAngle()) / sin(theta())); }
0094
0095 unsigned int moduleTypeID() const { return moduleTypeID_; }
0096
0097
0098
0099
0100 static unsigned int calcLayerIdReduced(unsigned int layerId) {
0101
0102 unsigned int lay = (layerId < 20) ? layerId : layerId - 10;
0103
0104
0105 if (lay == 6)
0106 lay = 11;
0107 else if (lay == 5)
0108 lay = 12;
0109 else if (lay == 4)
0110 lay = 13;
0111 else if (lay == 3)
0112 lay = 15;
0113
0114 if (lay > 10)
0115 lay -= 8;
0116
0117 if (lay < 1 || lay > 7)
0118 throw cms::Exception("LogicError") << "TrackerModule: Reduced layer ID out of expected range";
0119
0120 return lay;
0121 }
0122
0123
0124 unsigned int calcModuleType(float pitch, float space, bool barrel, bool tiltedBarrel, bool psModule) const;
0125
0126 private:
0127 DetId detId_;
0128 DetId stackedDetId_;
0129 const PixelGeomDetUnit* specDet_;
0130 const PixelTopology* specTopol_;
0131 float moduleMinR_;
0132 float moduleMaxR_;
0133 float moduleMinPhi_;
0134 float moduleMaxPhi_;
0135 float moduleMinZ_;
0136 float moduleMaxZ_;
0137 bool outerModuleAtSmallerR_;
0138 bool psModule_;
0139 bool barrel_;
0140 unsigned int layerId_;
0141 unsigned int layerIdReduced_;
0142 unsigned int endcapRing_;
0143 bool tiltedBarrel_;
0144 float tiltAngle_;
0145 float sensorWidth_;
0146 float sensorSpacing_;
0147 unsigned int nStrips_;
0148 float stripPitch_;
0149 float stripLength_;
0150 unsigned int moduleTypeID_;
0151
0152 ModuleTypeCfg moduleTypeCfg_;
0153
0154 static const float invRoot12;
0155 };
0156
0157 }
0158 #endif