File indexing completed on 2024-04-06 12:20:47
0001 #ifndef __L1TMuon_TriggerPrimitive_h__
0002 #define __L1TMuon_TriggerPrimitive_h__
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include <cstdint>
0021 #include <vector>
0022 #include <iosfwd>
0023
0024 #include "DataFormats/DetId/interface/DetId.h"
0025 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0026 #include "DataFormats/L1TMuon/interface/L1TMuonSubsystems.h"
0027
0028
0029 class DTChamberId;
0030 class L1MuDTChambPhDigi;
0031 class L1MuDTChambThDigi;
0032
0033
0034 class CSCCorrelatedLCTDigi;
0035 class CSCDetId;
0036
0037
0038 class RPCRecHit;
0039 class RPCDigi;
0040 class RPCDetId;
0041
0042
0043 namespace l1t {
0044 class CPPFDigi;
0045 }
0046
0047
0048 class GEMPadDigiCluster;
0049 class GEMDetId;
0050
0051
0052 class ME0TriggerDigi;
0053 class ME0DetId;
0054
0055 namespace L1TMuon {
0056
0057 class TriggerPrimitive {
0058 public:
0059
0060
0061
0062
0063 struct RPCData {
0064 RPCData()
0065 : strip(0),
0066 strip_low(0),
0067 strip_hi(0),
0068 phi_int(0),
0069 theta_int(0),
0070 emtf_sector(0),
0071 emtf_link(0),
0072 bx(0),
0073 valid(0),
0074 x(0.),
0075 y(0.),
0076 time(0.),
0077 isCPPF(false) {}
0078 uint16_t strip;
0079 uint16_t strip_low;
0080 uint16_t strip_hi;
0081 uint16_t phi_int;
0082 uint16_t theta_int;
0083 uint16_t emtf_sector;
0084 uint16_t emtf_link;
0085 int16_t bx;
0086 int16_t valid;
0087 float x;
0088 float y;
0089 float time;
0090 bool isCPPF;
0091 };
0092
0093 struct CSCData {
0094 CSCData()
0095 : trknmb(0),
0096 valid(0),
0097 quality(0),
0098 keywire(0),
0099 strip(0),
0100 pattern(0),
0101 bend(0),
0102 bx(0),
0103 mpclink(0),
0104 bx0(0),
0105 syncErr(0),
0106 cscID(0),
0107 alct_quality(0),
0108 clct_quality(0),
0109
0110 pattern_run3(0),
0111 strip_quart_bit(0),
0112 strip_eighth_bit(0),
0113 strip_quart(0),
0114 strip_eighth(0),
0115 slope(0) {}
0116 uint16_t trknmb;
0117 uint16_t valid;
0118 uint16_t quality;
0119 uint16_t keywire;
0120 uint16_t strip;
0121 uint16_t pattern;
0122 uint16_t bend;
0123 uint16_t bx;
0124 uint16_t mpclink;
0125 uint16_t bx0;
0126 uint16_t syncErr;
0127 uint16_t cscID;
0128 uint16_t alct_quality;
0129 uint16_t clct_quality;
0130
0131 uint16_t pattern_run3;
0132 uint16_t strip_quart_bit;
0133 uint16_t strip_eighth_bit;
0134 uint16_t strip_quart;
0135 uint16_t strip_eighth;
0136 uint16_t slope;
0137 };
0138
0139 struct DTData {
0140 DTData()
0141 : bx(0),
0142 wheel(0),
0143 sector(0),
0144 station(0),
0145 radialAngle(0),
0146 bendingAngle(0),
0147 qualityCode(0),
0148 Ts2TagCode(0),
0149 BxCntCode(0),
0150 RpcBit(-10),
0151 theta_bti_group(0),
0152 segment_number(0),
0153 theta_code(0),
0154 theta_quality(0) {}
0155
0156
0157 int bx;
0158 int wheel;
0159 int sector;
0160 int station;
0161 int radialAngle;
0162 int bendingAngle;
0163 int qualityCode;
0164 int Ts2TagCode;
0165 int BxCntCode;
0166 int RpcBit;
0167
0168
0169
0170
0171
0172 int theta_bti_group;
0173 int segment_number;
0174 int theta_code;
0175 int theta_quality;
0176 };
0177
0178
0179 struct GEMData {
0180 GEMData() : pad(0), pad_low(0), pad_hi(0), bx(0) {}
0181 uint16_t pad;
0182 uint16_t pad_low;
0183 uint16_t pad_hi;
0184 int16_t bx;
0185 };
0186
0187
0188 struct ME0Data {
0189 ME0Data() : chamberid(0), quality(0), phiposition(0), partition(0), deltaphi(0), bend(0), bx(0) {}
0190 uint16_t chamberid;
0191 uint16_t quality;
0192 uint16_t phiposition;
0193 uint16_t partition;
0194 uint16_t deltaphi;
0195 uint16_t bend;
0196 uint16_t bx;
0197 };
0198
0199
0200 TriggerPrimitive() : _id(0), _subsystem(kNSubsystems) {}
0201
0202
0203 TriggerPrimitive(const DTChamberId& detid, const L1MuDTChambPhDigi& digi_phi, const int segment_number);
0204 TriggerPrimitive(const DTChamberId& detid, const L1MuDTChambThDigi& digi_th, const int theta_bti_group);
0205 TriggerPrimitive(const DTChamberId& detid,
0206 const L1MuDTChambPhDigi& digi_phi,
0207 const L1MuDTChambThDigi& digi_th,
0208 const int theta_bti_group);
0209
0210
0211 TriggerPrimitive(const CSCDetId& detid, const CSCCorrelatedLCTDigi& digi);
0212
0213
0214 TriggerPrimitive(const RPCDetId& detid, const RPCDigi& digi);
0215 TriggerPrimitive(const RPCDetId& detid, const RPCRecHit& rechit);
0216
0217
0218 TriggerPrimitive(const RPCDetId& detid, const l1t::CPPFDigi& digi);
0219
0220
0221 TriggerPrimitive(const GEMDetId& detid, const GEMPadDigiCluster& digi);
0222
0223
0224 TriggerPrimitive(const ME0DetId& detid, const ME0TriggerDigi& digi);
0225
0226 TriggerPrimitive(const GEMDetId& detid, const ME0TriggerDigi& digi);
0227
0228
0229 TriggerPrimitive(const TriggerPrimitive& tp);
0230 TriggerPrimitive& operator=(const TriggerPrimitive& tp);
0231 bool operator==(const TriggerPrimitive& tp) const;
0232
0233
0234 subsystem_type subsystem() const { return _subsystem; }
0235
0236 void setCMSGlobalEta(double eta) { _eta = eta; }
0237 void setCMSGlobalPhi(double phi) { _phi = phi; }
0238 void setCMSGlobalRho(double rho) { _rho = rho; }
0239
0240 double getCMSGlobalEta() const { return _eta; }
0241 double getCMSGlobalPhi() const { return _phi; }
0242 double getCMSGlobalRho() const { return _rho; }
0243
0244 GlobalPoint getCMSGlobalPoint() const {
0245 double theta = 2. * std::atan(std::exp(-_eta));
0246 return GlobalPoint(GlobalPoint::Cylindrical(_rho, _phi, _rho / std::tan(theta)));
0247 }
0248
0249
0250
0251
0252 void setThetaBend(double theta) { _theta = theta; }
0253 double getThetaBend() const { return _theta; }
0254
0255 template <typename IDType>
0256 IDType detId() const {
0257 return IDType(_id);
0258 }
0259
0260
0261 void setDTData(const DTData& dt) { _dt = dt; }
0262 void setCSCData(const CSCData& csc) { _csc = csc; }
0263 void setRPCData(const RPCData& rpc) { _rpc = rpc; }
0264 void setGEMData(const GEMData& gem) { _gem = gem; }
0265 void setME0Data(const ME0Data& me0) { _me0 = me0; }
0266
0267 DTData getDTData() const { return _dt; }
0268 CSCData getCSCData() const { return _csc; }
0269 RPCData getRPCData() const { return _rpc; }
0270 GEMData getGEMData() const { return _gem; }
0271 ME0Data getME0Data() const { return _me0; }
0272
0273 DTData& accessDTData() { return _dt; }
0274 CSCData& accessCSCData() { return _csc; }
0275 RPCData& accessRPCData() { return _rpc; }
0276 GEMData& accessGEMData() { return _gem; }
0277 ME0Data& accessME0Data() { return _me0; }
0278
0279
0280 int getBX() const;
0281 int getStrip() const;
0282 int getWire() const;
0283 int getPattern() const;
0284 DetId rawId() const { return _id; }
0285
0286 unsigned getGlobalSector() const { return _globalsector; }
0287 unsigned getSubSector() const { return _subsector; }
0288
0289 void print(std::ostream&) const;
0290
0291 private:
0292
0293
0294 template <typename IDType>
0295 void calculateGlobalSector(const IDType& chid, unsigned& globalsector, unsigned& subsector) const {
0296
0297 globalsector = 0;
0298 subsector = 0;
0299 }
0300
0301 DTData _dt;
0302 CSCData _csc;
0303 RPCData _rpc;
0304 GEMData _gem;
0305 ME0Data _me0;
0306
0307 DetId _id;
0308
0309 subsystem_type _subsystem;
0310
0311 unsigned _globalsector;
0312 unsigned _subsector;
0313 double _eta, _phi, _rho;
0314 double _theta;
0315 };
0316
0317 }
0318
0319 #endif