File indexing completed on 2024-04-06 12:19:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef DT_TRIG_H
0013 #define DT_TRIG_H
0014
0015
0016
0017
0018 #include <map>
0019 #include <string>
0020
0021
0022
0023
0024 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0025 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0026 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
0027 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0028 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
0029 #include "DataFormats/MuonDetId/interface/DTSectCollId.h"
0030 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0031 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0032 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0033 #include "DataFormats/GeometryVector/interface/LocalVector.h"
0034 #include "L1Trigger/DTSectorCollector/interface/DTSCTrigUnit.h"
0035 #include "FWCore/Framework/interface/ConsumesCollector.h"
0036 #include "L1Trigger/DTUtilities/interface/DTTrigData.h"
0037 #include "L1Trigger/DTBti/interface/DTBtiTrigData.h"
0038 #include "L1Trigger/DTTraco/interface/DTTracoTrigData.h"
0039 #include "L1Trigger/DTTriggerServerPhi/interface/DTChambPhSegm.h"
0040 #include "L1Trigger/DTTriggerServerTheta/interface/DTChambThSegm.h"
0041 #include "L1Trigger/DTSectorCollector/interface/DTSectColl.h"
0042 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h"
0043
0044 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0045 #include "FWCore/Utilities/interface/ESGetToken.h"
0046 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0047 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0048 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h"
0049 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigManagerRcd.h"
0050
0051 #include <memory>
0052
0053 class InputTag;
0054
0055
0056
0057
0058
0059 class DTTrig {
0060 public:
0061 typedef std::map<DTChamberId, DTSCTrigUnit, std::less<DTChamberId> > TUcontainer;
0062 typedef TUcontainer::iterator TU_iterator;
0063 typedef TUcontainer::const_iterator TU_const_iterator;
0064 typedef std::map<DTSectCollId, DTSectColl, std::less<DTSectCollId> > SCcontainer;
0065 typedef SCcontainer::iterator SC_iterator;
0066 typedef SCcontainer::const_iterator SC_const_iterator;
0067 typedef std::pair<TU_iterator, TU_iterator> Range;
0068 typedef std::pair<SC_iterator, SC_iterator> SCRange;
0069 typedef std::map<DTChamberId, DTDigiCollection, std::less<DTChamberId> > DTDigiMap;
0070 typedef DTDigiMap::iterator DTDigiMap_iterator;
0071 typedef DTDigiMap::const_iterator DTDigiMap_const_iterator;
0072
0073 public:
0074
0075 DTTrig(const edm::ParameterSet& params, edm::ConsumesCollector&& ix);
0076
0077
0078 void createTUs(const edm::EventSetup& iSetup);
0079
0080
0081 void updateES(const edm::EventSetup& iSetup);
0082
0083
0084 void triggerReco(const edm::Event& iEvent, const edm::EventSetup& iSetup);
0085
0086
0087 void clear();
0088
0089
0090 int size() const { return _cache.size(); }
0091
0092
0093 TU_iterator begin() {
0094 return _cache.begin();
0095 }
0096
0097
0098 TU_iterator end() {
0099 return _cache.end();
0100 }
0101
0102
0103 TU_iterator find(DTChamberId id) {
0104 return _cache.find(id);
0105 }
0106
0107
0108 Range cache() {
0109 return Range(_cache.begin(), _cache.end());
0110 }
0111
0112
0113
0114
0115 int size1() const {
0116 return _cache1.size();
0117 }
0118
0119
0120 SC_iterator begin1() {
0121 return _cache1.begin();
0122 }
0123
0124
0125 SC_iterator end1() {
0126 return _cache1.end();
0127 }
0128
0129
0130 SC_iterator find1(DTSectCollId id) {
0131 return _cache1.find(id);
0132 }
0133
0134
0135 SCRange cache1() {
0136 return SCRange(_cache1.begin(), _cache1.end());
0137 }
0138
0139
0140 DTSCTrigUnit* trigUnit(DTChamberId sid);
0141
0142
0143 DTSCTrigUnit* trigUnit(int wheel, int stat, int sect);
0144
0145
0146 DTChambPhSegm* chPhiSegm1(DTChamberId sid, int step);
0147
0148
0149 DTChambPhSegm* chPhiSegm1(DTSCTrigUnit* unit, int step);
0150
0151
0152 DTChambPhSegm* chPhiSegm1(int wheel, int stat, int sect, int step);
0153
0154
0155 DTChambPhSegm* chPhiSegm2(DTChamberId sid, int step);
0156
0157
0158 DTChambPhSegm* chPhiSegm2(DTSCTrigUnit* unit, int step);
0159
0160
0161 DTChambPhSegm* chPhiSegm2(int wheel, int stat, int sect, int step);
0162
0163
0164 DTChambThSegm* chThetaSegm(DTChamberId sid, int step);
0165
0166
0167 DTChambThSegm* chThetaSegm(DTSCTrigUnit* unit, int step);
0168
0169
0170 DTChambThSegm* chThetaSegm(int wheel, int stat, int sect, int step);
0171
0172
0173
0174
0175 DTSectCollPhSegm* chSectCollPhSegm1(DTSectColl* unit, int step);
0176
0177
0178 DTSectCollPhSegm* chSectCollPhSegm1(int wheel, int sect, int step);
0179
0180
0181 DTSectCollPhSegm* chSectCollPhSegm2(DTSectColl* unit, int step);
0182
0183
0184 DTSectCollPhSegm* chSectCollPhSegm2(int wheel, int sect, int step);
0185
0186
0187 DTSectCollThSegm* chSectCollThSegm(DTSectColl* unit, int step);
0188
0189
0190 DTSectCollThSegm* chSectCollThSegm(int wheel, int sect, int step);
0191
0192
0193
0194
0195 void dumpGeom() const;
0196
0197
0198 void dumpLuts(short int lut_btic, const DTConfigManager* conf) const;
0199
0200
0201 int getBXOffset() const { return _conf_manager->getBXOffset(); }
0202
0203
0204
0205
0206 std::vector<DTBtiTrigData> BtiTrigs() const;
0207
0208
0209 std::vector<DTTracoTrigData> TracoTrigs() const;
0210
0211
0212 std::vector<DTChambPhSegm> TSPhTrigs() const;
0213
0214
0215 std::vector<DTChambThSegm> TSThTrigs() const;
0216
0217
0218 std::vector<DTSectCollPhSegm> SCPhTrigs() const;
0219
0220
0221 std::vector<DTSectCollThSegm> SCThTrigs() const;
0222
0223
0224 LocalPoint localPosition(const DTTrigData* trig) const {
0225 return constTrigUnit(trig->ChamberId())->localPosition(trig);
0226 }
0227
0228
0229 GlobalPoint CMSPosition(const DTTrigData* trig) const { return constTrigUnit(trig->ChamberId())->CMSPosition(trig); }
0230
0231
0232 LocalVector localDirection(const DTTrigData* trig) const {
0233 return constTrigUnit(trig->ChamberId())->localDirection(trig);
0234 }
0235
0236
0237 GlobalVector CMSDirection(const DTTrigData* trig) const {
0238 return constTrigUnit(trig->ChamberId())->CMSDirection(trig);
0239 }
0240
0241
0242 void print(DTTrigData* trig) const { constTrigUnit(trig->ChamberId())->print(trig); }
0243
0244 private:
0245
0246
0247 DTSCTrigUnit const* constTrigUnit(DTChamberId sid) const;
0248
0249
0250 DTSCTrigUnit const* constTrigUnit(int wheel, int stat, int sect) const;
0251
0252
0253 DTSectColl const* SCUnit(DTSectCollId scid) const;
0254
0255
0256 DTSectColl const* SCUnit(int wheel, int sect) const;
0257
0258 private:
0259 TUcontainer _cache;
0260 SCcontainer _cache1;
0261 const DTConfigManager* _conf_manager;
0262 edm::InputTag _digitag;
0263 edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0264 edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomBeginRunToken_;
0265 edm::ESGetToken<DTConfigManager, DTConfigManagerRcd> confToken_;
0266 bool _debug;
0267 bool _inputexist;
0268
0269 unsigned long long _configid;
0270 unsigned long long _geomid;
0271 };
0272
0273 #endif