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();*/
94  return _cache.begin();
95  }
96 
98  TU_iterator end() { /*check();*/
99  return _cache.end();
100  }
101 
103  TU_iterator find(DTChamberId id) { /*check();*/
104  return _cache.find(id);
105  }
106 
108  Range cache() { /*check();*/
109  return Range(_cache.begin(), _cache.end());
110  }
111 
112  // ------------ do the same for Sector Collector
113 
115  int size1() const { /*check();*/
116  return _cache1.size();
117  }
118 
120  SC_iterator begin1() { /*check();*/
121  return _cache1.begin();
122  }
123 
125  SC_iterator end1() { /*check();*/
126  return _cache1.end();
127  }
128 
130  SC_iterator find1(DTSectCollId id) { /*check();*/
131  return _cache1.find(id);
132  }
133 
135  SCRange cache1() { /*check();*/
136  return SCRange(_cache1.begin(), _cache1.end());
137  }
138 
141 
143  DTSCTrigUnit* trigUnit(int wheel, int stat, int sect);
144 
147 
150 
152  DTChambPhSegm* chPhiSegm1(int wheel, int stat, int sect, int step);
153 
156 
159 
161  DTChambPhSegm* chPhiSegm2(int wheel, int stat, int sect, int step);
162 
165 
168 
170  DTChambThSegm* chThetaSegm(int wheel, int stat, int sect, int step);
171 
172  // sector collector
173 
176 
178  DTSectCollPhSegm* chSectCollPhSegm1(int wheel, int sect, int step);
179 
182 
184  DTSectCollPhSegm* chSectCollPhSegm2(int wheel, int sect, int step);
185 
188 
190  DTSectCollThSegm* chSectCollThSegm(int wheel, int sect, int step);
191 
192  // end sector collector
193 
195  void dumpGeom() const;
196 
198  void dumpLuts(short int lut_btic, const DTConfigManager* conf) const;
199 
201  int getBXOffset() const { return _conf_manager->getBXOffset(); }
202 
203  // Methods to access intermediate results
204 
206  std::vector<DTBtiTrigData> BtiTrigs() const;
207 
209  std::vector<DTTracoTrigData> TracoTrigs() const;
210 
212  std::vector<DTChambPhSegm> TSPhTrigs() const;
213 
215  std::vector<DTChambThSegm> TSThTrigs() const;
216 
218  std::vector<DTSectCollPhSegm> SCPhTrigs() const;
219 
221  std::vector<DTSectCollThSegm> SCThTrigs() const;
222 
225  return constTrigUnit(trig->ChamberId())->localPosition(trig);
226  }
227 
229  GlobalPoint CMSPosition(const DTTrigData* trig) const { return constTrigUnit(trig->ChamberId())->CMSPosition(trig); }
230 
233  return constTrigUnit(trig->ChamberId())->localDirection(trig);
234  }
235 
238  return constTrigUnit(trig->ChamberId())->CMSDirection(trig);
239  }
240 
242  void print(DTTrigData* trig) const { constTrigUnit(trig->ChamberId())->print(trig); }
243 
244 private:
245  // const version of the methods to access TUs and SCs are private to avoid misuse
247  DTSCTrigUnit const* constTrigUnit(DTChamberId sid) const;
248 
250  DTSCTrigUnit const* constTrigUnit(int wheel, int stat, int sect) const;
251 
253  DTSectColl const* SCUnit(DTSectCollId scid) const;
254 
256  DTSectColl const* SCUnit(int wheel, int sect) const;
257 
258 private:
259  TUcontainer _cache; // Trigger units
260  SCcontainer _cache1; // Sector Collector units
261  const DTConfigManager* _conf_manager; // Configuration Manager class pointer
266  bool _debug; // Debug flag
268 
269  unsigned long long _configid;
270  unsigned long long _geomid;
271 };
272 
273 #endif
std::vector< DTBtiTrigData > BtiTrigs() const
Return a copy of all the BTI triggers.
Definition: DTTrig.cc:414
SC_iterator end1()
End of the sectoor collector store.
Definition: DTTrig.h:125
SC_iterator begin1()
Begin of the sector collector store.
Definition: DTTrig.h:120
SCcontainer::iterator SC_iterator
Definition: DTTrig.h:65
TU_iterator find(DTChamberId id)
Find a trigger unit in the map.
Definition: DTTrig.h:103
SCcontainer _cache1
Definition: DTTrig.h:260
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:266
SC_iterator find1(DTSectCollId id)
Find a Sector Collector in the map.
Definition: DTTrig.h:130
DTChambPhSegm * chPhiSegm2(DTChamberId sid, int step)
Return the second phi track segment in req. chamber/step.
Definition: DTTrig.cc:317
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:453
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:229
TUcontainer _cache
Definition: DTTrig.h:259
int getBXOffset() const
Get BX Offset.
Definition: DTTrig.h:201
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:349
DTChambPhSegm * chPhiSegm1(DTChamberId sid, int step)
Return the first phi track segment in req. chamber/step.
Definition: DTTrig.cc:315
unsigned long long _geomid
Definition: DTTrig.h:270
DTSCTrigUnit const * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:249
int iEvent
Definition: GenABIO.cc:224
std::vector< DTSectCollPhSegm > SCPhTrigs() const
Return a copy of all the Sector Collector (Phi) triggers.
Definition: DTTrig.cc:466
std::vector< DTTracoTrigData > TracoTrigs() const
Return a copy of all the TRACO triggers.
Definition: DTTrig.cc:427
TU_iterator end()
End of the trigger units store.
Definition: DTTrig.h:98
std::vector< DTSectCollThSegm > SCThTrigs() const
Return a copy of all the Sector Collector (Theta) triggers.
Definition: DTTrig.cc:489
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:232
edm::InputTag _digitag
Definition: DTTrig.h:262
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:440
Basic3DVector unit() const
DTSectCollPhSegm * chSectCollPhSegm2(DTSectColl *unit, int step)
Return the second phi track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:357
DTDigiMap::iterator DTDigiMap_iterator
Definition: DTTrig.h:70
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:265
LocalPoint localPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in chamber frame.
Definition: DTTrig.h:224
void print(DTTrigData *trig) const
Print a trigger-data object.
Definition: DTTrig.h:242
GlobalVector CMSDirection(const DTTrigData *trig) const
Direction of a trigger-data object in CMS frame.
Definition: DTTrig.h:237
SCRange cache1()
Range of the sector collector store.
Definition: DTTrig.h:135
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomBeginRunToken_
Definition: DTTrig.h:264
DTChambThSegm * chThetaSegm(DTChamberId sid, int step)
Return the theta candidates in req. chamber/step.
Definition: DTTrig.cc:319
DTDigiMap::const_iterator DTDigiMap_const_iterator
Definition: DTTrig.h:71
Range cache()
Begin of the trigger units store.
Definition: DTTrig.h:108
const DTConfigManager * _conf_manager
Definition: DTTrig.h:261
bool _inputexist
Definition: DTTrig.h:267
DTSectCollThSegm * chSectCollThSegm(DTSectColl *unit, int step)
Return the theta track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:378
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:263
int size1() const
Size of the sector collector store.
Definition: DTTrig.h:115
void dumpGeom() const
Dump the geometry.
Definition: DTTrig.cc:392
void dumpLuts(short int lut_btic, const DTConfigManager *conf) const
Dump the LUT files.
Definition: DTTrig.cc:399
DTSectColl const * SCUnit(DTSectCollId scid) const
Return a SC unit - Muon numbering - const version.
Definition: DTTrig.cc:264
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:269
SCcontainer::const_iterator SC_const_iterator
Definition: DTTrig.h:66
void clear()
Clear the trigger units cache.
Definition: DTTrig.cc:239