CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 () const
 Return iterator to the beghin of Phi cache. More...
 
std::vector< DTSectCollThSegm >
::const_iterator 
beginTh () const
 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 () const
 Return iterator to the end of Phi cache. More...
 
std::vector< DTSectCollThSegm >
::const_iterator 
endTh () const
 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 () const
 Return Phi cache size. More...
 
int sizeTh () const
 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 47 of file DTSectColl.cc.

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

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

Destructor.

Definition at line 65 of file DTSectColl.cc.

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

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

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 209 of file DTSectColl.cc.

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

Referenced by loadSectColl().

209  {
211  std::cout << "DTSectColl::addTSPhi: step out of range: " << step;
212  std::cout << " trigger not added!" << std::endl;
213  return;
214  }
215 
216  if (istat < 1 || istat > 4) {
217  std::cout << "DTSectColl::addTSPhi: station out of SC range: " << istat;
218  std::cout << " trigger not added!" << std::endl;
219  return;
220  }
221 
222  // Check that a trigger is present, by its code
223  if (tsmsegm->oldCode() == 0) {
224  std::cout << "DTSectColl::addTSPhi --> code = 0 ! ";
225  std::cout << " trigger not added!" << std::endl;
226  return;
227  }
228 
229  DTSC* tsc = getDTSC(step, istat);
230 
231  DTSectCollPhCand* cand = new DTSectCollPhCand(tsc, tsmsegm, ifs);
232 
233  bool fs = (ifs == 1);
234  _incand_ph[fs].push_back(cand);
235 
236  tsc->addDTSectCollPhCand(cand);
237 
238  // Debugging...
239  if (config()->debug()) {
240  std::cout << "DTSectColl::addTSPhi at step " << step;
241  std::cout << " in SC station " << istat;
242  if (ifs == 1) {
243  std::cout << " (first track)" << std::endl;
244  } else {
245  std::cout << " (second track)" << std::endl;
246  }
247  }
248 }
Definition: DTSC.h:41
int oldCode() const
Return trigger code (10*inner_code+outer_code; X_code=1,2,3,4,8)
Definition: DTChambPhSegm.h:91
void addDTSectCollPhCand(DTSectCollPhCand *cand)
Add a Sector Collector.
Definition: DTSC.cc:238
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
#define debug
Definition: HDRShower.cc:19
DTSC * getDTSC(int step, int istat) const
Get a Sector Collector (step is TS one)
Definition: DTSectColl.cc:290
const DTConfigSectColl * config() const
Configuration.
Definition: DTSectColl.h:75
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSectColl.h:200
tuple cout
Definition: gather_cfg.py:144
step
Definition: StallMonitor.cc:98
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 250 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 loadSectColl().

250  {
252  std::cout << "DTSectColl::addTSTheta: step out of range: " << step;
253  std::cout << " trigger not added!" << std::endl;
254  return;
255  }
256 
257  if (istat < 1 || istat > 5) {
258  std::cout << "DTSectColl::addTSTheta: station out of SC range: " << istat;
259  std::cout << " trigger not added!" << std::endl;
260  return;
261  }
262 
263  // Check if a trigger is present in theta
264  bool is_empty = false;
265  for (int i = 0; i < 7; i++)
266  if (tstsegm->position(i) == 1) {
267  is_empty = false;
268  break;
269  }
270  if (is_empty == true) {
271  std::cout << "DTSectColl::addTSTheta --> no position bit equal to 1 ! ";
272  std::cout << " trigger not added!" << std::endl;
273  return;
274  }
275 
276  DTSC* tsc = getDTSC(step, istat);
277 
278  DTSectCollThCand* cand = new DTSectCollThCand(tsc, tstsegm);
279 
280  _incand_th.push_back(cand);
281 
282  tsc->addThCand(cand);
283 
284  // Debugging...
285  if (config()->debug()) {
286  std::cout << "DTSectColl::addTSTheta at step " << step << std::endl;
287  }
288 }
std::vector< DTSectCollThCand * > _incand_th
Definition: DTSectColl.h:206
Definition: DTSC.h:41
void addThCand(DTSectCollThCand *cand)
Add a Theta candidate to sect coll.
Definition: DTSC.cc:198
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
#define debug
Definition: HDRShower.cc:19
DTSC * getDTSC(int step, int istat) const
Get a Sector Collector (step is TS one)
Definition: DTSectColl.cc:290
def is_empty
Definition: utils.py:179
const DTConfigSectColl * config() const
Configuration.
Definition: DTSectColl.h:75
tuple cout
Definition: gather_cfg.py:144
step
Definition: StallMonitor.cc:98
void DTSectColl::addTU ( DTSCTrigUnit tru)

Add a Trigger Unit to the Sector Collector.

Definition at line 116 of file DTSectColl.cc.

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

116  {
117  int stat = tru->station();
118  int sect = tru->sector();
119  switch (sect) {
120  case 13:
121  stat = 5;
122  sect = 4;
123  break;
124  case 14:
125  stat = 5;
126  sect = 10;
127  break;
128  }
129 
130  if (_sectcollid != DTSectCollId() && _sectcollid != DTSectCollId(tru->wheel(), sect)) {
131  std::cout << "DTSectColl::addTU: Trying to add tru " << tru << " into SectColl " << _sectcollid
132  << " Skipping insertion" << std::endl;
133  return;
134  }
135 
136  if (stat < 1 || stat > 5) {
137  std::cout << "DTSectColl::addTU: Wrong station number Skipping insertion" << std::endl;
138  return;
139  }
140 
141  _tsphi[stat - 1] = tru->TSPhTrigs();
142  if (stat < 4)
143  _tstheta[stat - 1] = tru->TSThTrigs();
144 
145  if (_sectcollid == DTSectCollId())
146  _sectcollid = DTSectCollId(tru->wheel(), sect);
147 
148  // add a Trigger Unit to the Sector Collector
149  // if(flag==2) {
150  // _tsphi1 = tru->TSPhTrigs(); // these are the "normal" stations
151  // _tsphi2 = 0;
152  // _tstheta = tru->TSThTrigs();
153  // }
154  // else if (flag==0){
155  // _tsphi1 = tru->TSPhTrigs();
156  // _tstheta = 0;
157  // }
158  // else if(flag==1) {
159  // _tsphi2 = tru->TSPhTrigs(); // these are the "double" stations
160  // _tstheta = 0;
161  // }
162  // // generates SectColl Id from tsphi Id
163  // if (flag==2 || flag==0){
164  // int sect = tru->sector();
165  // if (sect == 13) sect=4;
166  // if (sect == 14) sect=10;
167  // _sectcollid=DTSectCollId(tru->wheel(),tru->station(),sect);
168  // }
169 }
DTSectCollId _sectcollid
Definition: DTSectColl.h:191
DTTSTheta * TSThTrigs() const
Return the chamber Trigger Server (Theta)
Definition: DTSCTrigUnit.h:93
DTTSPhi * TSPhTrigs() const
Return the chamber Trigger Server (Phi)
Definition: DTSCTrigUnit.h:90
DTTSTheta * _tstheta[DTConfigSectColl::NTSTSC]
Definition: DTSectColl.h:194
DTTSPhi * _tsphi[DTConfigSectColl::NTSPSC]
Definition: DTSectColl.h:193
int station() const
Return station number.
Definition: DTSCTrigUnit.h:78
int wheel() const
Return wheel number.
Definition: DTSCTrigUnit.h:75
tuple cout
Definition: gather_cfg.py:144
int sector() const
Return sector number.
Definition: DTSCTrigUnit.h:81
std::vector<DTSectCollPhSegm>::const_iterator DTSectColl::beginPh ( ) const
inline

Return iterator to the beghin of Phi cache.

Definition at line 148 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::SCPhTrigs().

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

Return iterator to the begni of Theta cache.

Definition at line 157 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::SCThTrigs().

157 { return DTSCThCache::_cache.begin(); }
my_collection _cache
Definition: DTCache.h:53
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 172 of file DTSectColl.h.

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

Referenced by DTTrig::triggerReco().

172  {
175  }
void clearCache()
Clear cache vector.
Definition: DTCache.h:47
const DTConfigSectColl* DTSectColl::config ( void  ) const
inline

Configuration.

Definition at line 75 of file DTSectColl.h.

References _config.

Referenced by addTSPhi(), addTSTheta(), runSectColl(), setConfig(), and zMuMuValidation.ZMuMuValidation::trackcollection().

75 { return _config; }
const DTConfigSectColl * _config
Definition: DTSectColl.h:188
std::vector<DTSectCollPhSegm>::const_iterator DTSectColl::endPh ( ) const
inline

Return iterator to the end of Phi cache.

Definition at line 154 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::SCPhTrigs().

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

Return iterator to the end of Theta cache.

Definition at line 163 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::SCThTrigs().

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

Get a Sector Collector (step is TS one)

Definition at line 290 of file DTSectColl.cc.

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

Referenced by addTSPhi(), and addTSTheta().

290  {
292  std::cout << "DTSectColl::getDTSC: step out of range: " << step;
293  std::cout << " empty pointer returned!" << std::endl;
294  return nullptr;
295  }
296 
297  if (istat < 1 || istat > 4) {
298  std::cout << "DTSectColl::getDTSC: station out of SC range: " << istat;
299  std::cout << " emty pointer returned!" << std::endl;
300  return nullptr;
301  }
302 
303  return _tsc[step - DTConfigSectColl::NSTEPF][istat - 1];
304 }
static const int NSTEPF
Definition: DTConfig.h:35
DTSC * _tsc[DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
Definition: DTSectColl.h:197
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
tuple cout
Definition: gather_cfg.py:144
step
Definition: StallMonitor.cc:98
DTSectCollPhCand * DTSectColl::getDTSectCollPhCand ( int  ifs,
unsigned  n 
) const

Get a Phi Candidate for Sector Collector.

Definition at line 358 of file DTSectColl.cc.

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

358  {
359  if (ifs < 1 || ifs > 2) {
360  std::cout << "DTSectColl::getDTSectCollPhCand: wrong track number: " << ifs;
361  std::cout << " empty pointer returned!" << std::endl;
362  return nullptr;
363  }
364  if (n < 1 || n > nCandPh(ifs)) {
365  std::cout << "DTSectColl::getDTSectCollPhCand: requested trigger not present: " << n;
366  std::cout << " empty pointer returned!" << std::endl;
367  return nullptr;
368  }
369 
370  std::vector<DTSectCollPhCand*>::const_iterator p = _incand_ph[ifs - 1].begin() + n - 1;
371  return (*p);
372 }
unsigned nCandPh(int ifs) const
Return the number of Phi input tracks (first/second)
Definition: DTSectColl.cc:407
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSectColl.h:200
tuple cout
Definition: gather_cfg.py:144
DTSectCollThCand * DTSectColl::getDTSectCollThCand ( unsigned  n) const

Get a Candidate for Sector Collector.

Definition at line 374 of file DTSectColl.cc.

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

374  {
375  if (n < 1 || n > nCandTh()) {
376  std::cout << "DTSectColl::getDTSectCollThCand: requested trigger not present: " << n;
377  std::cout << " empty pointer returned!" << std::endl;
378  return nullptr;
379  }
380 
381  std::vector<DTSectCollThCand*>::const_iterator p = _incand_th.begin() + n - 1;
382  return (*p);
383 }
std::vector< DTSectCollThCand * > _incand_th
Definition: DTSectColl.h:206
unsigned nCandTh() const
Return the number of Theta input tracks.
Definition: DTSectColl.cc:417
tuple cout
Definition: gather_cfg.py:144
DTSectCollPhCand * DTSectColl::getTrackPh ( int  n) const

Return the requested Phi track.

Definition at line 385 of file DTSectColl.cc.

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

385  {
386  if (n < 1 || n > nTracksPh()) {
387  std::cout << "DTSectColl::getTrackPh: requested track not present: " << n;
388  std::cout << " empty pointer returned!" << std::endl;
389  return nullptr;
390  }
391 
392  std::vector<DTSectCollPhCand*>::const_iterator p = _outcand_ph.begin() + n - 1;
393  return (*p);
394 }
int nTracksPh() const
Return the number of output Phi tracks.
Definition: DTSectColl.h:136
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSectColl.h:203
tuple cout
Definition: gather_cfg.py:144
DTSectCollThCand * DTSectColl::getTrackTh ( int  n) const

Return the requested Theta track.

Definition at line 396 of file DTSectColl.cc.

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

396  {
397  if (n < 1 || n > nTracksTh()) {
398  std::cout << "DTSectColl::getTrackTh: requested track not present: " << n;
399  std::cout << " empty pointer returned!" << std::endl;
400  return nullptr;
401  }
402 
403  std::vector<DTSectCollThCand*>::const_iterator p = _outcand_th.begin() + n - 1;
404  return (*p);
405 }
std::vector< DTSectCollThCand * > _outcand_th
Definition: DTSectColl.h:209
int nTracksTh() const
Return the number of output Theta tracks.
Definition: DTSectColl.h:139
tuple cout
Definition: gather_cfg.py:144
DTTSPhi* DTSectColl::getTSPhi ( int  istat) const
inline

Return TSPhi.

Definition at line 69 of file DTSectColl.h.

References _tsphi.

Referenced by DTTrig::triggerReco().

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

Return TSTheta.

Definition at line 72 of file DTSectColl.h.

References _tstheta.

Referenced by DTTrig::triggerReco().

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

Load a Sector Collector.

Definition at line 171 of file DTSectColl.cc.

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

Referenced by reconstruct().

171  {
172  localClear();
173 
174  std::vector<DTChambPhSegm>::const_iterator p;
175  std::vector<DTChambPhSegm>::const_iterator pend;
176 
177  for (int istat = 1; istat < 5; istat++) {
178  pend = _tsphi[istat - 1]->end();
179  for (p = _tsphi[istat - 1]->begin(); p != pend; p++) {
180  int step = p->step();
181  int fs = (p->isFirst()) ? 1 : 2;
182  // load trigger
183  addTSPhi(step, &(*p), fs, istat);
184  }
185  }
186 
187  if (!(_tsphi[4] == nullptr)) { // only for double stations
188  pend = _tsphi[4]->end();
189  for (p = _tsphi[4]->begin(); p != pend; p++) {
190  int step = p->step();
191  int fs = (p->isFirst()) ? 1 : 2;
192  // load trigger
193  addTSPhi(step, &(*p), fs, 4);
194  }
195  }
196  std::vector<DTChambThSegm>::const_iterator pth;
197  std::vector<DTChambThSegm>::const_iterator pthend;
198 
199  for (int istat = 1; istat < 4; istat++) {
200  pthend = _tstheta[istat - 1]->end();
201  for (pth = _tstheta[istat - 1]->begin(); pth != pthend; pth++) {
202  int step = pth->step();
203  // load trigger
204  addTSTheta(step, &(*pth), istat);
205  }
206  }
207 }
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:209
DTTSTheta * _tstheta[DTConfigSectColl::NTSTSC]
Definition: DTSectColl.h:194
void addTSTheta(int step, const DTChambThSegm *tsmsegm, int istat)
Add a TS Theta candidate (step is TSTheta step not sc one)
Definition: DTSectColl.cc:250
DTTSPhi * _tsphi[DTConfigSectColl::NTSPSC]
Definition: DTSectColl.h:193
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
void localClear()
Local Clear.
Definition: DTSectColl.cc:79
step
Definition: StallMonitor.cc:98
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
void DTSectColl::localClear ( )

Local Clear.

Definition at line 79 of file DTSectColl.cc.

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

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

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

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

Definition at line 407 of file DTSectColl.cc.

References _incand_ph, and gather_cfg::cout.

Referenced by getDTSectCollPhCand().

407  {
408  if (ifs < 1 || ifs > 2) {
409  std::cout << "DTSectColl::nCandPh: wrong track number: " << ifs;
410  std::cout << " 0 returned!" << std::endl;
411  return 0;
412  }
413 
414  return _incand_ph[ifs - 1].size();
415 }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSectColl.h:200
tuple cout
Definition: gather_cfg.py:144
unsigned DTSectColl::nCandTh ( ) const

Return the number of Theta input tracks.

Definition at line 417 of file DTSectColl.cc.

References _incand_th.

Referenced by getDTSectCollThCand(), and runSectColl().

417 { return _incand_th.size(); }
std::vector< DTSectCollThCand * > _incand_th
Definition: DTSectColl.h:206
int DTSectColl::nSegmPh ( int  step)

Return number of DTSectCollPhi segments (SC step)

Definition at line 419 of file DTSectColl.cc.

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

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

419  {
420  int n = 0;
421  std::vector<DTSectCollPhSegm>::const_iterator p;
422  std::vector<DTSectCollPhSegm>::const_iterator endp = DTSCPhCache::end();
423  for (p = DTSCPhCache::begin(); p < endp; p++) {
424  if (p->step() == step)
425  n++;
426  }
427 
428  return n;
429 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
step
Definition: StallMonitor.cc:98
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
int DTSectColl::nSegmTh ( int  step)

Return number of DTSectCollTheta segments (SC step)

Definition at line 431 of file DTSectColl.cc.

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

Referenced by DTTrig::chSectCollThSegm().

431  {
432  int n = 0;
433  std::vector<DTSectCollThSegm>::const_iterator p;
434  std::vector<DTSectCollThSegm>::const_iterator endp = DTSCThCache::end();
435  for (p = DTSCThCache::begin(); p > endp; p++) {
436  if (p->step() == step)
437  n++;
438  }
439 
440  return n;
441 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
step
Definition: StallMonitor.cc:98
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
int DTSectColl::nTracksPh ( ) const
inline

Return the number of output Phi tracks.

Definition at line 136 of file DTSectColl.h.

References _outcand_ph.

Referenced by getTrackPh(), and runSectColl().

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

Return the number of output Theta tracks.

Definition at line 139 of file DTSectColl.h.

References _outcand_th.

Referenced by getTrackTh(), and runSectColl().

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

Load Trigger Units triggers and run Sector Collector algorithm.

Reimplemented from DTCache< T, Coll >.

Definition at line 178 of file DTSectColl.h.

References loadSectColl(), and runSectColl().

Referenced by DTTrig::triggerReco().

178  {
179  loadSectColl();
180  runSectColl();
181  }
void loadSectColl()
Load a Sector Collector.
Definition: DTSectColl.cc:171
void runSectColl()
Run Sector Collector.
Definition: DTSectColl.cc:306
void DTSectColl::runSectColl ( )

Run Sector Collector.

Definition at line 306 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(), relval_steps::istep, nCandTh(), DTConfig::NSTEPF, DTConfig::NSTEPL, nTracksPh(), nTracksTh(), DTSC::run(), SectCollId(), DTSectCollThCand::tsTr(), and DTSectCollPhCand::tsTr().

Referenced by reconstruct().

306  {
307  for (int istat = 0; istat < 4; istat++) {
309  if (_tsc[istep - DTConfigSectColl::NSTEPF][istat]->nFirstTPh() > 0 ||
310  _tsc[istep - DTConfigSectColl::NSTEPF][istat]->nCandTh() > 0) {
311  _tsc[istep - DTConfigSectColl::NSTEPF][istat]->run();
312 
313  if (_tsc[istep - DTConfigSectColl::NSTEPF][istat]->nTracksPh() > 0) {
315  DTSCPhCache::_cache.push_back(DTSectCollPhSegm(SectCollId(), istep + cand->CoarseSync(), cand->tsTr(), 1));
316  _outcand_ph.push_back(cand);
317 
318  if (_tsc[istep - DTConfigSectColl::NSTEPF][istat]->nTracksPh() > 1) {
320  DTSCPhCache::_cache.push_back(DTSectCollPhSegm(SectCollId(), istep + cand->CoarseSync(), cand->tsTr(), 2));
321  _outcand_ph.push_back(cand);
322  }
323  }
324  if (_tsc[istep - DTConfigSectColl::NSTEPF][istat]->nTracksTh() > 0) {
326  DTSCThCache::_cache.push_back(DTSectCollThSegm(SectCollId(), istep + cand->CoarseSync(), cand->tsTr()));
327  _outcand_th.push_back(cand); // CB getTrackTh non dovrebbe prendere argomenti modificala!
328  }
329  }
330  }
331  }
332 
333  // debugging...
334  if (config()->debug()) {
336  std::cout << "====================================================" << std::endl;
337  std::cout << " Sect Coll segments " << std::endl;
338  if (!DTSCPhCache::_cache.empty()) {
339  std::cout << " ***Phi Segments*** " << std::endl;
340  std::vector<DTSectCollPhSegm>::const_iterator pph;
341  for (pph = DTSCPhCache::_cache.begin(); pph < DTSCPhCache::_cache.end(); pph++) {
342  pph->print();
343  }
344  }
345  if (!DTSCThCache::_cache.empty()) {
346  std::cout << " **Theta Segments** " << std::endl;
347  std::vector<DTSectCollThSegm>::const_iterator pth;
348  for (pth = DTSCThCache::_cache.begin(); pth < DTSCThCache::_cache.end(); pth++) {
349  pth->print();
350  }
351  }
352  std::cout << "====================================================" << std::endl;
353  }
354  }
355  // end debugging
356 }
int nTracksPh() const
Return the number of output Phi tracks.
Definition: DTSectColl.h:136
my_collection _cache
Definition: DTCache.h:53
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:184
static const int NSTEPF
Definition: DTConfig.h:35
const DTChambThSegm * tsTr() const
Return associated TSTheta trigger.
std::vector< DTSectCollThCand * > _outcand_th
Definition: DTSectColl.h:209
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSectColl.h:203
unsigned nCandTh() const
Return the number of Theta input tracks.
Definition: DTSectColl.cc:417
DTSectCollThCand * getTrackTh(int n) const
Return the requested Theta track.
Definition: DTSC.cc:256
DTSC * _tsc[DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
Definition: DTSectColl.h:197
int CoarseSync() const
Return the Coarse Sync Parameter.
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
int nTracksTh() const
Return the number of output Theta tracks.
Definition: DTSectColl.h:139
DTSectCollPhCand * getTrackPh(int n) const
Return the requested Phi track.
Definition: DTSC.cc:244
void run()
Run the Sector Collector algorithm.
Definition: DTSC.cc:69
#define debug
Definition: HDRShower.cc:19
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
const DTConfigSectColl * config() const
Configuration.
Definition: DTSectColl.h:75
tuple cout
Definition: gather_cfg.py:144
DTSectCollId DTSectColl::SectCollId ( )
inline

Return the Sector Collector Id.

Definition at line 184 of file DTSectColl.h.

References _sectcollid.

Referenced by runSectColl().

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

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

Definition at line 443 of file DTSectColl.cc.

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

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

443  {
444  std::vector<DTSectCollPhSegm>::const_iterator p;
445  std::vector<DTSectCollPhSegm>::const_iterator endp = DTSCPhCache::end();
446  for (p = DTSCPhCache::begin(); p < endp; p++) {
447  if (p->step() == step && ((n == 1 && p->isFirst()) || (n == 2 && !p->isFirst())))
448  return &(*p);
449  }
450 
451  return nullptr;
452 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
step
Definition: StallMonitor.cc:98
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
const DTSectCollThSegm * DTSectColl::SectCollThSegment ( int  step)

Return requested Sector Collector Theta Segment.

Definition at line 454 of file DTSectColl.cc.

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

Referenced by DTTrig::chSectCollThSegm().

454  {
455  std::vector<DTSectCollThSegm>::const_iterator p;
456  std::vector<DTSectCollThSegm>::const_iterator endp = DTSCThCache::end();
457  for (p = DTSCThCache::begin(); p < endp; p++) {
458  if (p->step() == step)
459  return &(*p);
460  }
461 
462  return nullptr;
463 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
step
Definition: StallMonitor.cc:98
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
void DTSectColl::setConfig ( const DTConfigManager conf)

Set configuration.

Definition at line 106 of file DTSectColl.cc.

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

106  {
108 
109  for (int istat = 0; istat < 4; istat++) {
111  _tsc[istep][istat]->setConfig(config());
112  }
113  }
114 }
DTSectCollId _sectcollid
Definition: DTSectColl.h:191
const DTConfigSectColl * getDTConfigSectColl(DTSectCollId) const
Get desired SectorCollector configuration.
static const int NSTEPF
Definition: DTConfig.h:35
DTSC * _tsc[DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
Definition: DTSectColl.h:197
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
const DTConfigSectColl * _config
Definition: DTSectColl.h:188
const DTConfigSectColl * config() const
Configuration.
Definition: DTSectColl.h:75
void setConfig(const DTConfigSectColl *conf)
Set configuration.
Definition: DTSC.h:52
int DTSectColl::sizePh ( ) const
inline

Return Phi cache size.

Definition at line 151 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::triggerReco().

151 { return DTSCPhCache::_cache.size(); }
my_collection _cache
Definition: DTCache.h:53
int DTSectColl::sizeTh ( ) const
inline

Return Theta cache size.

Definition at line 160 of file DTSectColl.h.

References DTCache< T, Coll >::_cache.

Referenced by DTTrig::triggerReco().

160 { return DTSCThCache::_cache.size(); }
my_collection _cache
Definition: DTCache.h:53

Member Data Documentation

const DTConfigSectColl* DTSectColl::_config
private

Definition at line 188 of file DTSectColl.h.

Referenced by config(), and setConfig().

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

Definition at line 200 of file DTSectColl.h.

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

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

Definition at line 206 of file DTSectColl.h.

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

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

Definition at line 203 of file DTSectColl.h.

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

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

Definition at line 209 of file DTSectColl.h.

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

DTSectCollId DTSectColl::_sectcollid
private

Definition at line 191 of file DTSectColl.h.

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

Definition at line 197 of file DTSectColl.h.

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

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

Definition at line 193 of file DTSectColl.h.

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

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

Definition at line 194 of file DTSectColl.h.

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