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 
45 
46 #include <memory>
47 
48 class InputTag;
49 
50 // ---------------------
51 // -- Class Interface --
52 // ---------------------
53 
54 class DTTrig {
55 
56  public:
57 
58  typedef std::map< DTChamberId,DTSCTrigUnit,std::less<DTChamberId> > TUcontainer;
59  typedef TUcontainer::iterator TU_iterator;
60  typedef TUcontainer::const_iterator TU_const_iterator;
61  typedef std::map< DTSectCollId,DTSectColl,std::less<DTSectCollId> > SCcontainer;
62  typedef SCcontainer::iterator SC_iterator;
63  typedef SCcontainer::const_iterator SC_const_iterator;
64  typedef std::pair<TU_iterator,TU_iterator> Range;
65  typedef std::pair<SC_iterator,SC_iterator> SCRange;
66  typedef std::map< DTChamberId,DTDigiCollection,std::less<DTChamberId> > DTDigiMap;
67  typedef DTDigiMap::iterator DTDigiMap_iterator;
68  typedef DTDigiMap::const_iterator DTDigiMap_const_iterator;
69 
70  public:
71 
73  DTTrig(const edm::ParameterSet &params, edm::ConsumesCollector && ix);
74 
76  void createTUs(const edm::EventSetup& iSetup);
77 
79  void updateES(const edm::EventSetup& iSetup);
80 
82  void triggerReco(const edm::Event& iEvent, const edm::EventSetup& iSetup);
83 
85  void clear();
86 
88  int size() const { return _cache.size(); }
89 
91  TU_iterator begin() { /*check();*/ return _cache.begin(); }
92 
94  TU_iterator end() { /*check();*/ return _cache.end(); }
95 
97  TU_iterator find(DTChamberId id) { /*check();*/ return _cache.find(id); }
98 
100  Range cache() { /*check();*/ return Range(_cache.begin(), _cache.end()); }
101 
102  // ------------ do the same for Sector Collector
103 
105  int size1() const { /*check();*/ return _cache1.size(); }
106 
108  SC_iterator begin1() { /*check();*/ return _cache1.begin(); }
109 
111  SC_iterator end1() { /*check();*/ return _cache1.end(); }
112 
114  SC_iterator find1(DTSectCollId id) { /*check();*/ return _cache1.find(id); }
115 
117  SCRange cache1() { /*check();*/ return SCRange(_cache1.begin(), _cache1.end()); }
118 
121 
123  DTSCTrigUnit* trigUnit(int wheel, int stat, int sect);
124 
127 
130 
132  DTChambPhSegm* chPhiSegm1(int wheel, int stat, int sect, int step);
133 
135  DTChambPhSegm* chPhiSegm2(DTChamberId sid, int step);
136 
138  DTChambPhSegm* chPhiSegm2(DTSCTrigUnit* unit, int step);
139 
141  DTChambPhSegm* chPhiSegm2(int wheel, int stat, int sect, int step);
142 
144  DTChambThSegm* chThetaSegm(DTChamberId sid, int step);
145 
147  DTChambThSegm* chThetaSegm(DTSCTrigUnit* unit, int step);
148 
150  DTChambThSegm* chThetaSegm(int wheel, int stat, int sect, int step);
151 
152  // sector collector
153 
156 
158  DTSectCollPhSegm* chSectCollPhSegm1(int wheel, int sect, int step);
159 
162 
164  DTSectCollPhSegm* chSectCollPhSegm2(int wheel, int sect, int step);
165 
167  DTSectCollThSegm* chSectCollThSegm(DTSectColl* unit, int step);
168 
170  DTSectCollThSegm* chSectCollThSegm(int wheel, int sect, int step);
171 
172  // end sector collector
173 
175  void dumpGeom() const;
176 
178  void dumpLuts(short int lut_btic, const DTConfigManager *conf) const;
179 
181  int getBXOffset() const { return _conf_manager->getBXOffset(); }
182 
183  // Methods to access intermediate results
184 
186  std::vector<DTBtiTrigData> BtiTrigs() const;
187 
189  std::vector<DTTracoTrigData> TracoTrigs() const;
190 
192  std::vector<DTChambPhSegm> TSPhTrigs() const;
193 
195  std::vector<DTChambThSegm> TSThTrigs() const;
196 
198  std::vector<DTSectCollPhSegm> SCPhTrigs() const;
199 
201  std::vector<DTSectCollThSegm> SCThTrigs() const;
202 
204  LocalPoint localPosition(const DTTrigData* trig) const {
205  return constTrigUnit(trig->ChamberId())->localPosition(trig);
206  }
207 
209  GlobalPoint CMSPosition(const DTTrigData* trig) const {
210  return constTrigUnit(trig->ChamberId())->CMSPosition(trig);
211  }
212 
214  LocalVector localDirection(const DTTrigData* trig) const {
215  return constTrigUnit(trig->ChamberId())->localDirection(trig);
216  }
217 
219  GlobalVector CMSDirection(const DTTrigData* trig) const {
220  return constTrigUnit(trig->ChamberId())->CMSDirection(trig);
221  }
222 
224  void print(DTTrigData* trig) const {
225  constTrigUnit(trig->ChamberId())->print(trig);
226  }
227 
228  private:
229 
230  // const version of the methods to access TUs and SCs are private to avoid misuse
232  DTSCTrigUnit const* constTrigUnit(DTChamberId sid) const;
233 
235  DTSCTrigUnit const* constTrigUnit(int wheel, int stat, int sect) const;
236 
238  DTSectColl const* SCUnit(DTSectCollId scid) const;
239 
241  DTSectColl const* SCUnit(int wheel, int sect) const;
242 
243  private:
244 
245  TUcontainer _cache; // Trigger units
246  SCcontainer _cache1; // Sector Collector units
247  const DTConfigManager *_conf_manager; // Configuration Manager class pointer
249  bool _debug; // Debug flag
251 
252  unsigned long long _configid;
253  unsigned long long _geomid;
254 
255 };
256 
257 #endif
int size() const
Size of the trigger units store.
Definition: DTTrig.h:88
SC_iterator end1()
End of the sectoor collector store.
Definition: DTTrig.h:111
SC_iterator begin1()
Begin of the sector collector store.
Definition: DTTrig.h:108
SCcontainer::iterator SC_iterator
Definition: DTTrig.h:62
DTSCTrigUnit const * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:284
int getBXOffset() const
Get BX Offset.
Definition: DTTrig.h:181
TU_iterator find(DTChamberId id)
Find a trigger unit in the map.
Definition: DTTrig.h:97
SCcontainer _cache1
Definition: DTTrig.h:246
std::vector< DTTracoTrigData > TracoTrigs() const
Return a copy of all the TRACO triggers.
Definition: DTTrig.cc:488
std::pair< SC_iterator, SC_iterator > SCRange
Definition: DTTrig.h:65
int size1() const
Size of the sector collector store.
Definition: DTTrig.h:105
std::vector< DTChambThSegm > TSThTrigs() const
Return a copy of all the Trigger Server (Theta) triggers.
Definition: DTTrig.cc:516
bool _debug
Definition: DTTrig.h:249
SC_iterator find1(DTSectCollId id)
Find a Sector Collector in the map.
Definition: DTTrig.h:114
DTChambPhSegm * chPhiSegm2(DTChamberId sid, int step)
Return the second phi track segment in req. chamber/step.
Definition: DTTrig.cc:360
DTSectColl const * SCUnit(DTSectCollId scid) const
Return a SC unit - Muon numbering - const version.
Definition: DTTrig.cc:300
TU_iterator begin()
Begin of the trigger units store.
Definition: DTTrig.h:91
DTTrig(const edm::ParameterSet &params, edm::ConsumesCollector &&ix)
Constructors.
Definition: DTTrig.cc:50
int getBXOffset() const
Get BX Offset for a given vdrift config.
TUcontainer _cache
Definition: DTTrig.h:245
void dumpLuts(short int lut_btic, const DTConfigManager *conf) const
Dump the LUT files.
Definition: DTTrig.cc:455
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:59
LocalPoint localPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in chamber frame.
Definition: DTTrig.h:204
DTSectCollPhSegm * chSectCollPhSegm1(DTSectColl *unit, int step)
Return the first phi track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:398
DTChambPhSegm * chPhiSegm1(DTChamberId sid, int step)
Return the first phi track segment in req. chamber/step.
Definition: DTTrig.cc:355
unsigned long long _geomid
Definition: DTTrig.h:253
std::map< DTSectCollId, DTSectColl, std::less< DTSectCollId > > SCcontainer
Definition: DTTrig.h:61
void print(DTTrigData *trig) const
Print a trigger-data object.
Definition: DTTrig.h:224
int iEvent
Definition: GenABIO.cc:224
TU_iterator end()
End of the trigger units store.
Definition: DTTrig.h:94
void updateES(const edm::EventSetup &iSetup)
update the eventsetup info
Definition: DTTrig.cc:228
std::pair< TU_iterator, TU_iterator > Range
Definition: DTTrig.h:64
edm::InputTag _digitag
Definition: DTTrig.h:248
void triggerReco(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Run the whole trigger reconstruction chain.
Definition: DTTrig.cc:146
LocalVector localDirection(const DTTrigData *trig) const
Direction of a trigger-data object in chamber frame.
Definition: DTTrig.h:214
GlobalPoint CMSPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in CMS frame.
Definition: DTTrig.h:209
GlobalVector CMSDirection(const DTTrigData *trig) const
Direction of a trigger-data object in CMS frame.
Definition: DTTrig.h:219
DTSectCollPhSegm * chSectCollPhSegm2(DTSectColl *unit, int step)
Return the second phi track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:406
DTDigiMap::iterator DTDigiMap_iterator
Definition: DTTrig.h:67
std::vector< DTSectCollPhSegm > SCPhTrigs() const
Return a copy of all the Sector Collector (Phi) triggers.
Definition: DTTrig.cc:530
void dumpGeom() const
Dump the geometry.
Definition: DTTrig.cc:447
TUcontainer::const_iterator TU_const_iterator
Definition: DTTrig.h:60
Definition: DTTrig.h:54
std::map< DTChamberId, DTSCTrigUnit, std::less< DTChamberId > > TUcontainer
Definition: DTTrig.h:58
DTSCTrigUnit * trigUnit(DTChamberId sid)
Return a trigger unit - Muon numbering.
Definition: DTTrig.cc:276
virtual DTChamberId ChamberId() const =0
Identifier of the associated chamber.
SCRange cache1()
Range of the sector collector store.
Definition: DTTrig.h:117
std::vector< DTSectCollThSegm > SCThTrigs() const
Return a copy of all the Sector Collector (Theta) triggers.
Definition: DTTrig.cc:556
DTChambThSegm * chThetaSegm(DTChamberId sid, int step)
Return the theta candidates in req. chamber/step.
Definition: DTTrig.cc:365
DTDigiMap::const_iterator DTDigiMap_const_iterator
Definition: DTTrig.h:68
std::vector< DTBtiTrigData > BtiTrigs() const
Return a copy of all the BTI triggers.
Definition: DTTrig.cc:474
std::map< DTChamberId, DTDigiCollection, std::less< DTChamberId > > DTDigiMap
Definition: DTTrig.h:66
Range cache()
Begin of the trigger units store.
Definition: DTTrig.h:100
const DTConfigManager * _conf_manager
Definition: DTTrig.h:247
bool _inputexist
Definition: DTTrig.h:250
DTSectCollThSegm * chSectCollThSegm(DTSectColl *unit, int step)
Return the theta track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:430
step
Definition: StallMonitor.cc:94
std::vector< DTChambPhSegm > TSPhTrigs() const
Return a copy of all the Trigger Server (Phi) triggers.
Definition: DTTrig.cc:502
void createTUs(const edm::EventSetup &iSetup)
Create the trigger units and store them in the cache.
Definition: DTTrig.cc:68
unsigned long long _configid
Definition: DTTrig.h:252
SCcontainer::const_iterator SC_const_iterator
Definition: DTTrig.h:63
void clear()
Clear the trigger units cache.
Definition: DTTrig.cc:268