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

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

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

◆ ~DTTSPhi()

DTTSPhi::~DTTSPhi ( )
override

Destructor.

Definition at line 73 of file DTTSPhi.cc.

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

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

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

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

Referenced by loadTSPhi().

164  {
166  edm::LogWarning("DTTSPhi") << "addTracoT: step out of range: " << step << " trigger not added!";
167  return;
168  }
169  // Check that a preview is present and code is not zero
170  if (!tracotrig->pvCode() || !tracotrig->code()) {
171  edm::LogWarning("DTTSPhi") << "addTracoT: preview not present in TRACO trigger or its code=0 "
172  << " trigger not added!";
173  return;
174  }
175 
176  // Get the appropriate TSS
177  int itss = (tracotrig->tracoNumber() - 1) / DTConfigTSPhi::NTCTSS + 1;
178  if (itss < 1 || itss > DTConfigTSPhi::NTSSTSM) {
179  edm::LogWarning("DTTSPhi") << "addTracoT: wrong TRACO number: " << tracotrig->tracoNumber()
180  << " trigger not added!";
181  return;
182  }
183 
184  // TSM status check (if it is the case, reject TRACO triggers related to
185  // broken TSMData)
186  if (config()->TsmStatus().element(itss) == 0) { // TSMD broken
187  return;
188  }
189 
190  int pos = tracotrig->tracoNumber() - (itss - 1) * DTConfigTSPhi::NTCTSS;
191  DTTSS *tss = getDTTSS(step, itss);
192 
193  // Create a new Trigger Server candidate
194  DTTSCand *cand = new DTTSCand(tss, tracotrig, ifs, pos);
195 
196  // Add it to the buffer and to the TSS
197  _tctrig[step - DTConfigTSPhi::NSTEPF].push_back(cand);
198  tss->addDTTSCand(cand);
199 
200  // Debugging...
201  if (config()->debug()) {
202  edm::LogInfo("DTTSPhi") << "addTracoT at step " << step;
203  if (ifs == 1) {
204  edm::LogWarning("DTTSPhi") << " (first track)";
205  } else {
206  edm::LogWarning("DTTSPhi") << " (second track)";
207  }
208  edm::LogWarning("DTTSPhi") << " from TRACO " << tracotrig->tracoNumber() << " to TSS " << tss->number()
209  << ", position=" << pos;
210  tracotrig->print();
211  }
212  // end debugging
213 }
int pvCode() const
Return the preview code.
int number() const
Return identifier.
Definition: DTTSS.h:66
DTTSS * getDTTSS(int step, unsigned n) const
Definition: DTTSPhi.cc:431
void addDTTSCand(DTTSCand *cand)
Add a TS candidate to the TSS, ifs is first/second track flag.
Definition: DTTSS.cc:276
static const int NSTEPF
Definition: DTConfig.h:35
static const int NTSSTSM
Constant: maximum number of TSS in input to the TSM.
Definition: DTConfigTSPhi.h:39
static const int NTCTSS
Constant: number of TRACOs in input to a TSS.
Definition: DTConfig.h:40
int tracoNumber() const
Return parent TRACO number.
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
Log< level::Info, false > LogInfo
#define debug
Definition: HDRShower.cc:19
Definition: DTTSS.h:36
void print() const override
print
std::vector< DTTSCand * > _tctrig[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:120
step
Definition: StallMonitor.cc:83
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:62
Log< level::Warning, false > LogWarning
int code() const
Return trigger code.

◆ config()

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

Return the configuration class.

Definition at line 62 of file DTTSPhi.h.

References _config.

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

62 { return _config; }
const DTConfigTSPhi * _config
Definition: DTTSPhi.h:112

◆ getDTTSM()

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

Definition at line 446 of file DTTSPhi.cc.

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

Referenced by ignoreSecondTrack(), and runTSPhi().

446  {
448  edm::LogWarning("DTTSPhi") << "getDTTSM: step out of range: " << step << " empty pointer returned!";
449  return nullptr;
450  }
451  if (n < 1 || n > _tsm[step - DTConfigTSPhi::NSTEPF].size()) {
452  edm::LogWarning("DTTSPhi") << "getDTTSM: requested DTTSM not present: " << n << " (at step " << step << ")"
453  << " empty pointer returned!";
454  return nullptr;
455  }
456  std::vector<DTTSM *>::const_iterator p_tsm = _tsm[step - DTConfigTSPhi::NSTEPF].begin() + n - 1;
457  return *p_tsm;
458 }
static const int NSTEPF
Definition: DTConfig.h:35
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:44
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:117
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
step
Definition: StallMonitor.cc:83
Log< level::Warning, false > LogWarning

◆ getDTTSS()

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

Definition at line 431 of file DTTSPhi.cc.

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

Referenced by addTracoT(), and ignoreSecondTrack().

431  {
433  edm::LogWarning("DTTSPhi") << "getDTTSS: step out of range: " << step << " empty pointer returned!";
434  return nullptr;
435  }
436  if (n < 1 || n > _tss[step - DTConfigTSPhi::NSTEPF].size()) {
437  edm::LogWarning("DTTSPhi") << "getDTTSS: requested DTTSS not present: " << n << " (at step " << step << ")"
438  << " empty pointer returned!";
439  return nullptr;
440  }
441 
442  std::vector<DTTSS *>::const_iterator p = _tss[step - DTConfigTSPhi::NSTEPF].begin() + n - 1;
443  return *p;
444 }
static const int NSTEPF
Definition: DTConfig.h:35
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:44
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:115
step
Definition: StallMonitor.cc:83
Log< level::Warning, false > LogWarning

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

References config(), 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().

404  {
405  int itsmd = 1; // initialize it to default
406 
408  edm::LogWarning("DTTSPhi") << "ignoreSecondTrack: step out of range: " << step << " no flag set!";
409  return;
410  }
411  int itss = (tracon - 1) / DTConfigTSPhi::NTCTSS + 1;
412  if (itss < 1 || itss > DTConfigTSPhi::NTSSTSM) {
413  edm::LogWarning("DTTSPhi") << "ignoreSecondTrack: wrong TRACO number: " << tracon << " no flag set!";
414  return;
415  }
416  DTTSS *tss = getDTTSS(step, itss);
417  tss->ignoreSecondTrack();
418 
419  int bkmod = config()->TsmStatus().element(0);
420  if (bkmod == 0) { // we are in back-up mode
421 
422  int ntsstsmd = config()->TSSinTSMD(station(), sector());
423  // Get the appropriate TSMD
424  itsmd = (itss - 1) / ntsstsmd + 1;
425  }
426 
427  DTTSM *tsm = getDTTSM(step, itsmd);
428  tsm->ignoreSecondTrack();
429 }
int station() const
Return station number.
void ignoreSecondTrack()
Set a flag to skip sort2.
Definition: DTTSS.h:51
BitArray< 8 > TsmStatus() const
TSM status.
DTTSS * getDTTSS(int step, unsigned n) const
Definition: DTTSPhi.cc:431
static const int NTSSTSM
Constant: maximum number of TSS in input to the TSM.
Definition: DTConfigTSPhi.h:39
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 NTCTSS
Constant: number of TRACOs in input to a TSS.
Definition: DTConfig.h:40
Definition: DTTSM.h:38
int sector() const
Return sector number.
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
DTTSM * getDTTSM(int step, unsigned n) const
Definition: DTTSPhi.cc:446
void ignoreSecondTrack()
Set a flag to skip sort2.
Definition: DTTSM.h:57
Definition: DTTSS.h:36
step
Definition: StallMonitor.cc:83
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:62
Log< level::Warning, false > LogWarning
int element(const int pos) const
Definition: BitArray.h:206

◆ loadTSPhi()

void DTTSPhi::loadTSPhi ( )
private

store DTTracoChip triggers in the DTTSS's

Definition at line 137 of file DTTSPhi.cc.

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

Referenced by reconstruct().

137  {
138  // clear DTTSSs and DTTSM
139  localClear();
140 
141  if (config()->debug()) {
142  edm::LogInfo("DTTSPhi") << "loadDTTSPhi called for wheel=" << wheel() << ", station=" << station()
143  << ", sector=" << sector();
144  }
145 
146  // loop on all TRACO triggers
147  std::vector<DTTracoTrigData>::const_iterator p;
148  std::vector<DTTracoTrigData>::const_iterator pend = _tracocard->end();
149  for (p = _tracocard->begin(); p != pend; p++) {
150  if (config()->usedTraco(p->tracoNumber()) /*|| config()->usedTraco(p->tracoNumber())==1*/) {
151  int step = p->step();
152  int fs = (p->isFirst()) ? 1 : 2;
153 
154  // if first track is found inhibit second track processing in previous BX
155  if (fs == 1 && step > DTConfigTSPhi::NSTEPF)
156  ignoreSecondTrack(step - 1, p->tracoNumber());
157 
158  // load trigger
159  addTracoT(step, &(*p), fs);
160  }
161  }
162 }
int station() const
Return station number.
static const int NSTEPF
Definition: DTConfig.h:35
void ignoreSecondTrack(int step, int tracon)
Set a flag to ignore second tracks (if first track at following BX)
Definition: DTTSPhi.cc:404
bool usedTraco(int i) const
Enabled TRACOs in TS.
int wheel() const
Return wheel number.
int sector() const
Return sector number.
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
Log< level::Info, false > LogInfo
DTTracoCard * _tracocard
Definition: DTTSPhi.h:110
#define debug
Definition: HDRShower.cc:19
void localClear()
Clear.
Definition: DTTSPhi.cc:98
void addTracoT(int step, const DTTracoTrigData *tracotrig, int ifs)
Definition: DTTSPhi.cc:164
step
Definition: StallMonitor.cc:83
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:62
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38

◆ localClear()

void DTTSPhi::localClear ( )
private

Clear.

Definition at line 98 of file DTTSPhi.cc.

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

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

98  {
99  for (int is = 0; is < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1; is++) {
100  // clear buffer
101  std::vector<DTTSCand *>::iterator p1;
102  for (p1 = _tctrig[is].begin(); p1 != _tctrig[is].end(); p1++) {
103  delete (*p1);
104  }
105  _tctrig[is].clear();
106 
107  std::vector<DTTSS *>::iterator ptss;
108  for (ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++) {
109  (*ptss)->clear();
110  }
111  // clear all DTTSM
112  std::vector<DTTSM *>::iterator ptsm;
113  for (ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++) {
114  (*ptsm)->clear();
115  }
116  }
117 }
static const int NSTEPF
Definition: DTConfig.h:35
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:117
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:115
std::vector< DTTSCand * > _tctrig[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:120
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38

◆ localDirection()

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

Local direction in chamber of a trigger-data object.

Implements DTGeomSupplier.

Definition at line 491 of file DTTSPhi.cc.

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

491  {
492  DTChambPhSegm *trig = dynamic_cast<DTChambPhSegm *>(const_cast<DTTrigData *>(tr));
493  // const DTChambPhSegm* trig = dynamic_cast<const DTChambPhSegm*>(tr);
494  if (!trig) {
495  edm::LogWarning("DTTSPhi") << "LocalDirection called with wrong argument!";
496  return LocalVector(0, 0, 0);
497  }
498  return _tracocard->localDirection(trig->tracoTrig());
499 }
LocalVector localDirection(const DTTrigData *) const override
NEWGEO Local direction in chamber of a trigger-data object.
Definition: DTTracoCard.cc:403
Local3DVector LocalVector
Definition: LocalVector.h:12
DTTracoCard * _tracocard
Definition: DTTSPhi.h:110
Log< level::Warning, false > LogWarning

◆ localPosition()

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

Local position in chamber of a trigger-data object.

Implements DTGeomSupplier.

Definition at line 479 of file DTTSPhi.cc.

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

479  {
480  //@@ patch for Sun 4.2 compiler
481  // sm DTChambPhSegm* trig =
482  // dynamic_cast<DTChambPhSegm*>(const_cast<DTTrigData*>(tr));
483  const DTChambPhSegm *trig = dynamic_cast<const DTChambPhSegm *>(tr);
484  if (!trig) {
485  edm::LogWarning("DTTSPhi") << "LocalPosition called with wrong argument!";
486  return LocalPoint(0, 0, 0);
487  }
488  return _tracocard->localPosition(trig->tracoTrig());
489 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
DTTracoCard * _tracocard
Definition: DTTSPhi.h:110
Log< level::Warning, false > LogWarning
LocalPoint localPosition(const DTTrigData *) const override
NEWGEO Local position in chamber of a trigger-data object.
Definition: DTTracoCard.cc:351

◆ nSegm()

int DTTSPhi::nSegm ( int  step)

Return number of DTTSPhi segments.

Definition at line 460 of file DTTSPhi.cc.

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

Referenced by DTSCTrigUnit::nPhiSegm().

460  {
461  int n = 0;
462  std::vector<DTChambPhSegm>::const_iterator p; // p=0;
463  for (p = begin(); p < end(); p++) {
464  if (p->step() == step)
465  n++;
466  }
467  return n;
468 }
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
step
Definition: StallMonitor.cc:83
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38

◆ 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.

References loadTSPhi(), and runTSPhi().

Referenced by DTTrig::triggerReco().

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

◆ runTSPhi()

void DTTSPhi::runTSPhi ( )
private

run DTTSPhi algorithm (DTTSS+DTTSM)

Definition at line 215 of file DTTSPhi.cc.

References DTCache< T, Coll >::_cache, _tsm, _tss, DTTSM::addCand(), DTCache< T, Coll >::begin(), DTGeomSupplier::ChamberId(), DTTracoTrigData::code(), config(), DTConfigTSPhi::debug(), BitArray< N >::element(), dqmdumpme::first, getDTTSM(), DTTSCand::isCorr(), DTTSCand::isHtrig(), DTTSCand::isInner(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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().

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

◆ segment()

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

Return the requested DTTSPhi segment.

Definition at line 470 of file DTTSPhi.cc.

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

Referenced by DTSCTrigUnit::phiSegment().

470  {
471  std::vector<DTChambPhSegm>::const_iterator p; // p=0;
472  for (p = begin(); p < end(); p++) {
473  if (p->step() == step && ((n == 1 && p->isFirst()) || (n == 2 && !p->isFirst())))
474  return &(*p); // p;
475  }
476  return nullptr;
477 }
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
step
Definition: StallMonitor.cc:83
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38

◆ setConfig()

void DTTSPhi::setConfig ( const DTConfigManager conf)

Set configuration.

Definition at line 119 of file DTTSPhi.cc.

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

Referenced by DTSCTrigUnit::setConfig().

119  {
120  DTChamberId sid = ChamberId();
121  _config = conf->getDTConfigTSPhi(sid);
122 
123  for (int is = 0; is < DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF + 1; is++) {
124  // set TSS config
125  std::vector<DTTSS *>::iterator ptss;
126  for (ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++) {
127  (*ptss)->setConfig(config());
128  }
129  // set TSM config
130  std::vector<DTTSM *>::iterator ptsm;
131  for (ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++) {
132  (*ptsm)->setConfig(config());
133  }
134  }
135 }
static const int NSTEPF
Definition: DTConfig.h:35
const DTConfigTSPhi * getDTConfigTSPhi(DTChamberId) const
Get desired Trigger Server Phi configuration.
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:117
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:115
const DTConfigTSPhi * _config
Definition: DTTSPhi.h:112
DTChamberId ChamberId() const
Identifier of the associated chamber.
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:62
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38

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