CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
47 class InputTag;
48 
49 // ---------------------
50 // -- Class Interface --
51 // ---------------------
52 
53 class DTTrig {
54 
55  public:
56 
57  typedef std::map< DTChamberId,DTSCTrigUnit*,std::less<DTChamberId> > TUcontainer;
58  typedef TUcontainer::iterator TU_iterator;
59  typedef TUcontainer::const_iterator TU_const_iterator;
60  typedef std::map< DTSectCollId,DTSectColl*,std::less<DTSectCollId> > SCcontainer;
61  typedef SCcontainer::iterator SC_iterator;
62  typedef SCcontainer::const_iterator SC_const_iterator;
63  typedef std::pair<TU_iterator,TU_iterator> Range;
64  typedef std::pair<SC_iterator,SC_iterator> SCRange;
65  typedef std::map< DTChamberId,DTDigiCollection,std::less<DTChamberId> > DTDigiMap;
66  typedef DTDigiMap::iterator DTDigiMap_iterator;
67  typedef DTDigiMap::const_iterator DTDigiMap_const_iterator;
68 
69  public:
70 
72  DTTrig(const edm::ParameterSet &params, edm::ConsumesCollector && ix);
73 
75  ~DTTrig();
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() { 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() { /*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();
178 
180  void dumpLuts(short int lut_btic, const DTConfigManager *conf);
181 
183  int getBXOffset() { return _conf_manager->getBXOffset(); }
184 
185  // Methods to access intermediate results
186 
188  std::vector<DTBtiTrigData> BtiTrigs();
189 
191  std::vector<DTTracoTrigData> TracoTrigs();
192 
194  std::vector<DTChambPhSegm> TSPhTrigs();
195 
197  std::vector<DTChambThSegm> TSThTrigs();
198 
200  std::vector<DTSectCollPhSegm> SCPhTrigs();
201 
203  std::vector<DTSectCollThSegm> SCThTrigs();
204 
206  LocalPoint localPosition(const DTTrigData* trig) const {
207  return constTrigUnit(trig->ChamberId())->localPosition(trig);
208  }
209 
211  GlobalPoint CMSPosition(const DTTrigData* trig) const {
212  return constTrigUnit(trig->ChamberId())->CMSPosition(trig);
213  }
214 
216  LocalVector localDirection(const DTTrigData* trig) const {
217  return constTrigUnit(trig->ChamberId())->localDirection(trig);
218  }
219 
221  GlobalVector CMSDirection(const DTTrigData* trig) const {
222  return constTrigUnit(trig->ChamberId())->CMSDirection(trig);
223  }
224 
226  void print(DTTrigData* trig) const {
227  constTrigUnit(trig->ChamberId())->print(trig);
228  }
229 
230  private:
231 
232  // const version of the methods to access TUs and SCs are private to avoid misuse
235 
237  DTSCTrigUnit* constTrigUnit(int wheel, int stat, int sect) const;
238 
240  DTSectColl* SCUnit(DTSectCollId scid) const;
241 
243  DTSectColl* SCUnit(int wheel, int sect) const;
244 
245  private:
246 
247  TUcontainer _cache; // Trigger units
248  SCcontainer _cache1; // Sector Collector units
249  const DTConfigManager *_conf_manager; // Configuration Manager class pointer
251  bool _debug; // Debug flag
253 
254  unsigned long long _configid;
255  unsigned long long _geomid;
256 
257 };
258 
259 #endif
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:61
int getBXOffset()
Get BX Offset.
Definition: DTTrig.h:183
TU_iterator find(DTChamberId id)
Find a trigger unit in the map.
Definition: DTTrig.h:99
SCcontainer _cache1
Definition: DTTrig.h:248
std::pair< SC_iterator, SC_iterator > SCRange
Definition: DTTrig.h:64
DTSectColl * SCUnit(DTSectCollId scid) const
Return a SC unit - Muon numbering - const version.
Definition: DTTrig.cc:313
bool _debug
Definition: DTTrig.h:251
int size1()
Size of the sector collector store.
Definition: DTTrig.h:107
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:373
TU_iterator begin()
Begin of the trigger units store.
Definition: DTTrig.h:93
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:247
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:58
LocalPoint localPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in chamber frame.
Definition: DTTrig.h:206
DTSectCollPhSegm * chSectCollPhSegm1(DTSectColl *unit, int step)
Return the first phi track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:411
DTChambPhSegm * chPhiSegm1(DTChamberId sid, int step)
Return the first phi track segment in req. chamber/step.
Definition: DTTrig.cc:368
unsigned long long _geomid
Definition: DTTrig.h:255
virtual DTChamberId ChamberId() const =0
Identifier of the associated chamber.
std::vector< DTSectCollPhSegm > SCPhTrigs()
Return a copy of all the Sector Collector (Phi) triggers.
Definition: DTTrig.cc:551
void print(DTTrigData *trig) const
Print a trigger-data object.
Definition: DTTrig.h:226
int size()
Size of the trigger units store.
Definition: DTTrig.h:90
int iEvent
Definition: GenABIO.cc:230
std::map< DTSectCollId, DTSectColl *, std::less< DTSectCollId > > SCcontainer
Definition: DTTrig.h:60
TU_iterator end()
End of the trigger units store.
Definition: DTTrig.h:96
void updateES(const edm::EventSetup &iSetup)
update the eventsetup info
Definition: DTTrig.cc:232
std::pair< TU_iterator, TU_iterator > Range
Definition: DTTrig.h:63
string unit
Definition: csvLumiCalc.py:46
~DTTrig()
Destructor.
Definition: DTTrig.cc:69
edm::InputTag _digitag
Definition: DTTrig.h:250
void triggerReco(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Run the whole trigger reconstruction chain.
Definition: DTTrig.cc:150
DTSCTrigUnit * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:297
void dumpGeom()
Dump the geometry.
Definition: DTTrig.cc:460
LocalVector localDirection(const DTTrigData *trig) const
Direction of a trigger-data object in chamber frame.
Definition: DTTrig.h:216
GlobalPoint CMSPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in CMS frame.
Definition: DTTrig.h:211
GlobalVector CMSDirection(const DTTrigData *trig) const
Direction of a trigger-data object in CMS frame.
Definition: DTTrig.h:221
DTSectCollPhSegm * chSectCollPhSegm2(DTSectColl *unit, int step)
Return the second phi track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:419
DTDigiMap::iterator DTDigiMap_iterator
Definition: DTTrig.h:66
std::map< DTChamberId, DTSCTrigUnit *, std::less< DTChamberId > > TUcontainer
Definition: DTTrig.h:57
TUcontainer::const_iterator TU_const_iterator
Definition: DTTrig.h:59
std::vector< DTChambThSegm > TSThTrigs()
Return a copy of all the Trigger Server (Theta) triggers.
Definition: DTTrig.cc:535
Definition: DTTrig.h:53
void dumpLuts(short int lut_btic, const DTConfigManager *conf)
Dump the LUT files.
Definition: DTTrig.cc:468
DTSCTrigUnit * trigUnit(DTChamberId sid)
Return a trigger unit - Muon numbering.
Definition: DTTrig.cc:289
std::vector< DTTracoTrigData > TracoTrigs()
Return a copy of all the TRACO triggers.
Definition: DTTrig.cc:503
SCRange cache1()
Range of the sector collector store.
Definition: DTTrig.h:119
DTChambThSegm * chThetaSegm(DTChamberId sid, int step)
Return the theta candidates in req. chamber/step.
Definition: DTTrig.cc:378
DTDigiMap::const_iterator DTDigiMap_const_iterator
Definition: DTTrig.h:67
std::map< DTChamberId, DTDigiCollection, std::less< DTChamberId > > DTDigiMap
Definition: DTTrig.h:65
Range cache()
Begin of the trigger units store.
Definition: DTTrig.h:102
const DTConfigManager * _conf_manager
Definition: DTTrig.h:249
bool _inputexist
Definition: DTTrig.h:252
DTSectCollThSegm * chSectCollThSegm(DTSectColl *unit, int step)
Return the theta track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:443
step
void createTUs(const edm::EventSetup &iSetup)
Create the trigger units and store them in the cache.
Definition: DTTrig.cc:76
unsigned long long _configid
Definition: DTTrig.h:254
SCcontainer::const_iterator SC_const_iterator
Definition: DTTrig.h:62
std::vector< DTBtiTrigData > BtiTrigs()
Return a copy of all the BTI triggers.
Definition: DTTrig.cc:487
std::vector< DTSectCollThSegm > SCThTrigs()
Return a copy of all the Sector Collector (Theta) triggers.
Definition: DTTrig.cc:580
std::vector< DTChambPhSegm > TSPhTrigs()
Return a copy of all the Trigger Server (Phi) triggers.
Definition: DTTrig.cc:519
void clear()
Clear the trigger units cache.
Definition: DTTrig.cc:272