CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
DTSectColl Class Reference

#include <DTSectColl.h>

Inheritance diagram for DTSectColl:
DTCache< T, Coll > DTCache< T, Coll >

Classes

class  h
 

Public Member Functions

void addTSPhi (int step, const DTChambPhSegm *tsmsegm, int ifs, int istat)
 Add a TSM candidate (step is TSM step not SC one) More...
 
void addTSTheta (int step, const DTChambThSegm *tsmsegm, int istat)
 Add a TS Theta candidate (step is TSTheta step not sc one) More...
 
void addTU (DTSCTrigUnit *tru)
 Add a Trigger Unit to the Sector Collector. More...
 
std::vector< DTSectCollPhSegm >::const_iterator beginPh ()
 Return iterator to the beghin of Phi cache. More...
 
std::vector< DTSectCollThSegm >::const_iterator beginTh ()
 Return iterator to the begni of Theta cache. More...
 
void clearCache ()
 Local position in chamber of a trigger-data object. More...
 
const DTConfigSectCollconfig () const
 Configuration. More...
 
 DTSectColl (DTSectCollId id)
 Constructor. More...
 
std::vector< DTSectCollPhSegm >::const_iterator endPh ()
 Return iterator to the end of Phi cache. More...
 
std::vector< DTSectCollThSegm >::const_iterator endTh ()
 Return iterator to the end of Theta cache. More...
 
DTSCgetDTSC (int step, int istat) const
 Get a Sector Collector (step is TS one) More...
 
DTSectCollPhCandgetDTSectCollPhCand (int ifs, unsigned n) const
 Get a Phi Candidate for Sector Collector. More...
 
DTSectCollThCandgetDTSectCollThCand (unsigned n) const
 Get a Candidate for Sector Collector. More...
 
DTSectCollPhCandgetTrackPh (int n) const
 Return the requested Phi track. More...
 
DTSectCollThCandgetTrackTh (int n) const
 Return the requested Theta track. More...
 
DTTSPhigetTSPhi (int istat) const
 Return TSPhi. More...
 
DTTSThetagetTSTheta (int istat) const
 Return TSTheta. More...
 
void loadSectColl ()
 Load a Sector Collector. More...
 
void localClear ()
 Local Clear. More...
 
unsigned nCandPh (int ifs) const
 Return the number of Phi input tracks (first/second) More...
 
unsigned nCandTh () const
 Return the number of Theta input tracks. More...
 
int nSegmPh (int step)
 Return number of DTSectCollPhi segments (SC step) More...
 
int nSegmTh (int step)
 Return number of DTSectCollTheta segments (SC step) More...
 
int nTracksPh () const
 Return the number of output Phi tracks. More...
 
int nTracksTh () const
 Return the number of output Theta tracks. More...
 
void reconstruct () override
 Load Trigger Units triggers and run Sector Collector algorithm. More...
 
void runSectColl ()
 Run Sector Collector. More...
 
DTSectCollId SectCollId ()
 Return the Sector Collector Id. More...
 
const DTSectCollPhSegmSectCollPhSegment (int step, unsigned n)
 Return requested Sector Collector Phi Segment 1st/2nd. More...
 
const DTSectCollThSegmSectCollThSegment (int step)
 Return requested Sector Collector Theta Segment. More...
 
void setConfig (const DTConfigManager *conf)
 Set configuration. More...
 
int sizePh ()
 Return Phi cache size. More...
 
int sizeTh ()
 Return Theta cache size. More...
 
 ~DTSectColl () override
 Destructor. More...
 
- Public Member Functions inherited from DTCache< T, Coll >
const_iterator begin () const
 Get first cache element. More...
 
void clearCache ()
 Clear cache vector. More...
 
 DTCache ()
 Constructor. More...
 
const_iterator end () const
 Get last cache element. More...
 
int size () const
 Get cache vector's size. More...
 
virtual ~DTCache ()
 Destructor. More...
 

Private Attributes

const DTConfigSectColl_config
 
std::vector< DTSectCollPhCand * > _incand_ph [2]
 
std::vector< DTSectCollThCand * > _incand_th
 
std::vector< DTSectCollPhCand * > _outcand_ph
 
std::vector< DTSectCollThCand * > _outcand_th
 
DTSectCollId _sectcollid
 
DTSC_tsc [DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
 
DTTSPhi_tsphi [DTConfigSectColl::NTSPSC]
 
DTTSTheta_tstheta [DTConfigSectColl::NTSTSC]
 

Additional Inherited Members

- Public Types inherited from DTCache< T, Coll >
typedef my_collection::const_iterator const_iterator
 
typedef my_collection::iterator iterator
 
typedef Coll my_collection
 
typedef T my_type
 
- Protected Attributes inherited from DTCache< T, Coll >
my_collection _cache
 

Detailed Description

Definition at line 56 of file DTSectColl.h.

Constructor & Destructor Documentation

DTSectColl::DTSectColl ( DTSectCollId  id)

Constructor.

Definition at line 48 of file DTSectColl.cc.

References _tsc, _tsphi, _tstheta, DTConfig::NSTEPF, and DTConfig::NSTEPL.

48  : _sectcollid(id){
49 
50  //_config = _conf_manager->getDTConfigSectColl(_sectcollid);
51 
52  // create SC Chips
53  for(int istat=0;istat<4;istat++){
54  for(int istep=0;istep<DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1;istep++) {
55  _tsc[istep][istat] = new DTSC(istat+1);
56  }
57  }
58  for (int istat=0;istat<5;istat++) _tsphi[istat]=nullptr;
59  for (int istat=0;istat<3;istat++) _tstheta[istat]=nullptr;
60 
61 }
DTSectCollId _sectcollid
Definition: DTSectColl.h:188
Definition: DTSC.h:42
static const int NSTEPF
Definition: DTConfig.h:36
DTSC * _tsc[DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
Definition: DTSectColl.h:194
DTTSTheta * _tstheta[DTConfigSectColl::NTSTSC]
Definition: DTSectColl.h:191
DTTSPhi * _tsphi[DTConfigSectColl::NTSPSC]
Definition: DTSectColl.h:190
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
DTSectColl::~DTSectColl ( )
override

Destructor.

Definition at line 66 of file DTSectColl.cc.

References _tsc, localClear(), DTConfig::NSTEPF, and DTConfig::NSTEPL.

66  {
67 
68  localClear();
69 
70  for(int istat=0;istat<4;istat++){
71  for(int istep=0;istep<DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1;istep++){
72  delete _tsc[istep][istat];
73  }
74  }
75 
76 }
static const int NSTEPF
Definition: DTConfig.h:36
DTSC * _tsc[DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
Definition: DTSectColl.h:194
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
void localClear()
Local Clear.
Definition: DTSectColl.cc:84

Member Function Documentation

void DTSectColl::addTSPhi ( int  step,
const DTChambPhSegm tsmsegm,
int  ifs,
int  istat 
)

Add a TSM candidate (step is TSM step not SC one)

Definition at line 230 of file DTSectColl.cc.

References _incand_ph, DTSC::addDTSectCollPhCand(), config(), gather_cfg::cout, debug, getDTSC(), DTConfig::NSTEPL, and DTChambPhSegm::oldCode().

Referenced by config(), and loadSectColl().

230  {
231 
233  std::cout << "DTSectColl::addTSPhi: step out of range: " << step;
234  std::cout << " trigger not added!" << std::endl;
235  return;
236  }
237 
238  if(istat<1 || istat>4){
239  std::cout << "DTSectColl::addTSPhi: station out of SC range: " << istat;
240  std::cout << " trigger not added!" << std::endl;
241  return;
242  }
243 
244  // Check that a trigger is present, by its code
245  if(tsmsegm->oldCode()==0) {
246  std::cout << "DTSectColl::addTSPhi --> code = 0 ! ";
247  std::cout << " trigger not added!" << std::endl;
248  return;
249  }
250 
251  DTSC* tsc = getDTSC(step,istat);
252 
253  DTSectCollPhCand* cand = new DTSectCollPhCand(tsc, tsmsegm, ifs);
254 
255  bool fs = (ifs==1);
256  _incand_ph[fs].push_back(cand);
257 
258  tsc->addDTSectCollPhCand(cand);
259 
260  // Debugging...
261  if(config()->debug()){
262  std::cout << "DTSectColl::addTSPhi at step " << step;
263  std::cout << " in SC station " << istat;
264  if(ifs==1) {
265  std::cout << " (first track)" << std::endl;
266  } else {
267  std::cout << " (second track)" << std::endl;
268  }
269  }
270 
271 }
Definition: DTSC.h:42
int oldCode() const
Return trigger code (10*inner_code+outer_code; X_code=1,2,3,4,8)
Definition: DTChambPhSegm.h:96
void addDTSectCollPhCand(DTSectCollPhCand *cand)
Add a Sector Collector.
Definition: DTSC.cc:303
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
#define debug
Definition: HDRShower.cc:19
DTSC * getDTSC(int step, int istat) const
Get a Sector Collector (step is TS one)
Definition: DTSectColl.cc:319
const DTConfigSectColl * config() const
Configuration.
Definition: DTSectColl.h:77
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSectColl.h:197
step
void DTSectColl::addTSTheta ( int  step,
const DTChambThSegm tsmsegm,
int  istat 
)

Add a TS Theta candidate (step is TSTheta step not sc one)

Definition at line 274 of file DTSectColl.cc.

References _incand_th, DTSC::addThCand(), config(), gather_cfg::cout, debug, getDTSC(), mps_fire::i, utils::is_empty(), DTConfig::NSTEPL, and DTChambThSegm::position().

Referenced by config(), and loadSectColl().

274  {
275 
277  std::cout << "DTSectColl::addTSTheta: step out of range: " << step;
278  std::cout << " trigger not added!" << std::endl;
279  return;
280  }
281 
282  if(istat<1 || istat>5){
283  std::cout << "DTSectColl::addTSTheta: station out of SC range: " << istat;
284  std::cout << " trigger not added!" << std::endl;
285  return;
286  }
287 
288  // Check if a trigger is present in theta
289  bool is_empty=false;
290  for (int i=0;i<7;i++) if (tstsegm->position(i)==1){
291  is_empty = false;
292  break;
293  }
294  if (is_empty==true) {
295  std::cout << "DTSectColl::addTSTheta --> no position bit equal to 1 ! ";
296  std::cout << " trigger not added!" << std::endl;
297  return;
298  }
299 
300 
301 
302  DTSC* tsc = getDTSC(step,istat);
303 
304  DTSectCollThCand* cand = new DTSectCollThCand(tsc, tstsegm);
305 
306  _incand_th.push_back(cand);
307 
308  tsc->addThCand(cand);
309 
310  // Debugging...
311  if(config()->debug()){
312  std::cout << "DTSectColl::addTSTheta at step " << step << std::endl;
313  }
314 
315 }
std::vector< DTSectCollThCand * > _incand_th
Definition: DTSectColl.h:203
Definition: DTSC.h:42
void addThCand(DTSectCollThCand *cand)
Add a Theta candidate to sect coll.
Definition: DTSC.cc:242
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
#define debug
Definition: HDRShower.cc:19
def is_empty(h)
Definition: utils.py:167
DTSC * getDTSC(int step, int istat) const
Get a Sector Collector (step is TS one)
Definition: DTSectColl.cc:319
const DTConfigSectColl * config() const
Configuration.
Definition: DTSectColl.h:77
step
void DTSectColl::addTU ( DTSCTrigUnit tru)

Add a Trigger Unit to the Sector Collector.

Definition at line 128 of file DTSectColl.cc.

References _sectcollid, _tsphi, _tstheta, gather_cfg::cout, DTSCTrigUnit::sector(), DTSCTrigUnit::station(), DTSCTrigUnit::TSPhTrigs(), DTSCTrigUnit::TSThTrigs(), and DTSCTrigUnit::wheel().

Referenced by config(), and DTTrig::createTUs().

128  {
129 
130  int stat = tru->station();
131  int sect = tru->sector();
132  switch (sect){
133  case 13:
134  stat = 5;
135  sect = 4;
136  break;
137  case 14:
138  stat = 5;
139  sect = 10;
140  break;
141  }
142 
143  if (_sectcollid!=DTSectCollId() &&
144  _sectcollid!=DTSectCollId(tru->wheel(),sect)){
145  std::cout << "DTSectColl::addTU: Trying to add tru " << tru
146  << " into SectColl " << _sectcollid
147  << " Skipping insertion" << std::endl;
148  return;
149  }
150 
151  if (stat<1 || stat >5) {
152  std::cout << "DTSectColl::addTU: Wrong station number Skipping insertion" << std::endl;
153  return;
154  }
155 
156  _tsphi[stat-1] = tru->TSPhTrigs();
157  if (stat<4) _tstheta[stat-1]=tru->TSThTrigs();
158 
159  if (_sectcollid==DTSectCollId())
160  _sectcollid=DTSectCollId(tru->wheel(),sect);
161 
162  // add a Trigger Unit to the Sector Collector
163 // if(flag==2) {
164 // _tsphi1 = tru->TSPhTrigs(); // these are the "normal" stations
165 // _tsphi2 = 0;
166 // _tstheta = tru->TSThTrigs();
167 // }
168 // else if (flag==0){
169 // _tsphi1 = tru->TSPhTrigs();
170 // _tstheta = 0;
171 // }
172 // else if(flag==1) {
173 // _tsphi2 = tru->TSPhTrigs(); // these are the "double" stations
174 // _tstheta = 0;
175 // }
176 // // generates SectColl Id from tsphi Id
177 // if (flag==2 || flag==0){
178 // int sect = tru->sector();
179 // if (sect == 13) sect=4;
180 // if (sect == 14) sect=10;
181 // _sectcollid=DTSectCollId(tru->wheel(),tru->station(),sect);
182 // }
183 
184 }
DTSectCollId _sectcollid
Definition: DTSectColl.h:188
DTTSTheta * TSThTrigs() const
Return the chamber Trigger Server (Theta)
Definition: DTSCTrigUnit.h:97
DTTSPhi * TSPhTrigs() const
Return the chamber Trigger Server (Phi)
Definition: DTSCTrigUnit.h:94
DTTSTheta * _tstheta[DTConfigSectColl::NTSTSC]
Definition: DTSectColl.h:191
DTTSPhi * _tsphi[DTConfigSectColl::NTSPSC]
Definition: DTSectColl.h:190
int station() const
Return station number.
Definition: DTSCTrigUnit.h:82
int wheel() const
Return wheel number.
Definition: DTSCTrigUnit.h:79
int sector() const
Return sector number.
Definition: DTSCTrigUnit.h:85
std::vector<DTSectCollPhSegm>::const_iterator DTSectColl::beginPh ( )
inline

Return iterator to the beghin of Phi cache.

Definition at line 150 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::SCPhTrigs().

150 { return DTSCPhCache::_cache.begin(); }
my_collection _cache
Definition: DTCache.h:56
std::vector<DTSectCollThSegm>::const_iterator DTSectColl::beginTh ( )
inline

Return iterator to the begni of Theta cache.

Definition at line 159 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::SCThTrigs().

159 { return DTSCThCache::_cache.begin(); }
my_collection _cache
Definition: DTCache.h:56
void DTSectColl::clearCache ( )
inline

Local position in chamber of a trigger-data object.

Local direction in chamber of a trigger-data object Clear both (Phi and Theta) caches

Definition at line 174 of file DTSectColl.h.

References DTCache< T, Coll >::clearCache().

Referenced by DTTrig::triggerReco().

void clearCache()
Clear cache vector.
Definition: DTCache.h:49
const DTConfigSectColl* DTSectColl::config ( void  ) const
inline
std::vector<DTSectCollPhSegm>::const_iterator DTSectColl::endPh ( )
inline

Return iterator to the end of Phi cache.

Definition at line 156 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::SCPhTrigs().

156 { return DTSCPhCache::_cache.end(); }
my_collection _cache
Definition: DTCache.h:56
std::vector<DTSectCollThSegm>::const_iterator DTSectColl::endTh ( )
inline

Return iterator to the end of Theta cache.

Definition at line 165 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::SCThTrigs().

165 { return DTSCThCache::_cache.end(); }
my_collection _cache
Definition: DTCache.h:56
DTSC * DTSectColl::getDTSC ( int  step,
int  istat 
) const

Get a Sector Collector (step is TS one)

Definition at line 319 of file DTSectColl.cc.

References _tsc, gather_cfg::cout, DTConfig::NSTEPF, and DTConfig::NSTEPL.

Referenced by addTSPhi(), addTSTheta(), and config().

319  {
320 
322  std::cout << "DTSectColl::getDTSC: step out of range: " << step;
323  std::cout << " empty pointer returned!" << std::endl;
324  return nullptr;
325  }
326 
327  if(istat<1 || istat>4){
328  std::cout << "DTSectColl::getDTSC: station out of SC range: " << istat;
329  std::cout << " emty pointer returned!" << std::endl;
330  return nullptr;
331  }
332 
333  return _tsc[step-DTConfigSectColl::NSTEPF][istat-1];
334 
335 }
static const int NSTEPF
Definition: DTConfig.h:36
DTSC * _tsc[DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
Definition: DTSectColl.h:194
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
step
DTSectCollPhCand * DTSectColl::getDTSectCollPhCand ( int  ifs,
unsigned  n 
) const

Get a Phi Candidate for Sector Collector.

Definition at line 400 of file DTSectColl.cc.

References _incand_ph, gather_cfg::cout, gen::n, nCandPh(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by config().

400  {
401 
402  if(ifs<1||ifs>2){
403  std::cout << "DTSectColl::getDTSectCollPhCand: wrong track number: " << ifs;
404  std::cout << " empty pointer returned!" << std::endl;
405  return nullptr;
406  }
407  if(n<1 || n>nCandPh(ifs)) {
408  std::cout << "DTSectColl::getDTSectCollPhCand: requested trigger not present: " << n;
409  std::cout << " empty pointer returned!" << std::endl;
410  return nullptr;
411  }
412 
413  std::vector<DTSectCollPhCand*>::const_iterator p = _incand_ph[ifs-1].begin()+n-1;
414  return (*p);
415 
416 }
unsigned nCandPh(int ifs) const
Return the number of Phi input tracks (first/second)
Definition: DTSectColl.cc:463
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSectColl.h:197
DTSectCollThCand * DTSectColl::getDTSectCollThCand ( unsigned  n) const

Get a Candidate for Sector Collector.

Definition at line 419 of file DTSectColl.cc.

References _incand_th, gather_cfg::cout, gen::n, nCandTh(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by config().

419  {
420 
421  if(n<1 || n>nCandTh()) {
422  std::cout << "DTSectColl::getDTSectCollThCand: requested trigger not present: " << n;
423  std::cout << " empty pointer returned!" << std::endl;
424  return nullptr;
425  }
426 
427  std::vector<DTSectCollThCand*>::const_iterator p = _incand_th.begin()+n-1;
428  return (*p);
429 
430 }
std::vector< DTSectCollThCand * > _incand_th
Definition: DTSectColl.h:203
unsigned nCandTh() const
Return the number of Theta input tracks.
Definition: DTSectColl.cc:476
DTSectCollPhCand * DTSectColl::getTrackPh ( int  n) const

Return the requested Phi track.

Definition at line 434 of file DTSectColl.cc.

References _outcand_ph, gather_cfg::cout, gen::n, nTracksPh(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by config().

434  {
435 
436  if(n<1 || n>nTracksPh()) {
437  std::cout << "DTSectColl::getTrackPh: requested track not present: " << n;
438  std::cout << " empty pointer returned!" << std::endl;
439  return nullptr;
440  }
441 
442  std::vector<DTSectCollPhCand*>::const_iterator p = _outcand_ph.begin()+n-1;
443  return (*p);
444 
445 }
int nTracksPh() const
Return the number of output Phi tracks.
Definition: DTSectColl.h:138
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSectColl.h:200
DTSectCollThCand * DTSectColl::getTrackTh ( int  n) const

Return the requested Theta track.

Definition at line 448 of file DTSectColl.cc.

References _outcand_th, gather_cfg::cout, gen::n, nTracksTh(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by config().

448  {
449 
450  if(n<1 || n>nTracksTh()) {
451  std::cout << "DTSectColl::getTrackTh: requested track not present: " << n;
452  std::cout << " empty pointer returned!" << std::endl;
453  return nullptr;
454  }
455 
456  std::vector<DTSectCollThCand*>::const_iterator p = _outcand_th.begin()+n-1;
457  return (*p);
458 
459 }
std::vector< DTSectCollThCand * > _outcand_th
Definition: DTSectColl.h:206
int nTracksTh() const
Return the number of output Theta tracks.
Definition: DTSectColl.h:141
DTTSPhi* DTSectColl::getTSPhi ( int  istat) const
inline

Return TSPhi.

Definition at line 71 of file DTSectColl.h.

References _tsphi.

Referenced by DTTrig::triggerReco().

71 { return _tsphi[istat-1]; }
DTTSPhi * _tsphi[DTConfigSectColl::NTSPSC]
Definition: DTSectColl.h:190
DTTSTheta* DTSectColl::getTSTheta ( int  istat) const
inline

Return TSTheta.

Definition at line 74 of file DTSectColl.h.

References _tstheta.

Referenced by DTTrig::triggerReco().

74 { return _tstheta[istat-1]; }
DTTSTheta * _tstheta[DTConfigSectColl::NTSTSC]
Definition: DTSectColl.h:191
void DTSectColl::loadSectColl ( )

Load a Sector Collector.

Definition at line 188 of file DTSectColl.cc.

References _tsphi, _tstheta, addTSPhi(), addTSTheta(), DTCache< T, Coll >::begin(), DTCache< T, Coll >::end(), localClear(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by config(), and reconstruct().

188  {
189 
190  localClear();
191 
192  std::vector<DTChambPhSegm>::const_iterator p;
193  std::vector<DTChambPhSegm>::const_iterator pend;
194 
195  for(int istat=1;istat<5;istat++){
196  pend=_tsphi[istat-1]->end();
197  for(p=_tsphi[istat-1]->begin();p!=pend;p++){
198  int step = p->step();
199  int fs = (p->isFirst()) ? 1 : 2 ;
200  // load trigger
201  addTSPhi(step, &(*p), fs, istat);
202  }
203  }
204 
205  if(!(_tsphi[4]==nullptr)){ // only for double stations
206  pend=_tsphi[4]->end();
207  for(p=_tsphi[4]->begin();p!=pend;p++){
208  int step = p->step();
209  int fs = (p->isFirst()) ? 1 : 2 ;
210  // load trigger
211  addTSPhi(step, &(*p), fs ,4);
212  }
213  }
214  std::vector<DTChambThSegm>::const_iterator pth;
215  std::vector<DTChambThSegm>::const_iterator pthend;
216 
217  for(int istat=1;istat<4;istat++){
218  pthend=_tstheta[istat-1]->end();
219  for(pth=_tstheta[istat-1]->begin();pth!=pthend;pth++){
220  int step = pth->step();
221  // load trigger
222  addTSTheta(step, &(*pth), istat);
223  }
224  }
225 
226 }
void addTSPhi(int step, const DTChambPhSegm *tsmsegm, int ifs, int istat)
Add a TSM candidate (step is TSM step not SC one)
Definition: DTSectColl.cc:230
DTTSTheta * _tstheta[DTConfigSectColl::NTSTSC]
Definition: DTSectColl.h:191
void addTSTheta(int step, const DTChambThSegm *tsmsegm, int istat)
Add a TS Theta candidate (step is TSTheta step not sc one)
Definition: DTSectColl.cc:274
DTTSPhi * _tsphi[DTConfigSectColl::NTSPSC]
Definition: DTSectColl.h:190
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
void localClear()
Local Clear.
Definition: DTSectColl.cc:84
step
const_iterator end() const
Get last cache element.
Definition: DTCache.h:43
void DTSectColl::localClear ( )

Local Clear.

Definition at line 84 of file DTSectColl.cc.

References _incand_ph, _incand_th, _outcand_ph, _outcand_th, _tsc, DTSC::clear(), DTConfig::NSTEPF, and DTConfig::NSTEPL.

Referenced by config(), loadSectColl(), and ~DTSectColl().

84  {
85 
86  // clear all sector collectors
87  for(int istat=0;istat<4;istat++){
88  for(int istep=0;istep<DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1;istep++) {
89  _tsc[istep][istat]->clear();
90  }
91  }
92 
93  for(int iph=0;iph<2;++iph){
94  std::vector<DTSectCollPhCand*>::const_iterator phbi = _incand_ph[iph].begin();
95  std::vector<DTSectCollPhCand*>::const_iterator phei = _incand_ph[iph].end();
96  for ( std::vector<DTSectCollPhCand*>::const_iterator iphit = phbi;iphit!= phei;++iphit)
97  delete (*iphit);
98  _incand_ph[iph].clear();
99  }
100 
101  _outcand_ph.clear();
102 
103  std::vector<DTSectCollThCand*>::const_iterator thb = _incand_th.begin();
104  std::vector<DTSectCollThCand*>::const_iterator the = _incand_th.end();
105  for ( std::vector<DTSectCollThCand*>::const_iterator ithit = thb;ithit!= the;++ithit)
106  delete (*ithit);
107  _incand_th.clear();
108 
109  _outcand_th.clear();
110 
111 }
std::vector< DTSectCollThCand * > _incand_th
Definition: DTSectColl.h:203
static const int NSTEPF
Definition: DTConfig.h:36
std::vector< DTSectCollThCand * > _outcand_th
Definition: DTSectColl.h:206
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSectColl.h:200
DTSC * _tsc[DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
Definition: DTSectColl.h:194
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
void clear()
Clear.
Definition: DTSC.cc:67
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSectColl.h:197
unsigned DTSectColl::nCandPh ( int  ifs) const

Return the number of Phi input tracks (first/second)

Definition at line 463 of file DTSectColl.cc.

References _incand_ph, and gather_cfg::cout.

Referenced by config(), and getDTSectCollPhCand().

463  {
464 
465  if(ifs<1||ifs>2){
466  std::cout << "DTSectColl::nCandPh: wrong track number: " << ifs;
467  std::cout << " 0 returned!" << std::endl;
468  return 0;
469  }
470 
471  return _incand_ph[ifs-1].size();
472 
473 }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSectColl.h:197
unsigned DTSectColl::nCandTh ( ) const

Return the number of Theta input tracks.

Definition at line 476 of file DTSectColl.cc.

References _incand_th.

Referenced by config(), getDTSectCollThCand(), and runSectColl().

476  {
477 
478  return _incand_th.size();
479 
480 }
std::vector< DTSectCollThCand * > _incand_th
Definition: DTSectColl.h:203
int DTSectColl::nSegmPh ( int  step)

Return number of DTSectCollPhi segments (SC step)

Definition at line 483 of file DTSectColl.cc.

References DTCache< T, Coll >::begin(), DTCache< T, Coll >::end(), gen::n, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by DTTrig::chSectCollPhSegm1(), DTTrig::chSectCollPhSegm2(), and config().

483  {
484 
485  int n=0;
486  std::vector<DTSectCollPhSegm>::const_iterator p;
487  std::vector<DTSectCollPhSegm>::const_iterator endp = DTSCPhCache::end();
488  for(p=DTSCPhCache::begin(); p<endp; p++) {
489  if(p->step()==step)n++;
490  }
491 
492  return n;
493 
494 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
step
const_iterator end() const
Get last cache element.
Definition: DTCache.h:43
int DTSectColl::nSegmTh ( int  step)

Return number of DTSectCollTheta segments (SC step)

Definition at line 497 of file DTSectColl.cc.

References DTCache< T, Coll >::begin(), DTCache< T, Coll >::end(), gen::n, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by DTTrig::chSectCollThSegm(), and config().

497  {
498 
499  int n=0;
500  std::vector<DTSectCollThSegm>::const_iterator p;
501  std::vector<DTSectCollThSegm>::const_iterator endp = DTSCThCache::end();
502  for(p=DTSCThCache::begin(); p>endp; p++) {
503  if(p->step()==step)n++;
504  }
505 
506  return n;
507 
508 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
step
const_iterator end() const
Get last cache element.
Definition: DTCache.h:43
int DTSectColl::nTracksPh ( ) const
inline

Return the number of output Phi tracks.

Definition at line 138 of file DTSectColl.h.

References _outcand_ph.

Referenced by getTrackPh(), and runSectColl().

138 { return _outcand_ph.size(); }
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSectColl.h:200
int DTSectColl::nTracksTh ( ) const
inline

Return the number of output Theta tracks.

Definition at line 141 of file DTSectColl.h.

References _outcand_th, SectCollPhSegment(), and SectCollThSegment().

Referenced by getTrackTh(), and runSectColl().

141 { return _outcand_th.size(); }
std::vector< DTSectCollThCand * > _outcand_th
Definition: DTSectColl.h:206
void DTSectColl::reconstruct ( )
inlineoverridevirtual

Load Trigger Units triggers and run Sector Collector algorithm.

Reimplemented from DTCache< T, Coll >.

Definition at line 177 of file DTSectColl.h.

References loadSectColl(), and runSectColl().

Referenced by DTTrig::triggerReco().

177 { loadSectColl(); runSectColl(); }
void loadSectColl()
Load a Sector Collector.
Definition: DTSectColl.cc:188
void runSectColl()
Run Sector Collector.
Definition: DTSectColl.cc:339
void DTSectColl::runSectColl ( )

Run Sector Collector.

Definition at line 339 of file DTSectColl.cc.

References DTCache< T, Coll >::_cache, _outcand_ph, _outcand_th, _tsc, DTCache< T, Coll >::begin(), DTSectCollThCand::CoarseSync(), DTSectCollPhCand::CoarseSync(), config(), gather_cfg::cout, debug, relativeConstraints::empty, DTSC::getTrackPh(), DTSC::getTrackTh(), nCandTh(), DTConfig::NSTEPF, DTConfig::NSTEPL, nTracksPh(), nTracksTh(), DTSC::run(), SectCollId(), DTSectCollThCand::tsTr(), and DTSectCollPhCand::tsTr().

Referenced by config(), and reconstruct().

339  {
340 
341  for(int istat=0;istat<4;istat++){
342  for(int istep=DTConfigSectColl::NSTEPF;istep<DTConfigSectColl::NSTEPL+1;istep++) {
343 
344  if(_tsc[istep-DTConfigSectColl::NSTEPF][istat]->nFirstTPh()>0 || _tsc[istep-DTConfigSectColl::NSTEPF][istat]->nCandTh()>0 ) {
345 
346  _tsc[istep-DTConfigSectColl::NSTEPF][istat]->run();
347 
348  if(_tsc[istep-DTConfigSectColl::NSTEPF][istat]->nTracksPh()>0) {
349 
351  DTSCPhCache::_cache.push_back(DTSectCollPhSegm(SectCollId(),istep+cand->CoarseSync(),cand->tsTr(),1));
352  _outcand_ph.push_back(cand);
353 
354  if(_tsc[istep-DTConfigSectColl::NSTEPF][istat]->nTracksPh()>1) {
355 
356  DTSectCollPhCand *cand = _tsc[istep-DTConfigSectColl::NSTEPF][istat]->getTrackPh(2);
357  DTSCPhCache::_cache.push_back(DTSectCollPhSegm(SectCollId(),istep+cand->CoarseSync(),cand->tsTr(),2));
358  _outcand_ph.push_back(cand);
359  }
360  }
361  if(_tsc[istep-DTConfigSectColl::NSTEPF][istat]->nTracksTh()>0) {
362 
363  DTSectCollThCand *cand = _tsc[istep-DTConfigSectColl::NSTEPF][istat]->getTrackTh(1);
364  DTSCThCache::_cache.push_back(DTSectCollThSegm(SectCollId(),istep+cand->CoarseSync(),cand->tsTr()));
365  _outcand_th.push_back(cand); // CB getTrackTh non dovrebbe prendere argomenti modificala!
366 
367  }
368  }
369  }
370  }
371 
372  // debugging...
373  if(config()->debug()){
375  std::cout << "====================================================" << std::endl;
376  std::cout << " Sect Coll segments " << std::endl;
377  if (!DTSCPhCache::_cache.empty()){
378  std:: cout << " ***Phi Segments*** " << std:: endl;
379  std::vector<DTSectCollPhSegm>::const_iterator pph;
380  for(pph=DTSCPhCache::_cache.begin();pph<DTSCPhCache::_cache.end();pph++) {
381  pph->print();
382  }
383  }
384  if (!DTSCThCache::_cache.empty()){
385  std:: cout << " **Theta Segments** " << std:: endl;
386  std::vector<DTSectCollThSegm>::const_iterator pth;
387  for(pth=DTSCThCache::_cache.begin();pth<DTSCThCache::_cache.end();pth++) {
388  pth->print();
389  }
390  }
391  std::cout << "====================================================" << std::endl;
392  }
393  }
394  // end debugging
395 
396 }
int nTracksPh() const
Return the number of output Phi tracks.
Definition: DTSectColl.h:138
my_collection _cache
Definition: DTCache.h:56
const DTChambPhSegm * tsTr() const
Return associated TSPhi trigger.
int CoarseSync() const
Return the Coarse Sync Parameter.
DTSectCollId SectCollId()
Return the Sector Collector Id.
Definition: DTSectColl.h:180
static const int NSTEPF
Definition: DTConfig.h:36
const DTChambThSegm * tsTr() const
Return associated TSTheta trigger.
std::vector< DTSectCollThCand * > _outcand_th
Definition: DTSectColl.h:206
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSectColl.h:200
unsigned nCandTh() const
Return the number of Theta input tracks.
Definition: DTSectColl.cc:476
DTSectCollThCand * getTrackTh(int n) const
Return the requested Theta track.
Definition: DTSC.cc:328
DTSC * _tsc[DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
Definition: DTSectColl.h:194
int CoarseSync() const
Return the Coarse Sync Parameter.
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
int nTracksTh() const
Return the number of output Theta tracks.
Definition: DTSectColl.h:141
DTSectCollPhCand * getTrackPh(int n) const
Return the requested Phi track.
Definition: DTSC.cc:312
void run()
Run the Sector Collector algorithm.
Definition: DTSC.cc:84
#define debug
Definition: HDRShower.cc:19
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
const DTConfigSectColl * config() const
Configuration.
Definition: DTSectColl.h:77
DTSectCollId DTSectColl::SectCollId ( )
inline

Return the Sector Collector Id.

Definition at line 180 of file DTSectColl.h.

References _sectcollid.

Referenced by runSectColl().

180 { return _sectcollid; }
DTSectCollId _sectcollid
Definition: DTSectColl.h:188
const DTSectCollPhSegm * DTSectColl::SectCollPhSegment ( int  step,
unsigned  n 
)

Return requested Sector Collector Phi Segment 1st/2nd.

Definition at line 512 of file DTSectColl.cc.

References DTCache< T, Coll >::begin(), DTCache< T, Coll >::end(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by DTTrig::chSectCollPhSegm1(), DTTrig::chSectCollPhSegm2(), and nTracksTh().

512  {
513 
514  std::vector<DTSectCollPhSegm>::const_iterator p;
515  std::vector<DTSectCollPhSegm>::const_iterator endp = DTSCPhCache::end();
516  for(p=DTSCPhCache::begin();p<endp;p++){
517  if(p->step()==step&&((n==1&&p->isFirst())||(n==2&&!p->isFirst())))
518  return &(*p);
519  }
520 
521  return nullptr;
522 
523 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
step
const_iterator end() const
Get last cache element.
Definition: DTCache.h:43
const DTSectCollThSegm * DTSectColl::SectCollThSegment ( int  step)

Return requested Sector Collector Theta Segment.

Definition at line 526 of file DTSectColl.cc.

References DTCache< T, Coll >::begin(), DTCache< T, Coll >::end(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by DTTrig::chSectCollThSegm(), and nTracksTh().

526  {
527 
528  std::vector<DTSectCollThSegm>::const_iterator p;
529  std::vector<DTSectCollThSegm>::const_iterator endp = DTSCThCache::end();
530  for(p=DTSCThCache::begin();p<endp;p++){
531  if(p->step()==step)
532  return &(*p);
533  }
534 
535  return nullptr;
536 
537 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
step
const_iterator end() const
Get last cache element.
Definition: DTCache.h:43
void DTSectColl::setConfig ( const DTConfigManager conf)

Set configuration.

Definition at line 114 of file DTSectColl.cc.

References _config, _sectcollid, _tsc, config(), DTConfigManager::getDTConfigSectColl(), DTConfig::NSTEPF, DTConfig::NSTEPL, and DTSC::setConfig().

114  {
115 
117 
118  for(int istat=0;istat<4;istat++){
119  for(int istep=0;istep<DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1;istep++){
120  _tsc[istep][istat]->setConfig(config());
121  }
122  }
123 
124 }
DTSectCollId _sectcollid
Definition: DTSectColl.h:188
const DTConfigSectColl * getDTConfigSectColl(DTSectCollId) const
Get desired SectorCollector configuration.
static const int NSTEPF
Definition: DTConfig.h:36
DTSC * _tsc[DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
Definition: DTSectColl.h:194
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
const DTConfigSectColl * _config
Definition: DTSectColl.h:185
const DTConfigSectColl * config() const
Configuration.
Definition: DTSectColl.h:77
void setConfig(const DTConfigSectColl *conf)
Set configuration.
Definition: DTSC.h:55
int DTSectColl::sizePh ( )
inline

Return Phi cache size.

Definition at line 153 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::triggerReco().

153 { return DTSCPhCache::_cache.size(); }
my_collection _cache
Definition: DTCache.h:56
int DTSectColl::sizeTh ( )
inline

Return Theta cache size.

Definition at line 162 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::triggerReco().

162 { return DTSCThCache::_cache.size(); }
my_collection _cache
Definition: DTCache.h:56

Member Data Documentation

const DTConfigSectColl* DTSectColl::_config
private

Definition at line 185 of file DTSectColl.h.

Referenced by config(), and setConfig().

std::vector<DTSectCollPhCand*> DTSectColl::_incand_ph[2]
private

Definition at line 197 of file DTSectColl.h.

Referenced by addTSPhi(), getDTSectCollPhCand(), localClear(), and nCandPh().

std::vector<DTSectCollThCand*> DTSectColl::_incand_th
private

Definition at line 203 of file DTSectColl.h.

Referenced by addTSTheta(), getDTSectCollThCand(), localClear(), and nCandTh().

std::vector<DTSectCollPhCand*> DTSectColl::_outcand_ph
private

Definition at line 200 of file DTSectColl.h.

Referenced by getTrackPh(), localClear(), nTracksPh(), and runSectColl().

std::vector<DTSectCollThCand*> DTSectColl::_outcand_th
private

Definition at line 206 of file DTSectColl.h.

Referenced by getTrackTh(), localClear(), nTracksTh(), and runSectColl().

DTSectCollId DTSectColl::_sectcollid
private

Definition at line 188 of file DTSectColl.h.

Referenced by addTU(), SectCollId(), and setConfig().

Definition at line 194 of file DTSectColl.h.

Referenced by DTSectColl(), getDTSC(), localClear(), runSectColl(), setConfig(), and ~DTSectColl().

DTTSPhi* DTSectColl::_tsphi[DTConfigSectColl::NTSPSC]
private

Definition at line 190 of file DTSectColl.h.

Referenced by addTU(), DTSectColl(), getTSPhi(), and loadSectColl().

DTTSTheta* DTSectColl::_tstheta[DTConfigSectColl::NTSTSC]
private

Definition at line 191 of file DTSectColl.h.

Referenced by addTU(), DTSectColl(), getTSTheta(), and loadSectColl().