CMS 3D CMS Logo

DTTrig.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
10 //
11 //--------------------------------------------------
12 #ifndef DT_TRIG_H
13 #define DT_TRIG_H
14 
15 //---------------
16 // C++ Headers --
17 //---------------
18 #include <map>
19 #include <string>
20 
21 //------------------------------------
22 // Collaborating Class Declarations --
23 //------------------------------------
43 
50 
51 #include <memory>
52 
53 class InputTag;
54 
55 // ---------------------
56 // -- Class Interface --
57 // ---------------------
58 
59 class DTTrig {
60 public:
61  typedef std::map<DTChamberId, DTSCTrigUnit, std::less<DTChamberId> > TUcontainer;
62  typedef TUcontainer::iterator TU_iterator;
63  typedef TUcontainer::const_iterator TU_const_iterator;
64  typedef std::map<DTSectCollId, DTSectColl, std::less<DTSectCollId> > SCcontainer;
65  typedef SCcontainer::iterator SC_iterator;
66  typedef SCcontainer::const_iterator SC_const_iterator;
67  typedef std::pair<TU_iterator, TU_iterator> Range;
68  typedef std::pair<SC_iterator, SC_iterator> SCRange;
69  typedef std::map<DTChamberId, DTDigiCollection, std::less<DTChamberId> > DTDigiMap;
70  typedef DTDigiMap::iterator DTDigiMap_iterator;
71  typedef DTDigiMap::const_iterator DTDigiMap_const_iterator;
72 
73 public:
76 
78  void createTUs(const edm::EventSetup& iSetup);
79 
81  void updateES(const edm::EventSetup& iSetup);
82 
84  void triggerReco(const edm::Event& iEvent, const edm::EventSetup& iSetup);
85 
87  void clear();
88 
90  int size() const { return _cache.size(); }
91 
93  TU_iterator begin() { /*check();*/ return _cache.begin(); }
94 
96  TU_iterator end() { /*check();*/ return _cache.end(); }
97 
99  TU_iterator find(DTChamberId id) { /*check();*/ return _cache.find(id); }
100 
102  Range cache() { /*check();*/ return Range(_cache.begin(), _cache.end()); }
103 
104  // ------------ do the same for Sector Collector
105 
107  int size1() const { /*check();*/ return _cache1.size(); }
108 
110  SC_iterator begin1() { /*check();*/ return _cache1.begin(); }
111 
113  SC_iterator end1() { /*check();*/ return _cache1.end(); }
114 
116  SC_iterator find1(DTSectCollId id) { /*check();*/ return _cache1.find(id); }
117 
119  SCRange cache1() { /*check();*/ return SCRange(_cache1.begin(), _cache1.end()); }
120 
123 
125  DTSCTrigUnit* trigUnit(int wheel, int stat, int sect);
126 
129 
132 
134  DTChambPhSegm* chPhiSegm1(int wheel, int stat, int sect, int step);
135 
138 
141 
143  DTChambPhSegm* chPhiSegm2(int wheel, int stat, int sect, int step);
144 
147 
150 
152  DTChambThSegm* chThetaSegm(int wheel, int stat, int sect, int step);
153 
154  // sector collector
155 
158 
160  DTSectCollPhSegm* chSectCollPhSegm1(int wheel, int sect, int step);
161 
164 
166  DTSectCollPhSegm* chSectCollPhSegm2(int wheel, int sect, int step);
167 
170 
172  DTSectCollThSegm* chSectCollThSegm(int wheel, int sect, int step);
173 
174  // end sector collector
175 
177  void dumpGeom() const;
178 
180  void dumpLuts(short int lut_btic, const DTConfigManager* conf) const;
181 
183  int getBXOffset() const { return _conf_manager->getBXOffset(); }
184 
185  // Methods to access intermediate results
186 
188  std::vector<DTBtiTrigData> BtiTrigs() const;
189 
191  std::vector<DTTracoTrigData> TracoTrigs() const;
192 
194  std::vector<DTChambPhSegm> TSPhTrigs() const;
195 
197  std::vector<DTChambThSegm> TSThTrigs() const;
198 
200  std::vector<DTSectCollPhSegm> SCPhTrigs() const;
201 
203  std::vector<DTSectCollThSegm> SCThTrigs() const;
204 
207  return constTrigUnit(trig->ChamberId())->localPosition(trig);
208  }
209 
211  GlobalPoint CMSPosition(const DTTrigData* trig) const { return constTrigUnit(trig->ChamberId())->CMSPosition(trig); }
212 
215  return constTrigUnit(trig->ChamberId())->localDirection(trig);
216  }
217 
220  return constTrigUnit(trig->ChamberId())->CMSDirection(trig);
221  }
222 
224  void print(DTTrigData* trig) const { constTrigUnit(trig->ChamberId())->print(trig); }
225 
226 private:
227  // const version of the methods to access TUs and SCs are private to avoid misuse
229  DTSCTrigUnit const* constTrigUnit(DTChamberId sid) const;
230 
232  DTSCTrigUnit const* constTrigUnit(int wheel, int stat, int sect) const;
233 
235  DTSectColl const* SCUnit(DTSectCollId scid) const;
236 
238  DTSectColl const* SCUnit(int wheel, int sect) const;
239 
240 private:
241  TUcontainer _cache; // Trigger units
242  SCcontainer _cache1; // Sector Collector units
243  const DTConfigManager* _conf_manager; // Configuration Manager class pointer
248  bool _debug; // Debug flag
250 
251  unsigned long long _configid;
252  unsigned long long _geomid;
253 };
254 
255 #endif
std::vector< DTBtiTrigData > BtiTrigs() const
Return a copy of all the BTI triggers.
Definition: DTTrig.cc:412
SC_iterator end1()
End of the sectoor collector store.
Definition: DTTrig.h:113
SC_iterator begin1()
Begin of the sector collector store.
Definition: DTTrig.h:110
SCcontainer::iterator SC_iterator
Definition: DTTrig.h:65
TU_iterator find(DTChamberId id)
Find a trigger unit in the map.
Definition: DTTrig.h:99
SCcontainer _cache1
Definition: DTTrig.h:242
std::map< DTChamberId, DTDigiCollection, std::less< DTChamberId > > DTDigiMap
Definition: DTTrig.h:69
int size() const
Size of the trigger units store.
Definition: DTTrig.h:90
bool _debug
Definition: DTTrig.h:248
SC_iterator find1(DTSectCollId id)
Find a Sector Collector in the map.
Definition: DTTrig.h:116
DTChambPhSegm * chPhiSegm2(DTChamberId sid, int step)
Return the second phi track segment in req. chamber/step.
Definition: DTTrig.cc:315
TU_iterator begin()
Begin of the trigger units store.
Definition: DTTrig.h:93
std::vector< DTChambThSegm > TSThTrigs() const
Return a copy of all the Trigger Server (Theta) triggers.
Definition: DTTrig.cc:451
std::pair< TU_iterator, TU_iterator > Range
Definition: DTTrig.h:67
int getBXOffset() const
Get BX Offset for a given vdrift config.
DTTrig(const edm::ParameterSet &params, edm::ConsumesCollector &&ix)
Constructors.
Definition: DTTrig.cc:46
GlobalPoint CMSPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in CMS frame.
Definition: DTTrig.h:211
TUcontainer _cache
Definition: DTTrig.h:241
int getBXOffset() const
Get BX Offset.
Definition: DTTrig.h:183
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:62
DTSectCollPhSegm * chSectCollPhSegm1(DTSectColl *unit, int step)
Return the first phi track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:347
DTChambPhSegm * chPhiSegm1(DTChamberId sid, int step)
Return the first phi track segment in req. chamber/step.
Definition: DTTrig.cc:313
unsigned long long _geomid
Definition: DTTrig.h:252
DTSCTrigUnit const * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:247
int iEvent
Definition: GenABIO.cc:224
std::vector< DTSectCollPhSegm > SCPhTrigs() const
Return a copy of all the Sector Collector (Phi) triggers.
Definition: DTTrig.cc:464
std::vector< DTTracoTrigData > TracoTrigs() const
Return a copy of all the TRACO triggers.
Definition: DTTrig.cc:425
TU_iterator end()
End of the trigger units store.
Definition: DTTrig.h:96
std::vector< DTSectCollThSegm > SCThTrigs() const
Return a copy of all the Sector Collector (Theta) triggers.
Definition: DTTrig.cc:487
void updateES(const edm::EventSetup &iSetup)
update the eventsetup info
Definition: DTTrig.cc:207
LocalVector localDirection(const DTTrigData *trig) const
Direction of a trigger-data object in chamber frame.
Definition: DTTrig.h:214
edm::InputTag _digitag
Definition: DTTrig.h:244
void triggerReco(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Run the whole trigger reconstruction chain.
Definition: DTTrig.cc:132
std::vector< DTChambPhSegm > TSPhTrigs() const
Return a copy of all the Trigger Server (Phi) triggers.
Definition: DTTrig.cc:438
Basic3DVector unit() const
DTSectCollPhSegm * chSectCollPhSegm2(DTSectColl *unit, int step)
Return the second phi track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:355
DTDigiMap::iterator DTDigiMap_iterator
Definition: DTTrig.h:70
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
TUcontainer::const_iterator TU_const_iterator
Definition: DTTrig.h:63
Definition: DTTrig.h:59
DTSCTrigUnit * trigUnit(DTChamberId sid)
Return a trigger unit - Muon numbering.
Definition: DTTrig.cc:245
edm::ESGetToken< DTConfigManager, DTConfigManagerRcd > confToken_
Definition: DTTrig.h:247
LocalPoint localPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in chamber frame.
Definition: DTTrig.h:206
void print(DTTrigData *trig) const
Print a trigger-data object.
Definition: DTTrig.h:224
GlobalVector CMSDirection(const DTTrigData *trig) const
Direction of a trigger-data object in CMS frame.
Definition: DTTrig.h:219
SCRange cache1()
Range of the sector collector store.
Definition: DTTrig.h:119
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomBeginRunToken_
Definition: DTTrig.h:246
DTChambThSegm * chThetaSegm(DTChamberId sid, int step)
Return the theta candidates in req. chamber/step.
Definition: DTTrig.cc:317
DTDigiMap::const_iterator DTDigiMap_const_iterator
Definition: DTTrig.h:71
Range cache()
Begin of the trigger units store.
Definition: DTTrig.h:102
const DTConfigManager * _conf_manager
Definition: DTTrig.h:243
bool _inputexist
Definition: DTTrig.h:249
DTSectCollThSegm * chSectCollThSegm(DTSectColl *unit, int step)
Return the theta track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:376
std::map< DTChamberId, DTSCTrigUnit, std::less< DTChamberId > > TUcontainer
Definition: DTTrig.h:61
std::map< DTSectCollId, DTSectColl, std::less< DTSectCollId > > SCcontainer
Definition: DTTrig.h:64
std::pair< SC_iterator, SC_iterator > SCRange
Definition: DTTrig.h:68
step
Definition: StallMonitor.cc:83
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
Definition: DTTrig.h:245
int size1() const
Size of the sector collector store.
Definition: DTTrig.h:107
void dumpGeom() const
Dump the geometry.
Definition: DTTrig.cc:390
void dumpLuts(short int lut_btic, const DTConfigManager *conf) const
Dump the LUT files.
Definition: DTTrig.cc:397
DTSectColl const * SCUnit(DTSectCollId scid) const
Return a SC unit - Muon numbering - const version.
Definition: DTTrig.cc:262
void createTUs(const edm::EventSetup &iSetup)
Create the trigger units and store them in the cache.
Definition: DTTrig.cc:63
unsigned long long _configid
Definition: DTTrig.h:251
SCcontainer::const_iterator SC_const_iterator
Definition: DTTrig.h:66
void clear()
Clear the trigger units cache.
Definition: DTTrig.cc:239