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 //------------------------------------
42 
44 
45 
46 class InputTag;
47 
48 // ---------------------
49 // -- Class Interface --
50 // ---------------------
51 
52 class DTTrig {
53 
54  public:
55 
56  typedef std::map< DTChamberId,DTSCTrigUnit*,std::less<DTChamberId> > TUcontainer;
57  typedef TUcontainer::iterator TU_iterator;
58  typedef TUcontainer::const_iterator TU_const_iterator;
59  typedef std::map< DTSectCollId,DTSectColl*,std::less<DTSectCollId> > SCcontainer;
60  typedef SCcontainer::iterator SC_iterator;
61  typedef SCcontainer::const_iterator SC_const_iterator;
62  typedef std::pair<TU_iterator,TU_iterator> Range;
63  typedef std::pair<SC_iterator,SC_iterator> SCRange;
64  typedef std::map< DTChamberId,DTDigiCollection,std::less<DTChamberId> > DTDigiMap;
65  typedef DTDigiMap::iterator DTDigiMap_iterator;
66  typedef DTDigiMap::const_iterator DTDigiMap_const_iterator;
67 
68  public:
69 
71  DTTrig(const edm::ParameterSet &params);
72 
74  ~DTTrig();
75 
77  void createTUs(const edm::EventSetup& iSetup);
78 
80  void updateES(const edm::EventSetup& iSetup);
81 
83  void triggerReco(const edm::Event& iEvent, const edm::EventSetup& iSetup);
84 
86  void clear();
87 
89  int size() { return _cache.size(); }
90 
92  TU_iterator begin() { /*check();*/ return _cache.begin(); }
93 
95  TU_iterator end() { /*check();*/ return _cache.end(); }
96 
98  TU_iterator find(DTChamberId id) { /*check();*/ return _cache.find(id); }
99 
101  Range cache() { /*check();*/ return Range(_cache.begin(), _cache.end()); }
102 
103  // ------------ do the same for Sector Collector
104 
106  int size1() { /*check();*/ return _cache1.size(); }
107 
109  SC_iterator begin1() { /*check();*/ return _cache1.begin(); }
110 
112  SC_iterator end1() { /*check();*/ return _cache1.end(); }
113 
115  SC_iterator find1(DTSectCollId id) { /*check();*/ return _cache1.find(id); }
116 
118  SCRange cache1() { /*check();*/ return SCRange(_cache1.begin(), _cache1.end()); }
119 
122 
124  DTSCTrigUnit* trigUnit(int wheel, int stat, int sect);
125 
128 
131 
133  DTChambPhSegm* chPhiSegm1(int wheel, int stat, int sect, int step);
134 
137 
140 
142  DTChambPhSegm* chPhiSegm2(int wheel, int stat, int sect, int step);
143 
146 
149 
151  DTChambThSegm* chThetaSegm(int wheel, int stat, int sect, int step);
152 
153  // sector collector
154 
157 
159  DTSectCollPhSegm* chSectCollPhSegm1(int wheel, int sect, int step);
160 
163 
165  DTSectCollPhSegm* chSectCollPhSegm2(int wheel, int sect, int step);
166 
169 
171  DTSectCollThSegm* chSectCollThSegm(int wheel, int sect, int step);
172 
173  // end sector collector
174 
176  void dumpGeom();
177 
179  void dumpLuts(short int lut_btic, const DTConfigManager *conf);
180 
182  int getBXOffset() { return _conf_manager->getBXOffset(); }
183 
184  // Methods to access intermediate results
185 
187  std::vector<DTBtiTrigData> BtiTrigs();
188 
190  std::vector<DTTracoTrigData> TracoTrigs();
191 
193  std::vector<DTChambPhSegm> TSPhTrigs();
194 
196  std::vector<DTChambThSegm> TSThTrigs();
197 
199  std::vector<DTSectCollPhSegm> SCPhTrigs();
200 
202  std::vector<DTSectCollThSegm> SCThTrigs();
203 
205  LocalPoint localPosition(const DTTrigData* trig) const {
206  return constTrigUnit(trig->ChamberId())->localPosition(trig);
207  }
208 
210  GlobalPoint CMSPosition(const DTTrigData* trig) const {
211  return constTrigUnit(trig->ChamberId())->CMSPosition(trig);
212  }
213 
215  LocalVector localDirection(const DTTrigData* trig) const {
216  return constTrigUnit(trig->ChamberId())->localDirection(trig);
217  }
218 
220  GlobalVector CMSDirection(const DTTrigData* trig) const {
221  return constTrigUnit(trig->ChamberId())->CMSDirection(trig);
222  }
223 
225  void print(DTTrigData* trig) const {
226  constTrigUnit(trig->ChamberId())->print(trig);
227  }
228 
229  private:
230 
231  // const version of the methods to access TUs and SCs are private to avoid misuse
234 
236  DTSCTrigUnit* constTrigUnit(int wheel, int stat, int sect) const;
237 
239  DTSectColl* SCUnit(DTSectCollId scid) const;
240 
242  DTSectColl* SCUnit(int wheel, int sect) const;
243 
244  private:
245 
246  TUcontainer _cache; // Trigger units
247  SCcontainer _cache1; // Sector Collector units
248  const DTConfigManager *_conf_manager; // Configuration Manager class pointer
250  bool _debug; // Debug flag
252 
253  unsigned long long _configid;
254  unsigned long long _geomid;
255 
256 };
257 
258 #endif
SC_iterator end1()
End of the sectoor collector store.
Definition: DTTrig.h:112
SC_iterator begin1()
Begin of the sector collector store.
Definition: DTTrig.h:109
SCcontainer::iterator SC_iterator
Definition: DTTrig.h:60
int getBXOffset()
Get BX Offset.
Definition: DTTrig.h:182
TU_iterator find(DTChamberId id)
Find a trigger unit in the map.
Definition: DTTrig.h:98
SCcontainer _cache1
Definition: DTTrig.h:247
std::pair< SC_iterator, SC_iterator > SCRange
Definition: DTTrig.h:63
DTSectColl * SCUnit(DTSectCollId scid) const
Return a SC unit - Muon numbering - const version.
Definition: DTTrig.cc:313
bool _debug
Definition: DTTrig.h:250
int size1()
Size of the sector collector store.
Definition: DTTrig.h:106
SC_iterator find1(DTSectCollId id)
Find a Sector Collector in the map.
Definition: DTTrig.h:115
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:92
int getBXOffset() const
Get BX Offset for a given vdrift config.
TUcontainer _cache
Definition: DTTrig.h:246
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:57
LocalPoint localPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in chamber frame.
Definition: DTTrig.h:205
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:254
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:225
int size()
Size of the trigger units store.
Definition: DTTrig.h:89
int iEvent
Definition: GenABIO.cc:243
std::map< DTSectCollId, DTSectColl *, std::less< DTSectCollId > > SCcontainer
Definition: DTTrig.h:59
TU_iterator end()
End of the trigger units store.
Definition: DTTrig.h:95
void updateES(const edm::EventSetup &iSetup)
update the eventsetup info
Definition: DTTrig.cc:232
std::pair< TU_iterator, TU_iterator > Range
Definition: DTTrig.h:62
string unit
Definition: csvLumiCalc.py:46
~DTTrig()
Destructor.
Definition: DTTrig.cc:69
edm::InputTag _digitag
Definition: DTTrig.h:249
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:215
GlobalPoint CMSPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in CMS frame.
Definition: DTTrig.h:210
tuple conf
Definition: dbtoconf.py:185
GlobalVector CMSDirection(const DTTrigData *trig) const
Direction of a trigger-data object in CMS frame.
Definition: DTTrig.h:220
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:65
std::map< DTChamberId, DTSCTrigUnit *, std::less< DTChamberId > > TUcontainer
Definition: DTTrig.h:56
TUcontainer::const_iterator TU_const_iterator
Definition: DTTrig.h:58
std::vector< DTChambThSegm > TSThTrigs()
Return a copy of all the Trigger Server (Theta) triggers.
Definition: DTTrig.cc:535
Definition: DTTrig.h:52
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:118
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:66
std::map< DTChamberId, DTDigiCollection, std::less< DTChamberId > > DTDigiMap
Definition: DTTrig.h:64
Range cache()
Begin of the trigger units store.
Definition: DTTrig.h:101
const DTConfigManager * _conf_manager
Definition: DTTrig.h:248
bool _inputexist
Definition: DTTrig.h:251
DTSectCollThSegm * chSectCollThSegm(DTSectColl *unit, int step)
Return the theta track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:443
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:253
SCcontainer::const_iterator SC_const_iterator
Definition: DTTrig.h:61
std::vector< DTBtiTrigData > BtiTrigs()
Return a copy of all the BTI triggers.
Definition: DTTrig.cc:487
DTTrig(const edm::ParameterSet &params)
Constructors.
Definition: DTTrig.cc:50
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