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
 Local direction in chamber of a trigger-data object. More...
 
LocalPoint localPosition (const DTTrigData *) const
 Local position in chamber of a trigger-data object. More...
 
int nSegm (int step)
 Return number of DTTSPhi segments. More...
 
virtual void reconstruct ()
 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 ()
 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)
 Add a DTTracoChip trigger to the DTTSPhi, ifs is track number (first or second) More...
 
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.

44  :
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 ;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 
57  // create DTTSSs
58  for(int itss=1; itss<=DTConfigTSPhi::NTSSTSM; itss++) {
59  DTTSS* tss = new DTTSS(itss);
60  _tss[is].push_back(tss);
61  }
62 
63  // create DTTSMs SM double TSM
64  for(int itsmd=1; itsmd<=DTConfigTSPhi::NTSMD; itsmd++) {
65  DTTSM* tsm = new DTTSM(itsmd);
66  _tsm[is].push_back(tsm);
67  }
68  }
69 }
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:119
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:112
DTGeomSupplier(DTTrigGeom *geom)
Constructor.
Definition: DTTSS.h:36
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:117
DTTSPhi::~DTTSPhi ( )

Destructor.

Definition at line 75 of file DTTSPhi.cc.

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

75  {
76 
77  std::vector<DTTSS*>::iterator ptss;
78  std::vector<DTTSM*>::iterator ptsm;
79  for(int is=0;is<DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1;is++){
80  // clear TSSs
81  for (ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++){
82  delete (*ptss);
83  }
84  _tss[is].clear();
85  // clear TSMs
86  for (ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++){
87  delete (*ptsm);
88  }
89  _tsm[is].clear();
90 
91  }
92 
93  localClear();
94 
95  //delete _config;
96 
97 }
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:119
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:40
void localClear()
Clear.
Definition: DTTSPhi.cc:105
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:117

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

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

Return the configuration class.

Definition at line 64 of file DTTSPhi.h.

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

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

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

Definition at line 481 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().

481  {
483  std::cout << "DTTSPhi::getDTTSM: step out of range: " << step;
484  std::cout << " empty pointer returned!" << std::endl;
485  return 0;
486  }
487  if(n<1 || n>_tsm[step-DTConfigTSPhi::NSTEPF].size()){
488  std::cout << "DTTSPhi::getDTTSM: requested DTTSM not present: " << n;
489  std::cout << " (at step " << step << ")";
490  std::cout << " empty pointer returned!" << std::endl;
491  return 0;
492  }
493  std::vector<DTTSM*>::const_iterator p_tsm = _tsm[step-DTConfigTSPhi::NSTEPF].begin()+n-1;
494  return *p_tsm;
495 }
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:119
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
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:46
DTTSS * DTTSPhi::getDTTSS ( int  step,
unsigned  n 
) const
private

Definition at line 460 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().

460  {
462  std::cout << "DTTSPhi::getDTTSS: step out of range: " << step;
463  std::cout << " empty pointer returned!" << std::endl;
464  return 0;
465  }
466  if(n<1 || n>_tss[step-DTConfigTSPhi::NSTEPF].size()){
467  std::cout << "DTTSPhi::getDTTSS: requested DTTSS not present: " << n;
468  std::cout << " (at step " << step << ")";
469  std::cout << " empty pointer returned!" << std::endl;
470  return 0;
471  }
472 
473  std::vector<DTTSS*>::const_iterator p = _tss[step-DTConfigTSPhi::NSTEPF].begin()+n-1;
474  return *p;
475 
476 
477 }
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:117
step
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:46
void DTTSPhi::ignoreSecondTrack ( int  step,
int  tracon 
)
private

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

Definition at line 428 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().

428  {
429 
430  int itsmd = 1; // initialize it to default
431 
433  std::cout << "DTTSPhi::ignoreSecondTrack: step out of range: " << step;
434  std::cout << " no flag set!" << std::endl;
435  return;
436  }
437  int itss = (tracon-1 ) / DTConfigTSPhi::NTCTSS + 1;
438  if(itss<1 || itss>DTConfigTSPhi::NTSSTSM) {
439  std::cout << "DTTSPhi::ignoreSecondTrack: wrong TRACO number: " << tracon;
440  std::cout << " no flag set!" << std::endl;
441  return;
442  }
443  DTTSS* tss = getDTTSS(step,itss);
444  tss->ignoreSecondTrack();
445 
446  int bkmod = config()->TsmStatus().element(0);
447  if (bkmod==0) { // we are in back-up mode
448 
449  int ntsstsmd = config()->TSSinTSMD(station(),sector());
450  // Get the appropriate TSMD
451  itsmd = (itss -1 ) / ntsstsmd + 1;
452 
453  }
454 
455  DTTSM* tsm = getDTTSM(step,itsmd);
456  tsm->ignoreSecondTrack();
457 }
void ignoreSecondTrack()
Set a flag to skip sort2.
Definition: DTTSS.h:53
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:64
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:460
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:59
int element(const int pos) const
Definition: BitArray.h:210
Definition: DTTSS.h:36
BitArray< 8 > TsmStatus() const
TSM status.
step
DTTSM * getDTTSM(int step, unsigned n) const
Definition: DTTSPhi.cc:481
void DTTSPhi::loadTSPhi ( )
private

store DTTracoChip triggers in the DTTSS's

Definition at line 150 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().

150  {
151 
152  // clear DTTSSs and DTTSM
153  localClear();
154 
155  if(config()->debug()){
156  std::cout << "DTTSPhi::loadDTTSPhi called for wheel=" << wheel() ;
157  std::cout << ", station=" << station();
158  std::cout << ", sector=" << sector() << std::endl;
159  }
160 
161  // loop on all TRACO triggers
162  std::vector<DTTracoTrigData>::const_iterator p;
163  std::vector<DTTracoTrigData>::const_iterator pend=_tracocard->end();
164  for(p=_tracocard->begin();p!=pend;p++){
165 
166  if(config()->usedTraco(p->tracoNumber()) /*|| config()->usedTraco(p->tracoNumber())==1*/ ) {
167  int step = p->step();
168  int fs = (p->isFirst()) ? 1 : 2 ;
169 
170  // if first track is found inhibit second track processing in previous BX
171  if( fs==1 && step>DTConfigTSPhi::NSTEPF)
172  ignoreSecondTrack(step-1,p->tracoNumber());
173 
174  // load trigger
175  addTracoT( step, &(*p), fs );
176  }
177  }
178 }
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:64
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:428
DTTracoCard * _tracocard
Definition: DTTSPhi.h:112
#define debug
Definition: HDRShower.cc:19
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
void localClear()
Clear.
Definition: DTTSPhi.cc:105
void addTracoT(int step, const DTTracoTrigData *tracotrig, int ifs)
Add a DTTracoChip trigger to the DTTSPhi, ifs is track number (first or second)
Definition: DTTSPhi.cc:181
step
const_iterator end() const
Get last cache element.
Definition: DTCache.h:43
bool usedTraco(int i) const
Enabled TRACOs in TS.
void DTTSPhi::localClear ( )
private

Clear.

Definition at line 105 of file DTTSPhi.cc.

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

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

105  {
106  for(int is=0;is<DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1;is++) {
107  // clear buffer
108  std::vector<DTTSCand*>::iterator p1;
109  for(p1 = _tctrig[is].begin(); p1 != _tctrig[is].end(); p1++) {
110  delete (*p1);
111  }
112  _tctrig[is].clear();
113 
114  std::vector<DTTSS*>::iterator ptss;
115  for(ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++) {
116  (*ptss)->clear();
117  }
118  // clear all DTTSM
119  std::vector<DTTSM*>::iterator ptsm;
120  for(ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++) {
121  (*ptsm)->clear();
122  }
123  }
124 }
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:119
static const int NSTEPF
Definition: DTConfig.h:36
std::vector< DTTSCand * > _tctrig[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:122
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:40
double p1[4]
Definition: TauolaWrapper.h:89
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:117
LocalVector DTTSPhi::localDirection ( const DTTrigData tr) const
virtual

Local direction in chamber of a trigger-data object.

Implements DTGeomSupplier.

Definition at line 532 of file DTTSPhi.cc.

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

Referenced by config().

532  {
533  DTChambPhSegm* trig = dynamic_cast<DTChambPhSegm*>(const_cast<DTTrigData*>(tr));
534  // const DTChambPhSegm* trig = dynamic_cast<const DTChambPhSegm*>(tr);
535  if(!trig) {
536  std::cout << "DTTSPhi::LocalDirection called with wrong argument!" << std::endl;
537  return LocalVector(0,0,0);
538  }
539  return _tracocard->localDirection(trig->tracoTrig());
540 }
Local3DVector LocalVector
Definition: LocalVector.h:12
DTTracoCard * _tracocard
Definition: DTTSPhi.h:112
const DTTracoTrigData * tracoTrig() const
Return associated TRACO trigger.
Definition: DTChambPhSegm.h:75
LocalVector localDirection(const DTTrigData *) const
NEWGEO Local direction in chamber of a trigger-data object.
Definition: DTTracoCard.cc:429
LocalPoint DTTSPhi::localPosition ( const DTTrigData tr) const
virtual

Local position in chamber of a trigger-data object.

Implements DTGeomSupplier.

Definition at line 520 of file DTTSPhi.cc.

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

Referenced by config().

520  {
521  //@@ patch for Sun 4.2 compiler
522  //sm DTChambPhSegm* trig = dynamic_cast<DTChambPhSegm*>(const_cast<DTTrigData*>(tr));
523  const DTChambPhSegm* trig = dynamic_cast<const DTChambPhSegm*>(tr);
524  if(!trig) {
525  std::cout << "DTTSPhi::LocalPosition called with wrong argument!" << std::endl;
526  return LocalPoint(0,0,0);
527  }
528  return _tracocard->localPosition(trig->tracoTrig());
529 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
LocalPoint localPosition(const DTTrigData *) const
NEWGEO Local position in chamber of a trigger-data object.
Definition: DTTracoCard.cc:376
DTTracoCard * _tracocard
Definition: DTTSPhi.h:112
const DTTracoTrigData * tracoTrig() const
Return associated TRACO trigger.
Definition: DTChambPhSegm.h:75
int DTTSPhi::nSegm ( int  step)

Return number of DTTSPhi segments.

Definition at line 500 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().

500  {
501  int n=0;
502  std::vector<DTChambPhSegm>::const_iterator p; //p=0;
503  for(p=begin(); p<end(); p++) {
504  if(p->step()==step)n++;
505  }
506  return n;
507 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
step
const_iterator end() const
Get last cache element.
Definition: DTCache.h:43
virtual void DTTSPhi::reconstruct ( )
inlinevirtual

Load TRACO triggers and run TSPhi algorithm.

Reimplemented from DTCache< T, Coll >.

Definition at line 82 of file DTTSPhi.h.

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

Referenced by DTTrig::triggerReco().

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

run DTTSPhi algorithm (DTTSS+DTTSM)

Definition at line 235 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().

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

Return the requested DTTSPhi segment.

Definition at line 510 of file DTTSPhi.cc.

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

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

510  {
511  std::vector<DTChambPhSegm>::const_iterator p; //p=0;
512  for(p=begin();p<end();p++){
513  if(p->step()==step&&((n==1&&p->isFirst())||(n==2&&!p->isFirst())))
514  return &(*p);// p;
515  }
516  return 0;
517 }
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
step
const_iterator end() const
Get last cache element.
Definition: DTCache.h:43
void DTTSPhi::setConfig ( const DTConfigManager conf)

Set configuration.

Definition at line 127 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().

127  {
128 
129  DTChamberId sid = ChamberId();
130  _config = conf->getDTConfigTSPhi(sid);
131 
132  for(int is=0;is<DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1;is++) {
133 
134  // set TSS config
135  std::vector<DTTSS*>::iterator ptss;
136  for (ptss = _tss[is].begin(); ptss != _tss[is].end(); ptss++){
137  (*ptss)->setConfig(config());
138  }
139  // set TSM config
140  std::vector<DTTSM*>::iterator ptsm;
141  for (ptsm = _tsm[is].begin(); ptsm != _tsm[is].end(); ptsm++){
142  (*ptsm)->setConfig(config());
143  }
144 
145  }
146 
147 }
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:119
static const int NSTEPF
Definition: DTConfig.h:36
const DTConfigTSPhi * config() const
Return the configuration class.
Definition: DTTSPhi.h:64
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:114
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Definition: DTTSPhi.h:117
const DTConfigTSPhi * getDTConfigTSPhi(DTChamberId) const
Get desired Trigger Server Phi configuration.

Member Data Documentation

const DTConfigTSPhi* DTTSPhi::_config
private

Definition at line 114 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 112 of file DTTSPhi.h.

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

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

Definition at line 119 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 117 of file DTTSPhi.h.

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