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 ( DTTrigGeom geom,
DTTracoCard tracocard 
)

Constructor.

Definition at line 44 of file DTTSPhi.cc.

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

45  : DTGeomSupplier(geom), _tracocard(tracocard) {
46 
47  // reserve the appropriate amount of space for vectors
48  int i = 0;
49  for (i = 0; i < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1;
50  i++) { // SM add + 1
51  _tss[i].reserve(DTConfigTSPhi::NTSSTSM);
52  // DBSM-doubleTSM
53  _tsm[i].reserve(DTConfigTSPhi::NTSMD);
54  }
55 
56  for (int is = 0; is < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1;
57  is++) {
58 
59  // create DTTSSs
60  for (int itss = 1; itss <= DTConfigTSPhi::NTSSTSM; itss++) {
61  DTTSS *tss = new DTTSS(itss);
62  _tss[is].push_back(tss);
63  }
64 
65  // create DTTSMs SM double TSM
66  for (int itsmd = 1; itsmd <= DTConfigTSPhi::NTSMD; itsmd++) {
67  DTTSM *tsm = new DTTSM(itsmd);
68  _tsm[is].push_back(tsm);
69  }
70  }
71 }
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:118
static const int NSTEPF
Definition: DTConfig.h:36
static const int NTSSTSM
Constant: maximum number of TSS in input to the TSM.
Definition: DTConfigTSPhi.h:42
Definition: DTTSM.h:38
static const int NTSMD
Constant: number of TSMD.
Definition: DTConfigTSPhi.h:45
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
DTTracoCard * _tracocard
Definition: DTTSPhi.h:111
DTGeomSupplier(DTTrigGeom *geom)
Constructor.
Definition: DTTSS.h:36
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:116
DTTSPhi::~DTTSPhi ( )
override

Destructor.

Definition at line 76 of file DTTSPhi.cc.

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

76  {
77 
78  std::vector<DTTSS *>::iterator ptss;
79  std::vector<DTTSM *>::iterator ptsm;
80  for (int is = 0; is < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1;
81  is++) {
82  // clear TSSs
83  for (ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++) {
84  delete (*ptss);
85  }
86  _tss[is].clear();
87  // clear TSMs
88  for (ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++) {
89  delete (*ptsm);
90  }
91  _tsm[is].clear();
92  }
93 
94  localClear();
95 
96  // delete _config;
97 }
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:118
static const int NSTEPF
Definition: DTConfig.h:36
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
void localClear()
Clear.
Definition: DTTSPhi.cc:103
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:116

Member Function Documentation

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 177 of file DTTSPhi.cc.

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(), and reconstruct().

177  {
179  std::cout << "DTTSPhi::addTracoT: step out of range: " << step;
180  std::cout << " trigger not added!" << std::endl;
181  return;
182  }
183  // Check that a preview is present and code is not zero
184  if (!tracotrig->pvCode() || !tracotrig->code()) {
185  std::cout << "DTTSPhi::addTracoT: preview not present in TRACO trigger or "
186  "its code=0 ";
187  std::cout << " trigger not added!" << std::endl;
188  return;
189  }
190 
191  // Get the appropriate TSS
192  int itss = (tracotrig->tracoNumber() - 1) / DTConfigTSPhi::NTCTSS + 1;
193  if (itss < 1 || itss > DTConfigTSPhi::NTSSTSM) {
194  std::cout << "DTTSPhi::addTracoT: wrong TRACO number: ";
195  std::cout << tracotrig->tracoNumber();
196  std::cout << " trigger not added!" << std::endl;
197  return;
198  }
199 
200  // TSM status check (if it is the case, reject TRACO triggers related to
201  // broken TSMData)
202  if (config()->TsmStatus().element(itss) == 0) { // TSMD broken
203  return;
204  }
205 
206  int pos = tracotrig->tracoNumber() - (itss - 1) * DTConfigTSPhi::NTCTSS;
207  DTTSS *tss = getDTTSS(step, itss);
208 
209  // Create a new Trigger Server candidate
210  DTTSCand *cand = new DTTSCand(tss, tracotrig, ifs, pos);
211 
212  // Add it to the buffer and to the TSS
213  _tctrig[step - DTConfigTSPhi::NSTEPF].push_back(cand);
214  tss->addDTTSCand(cand);
215 
216  // Debugging...
217  if (config()->debug()) {
218  std::cout << "DTTSPhi::addTracoT at step " << step;
219  if (ifs == 1) {
220  std::cout << " (first track)";
221  } else {
222  std::cout << " (second track)";
223  }
224  std::cout << " from TRACO " << tracotrig->tracoNumber();
225  std::cout << " to TSS " << tss->number() << ", position=" << pos
226  << std::endl;
227  tracotrig->print();
228  }
229  // end debugging
230 }
void addDTTSCand(DTTSCand *cand)
Add a TS candidate to the TSS, ifs is first/second track flag.
Definition: DTTSS.cc:283
static const int NSTEPF
Definition: DTConfig.h:36
int tracoNumber() const
Return parent TRACO number.
static const int NTSSTSM
Constant: maximum number of TSS in input to the TSM.
Definition: DTConfigTSPhi.h:42
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:63
void print() const override
print
static const int NTCTSS
Constant: number of TRACOs in input to a TSS.
Definition: DTConfig.h:41
DTTSS * getDTTSS(int step, unsigned n) const
Definition: DTTSPhi.cc:511
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
int pvCode() const
Return the preview code.
#define debug
Definition: HDRShower.cc:19
std::vector< DTTSCand * > _tctrig[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:122
Definition: DTTSS.h:36
int code() const
Return trigger code.
int number() const
Return identifier.
Definition: DTTSS.h:67
step
Definition: StallMonitor.cc:94
const DTConfigTSPhi* DTTSPhi::config ( void  ) const
inline

Return the configuration class.

Definition at line 63 of file DTTSPhi.h.

References _config, localDirection(), localPosition(), gen::n, nSegm(), segment(), and setConfig().

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

63 { return _config; }
const DTConfigTSPhi * _config
Definition: DTTSPhi.h:113
DTTSM * DTTSPhi::getDTTSM ( int  step,
unsigned  n 
) const
private

Definition at line 529 of file DTTSPhi.cc.

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

Referenced by ignoreSecondTrack(), reconstruct(), and runTSPhi().

529  {
531  std::cout << "DTTSPhi::getDTTSM: step out of range: " << step;
532  std::cout << " empty pointer returned!" << std::endl;
533  return nullptr;
534  }
535  if (n < 1 || n > _tsm[step - DTConfigTSPhi::NSTEPF].size()) {
536  std::cout << "DTTSPhi::getDTTSM: requested DTTSM not present: " << n;
537  std::cout << " (at step " << step << ")";
538  std::cout << " empty pointer returned!" << std::endl;
539  return nullptr;
540  }
541  std::vector<DTTSM *>::const_iterator p_tsm =
542  _tsm[step - DTConfigTSPhi::NSTEPF].begin() + n - 1;
543  return *p_tsm;
544 }
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:118
static const int NSTEPF
Definition: DTConfig.h:36
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
step
Definition: StallMonitor.cc:94
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:44
DTTSS * DTTSPhi::getDTTSS ( int  step,
unsigned  n 
) const
private

Definition at line 511 of file DTTSPhi.cc.

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

Referenced by addTracoT(), ignoreSecondTrack(), and reconstruct().

511  {
513  std::cout << "DTTSPhi::getDTTSS: step out of range: " << step;
514  std::cout << " empty pointer returned!" << std::endl;
515  return nullptr;
516  }
517  if (n < 1 || n > _tss[step - DTConfigTSPhi::NSTEPF].size()) {
518  std::cout << "DTTSPhi::getDTTSS: requested DTTSS not present: " << n;
519  std::cout << " (at step " << step << ")";
520  std::cout << " empty pointer returned!" << std::endl;
521  return nullptr;
522  }
523 
524  std::vector<DTTSS *>::const_iterator p =
525  _tss[step - DTConfigTSPhi::NSTEPF].begin() + n - 1;
526  return *p;
527 }
static const int NSTEPF
Definition: DTConfig.h:36
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:116
step
Definition: StallMonitor.cc:94
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:44
void DTTSPhi::ignoreSecondTrack ( int  step,
int  tracon 
)
private

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

Definition at line 481 of file DTTSPhi.cc.

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(), and reconstruct().

481  {
482 
483  int itsmd = 1; // initialize it to default
484 
486  std::cout << "DTTSPhi::ignoreSecondTrack: step out of range: " << step;
487  std::cout << " no flag set!" << std::endl;
488  return;
489  }
490  int itss = (tracon - 1) / DTConfigTSPhi::NTCTSS + 1;
491  if (itss < 1 || itss > DTConfigTSPhi::NTSSTSM) {
492  std::cout << "DTTSPhi::ignoreSecondTrack: wrong TRACO number: " << tracon;
493  std::cout << " no flag set!" << std::endl;
494  return;
495  }
496  DTTSS *tss = getDTTSS(step, itss);
497  tss->ignoreSecondTrack();
498 
499  int bkmod = config()->TsmStatus().element(0);
500  if (bkmod == 0) { // we are in back-up mode
501 
502  int ntsstsmd = config()->TSSinTSMD(station(), sector());
503  // Get the appropriate TSMD
504  itsmd = (itss - 1) / ntsstsmd + 1;
505  }
506 
507  DTTSM *tsm = getDTTSM(step, itsmd);
508  tsm->ignoreSecondTrack();
509 }
void ignoreSecondTrack()
Set a flag to skip sort2.
Definition: DTTSS.h:52
int sector() const
Return sector number.
static const int NTSSTSM
Constant: maximum number of TSS in input to the TSM.
Definition: DTConfigTSPhi.h:42
int station() const
Return station number.
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:63
static const int NTCTSS
Constant: number of TRACOs in input to a TSS.
Definition: DTConfig.h:41
Definition: DTTSM.h:38
DTTSS * getDTTSS(int step, unsigned n) const
Definition: DTTSPhi.cc:511
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) ...
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
void ignoreSecondTrack()
Set a flag to skip sort2.
Definition: DTTSM.h:58
int element(const int pos) const
Definition: BitArray.h:210
Definition: DTTSS.h:36
BitArray< 8 > TsmStatus() const
TSM status.
step
Definition: StallMonitor.cc:94
DTTSM * getDTTSM(int step, unsigned n) const
Definition: DTTSPhi.cc:529
void DTTSPhi::loadTSPhi ( )
private

store DTTracoChip triggers in the DTTSS's

Definition at line 146 of file DTTSPhi.cc.

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().

146  {
147 
148  // clear DTTSSs and DTTSM
149  localClear();
150 
151  if (config()->debug()) {
152  std::cout << "DTTSPhi::loadDTTSPhi called for wheel=" << wheel();
153  std::cout << ", station=" << station();
154  std::cout << ", sector=" << sector() << std::endl;
155  }
156 
157  // loop on all TRACO triggers
158  std::vector<DTTracoTrigData>::const_iterator p;
159  std::vector<DTTracoTrigData>::const_iterator pend = _tracocard->end();
160  for (p = _tracocard->begin(); p != pend; p++) {
161 
162  if (config()->usedTraco(
163  p->tracoNumber()) /*|| config()->usedTraco(p->tracoNumber())==1*/) {
164  int step = p->step();
165  int fs = (p->isFirst()) ? 1 : 2;
166 
167  // if first track is found inhibit second track processing in previous BX
168  if (fs == 1 && step > DTConfigTSPhi::NSTEPF)
169  ignoreSecondTrack(step - 1, p->tracoNumber());
170 
171  // load trigger
172  addTracoT(step, &(*p), fs);
173  }
174  }
175 }
int sector() const
Return sector number.
static const int NSTEPF
Definition: DTConfig.h:36
int station() const
Return station number.
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:63
int wheel() const
Return wheel number.
void ignoreSecondTrack(int step, int tracon)
Set a flag to ignore second tracks (if first track at following BX)
Definition: DTTSPhi.cc:481
DTTracoCard * _tracocard
Definition: DTTSPhi.h:111
#define debug
Definition: HDRShower.cc:19
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
void localClear()
Clear.
Definition: DTTSPhi.cc:103
void addTracoT(int step, const DTTracoTrigData *tracotrig, int ifs)
Definition: DTTSPhi.cc:177
step
Definition: StallMonitor.cc:94
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
bool usedTraco(int i) const
Enabled TRACOs in TS.
void DTTSPhi::localClear ( )
private

Clear.

Definition at line 103 of file DTTSPhi.cc.

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

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

103  {
104  for (int is = 0; is < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1;
105  is++) {
106  // clear buffer
107  std::vector<DTTSCand *>::iterator p1;
108  for (p1 = _tctrig[is].begin(); p1 != _tctrig[is].end(); p1++) {
109  delete (*p1);
110  }
111  _tctrig[is].clear();
112 
113  std::vector<DTTSS *>::iterator ptss;
114  for (ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++) {
115  (*ptss)->clear();
116  }
117  // clear all DTTSM
118  std::vector<DTTSM *>::iterator ptsm;
119  for (ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++) {
120  (*ptsm)->clear();
121  }
122  }
123 }
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:118
static const int NSTEPF
Definition: DTConfig.h:36
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
std::vector< DTTSCand * > _tctrig[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:122
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
double p1[4]
Definition: TauolaWrapper.h:89
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:116
LocalVector DTTSPhi::localDirection ( const DTTrigData tr) const
overridevirtual

Local direction in chamber of a trigger-data object.

Implements DTGeomSupplier.

Definition at line 579 of file DTTSPhi.cc.

References _tracocard, gather_cfg::cout, DTTracoCard::localDirection(), and DTChambPhSegm::tracoTrig().

Referenced by config().

579  {
580  DTChambPhSegm *trig =
581  dynamic_cast<DTChambPhSegm *>(const_cast<DTTrigData *>(tr));
582  // const DTChambPhSegm* trig = dynamic_cast<const DTChambPhSegm*>(tr);
583  if (!trig) {
584  std::cout << "DTTSPhi::LocalDirection called with wrong argument!"
585  << std::endl;
586  return LocalVector(0, 0, 0);
587  }
588  return _tracocard->localDirection(trig->tracoTrig());
589 }
Local3DVector LocalVector
Definition: LocalVector.h:12
DTTracoCard * _tracocard
Definition: DTTSPhi.h:111
const DTTracoTrigData * tracoTrig() const
Return associated TRACO trigger.
Definition: DTChambPhSegm.h:72
LocalVector localDirection(const DTTrigData *) const override
NEWGEO Local direction in chamber of a trigger-data object.
Definition: DTTracoCard.cc:428
LocalPoint DTTSPhi::localPosition ( const DTTrigData tr) const
overridevirtual

Local position in chamber of a trigger-data object.

Implements DTGeomSupplier.

Definition at line 566 of file DTTSPhi.cc.

References _tracocard, gather_cfg::cout, DTTracoCard::localPosition(), and DTChambPhSegm::tracoTrig().

Referenced by config().

566  {
567  //@@ patch for Sun 4.2 compiler
568  // sm DTChambPhSegm* trig =
569  // dynamic_cast<DTChambPhSegm*>(const_cast<DTTrigData*>(tr));
570  const DTChambPhSegm *trig = dynamic_cast<const DTChambPhSegm *>(tr);
571  if (!trig) {
572  std::cout << "DTTSPhi::LocalPosition called with wrong argument!"
573  << std::endl;
574  return LocalPoint(0, 0, 0);
575  }
576  return _tracocard->localPosition(trig->tracoTrig());
577 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
DTTracoCard * _tracocard
Definition: DTTSPhi.h:111
const DTTracoTrigData * tracoTrig() const
Return associated TRACO trigger.
Definition: DTChambPhSegm.h:72
LocalPoint localPosition(const DTTrigData *) const override
NEWGEO Local position in chamber of a trigger-data object.
Definition: DTTracoCard.cc:372
int DTTSPhi::nSegm ( int  step)

Return number of DTTSPhi segments.

Definition at line 546 of file DTTSPhi.cc.

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

Referenced by config(), and DTSCTrigUnit::nPhiSegm().

546  {
547  int n = 0;
548  std::vector<DTChambPhSegm>::const_iterator p; // p=0;
549  for (p = begin(); p < end(); p++) {
550  if (p->step() == step)
551  n++;
552  }
553  return n;
554 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
step
Definition: StallMonitor.cc:94
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
void DTTSPhi::reconstruct ( )
inlineoverridevirtual

Load TRACO triggers and run TSPhi algorithm.

Reimplemented from DTCache< T, Coll >.

Definition at line 81 of file DTTSPhi.h.

References addTracoT(), getDTTSM(), getDTTSS(), ignoreSecondTrack(), loadTSPhi(), localClear(), and runTSPhi().

Referenced by DTTrig::triggerReco().

81  {
82  loadTSPhi();
83  runTSPhi();
84  }
void runTSPhi()
run DTTSPhi algorithm (DTTSS+DTTSM)
Definition: DTTSPhi.cc:232
void loadTSPhi()
store DTTracoChip triggers in the DTTSS&#39;s
Definition: DTTSPhi.cc:146
void DTTSPhi::runTSPhi ( )
private

run DTTSPhi algorithm (DTTSS+DTTSM)

Definition at line 232 of file DTTSPhi.cc.

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(), plotBeamSpotDB::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().

232  {
233 
234  DTTSCand *secondPrevBx = nullptr; // new DTTSCand;
235 
236  bool existSecondPrevBx = false;
237  int itsmd = 1; // initialize it to 1, default value if not in back up mode
240  int i_tsmd;
241 
242  for (int is = DTConfigTSPhi::NSTEPF; is < DTConfigTSPhi::NSTEPL + 1; is++) {
243  // loop on DTTSSs
244  int ntss = 0;
245  i_tsmd = 0;
246  ntsm[is - DTConfigTSPhi::NSTEPF][0] =
247  0; // counter to make sector collector run if at least a tsm
248  ntsm[is - DTConfigTSPhi::NSTEPF][1] = 0;
249  std::vector<DTTSS *>::iterator p;
250  for (p = _tss[is - DTConfigTSPhi::NSTEPF].begin();
251  p < _tss[is - DTConfigTSPhi::NSTEPF].end(); p++) {
252  if ((*p)->nTracoT(1) > 0) {
253  // run DTTSS algorithm on non-empty DTTSSs
254  (*p)->run();
255  // load DTTSM with output DTTSS tracks
256  if ((*p)->nTracks() > 0) {
257  for (int it = 1; it <= (*p)->nTracks(); it++) {
258  //--- SM double TSM get the corresponding tsm data
259  int bkmod = config()->TsmStatus().element(0);
260  if (bkmod == 0) { // we are in back-up mode
261  int my_itss = (*p)->number(); // metodo di DTTSS che ritorna itss
262  int ntsstsmd = config()->TSSinTSMD(station(), sector());
263  if (ntsstsmd < 2 || ntsstsmd > DTConfigTSPhi::NTSSTSMD) {
264  std::cout << " DTTSPhi::addTracoT - wrong TSMD: " << ntsstsmd
265  << std::endl;
266  }
267 
268  // Get the appropriate TSMD
269  itsmd = (my_itss - 1) / ntsstsmd + 1;
270  if (config()->debug()) {
271  std::cout << " DTTSPhi::addTracoT: itsmd = (my_itss -1 ) / "
272  "ntsstsmd + 1 ---> my_itss = "
273  << my_itss << " ntsstsmd = " << ntsstsmd
274  << " itsmd = " << itsmd << std::endl;
275  }
276  } else if (bkmod == 1) {
277  itsmd =
278  1; // initialize it to 1, default value if not in back up mode
279  }
280  if (itsmd > 2)
281  std::cout << "****** >DTTSPhi::RunTSPhi wrong itsmd = " << itsmd
282  << std::endl;
283  DTTSM *tsm = getDTTSM(is, itsmd);
284  tsm->addCand((*p)->getTrack(it));
285  }
286  ntss++;
287  } // end loop on output DTTSS tracks
288  }
289  } // end loop on DTTSSs
290 
291  // at least a DTTSS with signal. Run DTTSM
292 
293  std::vector<DTTSM *>::iterator p_tsm;
294 
295  for (p_tsm = _tsm[is - DTConfigTSPhi::NSTEPF].begin();
296  p_tsm < _tsm[is - DTConfigTSPhi::NSTEPF].end(); p_tsm++) {
297 
298  // Run TSM sorting if at least a first track
299 
300  i_tsmd = (*p_tsm)->number() -
301  1; // returns itsmd (0 in default, 0 or 1 when bkmode )
302 
303  if ((*p_tsm)->nCand(1) > 0) {
304  int bkmod = config()->TsmStatus().element(0);
305 
306  (*p_tsm)->run(bkmod); // bkmod 1 normal, 0 backup
307  // Run TSM for current BX in case of 1st Tracks
308  // Run TSM for previous BX for second tracks, to check whether there is
309  // a pile up Tells whether a second track at previous BX exists
310 
311  if ((*p_tsm)->nTracks() > 0) {
312  // We have a first track. Store it if code is > 0
313 
314  if ((*p_tsm)->getTrack(1)->tracoTr()->code() > 0) {
315 
316  DTTSCand *first = (*p_tsm)->getTrack(1);
317  if (config()->TsmGetCarryFlag() ==
318  0) { // get 1st tk at current BX and ignore any 2nd tk at
319  // previous BX
320 
321  _cache.push_back(DTChambPhSegm(
322  ChamberId(), is, (*p_tsm)->getTrack(1)->tracoTr(), 1));
323  ntsm[is - DTConfigTSPhi::NSTEPF]
324  [i_tsmd]++; // SM increment ntsm at current BX
325  if (config()->debug())
326  std::cout << "ntsm = "
327  << ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]
328  << " is = " << is << " i_tsmd = " << i_tsmd
329  << std::endl;
330  if ((*p_tsm)->nTracks() > 1) { // there is a 2nd tk
331  if ((*p_tsm)->getTrack(2)->tracoTr()->code() >
332  0) { // check if its code > 0
333  ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]++;
334  if (config()->debug())
335  std::cout
336  << "ntsm = " << ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]
337  << " is = " << is << " i_tsmd = " << i_tsmd
338  << std::endl;
339 
340  secondPrevBx =
341  (*p_tsm)->getTrack(2); // assign second tk of previous BX
342  }
343  }
344  } else if (config()->TsmGetCarryFlag() ==
345  1) { // compare with 2nd tk in previous BX and get the tk
346  // with better quality
347  existSecondPrevBx =
348  ((is - 1 - DTConfigTSPhi::NSTEPF >= 0) &&
349  (ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] > 1) &&
350  (secondPrevBx->tracoTr()->code() > 0));
351  if ((!existSecondPrevBx) ||
352  !((secondPrevBx->isCorr() && secondPrevBx->isHtrig() &&
353  secondPrevBx->isInner()) ||
354  (secondPrevBx->isCorr() && secondPrevBx->isHtrig() &&
355  !secondPrevBx->isInner()) ||
356  (!secondPrevBx->isCorr() && secondPrevBx->isHtrig() &&
357  secondPrevBx->isInner())) ||
358 
359  ((secondPrevBx->isCorr() && secondPrevBx->isHtrig() &&
360  secondPrevBx->isInner()) &&
361  (first->isCorr() && first->isHtrig() && first->isInner())) ||
362 
363  ((secondPrevBx->isCorr() && secondPrevBx->isHtrig() &&
364  !secondPrevBx->isInner()) &&
365  ((first->isCorr() && first->isHtrig() && first->isInner()) ||
366  (first->isCorr() && first->isHtrig() &&
367  !first->isInner()))) ||
368 
369  ((!secondPrevBx->isCorr() && secondPrevBx->isHtrig() &&
370  secondPrevBx->isInner()) &&
371  !((!first->isCorr() && first->isHtrig() &&
372  !first->isInner()) ||
373  (!first->isCorr() && !first->isHtrig() &&
374  first->isInner()) ||
375  (!first->isCorr() && !first->isHtrig() &&
376  !first->isInner()) ||
377  (first->isCorr() && !first->isHtrig() &&
378  !first->isInner()) ||
379  (first->isCorr() && !first->isHtrig() &&
380  first->isInner())))) {
381  // SM sector collector
382  ntsm[is - DTConfigTSPhi::NSTEPF]
383  [i_tsmd]++; // SM increment ntsm at current BX. I need to
384  // know if there is at least a first track from
385  // TSM to run Sect Coll
386 
387  _cache.push_back(DTChambPhSegm(
388  ChamberId(), is, (*p_tsm)->getTrack(1)->tracoTr(), 1));
389  // (*p_tsm)->getTrack(1)->print();
390 
391  if ((*p_tsm)->nTracks() > 1) { // there is a 2nd tk
392  ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]++;
393  if ((*p_tsm)->getTrack(2)->tracoTr()->code() >
394  0) { // check if its code > 0
395  secondPrevBx =
396  (*p_tsm)->getTrack(2); // assign second previous BX
397  }
398  }
399  } else { // if 2nd tk prev BX is better than first present BX skip
400  // the event and get 2nd prev BX
401  ntsm[is - 1 - DTConfigTSPhi::NSTEPF]
402  [i_tsmd]++; // SM increment ntsm at previous BX.
403  _cache.push_back(DTChambPhSegm(ChamberId(), is - 1,
404  secondPrevBx->tracoTr(), 2));
405  // secondPrevBx->print();
406  }
407  }
408 
409  else if (config()->TsmGetCarryFlag() ==
410  2) { // neglect first tk if it is a low uncorrelated
411  // trigger
412  existSecondPrevBx =
413  ((is - 1 - DTConfigTSPhi::NSTEPF >= 0) &&
414  (ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] > 1) &&
415  (secondPrevBx->tracoTr()->code() > 0));
416  if ((!existSecondPrevBx) || first->isHtrig() || first->isCorr()) {
417  ntsm[is - DTConfigTSPhi::NSTEPF]
418  [i_tsmd]++; // SM increment ntsm at current BX.
419  // SM sector collector: Load DTSectColl with output of DTTSM
420  _cache.push_back(DTChambPhSegm(
421  ChamberId(), is, (*p_tsm)->getTrack(1)->tracoTr(), 1));
422  // (*p_tsm)->getTrack(1)->print();
423 
424  if ((*p_tsm)->nTracks() > 1) { // there is a 2nd tk
425  ntsm[is - DTConfigTSPhi::NSTEPF][i_tsmd]++;
426  if ((*p_tsm)->getTrack(2)->tracoTr()->code() >
427  0) { // check if its code > 0
428  secondPrevBx = (*p_tsm)->getTrack(
429  2); // assign second tk of previous BX
430  }
431  }
432  } else {
433  ntsm[is - 1 - DTConfigTSPhi::NSTEPF]
434  [i_tsmd]++; // SM increment ntsm at previous BX.
435  _cache.push_back(DTChambPhSegm(ChamberId(), is - 1,
436  secondPrevBx->tracoTr(), 2));
437  // secondPrevBx->print();
438  }
439  }
440  }
441  }
442 
443  } else if (((*p_tsm)->nCand(1) == 0) &&
444  (is - 1 - DTConfigTSPhi::NSTEPF >= 0) &&
445  ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] >
446  0) { // it means that the last BX with sort 2 was not the
447  // previous one
448  existSecondPrevBx =
449  ((is - 1 - DTConfigTSPhi::NSTEPF >= 0) &&
450  (ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] > 1) &&
451  (secondPrevBx->tracoTr()->code() > 0));
452  if (existSecondPrevBx) {
453  _cache.push_back(
454  DTChambPhSegm(ChamberId(), is - 1, secondPrevBx->tracoTr(), 2));
455 
456  // secondPrevBx->print();
457  }
458  }
459  }
460  //---
461 
462  } // end loop on step
463  // debugging...
464  if (config()->debug()) {
465  if (!_cache.empty()) {
466  std::cout << "===================================================="
467  << std::endl;
468  std::cout << " Phi segments "
469  << std::endl;
470  std::vector<DTChambPhSegm>::const_iterator p;
471  for (p = _cache.begin(); p < _cache.end(); p++) {
472  p->print();
473  }
474  std::cout << "===================================================="
475  << std::endl;
476  }
477  }
478  // end debugging
479 }
my_collection _cache
Definition: DTCache.h:53
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:118
int sector() const
Return sector number.
int isHtrig() const
Return HTRIG/LTRIG bit.
Definition: DTTSCand.h:103
static const int NSTEPF
Definition: DTConfig.h:36
int station() const
Return station number.
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:63
Definition: DTTSM.h:38
bool debug() const
Return the debug flag.
Definition: DTConfigTSPhi.h:63
static const int NTSMD
Constant: number of TSMD.
Definition: DTConfigTSPhi.h:45
int TsmGetCarryFlag() const
Handling of second track (carry) in case of pile-up, in TSM.
DTChamberId ChamberId() const
Identifier of the associated chamber.
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) ...
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
const DTTracoTrigData * tracoTr() const
Return associated TRACO trigger.
Definition: DTTSCand.h:85
int element(const int pos) const
Definition: BitArray.h:210
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
int isInner() const
Return Inner/Outer bit.
Definition: DTTSCand.h:107
int code() const
Return trigger code.
static const int NTSSTSMD
Constant: maximum number of TSS in input to a single TSMD.
Definition: DTConfigTSPhi.h:48
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:116
BitArray< 8 > TsmStatus() const
TSM status.
void addCand(DTTSCand *cand)
Add a TSS candidate to the TSM, ifs is first/second track flag.
Definition: DTTSM.cc:268
int isCorr() const
Return correlation bit.
Definition: DTTSCand.h:110
DTTSM * getDTTSM(int step, unsigned n) const
Definition: DTTSPhi.cc:529
const DTChambPhSegm * DTTSPhi::segment ( int  step,
unsigned  n 
)

Return the requested DTTSPhi segment.

Definition at line 556 of file DTTSPhi.cc.

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

Referenced by config(), and DTSCTrigUnit::phiSegment().

556  {
557  std::vector<DTChambPhSegm>::const_iterator p; // p=0;
558  for (p = begin(); p < end(); p++) {
559  if (p->step() == step &&
560  ((n == 1 && p->isFirst()) || (n == 2 && !p->isFirst())))
561  return &(*p); // p;
562  }
563  return nullptr;
564 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
step
Definition: StallMonitor.cc:94
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
void DTTSPhi::setConfig ( const DTConfigManager conf)

Set configuration.

Definition at line 125 of file DTTSPhi.cc.

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

Referenced by config(), and DTSCTrigUnit::setConfig().

125  {
126 
127  DTChamberId sid = ChamberId();
128  _config = conf->getDTConfigTSPhi(sid);
129 
130  for (int is = 0; is < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1;
131  is++) {
132 
133  // set TSS config
134  std::vector<DTTSS *>::iterator ptss;
135  for (ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++) {
136  (*ptss)->setConfig(config());
137  }
138  // set TSM config
139  std::vector<DTTSM *>::iterator ptsm;
140  for (ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++) {
141  (*ptsm)->setConfig(config());
142  }
143  }
144 }
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:118
static const int NSTEPF
Definition: DTConfig.h:36
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:63
DTChamberId ChamberId() const
Identifier of the associated chamber.
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
const DTConfigTSPhi * _config
Definition: DTTSPhi.h:113
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:116
const DTConfigTSPhi * getDTConfigTSPhi(DTChamberId) const
Get desired Trigger Server Phi configuration.

Member Data Documentation

const DTConfigTSPhi* DTTSPhi::_config
private

Definition at line 113 of file DTTSPhi.h.

Referenced by config(), and setConfig().

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

Definition at line 122 of file DTTSPhi.h.

Referenced by addTracoT(), and localClear().

DTTracoCard* DTTSPhi::_tracocard
private

Definition at line 111 of file DTTSPhi.h.

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

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

Definition at line 118 of file DTTSPhi.h.

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

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

Definition at line 116 of file DTTSPhi.h.

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