File indexing completed on 2023-03-17 11:12:29
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
0227 TriggerPrimitive(const TriggerPrimitive& tp);
0228 TriggerPrimitive& operator=(const TriggerPrimitive& tp);
0229 bool operator==(const TriggerPrimitive& tp) const;
0230
0231
0232 subsystem_type subsystem() const { return _subsystem; }
0233
0234 void setCMSGlobalEta(double eta) { _eta = eta; }
0235 void setCMSGlobalPhi(double phi) { _phi = phi; }
0236 void setCMSGlobalRho(double rho) { _rho = rho; }
0237
0238 double getCMSGlobalEta() const { return _eta; }
0239 double getCMSGlobalPhi() const { return _phi; }
0240 double getCMSGlobalRho() const { return _rho; }
0241
0242 GlobalPoint getCMSGlobalPoint() const {
0243 double theta = 2. * std::atan(std::exp(-_eta));
0244 return GlobalPoint(GlobalPoint::Cylindrical(_rho, _phi, _rho / std::tan(theta)));
0245 }
0246
0247
0248
0249
0250 void setThetaBend(double theta) { _theta = theta; }
0251 double getThetaBend() const { return _theta; }
0252
0253 template <typename IDType>
0254 IDType detId() const {
0255 return IDType(_id);
0256 }
0257
0258
0259 void setDTData(const DTData& dt) { _dt = dt; }
0260 void setCSCData(const CSCData& csc) { _csc = csc; }
0261 void setRPCData(const RPCData& rpc) { _rpc = rpc; }
0262 void setGEMData(const GEMData& gem) { _gem = gem; }
0263 void setME0Data(const ME0Data& me0) { _me0 = me0; }
0264
0265 DTData getDTData() const { return _dt; }
0266 CSCData getCSCData() const { return _csc; }
0267 RPCData getRPCData() const { return _rpc; }
0268 GEMData getGEMData() const { return _gem; }
0269 ME0Data getME0Data() const { return _me0; }
0270
0271 DTData& accessDTData() { return _dt; }
0272 CSCData& accessCSCData() { return _csc; }
0273 RPCData& accessRPCData() { return _rpc; }
0274 GEMData& accessGEMData() { return _gem; }
0275 ME0Data& accessME0Data() { return _me0; }
0276
0277
0278 int getBX() const;
0279 int getStrip() const;
0280 int getWire() const;
0281 int getPattern() const;
0282 DetId rawId() const { return _id; }
0283
0284 unsigned getGlobalSector() const { return _globalsector; }
0285 unsigned getSubSector() const { return _subsector; }
0286
0287 void print(std::ostream&) const;
0288
0289 private:
0290
0291
0292 template <typename IDType>
0293 void calculateGlobalSector(const IDType& chid, unsigned& globalsector, unsigned& subsector) const {
0294
0295 globalsector = 0;
0296 subsector = 0;
0297 }
0298
0299 DTData _dt;
0300 CSCData _csc;
0301 RPCData _rpc;
0302 GEMData _gem;
0303 ME0Data _me0;
0304
0305 DetId _id;
0306
0307 subsystem_type _subsystem;
0308
0309 unsigned _globalsector;
0310 unsigned _subsector;
0311 double _eta, _phi, _rho;
0312 double _theta;
0313 };
0314
0315 }
0316
0317 #endif