File indexing completed on 2024-09-07 04:36:45
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() { return _cache.begin(); }
0094
0095
0096 TU_iterator end() { return _cache.end(); }
0097
0098
0099 TU_iterator find(DTChamberId id) { return _cache.find(id); }
0100
0101
0102 Range cache() { return Range(_cache.begin(), _cache.end()); }
0103
0104
0105
0106
0107 int size1() const { return _cache1.size(); }
0108
0109
0110 SC_iterator begin1() { return _cache1.begin(); }
0111
0112
0113 SC_iterator end1() { return _cache1.end(); }
0114
0115
0116 SC_iterator find1(DTSectCollId id) { return _cache1.find(id); }
0117
0118
0119 SCRange cache1() { return SCRange(_cache1.begin(), _cache1.end()); }
0120
0121
0122 DTSCTrigUnit* trigUnit(DTChamberId sid);
0123
0124
0125 DTSCTrigUnit* trigUnit(int wheel, int stat, int sect);
0126
0127
0128 DTChambPhSegm* chPhiSegm1(DTChamberId sid, int step);
0129
0130
0131 DTChambPhSegm* chPhiSegm1(DTSCTrigUnit* unit, int step);
0132
0133
0134 DTChambPhSegm* chPhiSegm1(int wheel, int stat, int sect, int step);
0135
0136
0137 DTChambPhSegm* chPhiSegm2(DTChamberId sid, int step);
0138
0139
0140 DTChambPhSegm* chPhiSegm2(DTSCTrigUnit* unit, int step);
0141
0142
0143 DTChambPhSegm* chPhiSegm2(int wheel, int stat, int sect, int step);
0144
0145
0146 DTChambThSegm* chThetaSegm(DTChamberId sid, int step);
0147
0148
0149 DTChambThSegm* chThetaSegm(DTSCTrigUnit* unit, int step);
0150
0151
0152 DTChambThSegm* chThetaSegm(int wheel, int stat, int sect, int step);
0153
0154
0155
0156
0157 DTSectCollPhSegm* chSectCollPhSegm1(DTSectColl* unit, int step);
0158
0159
0160 DTSectCollPhSegm* chSectCollPhSegm1(int wheel, int sect, int step);
0161
0162
0163 DTSectCollPhSegm* chSectCollPhSegm2(DTSectColl* unit, int step);
0164
0165
0166 DTSectCollPhSegm* chSectCollPhSegm2(int wheel, int sect, int step);
0167
0168
0169 DTSectCollThSegm* chSectCollThSegm(DTSectColl* unit, int step);
0170
0171
0172 DTSectCollThSegm* chSectCollThSegm(int wheel, int sect, int step);
0173
0174
0175
0176
0177 void dumpGeom() const;
0178
0179
0180 void dumpLuts(short int lut_btic, const DTConfigManager* conf) const;
0181
0182
0183 int getBXOffset() const { return _conf_manager->getBXOffset(); }
0184
0185
0186
0187
0188 std::vector<DTBtiTrigData> BtiTrigs() const;
0189
0190
0191 std::vector<DTTracoTrigData> TracoTrigs() const;
0192
0193
0194 std::vector<DTChambPhSegm> TSPhTrigs() const;
0195
0196
0197 std::vector<DTChambThSegm> TSThTrigs() const;
0198
0199
0200 std::vector<DTSectCollPhSegm> SCPhTrigs() const;
0201
0202
0203 std::vector<DTSectCollThSegm> SCThTrigs() const;
0204
0205
0206 LocalPoint localPosition(const DTTrigData* trig) const {
0207 return constTrigUnit(trig->ChamberId())->localPosition(trig);
0208 }
0209
0210
0211 GlobalPoint CMSPosition(const DTTrigData* trig) const { return constTrigUnit(trig->ChamberId())->CMSPosition(trig); }
0212
0213
0214 LocalVector localDirection(const DTTrigData* trig) const {
0215 return constTrigUnit(trig->ChamberId())->localDirection(trig);
0216 }
0217
0218
0219 GlobalVector CMSDirection(const DTTrigData* trig) const {
0220 return constTrigUnit(trig->ChamberId())->CMSDirection(trig);
0221 }
0222
0223
0224 void print(DTTrigData* trig) const { constTrigUnit(trig->ChamberId())->print(trig); }
0225
0226 private:
0227
0228
0229 DTSCTrigUnit const* constTrigUnit(DTChamberId sid) const;
0230
0231
0232 DTSCTrigUnit const* constTrigUnit(int wheel, int stat, int sect) const;
0233
0234
0235 DTSectColl const* SCUnit(DTSectCollId scid) const;
0236
0237
0238 DTSectColl const* SCUnit(int wheel, int sect) const;
0239
0240 private:
0241 TUcontainer _cache;
0242 SCcontainer _cache1;
0243 const DTConfigManager* _conf_manager;
0244 edm::InputTag _digitag;
0245 edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0246 edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomBeginRunToken_;
0247 edm::ESGetToken<DTConfigManager, DTConfigManagerRcd> confToken_;
0248 bool _debug;
0249 bool _inputexist;
0250
0251 unsigned long long _configid;
0252 unsigned long long _geomid;
0253 };
0254
0255 #endif