CMS 3D CMS Logo

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

#include <DTTSPhi.h>

Inheritance diagram for DTTSPhi:
DTCache< T, Coll > DTGeomSupplier

Public Member Functions

const DTConfigTSPhiconfig () const
 Return the configuration class. More...
 
 DTTSPhi (DTTrigGeom *, DTTracoCard *)
 Constructor. More...
 
LocalVector localDirection (const DTTrigData *) const override
 Local direction in chamber of a trigger-data object. More...
 
LocalPoint localPosition (const DTTrigData *) const override
 Local position in chamber of a trigger-data object. More...
 
int nSegm (int step)
 Return number of DTTSPhi segments. More...
 
void reconstruct () override
 Load TRACO triggers and run TSPhi algorithm. More...
 
const DTChambPhSegmsegment (int step, unsigned n)
 Return the requested DTTSPhi segment. More...
 
void setConfig (const DTConfigManager *conf)
 Set configuration. More...
 
 ~DTTSPhi () 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...
 
- Public Member Functions inherited from DTGeomSupplier
DTChamberId ChamberId () const
 Identifier of the associated chamber. More...
 
GlobalVector CMSDirection (const DTTrigData *trig) const
 CMS direction in chamber of a trigger -data object. More...
 
GlobalPoint CMSPosition (const DTTrigData *trig) const
 CMS position in chamber of a trigger-data object. More...
 
 DTGeomSupplier (DTTrigGeom *geom)
 Constructor. More...
 
DTTrigGeomgeom () const
 Associated geometry. More...
 
virtual void print (const DTTrigData *trig) const
 Print a trigger-data object with also local and global position/direction. More...
 
int sector () const
 Return sector number. More...
 
const DTChamberstat () const
 Associated chamber. More...
 
int station () const
 Return station number. More...
 
int wheel () const
 Return wheel number. More...
 
virtual ~DTGeomSupplier ()
 Destructor. More...
 

Private Member Functions

void addTracoT (int step, const DTTracoTrigData *tracotrig, int ifs)
 
DTTSMgetDTTSM (int step, unsigned n) const
 
DTTSSgetDTTSS (int step, unsigned n) const
 
void ignoreSecondTrack (int step, int tracon)
 Set a flag to ignore second tracks (if first track at following BX) More...
 
void loadTSPhi ()
 store DTTracoChip triggers in the DTTSS's More...
 
void localClear ()
 Clear. More...
 
void runTSPhi ()
 run DTTSPhi algorithm (DTTSS+DTTSM) More...
 

Private Attributes

const DTConfigTSPhi_config
 
std::vector< DTTSCand * > _tctrig [DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
 
DTTracoCard_tracocard
 
std::vector< DTTSM * > _tsm [DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
 
std::vector< DTTSS * > _tss [DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
 

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
 
- Protected Attributes inherited from DTGeomSupplier
DTTrigGeom_geom
 

Detailed Description

Implementation of TS Phi trigger algorithm

Author
C. Grandi, D. Bonacorsi, S. Marcellini

Definition at line 53 of file DTTSPhi.h.

Constructor & Destructor Documentation

◆ DTTSPhi()

DTTSPhi::DTTSPhi ( DTTrigGeom geom,
DTTracoCard tracocard 
)

Constructor.

Definition at line 44 of file DTTSPhi.cc.

44  : DTGeomSupplier(geom), _tracocard(tracocard) {
45  // reserve the appropriate amount of space for vectors
46  int i = 0;
47  for (i = 0; i < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1; i++) { // SM add + 1
48  _tss[i].reserve(DTConfigTSPhi::NTSSTSM);
49  // DBSM-doubleTSM
50  _tsm[i].reserve(DTConfigTSPhi::NTSMD);
51  }
52 
53  for (int is = 0; is < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1; is++) {
54  // create DTTSSs
55  for (int itss = 1; itss <= DTConfigTSPhi::NTSSTSM; itss++) {
56  DTTSS *tss = new DTTSS(itss);
57  _tss[is].push_back(tss);
58  }
59 
60  // create DTTSMs SM double TSM
61  for (int itsmd = 1; itsmd <= DTConfigTSPhi::NTSMD; itsmd++) {
62  DTTSM *tsm = new DTTSM(itsmd);
63  _tsm[is].push_back(tsm);
64  }
65  }
66 }

References _tsm, _tss, mps_fire::i, DTConfig::NSTEPF, DTConfig::NSTEPL, DTConfigTSPhi::NTSMD, and DTConfigTSPhi::NTSSTSM.

◆ ~DTTSPhi()

DTTSPhi::~DTTSPhi ( )
override

Destructor.

Definition at line 71 of file DTTSPhi.cc.

71  {
72  std::vector<DTTSS *>::iterator ptss;
73  std::vector<DTTSM *>::iterator ptsm;
74  for (int is = 0; is < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1; is++) {
75  // clear TSSs
76  for (ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++) {
77  delete (*ptss);
78  }
79  _tss[is].clear();
80  // clear TSMs
81  for (ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++) {
82  delete (*ptsm);
83  }
84  _tsm[is].clear();
85  }
86 
87  localClear();
88 
89  // delete _config;
90 }

References _tsm, _tss, DTCache< T, Coll >::begin(), localClear(), DTConfig::NSTEPF, and DTConfig::NSTEPL.

Member Function Documentation

◆ addTracoT()

void DTTSPhi::addTracoT ( int  step,
const DTTracoTrigData tracotrig,
int  ifs 
)
private

Add a DTTracoChip trigger to the DTTSPhi, ifs is track number (first or second)

Definition at line 163 of file DTTSPhi.cc.

163  {
165  std::cout << "DTTSPhi::addTracoT: step out of range: " << step;
166  std::cout << " trigger not added!" << std::endl;
167  return;
168  }
169  // Check that a preview is present and code is not zero
170  if (!tracotrig->pvCode() || !tracotrig->code()) {
171  std::cout << "DTTSPhi::addTracoT: preview not present in TRACO trigger or "
172  "its code=0 ";
173  std::cout << " trigger not added!" << std::endl;
174  return;
175  }
176 
177  // Get the appropriate TSS
178  int itss = (tracotrig->tracoNumber() - 1) / DTConfigTSPhi::NTCTSS + 1;
179  if (itss < 1 || itss > DTConfigTSPhi::NTSSTSM) {
180  std::cout << "DTTSPhi::addTracoT: wrong TRACO number: ";
181  std::cout << tracotrig->tracoNumber();
182  std::cout << " trigger not added!" << std::endl;
183  return;
184  }
185 
186  // TSM status check (if it is the case, reject TRACO triggers related to
187  // broken TSMData)
188  if (config()->TsmStatus().element(itss) == 0) { // TSMD broken
189  return;
190  }
191 
192  int pos = tracotrig->tracoNumber() - (itss - 1) * DTConfigTSPhi::NTCTSS;
193  DTTSS *tss = getDTTSS(step, itss);
194 
195  // Create a new Trigger Server candidate
196  DTTSCand *cand = new DTTSCand(tss, tracotrig, ifs, pos);
197 
198  // Add it to the buffer and to the TSS
199  _tctrig[step - DTConfigTSPhi::NSTEPF].push_back(cand);
200  tss->addDTTSCand(cand);
201 
202  // Debugging...
203  if (config()->debug()) {
204  std::cout << "DTTSPhi::addTracoT at step " << step;
205  if (ifs == 1) {
206  std::cout << " (first track)";
207  } else {
208  std::cout << " (second track)";
209  }
210  std::cout << " from TRACO " << tracotrig->tracoNumber();
211  std::cout << " to TSS " << tss->number() << ", position=" << pos << std::endl;
212  tracotrig->print();
213  }
214  // end debugging
215 }

References _tctrig, DTTSS::addDTTSCand(), DTTracoTrigData::code(), config(), gather_cfg::cout, debug, getDTTSS(), DTConfig::NSTEPF, DTConfig::NSTEPL, DTConfig::NTCTSS, DTConfigTSPhi::NTSSTSM, DTTSS::number(), DTTracoTrigData::print(), DTTracoTrigData::pvCode(), and DTTracoTrigData::tracoNumber().

Referenced by loadTSPhi().

◆ config()

const DTConfigTSPhi* DTTSPhi::config ( void  ) const
inline

Return the configuration class.

Definition at line 62 of file DTTSPhi.h.

62 { return _config; }

References _config.

Referenced by addTracoT(), ignoreSecondTrack(), loadTSPhi(), runTSPhi(), and setConfig().

◆ getDTTSM()

DTTSM * DTTSPhi::getDTTSM ( int  step,
unsigned  n 
) const
private

Definition at line 457 of file DTTSPhi.cc.

457  {
459  std::cout << "DTTSPhi::getDTTSM: step out of range: " << step;
460  std::cout << " empty pointer returned!" << std::endl;
461  return nullptr;
462  }
463  if (n < 1 || n > _tsm[step - DTConfigTSPhi::NSTEPF].size()) {
464  std::cout << "DTTSPhi::getDTTSM: requested DTTSM not present: " << n;
465  std::cout << " (at step " << step << ")";
466  std::cout << " empty pointer returned!" << std::endl;
467  return nullptr;
468  }
469  std::vector<DTTSM *>::const_iterator p_tsm = _tsm[step - DTConfigTSPhi::NSTEPF].begin() + n - 1;
470  return *p_tsm;
471 }

References _tsm, gather_cfg::cout, dqmiodumpmetadata::n, DTConfig::NSTEPF, DTConfig::NSTEPL, and DTCache< T, Coll >::size().

Referenced by ignoreSecondTrack(), and runTSPhi().

◆ getDTTSS()

DTTSS * DTTSPhi::getDTTSS ( int  step,
unsigned  n 
) const
private

Definition at line 440 of file DTTSPhi.cc.

440  {
442  std::cout << "DTTSPhi::getDTTSS: step out of range: " << step;
443  std::cout << " empty pointer returned!" << std::endl;
444  return nullptr;
445  }
446  if (n < 1 || n > _tss[step - DTConfigTSPhi::NSTEPF].size()) {
447  std::cout << "DTTSPhi::getDTTSS: requested DTTSS not present: " << n;
448  std::cout << " (at step " << step << ")";
449  std::cout << " empty pointer returned!" << std::endl;
450  return nullptr;
451  }
452 
453  std::vector<DTTSS *>::const_iterator p = _tss[step - DTConfigTSPhi::NSTEPF].begin() + n - 1;
454  return *p;
455 }

References _tss, gather_cfg::cout, dqmiodumpmetadata::n, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, and DTCache< T, Coll >::size().

Referenced by addTracoT(), and ignoreSecondTrack().

◆ ignoreSecondTrack()

void DTTSPhi::ignoreSecondTrack ( int  step,
int  tracon 
)
private

Set a flag to ignore second tracks (if first track at following BX)

Definition at line 411 of file DTTSPhi.cc.

411  {
412  int itsmd = 1; // initialize it to default
413 
415  std::cout << "DTTSPhi::ignoreSecondTrack: step out of range: " << step;
416  std::cout << " no flag set!" << std::endl;
417  return;
418  }
419  int itss = (tracon - 1) / DTConfigTSPhi::NTCTSS + 1;
420  if (itss < 1 || itss > DTConfigTSPhi::NTSSTSM) {
421  std::cout << "DTTSPhi::ignoreSecondTrack: wrong TRACO number: " << tracon;
422  std::cout << " no flag set!" << std::endl;
423  return;
424  }
425  DTTSS *tss = getDTTSS(step, itss);
426  tss->ignoreSecondTrack();
427 
428  int bkmod = config()->TsmStatus().element(0);
429  if (bkmod == 0) { // we are in back-up mode
430 
431  int ntsstsmd = config()->TSSinTSMD(station(), sector());
432  // Get the appropriate TSMD
433  itsmd = (itss - 1) / ntsstsmd + 1;
434  }
435 
436  DTTSM *tsm = getDTTSM(step, itsmd);
437  tsm->ignoreSecondTrack();
438 }

References config(), gather_cfg::cout, BitArray< N >::element(), getDTTSM(), getDTTSS(), DTTSS::ignoreSecondTrack(), DTTSM::ignoreSecondTrack(), DTConfig::NSTEPL, DTConfig::NTCTSS, DTConfigTSPhi::NTSSTSM, DTGeomSupplier::sector(), DTGeomSupplier::station(), DTConfigTSPhi::TsmStatus(), and DTConfigTSPhi::TSSinTSMD().

Referenced by loadTSPhi().

◆ loadTSPhi()

void DTTSPhi::loadTSPhi ( )
private

store DTTracoChip triggers in the DTTSS's

Definition at line 135 of file DTTSPhi.cc.

135  {
136  // clear DTTSSs and DTTSM
137  localClear();
138 
139  if (config()->debug()) {
140  std::cout << "DTTSPhi::loadDTTSPhi called for wheel=" << wheel();
141  std::cout << ", station=" << station();
142  std::cout << ", sector=" << sector() << std::endl;
143  }
144 
145  // loop on all TRACO triggers
146  std::vector<DTTracoTrigData>::const_iterator p;
147  std::vector<DTTracoTrigData>::const_iterator pend = _tracocard->end();
148  for (p = _tracocard->begin(); p != pend; p++) {
149  if (config()->usedTraco(p->tracoNumber()) /*|| config()->usedTraco(p->tracoNumber())==1*/) {
150  int step = p->step();
151  int fs = (p->isFirst()) ? 1 : 2;
152 
153  // if first track is found inhibit second track processing in previous BX
154  if (fs == 1 && step > DTConfigTSPhi::NSTEPF)
155  ignoreSecondTrack(step - 1, p->tracoNumber());
156 
157  // load trigger
158  addTracoT(step, &(*p), fs);
159  }
160  }
161 }

References _tracocard, addTracoT(), DTCache< T, Coll >::begin(), config(), gather_cfg::cout, debug, DTCache< T, Coll >::end(), ignoreSecondTrack(), localClear(), DTConfig::NSTEPF, AlCaHLTBitMon_ParallelJobs::p, DTGeomSupplier::sector(), DTGeomSupplier::station(), DTConfigTSPhi::usedTraco(), and DTGeomSupplier::wheel().

Referenced by reconstruct().

◆ localClear()

void DTTSPhi::localClear ( )
private

Clear.

Definition at line 96 of file DTTSPhi.cc.

96  {
97  for (int is = 0; is < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1; is++) {
98  // clear buffer
99  std::vector<DTTSCand *>::iterator p1;
100  for (p1 = _tctrig[is].begin(); p1 != _tctrig[is].end(); p1++) {
101  delete (*p1);
102  }
103  _tctrig[is].clear();
104 
105  std::vector<DTTSS *>::iterator ptss;
106  for (ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++) {
107  (*ptss)->clear();
108  }
109  // clear all DTTSM
110  std::vector<DTTSM *>::iterator ptsm;
111  for (ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++) {
112  (*ptsm)->clear();
113  }
114  }
115 }

References _tctrig, _tsm, _tss, DTCache< T, Coll >::begin(), DTConfig::NSTEPF, DTConfig::NSTEPL, and p1.

Referenced by loadTSPhi(), and ~DTTSPhi().

◆ localDirection()

LocalVector DTTSPhi::localDirection ( const DTTrigData tr) const
overridevirtual

Local direction in chamber of a trigger-data object.

Implements DTGeomSupplier.

Definition at line 504 of file DTTSPhi.cc.

504  {
505  DTChambPhSegm *trig = dynamic_cast<DTChambPhSegm *>(const_cast<DTTrigData *>(tr));
506  // const DTChambPhSegm* trig = dynamic_cast<const DTChambPhSegm*>(tr);
507  if (!trig) {
508  std::cout << "DTTSPhi::LocalDirection called with wrong argument!" << std::endl;
509  return LocalVector(0, 0, 0);
510  }
511  return _tracocard->localDirection(trig->tracoTrig());
512 }

References _tracocard, gather_cfg::cout, DTTracoCard::localDirection(), and ClusterTask_cfi::trig.

◆ localPosition()

LocalPoint DTTSPhi::localPosition ( const DTTrigData tr) const
overridevirtual

Local position in chamber of a trigger-data object.

Implements DTGeomSupplier.

Definition at line 492 of file DTTSPhi.cc.

492  {
493  //@@ patch for Sun 4.2 compiler
494  // sm DTChambPhSegm* trig =
495  // dynamic_cast<DTChambPhSegm*>(const_cast<DTTrigData*>(tr));
496  const DTChambPhSegm *trig = dynamic_cast<const DTChambPhSegm *>(tr);
497  if (!trig) {
498  std::cout << "DTTSPhi::LocalPosition called with wrong argument!" << std::endl;
499  return LocalPoint(0, 0, 0);
500  }
501  return _tracocard->localPosition(trig->tracoTrig());
502 }

References _tracocard, gather_cfg::cout, DTTracoCard::localPosition(), and ClusterTask_cfi::trig.

◆ nSegm()

int DTTSPhi::nSegm ( int  step)

Return number of DTTSPhi segments.

Definition at line 473 of file DTTSPhi.cc.

473  {
474  int n = 0;
475  std::vector<DTChambPhSegm>::const_iterator p; // p=0;
476  for (p = begin(); p < end(); p++) {
477  if (p->step() == step)
478  n++;
479  }
480  return n;
481 }

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

Referenced by DTSCTrigUnit::nPhiSegm().

◆ reconstruct()

void DTTSPhi::reconstruct ( )
inlineoverridevirtual

Load TRACO triggers and run TSPhi algorithm.

Reimplemented from DTCache< T, Coll >.

Definition at line 80 of file DTTSPhi.h.

80  {
81  loadTSPhi();
82  runTSPhi();
83  }

References loadTSPhi(), and runTSPhi().

Referenced by DTTrig::triggerReco().

◆ runTSPhi()

void DTTSPhi::runTSPhi ( )
private

run DTTSPhi algorithm (DTTSS+DTTSM)

Definition at line 217 of file DTTSPhi.cc.

217  {
218  DTTSCand *secondPrevBx = nullptr; // new DTTSCand;
219 
220  bool existSecondPrevBx = false;
221  int itsmd = 1; // initialize it to 1, default value if not in back up mode
223  int i_tsmd;
224 
225  for (int is = DTConfigTSPhi::NSTEPF; is < DTConfigTSPhi::NSTEPL + 1; is++) {
226  // loop on DTTSSs
227  int ntss = 0;
228  i_tsmd = 0;
229  ntsm[is - DTConfigTSPhi::NSTEPF][0] = 0; // counter to make sector collector run if at least a tsm
230  ntsm[is - DTConfigTSPhi::NSTEPF][1] = 0;
231  std::vector<DTTSS *>::iterator p;
232  for (p = _tss[is - DTConfigTSPhi::NSTEPF].begin(); p < _tss[is - DTConfigTSPhi::NSTEPF].end(); p++) {
233  if ((*p)->nTracoT(1) > 0) {
234  // run DTTSS algorithm on non-empty DTTSSs
235  (*p)->run();
236  // load DTTSM with output DTTSS tracks
237  if ((*p)->nTracks() > 0) {
238  for (int it = 1; it <= (*p)->nTracks(); it++) {
239  //--- SM double TSM get the corresponding tsm data
240  int bkmod = config()->TsmStatus().element(0);
241  if (bkmod == 0) { // we are in back-up mode
242  int my_itss = (*p)->number(); // metodo di DTTSS che ritorna itss
243  int ntsstsmd = config()->TSSinTSMD(station(), sector());
244  if (ntsstsmd < 2 || ntsstsmd > DTConfigTSPhi::NTSSTSMD) {
245  std::cout << " DTTSPhi::addTracoT - wrong TSMD: " << ntsstsmd << std::endl;
246  }
247 
248  // Get the appropriate TSMD
249  itsmd = (my_itss - 1) / ntsstsmd + 1;
250  if (config()->debug()) {
251  std::cout << " DTTSPhi::addTracoT: itsmd = (my_itss -1 ) / "
252  "ntsstsmd + 1 ---> my_itss = "
253  << my_itss << " ntsstsmd = " << ntsstsmd << " itsmd = " << itsmd << std::endl;
254  }
255  } else if (bkmod == 1) {
256  itsmd = 1; // initialize it to 1, default value if not in back up mode
257  }
258  if (itsmd > 2)
259  std::cout << "****** >DTTSPhi::RunTSPhi wrong itsmd = " << itsmd << std::endl;
260  DTTSM *tsm = getDTTSM(is, itsmd);
261  tsm->addCand((*p)->getTrack(it));
262  }
263  ntss++;
264  } // end loop on output DTTSS tracks
265  }
266  } // end loop on DTTSSs
267 
268  // at least a DTTSS with signal. Run DTTSM
269 
270  std::vector<DTTSM *>::iterator p_tsm;
271 
272  for (p_tsm = _tsm[is - DTConfigTSPhi::NSTEPF].begin(); p_tsm < _tsm[is - DTConfigTSPhi::NSTEPF].end(); p_tsm++) {
273  // Run TSM sorting if at least a first track
274 
275  i_tsmd = (*p_tsm)->number() - 1; // returns itsmd (0 in default, 0 or 1 when bkmode )
276 
277  if ((*p_tsm)->nCand(1) > 0) {
278  int bkmod = config()->TsmStatus().element(0);
279 
280  (*p_tsm)->run(bkmod); // bkmod 1 normal, 0 backup
281  // Run TSM for current BX in case of 1st Tracks
282  // Run TSM for previous BX for second tracks, to check whether there is
283  // a pile up Tells whether a second track at previous BX exists
284 
285  if ((*p_tsm)->nTracks() > 0) {
286  // We have a first track. Store it if code is > 0
287 
288  if ((*p_tsm)->getTrack(1)->tracoTr()->code() > 0) {
289  DTTSCand *first = (*p_tsm)->getTrack(1);
290  if (config()->TsmGetCarryFlag() == 0) { // get 1st tk at current BX and ignore any 2nd tk at
291  // previous BX
292 
293  _cache.push_back(DTChambPhSegm(ChamberId(), is, (*p_tsm)->getTrack(1)->tracoTr(), 1));
294  ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]++; // SM increment ntsm at current BX
295  if (config()->debug())
296  std::cout << "ntsm = " << ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd] << " is = " << is
297  << " i_tsmd = " << i_tsmd << std::endl;
298  if ((*p_tsm)->nTracks() > 1) { // there is a 2nd tk
299  if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) { // check if its code > 0
300  ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]++;
301  if (config()->debug())
302  std::cout << "ntsm = " << ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd] << " is = " << is
303  << " i_tsmd = " << i_tsmd << std::endl;
304 
305  secondPrevBx = (*p_tsm)->getTrack(2); // assign second tk of previous BX
306  }
307  }
308  } else if (config()->TsmGetCarryFlag() == 1) { // compare with 2nd tk in previous BX and get the tk
309  // with better quality
310  existSecondPrevBx =
311  ((is - 1 - DTConfigTSPhi::NSTEPF >= 0) && (ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] > 1) &&
312  (secondPrevBx->tracoTr()->code() > 0));
313  if ((!existSecondPrevBx) ||
314  !((secondPrevBx->isCorr() && secondPrevBx->isHtrig() && secondPrevBx->isInner()) ||
315  (secondPrevBx->isCorr() && secondPrevBx->isHtrig() && !secondPrevBx->isInner()) ||
316  (!secondPrevBx->isCorr() && secondPrevBx->isHtrig() && secondPrevBx->isInner())) ||
317 
318  ((secondPrevBx->isCorr() && secondPrevBx->isHtrig() && secondPrevBx->isInner()) &&
319  (first->isCorr() && first->isHtrig() && first->isInner())) ||
320 
321  ((secondPrevBx->isCorr() && secondPrevBx->isHtrig() && !secondPrevBx->isInner()) &&
322  ((first->isCorr() && first->isHtrig() && first->isInner()) ||
323  (first->isCorr() && first->isHtrig() && !first->isInner()))) ||
324 
325  ((!secondPrevBx->isCorr() && secondPrevBx->isHtrig() && secondPrevBx->isInner()) &&
326  !((!first->isCorr() && first->isHtrig() && !first->isInner()) ||
327  (!first->isCorr() && !first->isHtrig() && first->isInner()) ||
328  (!first->isCorr() && !first->isHtrig() && !first->isInner()) ||
329  (first->isCorr() && !first->isHtrig() && !first->isInner()) ||
330  (first->isCorr() && !first->isHtrig() && first->isInner())))) {
331  // SM sector collector
332  ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]++; // SM increment ntsm at current BX. I need to
333  // know if there is at least a first track from
334  // TSM to run Sect Coll
335 
336  _cache.push_back(DTChambPhSegm(ChamberId(), is, (*p_tsm)->getTrack(1)->tracoTr(), 1));
337  // (*p_tsm)->getTrack(1)->print();
338 
339  if ((*p_tsm)->nTracks() > 1) { // there is a 2nd tk
340  ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]++;
341  if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) { // check if its code > 0
342  secondPrevBx = (*p_tsm)->getTrack(2); // assign second previous BX
343  }
344  }
345  } else { // if 2nd tk prev BX is better than first present BX skip
346  // the event and get 2nd prev BX
347  ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd]++; // SM increment ntsm at previous BX.
348  _cache.push_back(DTChambPhSegm(ChamberId(), is - 1, secondPrevBx->tracoTr(), 2));
349  // secondPrevBx->print();
350  }
351  }
352 
353  else if (config()->TsmGetCarryFlag() == 2) { // neglect first tk if it is a low uncorrelated
354  // trigger
355  existSecondPrevBx =
356  ((is - 1 - DTConfigTSPhi::NSTEPF >= 0) && (ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] > 1) &&
357  (secondPrevBx->tracoTr()->code() > 0));
358  if ((!existSecondPrevBx) || first->isHtrig() || first->isCorr()) {
359  ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]++; // SM increment ntsm at current BX.
360  // SM sector collector: Load DTSectColl with output of DTTSM
361  _cache.push_back(DTChambPhSegm(ChamberId(), is, (*p_tsm)->getTrack(1)->tracoTr(), 1));
362  // (*p_tsm)->getTrack(1)->print();
363 
364  if ((*p_tsm)->nTracks() > 1) { // there is a 2nd tk
365  ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]++;
366  if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) { // check if its code > 0
367  secondPrevBx = (*p_tsm)->getTrack(2); // assign second tk of previous BX
368  }
369  }
370  } else {
371  ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd]++; // SM increment ntsm at previous BX.
372  _cache.push_back(DTChambPhSegm(ChamberId(), is - 1, secondPrevBx->tracoTr(), 2));
373  // secondPrevBx->print();
374  }
375  }
376  }
377  }
378 
379  } else if (((*p_tsm)->nCand(1) == 0) && (is - 1 - DTConfigTSPhi::NSTEPF >= 0) &&
380  ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] >
381  0) { // it means that the last BX with sort 2 was not the
382  // previous one
383  existSecondPrevBx =
384  ((is - 1 - DTConfigTSPhi::NSTEPF >= 0) && (ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] > 1) &&
385  (secondPrevBx->tracoTr()->code() > 0));
386  if (existSecondPrevBx) {
387  _cache.push_back(DTChambPhSegm(ChamberId(), is - 1, secondPrevBx->tracoTr(), 2));
388 
389  // secondPrevBx->print();
390  }
391  }
392  }
393  //---
394 
395  } // end loop on step
396  // debugging...
397  if (config()->debug()) {
398  if (!_cache.empty()) {
399  std::cout << "====================================================" << std::endl;
400  std::cout << " Phi segments " << std::endl;
401  std::vector<DTChambPhSegm>::const_iterator p;
402  for (p = _cache.begin(); p < _cache.end(); p++) {
403  p->print();
404  }
405  std::cout << "====================================================" << std::endl;
406  }
407  }
408  // end debugging
409 }

References DTCache< T, Coll >::_cache, _tsm, _tss, DTTSM::addCand(), DTCache< T, Coll >::begin(), DTGeomSupplier::ChamberId(), DTTracoTrigData::code(), config(), gather_cfg::cout, DTConfigTSPhi::debug(), BitArray< N >::element(), first, getDTTSM(), DTTSCand::isCorr(), DTTSCand::isHtrig(), DTTSCand::isInner(), DTConfig::NSTEPF, DTConfig::NSTEPL, DTConfigTSPhi::NTSMD, DTConfigTSPhi::NTSSTSMD, AlCaHLTBitMon_ParallelJobs::p, DTGeomSupplier::sector(), DTGeomSupplier::station(), DTTSCand::tracoTr(), DTConfigTSPhi::TsmGetCarryFlag(), DTConfigTSPhi::TsmStatus(), and DTConfigTSPhi::TSSinTSMD().

Referenced by reconstruct().

◆ segment()

const DTChambPhSegm * DTTSPhi::segment ( int  step,
unsigned  n 
)

Return the requested DTTSPhi segment.

Definition at line 483 of file DTTSPhi.cc.

483  {
484  std::vector<DTChambPhSegm>::const_iterator p; // p=0;
485  for (p = begin(); p < end(); p++) {
486  if (p->step() == step && ((n == 1 && p->isFirst()) || (n == 2 && !p->isFirst())))
487  return &(*p); // p;
488  }
489  return nullptr;
490 }

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

Referenced by DTSCTrigUnit::phiSegment().

◆ setConfig()

void DTTSPhi::setConfig ( const DTConfigManager conf)

Set configuration.

Definition at line 117 of file DTTSPhi.cc.

117  {
118  DTChamberId sid = ChamberId();
119  _config = conf->getDTConfigTSPhi(sid);
120 
121  for (int is = 0; is < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1; is++) {
122  // set TSS config
123  std::vector<DTTSS *>::iterator ptss;
124  for (ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++) {
125  (*ptss)->setConfig(config());
126  }
127  // set TSM config
128  std::vector<DTTSM *>::iterator ptsm;
129  for (ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++) {
130  (*ptsm)->setConfig(config());
131  }
132  }
133 }

References _config, _tsm, _tss, DTCache< T, Coll >::begin(), DTGeomSupplier::ChamberId(), config(), DTConfigManager::getDTConfigTSPhi(), DTConfig::NSTEPF, and DTConfig::NSTEPL.

Referenced by DTSCTrigUnit::setConfig().

Member Data Documentation

◆ _config

const DTConfigTSPhi* DTTSPhi::_config
private

Definition at line 112 of file DTTSPhi.h.

Referenced by config(), and setConfig().

◆ _tctrig

std::vector<DTTSCand *> DTTSPhi::_tctrig[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
private

Definition at line 120 of file DTTSPhi.h.

Referenced by addTracoT(), and localClear().

◆ _tracocard

DTTracoCard* DTTSPhi::_tracocard
private

Definition at line 110 of file DTTSPhi.h.

Referenced by loadTSPhi(), localDirection(), and localPosition().

◆ _tsm

std::vector<DTTSM *> DTTSPhi::_tsm[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
private

Definition at line 117 of file DTTSPhi.h.

Referenced by DTTSPhi(), getDTTSM(), localClear(), runTSPhi(), setConfig(), and ~DTTSPhi().

◆ _tss

std::vector<DTTSS *> DTTSPhi::_tss[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
private

Definition at line 115 of file DTTSPhi.h.

Referenced by DTTSPhi(), getDTTSS(), localClear(), runTSPhi(), setConfig(), and ~DTTSPhi().

DTTracoTrigData::tracoNumber
int tracoNumber() const
Return parent TRACO number.
Definition: DTTracoTrigData.h:159
DTTSPhi::runTSPhi
void runTSPhi()
run DTTSPhi algorithm (DTTSS+DTTSM)
Definition: DTTSPhi.cc:217
mps_fire.i
i
Definition: mps_fire.py:428
DTTSCand
Definition: DTTSCand.h:35
DTConfigTSPhi::NTSMD
static const int NTSMD
Constant: number of TSMD.
Definition: DTConfigTSPhi.h:42
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
DTCache::size
int size() const
Get cache vector's size.
Definition: DTCache.h:44
step
step
Definition: StallMonitor.cc:94
DTTSPhi::getDTTSS
DTTSS * getDTTSS(int step, unsigned n) const
Definition: DTTSPhi.cc:440
DTTSPhi::_config
const DTConfigTSPhi * _config
Definition: DTTSPhi.h:112
DTTracoCard::localDirection
LocalVector localDirection(const DTTrigData *) const override
NEWGEO Local direction in chamber of a trigger-data object.
Definition: DTTracoCard.cc:403
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos
Definition: PixelAliasList.h:18
DTTracoTrigData::pvCode
int pvCode() const
Return the preview code.
Definition: DTTracoTrigData.h:186
DTTSS::number
int number() const
Return identifier.
Definition: DTTSS.h:66
DTTSCand::isInner
int isInner() const
Return Inner/Outer bit.
Definition: DTTSCand.h:104
DTConfig::NSTEPL
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
DTConfigTSPhi::TsmGetCarryFlag
int TsmGetCarryFlag() const
Handling of second track (carry) in case of pile-up, in TSM.
Definition: DTConfigTSPhi.h:129
DTConfig::NSTEPF
static const int NSTEPF
Definition: DTConfig.h:35
DTTSS
Definition: DTTSS.h:36
DTTSPhi::_tsm
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:117
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
DTCache::begin
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
DTTSPhi::localClear
void localClear()
Clear.
Definition: DTTSPhi.cc:96
DTGeomSupplier::ChamberId
DTChamberId ChamberId() const
Identifier of the associated chamber.
Definition: DTGeomSupplier.h:57
DTGeomSupplier::sector
int sector() const
Return sector number.
Definition: DTGeomSupplier.h:66
DTTSPhi::loadTSPhi
void loadTSPhi()
store DTTracoChip triggers in the DTTSS's
Definition: DTTSPhi.cc:135
DTTSPhi::ignoreSecondTrack
void ignoreSecondTrack(int step, int tracon)
Set a flag to ignore second tracks (if first track at following BX)
Definition: DTTSPhi.cc:411
DTTSS::addDTTSCand
void addDTTSCand(DTTSCand *cand)
Add a TS candidate to the TSS, ifs is first/second track flag.
Definition: DTTSS.cc:274
debug
#define debug
Definition: HDRShower.cc:19
DTCache::_cache
my_collection _cache
Definition: DTCache.h:53
DTTSCand::isCorr
int isCorr() const
Return correlation bit.
Definition: DTTSCand.h:107
BitArray::element
int element(const int pos) const
Definition: BitArray.h:206
DTConfigTSPhi::usedTraco
bool usedTraco(int i) const
Enabled TRACOs in TS.
Definition: DTConfigTSPhi.h:132
DTConfigTSPhi::NTSSTSM
static const int NTSSTSM
Constant: maximum number of TSS in input to the TSM.
Definition: DTConfigTSPhi.h:39
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
DTGeomSupplier::wheel
int wheel() const
Return wheel number.
Definition: DTGeomSupplier.h:60
DTTSPhi::_tracocard
DTTracoCard * _tracocard
Definition: DTTSPhi.h:110
DTTSPhi::config
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:62
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DTConfig::NTCTSS
static const int NTCTSS
Constant: number of TRACOs in input to a TSS.
Definition: DTConfig.h:40
DTConfigTSPhi::TSSinTSMD
int TSSinTSMD(int stat, int sect) const
Return the max nb. of TSSs in input to a single TSMD (called ONLY in back-up mode)
Definition: DTConfigTSPhi.cc:378
cand
Definition: decayParser.h:32
DTCache::end
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
LocalVector
Local3DVector LocalVector
Definition: LocalVector.h:12
DTGeomSupplier::DTGeomSupplier
DTGeomSupplier(DTTrigGeom *geom)
Constructor.
Definition: DTGeomSupplier.h:45
p1
double p1[4]
Definition: TauolaWrapper.h:89
DTTSCand::tracoTr
const DTTracoTrigData * tracoTr() const
Return associated TRACO trigger.
Definition: DTTSCand.h:84
DTTracoTrigData::print
void print() const override
print
Definition: DTTracoTrigData.cc:62
ClusterTask_cfi.trig
trig
Definition: ClusterTask_cfi.py:398
DTTSPhi::_tctrig
std::vector< DTTSCand * > _tctrig[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:120
DTTSM::addCand
void addCand(DTTSCand *cand)
Add a TSS candidate to the TSM, ifs is first/second track flag.
Definition: DTTSM.cc:256
DTTSPhi::addTracoT
void addTracoT(int step, const DTTracoTrigData *tracotrig, int ifs)
Definition: DTTSPhi.cc:163
DTTracoTrigData::code
int code() const
Return trigger code.
Definition: DTTracoTrigData.h:165
DTTSM::ignoreSecondTrack
void ignoreSecondTrack()
Set a flag to skip sort2.
Definition: DTTSM.h:57
DTConfigTSPhi::TsmStatus
BitArray< 8 > TsmStatus() const
TSM status.
Definition: DTConfigTSPhi.h:135
DTChambPhSegm
Definition: DTChambPhSegm.h:41
DTGeomSupplier::station
int station() const
Return station number.
Definition: DTGeomSupplier.h:63
DTTSCand::isHtrig
int isHtrig() const
Return HTRIG/LTRIG bit.
Definition: DTTSCand.h:102
DTTracoCard::localPosition
LocalPoint localPosition(const DTTrigData *) const override
NEWGEO Local position in chamber of a trigger-data object.
Definition: DTTracoCard.cc:351
DTConfigManager::getDTConfigTSPhi
const DTConfigTSPhi * getDTConfigTSPhi(DTChamberId) const
Get desired Trigger Server Phi configuration.
Definition: DTConfigManager.cc:127
DTGeomSupplier::geom
DTTrigGeom * geom() const
Associated geometry.
Definition: DTGeomSupplier.h:51
DTChamberId
Definition: DTChamberId.h:14
DTTSPhi::_tss
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:115
DTTSS::ignoreSecondTrack
void ignoreSecondTrack()
Set a flag to skip sort2.
Definition: DTTSS.h:51
DTConfigTSPhi::debug
bool debug() const
Return the debug flag.
Definition: DTConfigTSPhi.h:60
DTTSM
Definition: DTTSM.h:38
DTTSPhi::getDTTSM
DTTSM * getDTTSM(int step, unsigned n) const
Definition: DTTSPhi.cc:457
DTConfigTSPhi::NTSSTSMD
static const int NTSSTSMD
Constant: maximum number of TSS in input to a single TSMD.
Definition: DTConfigTSPhi.h:45