CMS 3D CMS Logo

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

#include <DTTracoCard.h>

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

Public Member Functions

void clearCache ()
 Clear all traco stuff (cache & map) More...
 
const DTConfigLUTsconfig_luts () const
 Return LUTS config for this chamber (=minicrate) More...
 
bool debug ()
 Return TU debug flag. More...
 
 DTTracoCard (DTTrigGeom *, DTBtiCard *, DTTSTheta *)
 Constructor. More...
 
DTTracoChipgetTRACO (int n) const
 Returns the required DTTracoChip. Return 0 if it doesn't exist. More...
 
DTTracoChipgetTRACO (const DTTracoId &tracoid) const
 Returns the required DTTracoChip. Return 0 if it doesn't exist. More...
 
LocalVector localDirection (const DTTrigData *) const override
 NEWGEO Local direction in chamber of a trigger-data object. More...
 
LocalPoint localPosition (const DTTrigData *) const override
 NEWGEO Local position in chamber of a trigger-data object. More...
 
bool lutFromDBFlag ()
 Return lut computation option (DB/geometry) More...
 
void reconstruct () override
 Load BTIs triggers and run TRACOs algorithm. More...
 
void setConfig (const DTConfigManager *conf)
 Set configuration. More...
 
DTTracoTrigstoreTrigger (DTTracoTrigData)
 
std::vector< DTTracoChip * > tracoList ()
 Returns the active TRACO list. More...
 
DTTSThetaTSTh () const
 Return TSTheta. More...
 
bool useAcceptParamFlag ()
 Return acceptance flag. More...
 
 ~DTTracoCard () 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

DTTracoChipactiveGetTRACO (int)
 Returns the required DTTracoChip. Create it if it doesn't exist. More...
 
DTTracoChipactiveGetTRACO (const DTTracoId &tracoid)
 Returns the required DTTracoChip. Create it if it doesn't exist. More...
 
DTConfigTracoconfig_traco (const DTTracoId &tracoid) const
 Return single TRACO config. More...
 
void loadTRACO ()
 store BTI triggers in TRACO's More...
 
void localClear ()
 clear the TRACO map More...
 
void runTRACO ()
 run TRACO algorithm More...
 

Private Attributes

DTBtiCard_bticard
 
const DTConfigLUTs_conf_luts
 
ConfTracoMap _conf_traco_map
 
bool _debug
 
bool _flag_acc
 
bool _lut_from_db
 
TRACOContainer _tracomap
 
DTTSTheta_tstheta
 

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

Contains active DTTracoChips

Author
C. Grandi, S. Vanini

Modifications: III/07 : SV configuration with DTConfigManager

Definition at line 58 of file DTTracoCard.h.

Constructor & Destructor Documentation

DTTracoCard::DTTracoCard ( DTTrigGeom geo,
DTBtiCard bticard,
DTTSTheta tstheta 
)

Constructor.

Definition at line 48 of file DTTracoCard.cc.

50  : DTGeomSupplier(geo), _bticard(bticard), _tstheta(tstheta) {}
DTTSTheta * _tstheta
Definition: DTTracoCard.h:142
DTBtiCard * _bticard
Definition: DTTracoCard.h:141
DTGeomSupplier(DTTrigGeom *geom)
Constructor.
DTTracoCard::~DTTracoCard ( )
override

Destructor.

Definition at line 56 of file DTTracoCard.cc.

References localClear().

56 { localClear(); }
void localClear()
clear the TRACO map
Definition: DTTracoCard.cc:86

Member Function Documentation

DTTracoChip * DTTracoCard::activeGetTRACO ( int  n)
private

Returns the required DTTracoChip. Create it if it doesn't exist.

Definition at line 286 of file DTTracoCard.cc.

References photons_cff::_id, _tracomap, config_traco(), DTGeomSupplier::geom(), gen::n, and DTTrigGeom::statId().

Referenced by activeGetTRACO(), loadTRACO(), lutFromDBFlag(), and storeTrigger().

286  {
287 
288  // the traco identifier
289  DTChamberId sid = geom()->statId();
290  DTTracoId _id = DTTracoId(sid, n);
291 
292  DTTracoChip *traco = nullptr;
293  TRACO_iter ptraco = _tracomap.find(n);
294  if (ptraco != _tracomap.end()) {
295  traco = (*ptraco).second;
296  } else {
297  traco = new DTTracoChip(this, n, config_traco(_id));
298  _tracomap[n] = traco;
299  }
300  return traco;
301 }
DTTrigGeom * geom() const
Associated geometry.
TRACOContainer _tracomap
Definition: DTTracoCard.h:144
TRACOContainer::iterator TRACO_iter
Definition: DTTracoCard.h:52
DTConfigTraco * config_traco(const DTTracoId &tracoid) const
Return single TRACO config.
Definition: DTTracoCard.cc:465
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTTrigGeom.h:54
DTTracoChip* DTTracoCard::activeGetTRACO ( const DTTracoId tracoid)
inlineprivate

Returns the required DTTracoChip. Create it if it doesn't exist.

Definition at line 130 of file DTTracoCard.h.

References activeGetTRACO(), config_traco(), localClear(), and DTTracoId::traco().

130  {
131  return activeGetTRACO(tracoid.traco());
132  }
DTTracoChip * activeGetTRACO(int)
Returns the required DTTracoChip. Create it if it doesn&#39;t exist.
Definition: DTTracoCard.cc:286
int traco() const
Returns the traco.
Definition: DTTracoId.h:70
void DTTracoCard::clearCache ( )

Clear all traco stuff (cache & map)

Definition at line 62 of file DTTracoCard.cc.

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

Referenced by reconstruct(), and DTTrig::triggerReco().

62  {
63 
65  localClear();
66 }
void localClear()
clear the TRACO map
Definition: DTTracoCard.cc:86
void clearCache()
Clear cache vector.
Definition: DTCache.h:47
const DTConfigLUTs* DTTracoCard::config_luts ( ) const
inline

Return LUTS config for this chamber (=minicrate)

Definition at line 111 of file DTTracoCard.h.

References _conf_luts.

Referenced by DTTracoChip::DTTracoChip().

111 { return _conf_luts; }
const DTConfigLUTs * _conf_luts
Definition: DTTracoCard.h:147
DTConfigTraco * DTTracoCard::config_traco ( const DTTracoId tracoid) const
private

Return single TRACO config.

Definition at line 465 of file DTTracoCard.cc.

References _conf_traco_map, gather_cfg::cout, DTTracoId::sector(), DTTracoId::station(), DTTracoId::traco(), and DTTracoId::wheel().

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

465  {
466  // loop on map to find traco
467  ConfTracoMap::const_iterator titer = _conf_traco_map.find(tracoid);
468  if (titer == _conf_traco_map.end()) {
469  std::cout << "DTTracoCard::config_traco : TRACO (" << tracoid.wheel() << ","
470  << tracoid.sector() << "," << tracoid.station() << ","
471  << tracoid.traco() << ") not found, return 0" << std::endl;
472  return nullptr;
473  }
474 
475  return const_cast<DTConfigTraco *>(&(*titer).second);
476 }
int sector() const
Returns sector number.
Definition: DTTracoId.h:68
int traco() const
Returns the traco.
Definition: DTTracoId.h:70
ConfTracoMap _conf_traco_map
Definition: DTTracoCard.h:145
int station() const
Returns station number.
Definition: DTTracoId.h:66
int wheel() const
Returns wheel number.
Definition: DTTracoId.h:64
bool DTTracoCard::debug ( )
inline

Return TU debug flag.

Definition at line 75 of file DTTracoCard.h.

References _debug.

Referenced by loadTRACO(), localDirection(), and runTRACO().

75 { return _debug; }
DTTracoChip * DTTracoCard::getTRACO ( int  n) const

Returns the required DTTracoChip. Return 0 if it doesn't exist.

Definition at line 303 of file DTTracoCard.cc.

References _tracomap.

Referenced by getTRACO(), DTTracoChip::setFlag(), and TSTh().

303  {
304  TRACO_const_iter ptraco = _tracomap.find(n);
305  if (ptraco == _tracomap.end())
306  return nullptr;
307  return (*ptraco).second;
308 }
TRACOContainer _tracomap
Definition: DTTracoCard.h:144
TRACOContainer::const_iterator TRACO_const_iter
Definition: DTTracoCard.h:51
DTTracoChip* DTTracoCard::getTRACO ( const DTTracoId tracoid) const
inline

Returns the required DTTracoChip. Return 0 if it doesn't exist.

Definition at line 84 of file DTTracoCard.h.

References getTRACO(), localDirection(), localPosition(), storeTrigger(), DTTracoId::traco(), and tracoList().

84  {
85  return getTRACO(tracoid.traco());
86  }
DTTracoChip * getTRACO(int n) const
Returns the required DTTracoChip. Return 0 if it doesn&#39;t exist.
Definition: DTTracoCard.cc:303
int traco() const
Returns the traco.
Definition: DTTracoId.h:70
void DTTracoCard::loadTRACO ( )
private

store BTI triggers in TRACO's

Definition at line 94 of file DTTracoCard.cc.

References _bticard, _flag_acc, activeGetTRACO(), DTTracoChip::add_btiT(), DTCache< T, Coll >::begin(), DTConfigBti::CH(), DTConfigBti::CL(), DTBtiCard::config_bti(), gather_cfg::cout, debug(), DTCache< T, Coll >::end(), DTGeomSupplier::geom(), createfilelist::int, DTConfigBti::LH(), DTConfigBti::LL(), localClear(), DTConfig::NBTITC, AlCaHLTBitMon_ParallelJobs::p, DTConfigBti::RH(), DTConfigBti::RL(), DTGeomSupplier::sector(), DTGeomSupplier::station(), and DTGeomSupplier::wheel().

Referenced by lutFromDBFlag(), and reconstruct().

94  {
95 
96  localClear();
97 
98  if (debug()) {
99  std::cout << "DTTracoCard::loadTRACO called for wheel=" << wheel();
100  std::cout << ", station=" << station();
101  std::cout << ", sector=" << sector() << std::endl;
102  }
103 
104  int maxtc = int(ceil(float(geom()->nCell(1)) / float(DTConfig::NBTITC)));
105 
106  // loop on all BTI triggers
107  std::vector<DTBtiTrigData>::const_iterator p;
108  std::vector<DTBtiTrigData>::const_iterator pend = _bticard->end();
109  for (p = _bticard->begin(); p != pend; p++) {
110  if (debug()) {
111  std::cout << "Found bti trigger: ";
112  (*p).print();
113  }
114 
115  // BTI data
116  int nbti = (*p).btiNumber();
117  int nsl = (*p).btiSL();
118  int step = (*p).step();
119  int K = (*p).K();
120  DTBtiId id_bti = (*p).parentId();
121 
122  DTConfigBti *conf_bti = _bticard->config_bti(id_bti);
123  int LL = conf_bti->LL();
124  int LH = conf_bti->LH();
125  int CL = conf_bti->CL();
126  int CH = conf_bti->CH();
127  int RL = conf_bti->RL();
128  int RH = conf_bti->RH();
129  /*
130  if(debug())
131  std::cout << "Bti trigger acceptances: \n"
132  << " LL " << LL << ", LH " << LH << "\n"
133  << " CL " << CL << ", CH " << CH << "\n"
134  << " RL " << RL << ", RH " << RH << std::endl;
135  */
136  // assign BTI to TRACO (central TRACO for sl=3); ntc=1,2...maxtc
137  int ntc = static_cast<int>((nbti - 1) / DTConfig::NBTITC) + 1;
138  if (ntc < 1 || ntc > maxtc)
139  continue;
140 
141  if (debug())
142  std::cout << "Bti trigger assigned to traco " << ntc << " (maxtc "
143  << maxtc << ")" << std::endl;
144 
145  // TRACO information
146  DTTracoId tracoid = DTTracoId(wheel(), station(), sector(), ntc);
147 
148  // position inside TRACO:
149  int pos = nbti - (ntc - 1) * DTConfig::NBTITC;
150 
151  // store trigger in TRACO. Create TRACO if it doesn't exist
152  // SV tb2003 : check if traco is connected!
153 
154  // SV 091103 : add bti trigger filtering in acceptance windows
155  // if flag is useAcceptParam() = true
156 
157  // Load master TRACO plane
158  if (nsl == 1) {
159  if (!_flag_acc || (K >= CL && K <= CH))
160  activeGetTRACO(ntc)->add_btiT(step, pos, &(*p));
161  else if (debug())
162  std::cout << "ATTENTION: in TRACO n. " << ntc << " bti pos " << pos
163  << " trigger K= " << K << " outside acceptance " << CL
164  << "<K<" << CH << std::endl;
165  }
166 
167  // Load slave TRACO plane
168  if (nsl == 3) {
169  // 3 TRACO's
170  // for(int tci=-1;tci<=1;tci++) {
171  // if( (ntc+tci)>0 && (ntc+tci)<=maxtc )
172  // activeGetTRACO(ntc+tci)->add_btiT( step, pos+8-4*tci, &(*p) );
173  // else{
174  // if(debug())
175  // std::cout << "ATTENTION: traco " << ntc+tci << " is disconnected!"
176  // << std::endl;
177  // }
178 
179  // Left Traco
180  if ((ntc - 1) > 0 && (ntc - 1) <= maxtc) {
181  if (!_flag_acc || (K >= LL && K <= LH)) {
182  activeGetTRACO(ntc - 1)->add_btiT(step, pos + 8 - 4 * (-1), &(*p));
183  } else {
184  if (debug()) {
185  std::cout << "ATTENTION: in TRACO n. " << ntc - 1 << " bti pos "
186  << pos + 8 - 4 * (-1) << " trigger K= " << K
187  << " outside acceptance " << LL << "<K<" << LH
188  << std::endl;
189  }
190  }
191  }
192 
193  // Central Traco
194  if ((ntc) > 0 && (ntc) <= maxtc) {
195  if (!_flag_acc || (K >= CL && K <= CH)) {
196  activeGetTRACO(ntc)->add_btiT(step, pos + 8 - 4 * (0), &(*p));
197  } else {
198  if (debug())
199  std::cout << "ATTENTION: in TRACO n. " << ntc << " bti pos "
200  << pos + 8 - 4 * (0) << " trigger K= " << K
201  << " outside acceptance " << CL << "<K<" << CH
202  << std::endl;
203  }
204  }
205 
206  // Right Traco
207  if ((ntc + 1) > 0 && (ntc + 1) <= maxtc) {
208  if (!_flag_acc || (K >= RL && K <= RH)) {
209  activeGetTRACO(ntc + 1)->add_btiT(step, pos + 8 - 4 * (+1), &(*p));
210  } else {
211  if (debug())
212  std::cout << "ATTENTION: in TRACO n. " << ntc + 1 << " bti pos "
213  << pos + 8 - 4 * (+1) << " trigger K= " << K
214  << " outside acceptance " << RL << "<K<" << RH
215  << std::endl;
216  }
217  }
218  }
219 
220  // Filter Theta BTIs -> this is done in DTBtiChip
221 
222  } // end loop on bti trigs
223 }
DTConfigBti * config_bti(DTBtiId &btiid) const
Return bti chip configuration.
Definition: DTBtiCard.cc:677
int RL() const
K left limit for right traco.
Definition: DTConfigBti.h:117
DTTrigGeom * geom() const
Associated geometry.
int sector() const
Return sector number.
DTTracoChip * activeGetTRACO(int)
Returns the required DTTracoChip. Create it if it doesn&#39;t exist.
Definition: DTTracoCard.cc:286
int CH() const
K right limit for center traco.
Definition: DTConfigBti.h:114
void add_btiT(int step, int pos, const DTBtiTrigData *btitrig)
Add a BTI trigger to the TRACO.
int station() const
Return station number.
bool _flag_acc
Definition: DTTracoCard.h:151
void localClear()
clear the TRACO map
Definition: DTTracoCard.cc:86
int LL() const
K left limit for left traco.
Definition: DTConfigBti.h:105
int wheel() const
Return wheel number.
DTBtiCard * _bticard
Definition: DTTracoCard.h:141
bool debug()
Return TU debug flag.
Definition: DTTracoCard.h:75
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38
int LH() const
K right limit for left traco.
Definition: DTConfigBti.h:108
int RH() const
K right limit for right traco.
Definition: DTConfigBti.h:120
step
Definition: StallMonitor.cc:94
int CL() const
K left limit for center traco.
Definition: DTConfigBti.h:111
static const int NBTITC
Definition: DTConfig.h:38
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
void DTTracoCard::localClear ( )
private

clear the TRACO map

Definition at line 86 of file DTTracoCard.cc.

References _tracomap, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by activeGetTRACO(), clearCache(), loadTRACO(), and ~DTTracoCard().

86  {
87  // Clear the map
88  for (TRACO_iter p = _tracomap.begin(); p != _tracomap.end(); p++) {
89  delete (*p).second;
90  }
91  _tracomap.clear();
92 }
TRACOContainer _tracomap
Definition: DTTracoCard.h:144
TRACOContainer::iterator TRACO_iter
Definition: DTTracoCard.h:52
LocalVector DTTracoCard::localDirection ( const DTTrigData tr) const
overridevirtual

NEWGEO Local direction in chamber of a trigger-data object.

Implements DTGeomSupplier.

Definition at line 428 of file DTTracoCard.cc.

References DTTrigGeom::cellPitch(), config_traco(), funct::cos(), gather_cfg::cout, debug(), DTTrigGeom::distSL(), DTGeomSupplier::geom(), DTTracoTrigData::K(), DTTracoTrigData::parentId(), and funct::sin().

Referenced by DTTracoChip::calculateAngles(), getTRACO(), and DTTSPhi::localDirection().

428  {
429  // NEWGEO
430  DTTracoTrigData *trig =
431  dynamic_cast<DTTracoTrigData *>(const_cast<DTTrigData *>(tr));
432  if (!trig) {
433  std::cout << "DTtracoCard::localDirection called with wrong argument!"
434  << std::endl;
435  return LocalVector(0, 0, 0);
436  }
437 
438  // FE position
439  // int FE = geom()->posFE(3);
440 
441  float psi = atan((float)(trig->K()) * geom()->cellPitch() /
442  (geom()->distSL() * config_traco(trig->parentId())->BTIC()));
443 
444  if (config_traco(trig->parentId())->debug() == 4)
445  std::cout << "K " << trig->K() << " == psi " << psi << " in FE frame "
446  << std::endl;
447 
448  // (xd,yd,zd) in chamber frame
449  float xd = -sin(psi);
450  float yd = 0;
451  float zd = -cos(psi);
452 
453  // 10/07/06 Not needed anymore (chages in geometry)
454  // if(FE==1){//FE in negative y
455  // xd = - xd;
456  //}
457 
458  if (config_traco(trig->parentId())->debug() == 4)
459  std::cout << "Direction in chamber frame is (" << xd << "," << yd << ","
460  << zd << ")" << std::endl;
461 
462  return LocalVector(xd, yd, zd);
463 }
DTTrigGeom * geom() const
Associated geometry.
Local3DVector LocalVector
Definition: LocalVector.h:12
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
Definition: DTTrigGeom.h:77
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::map< std::string, int, std::less< std::string > > psi
float distSL() const
Distance between the phi view superlayers (cms)
Definition: DTTrigGeom.h:80
DTTracoId parentId() const
Return parent TRACO identifier.
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
bool debug()
Return TU debug flag.
Definition: DTTracoCard.h:75
DTConfigTraco * config_traco(const DTTracoId &tracoid) const
Return single TRACO config.
Definition: DTTracoCard.cc:465
int K() const
Return trigger K parameter.
LocalPoint DTTracoCard::localPosition ( const DTTrigData tr) const
overridevirtual

NEWGEO Local position in chamber of a trigger-data object.

Implements DTGeomSupplier.

Definition at line 372 of file DTTracoCard.cc.

References DTTrigGeom::cellPitch(), config_traco(), gather_cfg::cout, DTTrigGeom::distSL(), objects.autophobj::float, DTGeomSupplier::geom(), DTTrigGeom::localPosition(), DTTracoTrigData::parentId(), DTTracoTrigData::posIn(), DTTracoTrigData::posOut(), x, DTTracoTrigData::X(), y, and z.

Referenced by getTRACO(), and DTTSPhi::localPosition().

372  {
373  // NEWGEO
374  DTTracoTrigData *trig =
375  dynamic_cast<DTTracoTrigData *>(const_cast<DTTrigData *>(tr));
376  if (!trig) {
377  std::cout << "DTTracoCard::localPosition called with wrong argument!"
378  << std::endl;
379  return LocalPoint(0, 0, 0);
380  }
381  float x = geom()->localPosition(trig->parentId()).x();
382  float y = geom()->localPosition(trig->parentId()).y();
383  float z = geom()->localPosition(trig->parentId()).z();
384 
385  float trig_pos =
386  geom()->cellPitch() *
387  ((float)trig->X() / (float)(config_traco(trig->parentId())->BTIC()));
388 
389  // 10/7/06 May be not needed anymore in new geometry
390  // if(geom()->posFE(1)==1)
391  // trig_pos = -trig_pos;
392 
393  x += trig_pos;
394 
395  // If not correlated get the position of the SL instead of the chamber center
396  // z axis toward vertex
397  if (trig->posIn() == 0) {
398  z -= 0.5 * geom()->distSL(); // no inner ==> only outer
399  } else if (trig->posOut() == 0) {
400  z += 0.5 * geom()->distSL(); // no outer ==> only inner
401  }
402  return LocalPoint(x, y, z);
403 }
DTTrigGeom * geom() const
Associated geometry.
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
Definition: DTTrigGeom.h:77
int posIn() const
Return the position of inner segment.
int posOut() const
Return the position of outer segment.
int X() const
Return trigger X parameter.
float distSL() const
Distance between the phi view superlayers (cms)
Definition: DTTrigGeom.h:80
DTTracoId parentId() const
Return parent TRACO identifier.
DTConfigTraco * config_traco(const DTTracoId &tracoid) const
Return single TRACO config.
Definition: DTTracoCard.cc:465
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:541
bool DTTracoCard::lutFromDBFlag ( )
inline

Return lut computation option (DB/geometry)

Definition at line 117 of file DTTracoCard.h.

References _lut_from_db, activeGetTRACO(), loadTRACO(), and runTRACO().

Referenced by DTTracoChip::calculateAngles(), DTTracoChip::DTTracoChip(), and DTTracoChip::~DTTracoChip().

117 { return _lut_from_db; }
bool _lut_from_db
Definition: DTTracoCard.h:152
void DTTracoCard::reconstruct ( )
inlineoverridevirtual

Load BTIs triggers and run TRACOs algorithm.

Reimplemented from DTCache< T, Coll >.

Definition at line 104 of file DTTracoCard.h.

References clearCache(), loadTRACO(), and runTRACO().

Referenced by DTTrig::triggerReco().

104  {
105  clearCache();
106  loadTRACO();
107  runTRACO();
108  }
void clearCache()
Clear all traco stuff (cache & map)
Definition: DTTracoCard.cc:62
void runTRACO()
run TRACO algorithm
Definition: DTTracoCard.cc:225
void loadTRACO()
store BTI triggers in TRACO&#39;s
Definition: DTTracoCard.cc:94
void DTTracoCard::runTRACO ( )
private

run TRACO algorithm

Definition at line 225 of file DTTracoCard.cc.

References DTCache< T, Coll >::_cache, _tracomap, gather_cfg::cout, debug(), DTConfig::NSTEPF, DTConfig::NSTEPL, DTTracoChip::nTrig(), DTTracoChip::run(), DTGeomSupplier::sector(), DTGeomSupplier::station(), DTTracoChip::triggerData(), DTTracoChip::useSecondTrack(), and DTGeomSupplier::wheel().

Referenced by lutFromDBFlag(), and reconstruct().

225  {
226 
227  if (debug()) {
228  std::cout << "DTTracoCard:runTRACO called for wheel=" << wheel();
229  std::cout << ", station=" << station();
230  std::cout << ", sector=" << sector();
231  std::cout << ", " << _tracomap.size() << " TRACOs with signal" << std::endl;
232  }
233 
234  // run TRACO algorithm on all non-empty TRACO
235  if (!_tracomap.empty()) {
236 
237  if (debug()) {
238  std::cout << "===================================================="
239  << std::endl;
240  std::cout << " TRACO triggers "
241  << std::endl;
242  }
243 
244  TRACO_iter ptraco;
245  for (ptraco = _tracomap.begin(); ptraco != _tracomap.end(); ptraco++) {
246  DTTracoChip *traco = (*ptraco).second;
247  traco->run();
248  for (int step = DTConfig::NSTEPF; step <= DTConfig::NSTEPL; step++) {
249  if (traco->nTrig(step) > 0) {
250  _cache.push_back(traco->triggerData(step, 1));
251  /*
252  std::cout<<"first bti sl3:
253  "<<geom()->localPosition(DTBtiId(wheel(),station(),sector(),3,1))<<std::endl;
254  std::cout<<"traco pos: " <<
255  geom()->localPosition((traco->triggerData(step,1).parentId()))<<std::endl;
256  traco->triggerData(step,1).print();
257  std::cout<<"pos: " << localPosition(&(traco->triggerData(step,1))) <<
258  std::endl; std::cout<<"dir: " <<
259  localDirection(&(traco->triggerData(step,1))) << std::endl; std::cout
260  << std::endl;
261  */
262  }
263  // Store second track only if no first track at previous BX
264  if (traco->nTrig(step) > 1 && traco->useSecondTrack(step)) {
265  _cache.push_back(traco->triggerData(step, 2));
266  /*
267  std::cout<<"first bti sl3:
268  "<<geom()->localPosition(DTBtiId(wheel(),station(),sector(),3,1))<<std::endl;
269  std::cout<<"traco pos: " <<
270  geom()->localPosition((traco->triggerData(step,2).parentId()))<<std::endl;
271  traco->triggerData(step,2).print();
272  std::cout<<"pos: " << localPosition(&(traco->triggerData(step,2))) <<
273  std::endl; std::cout<<"dir: " <<
274  localDirection(&(traco->triggerData(step,2))) << std::endl; std::cout
275  << std::endl;
276  */
277  }
278  }
279  }
280  if (debug())
281  std::cout << "===================================================="
282  << std::endl;
283  }
284 }
my_collection _cache
Definition: DTCache.h:53
void run()
Run TRACO algorithm.
Definition: DTTracoChip.cc:261
TRACOContainer _tracomap
Definition: DTTracoCard.h:144
int sector() const
Return sector number.
static const int NSTEPF
Definition: DTConfig.h:36
TRACOContainer::iterator TRACO_iter
Definition: DTTracoCard.h:52
int station() const
Return station number.
int wheel() const
Return wheel number.
bool debug()
Return TU debug flag.
Definition: DTTracoCard.h:75
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
DTTracoTrigData triggerData(int step, unsigned n) const
Return the data part of the requested trigger.
int useSecondTrack(int step) const
a flag for a usable second track
step
Definition: StallMonitor.cc:94
int nTrig(int step) const
Return the number of trigger candidates.
void DTTracoCard::setConfig ( const DTConfigManager conf)

Set configuration.

Definition at line 68 of file DTTracoCard.cc.

References _conf_luts, _conf_traco_map, _debug, _flag_acc, _lut_from_db, DTGeomSupplier::ChamberId(), DTConfigManager::getDTConfigLUTs(), DTConfigManager::getDTConfigTracoMap(), DTConfigManager::getDTTPGDebug(), DTConfigManager::lutFromDB(), and DTConfigManager::useAcceptParam().

Referenced by DTSCTrigUnit::setConfig().

68  {
69  // get traco configuration map
70  DTChamberId sid = ChamberId();
72  _debug = conf->getDTTPGDebug();
73 
74  // get bti acceptance flag
75  _flag_acc = conf->useAcceptParam();
76 
77  // get lut computation flag
78  _lut_from_db = conf->lutFromDB();
79 
80  // get lut configuration for this chamber
81  // 100511 SV only if luts are read from OMDS
82  if (_lut_from_db)
83  _conf_luts = conf->getDTConfigLUTs(sid);
84 }
const DTConfigLUTs * getDTConfigLUTs(DTChamberId) const
Get desired LUT configuration.
bool _flag_acc
Definition: DTTracoCard.h:151
ConfTracoMap _conf_traco_map
Definition: DTTracoCard.h:145
DTChamberId ChamberId() const
Identifier of the associated chamber.
bool _lut_from_db
Definition: DTTracoCard.h:152
bool getDTTPGDebug() const
Get global debug flag.
const std::map< DTTracoId, DTConfigTraco > & getDTConfigTracoMap(DTChamberId) const
Get desired TRACO configuration map for a given DTChamber.
bool lutFromDB() const
Lut from DB flag.
const DTConfigLUTs * _conf_luts
Definition: DTTracoCard.h:147
bool useAcceptParam() const
Use Bti acceptance parameters (LL,LH,CL,CH,RL,RH)
DTTracoTrig * DTTracoCard::storeTrigger ( DTTracoTrigData  td)

Returns a DTTracoTrig corresponding to a DTTracoTrigData. Creates the corresponding TRACO chip if needed and stores the trigger

Definition at line 323 of file DTTracoCard.cc.

References activeGetTRACO(), DTTracoChip::addTrig(), gather_cfg::cout, DTTracoTrigData::parentId(), DTGeomSupplier::sector(), DTTracoId::sector(), DTGeomSupplier::station(), DTTracoId::station(), DTTracoTrigData::step(), DTTracoId::traco(), DTGeomSupplier::wheel(), and DTTracoId::wheel().

Referenced by getTRACO().

323  {
324  DTTracoId tracoid = td.parentId();
325  if (!(tracoid.wheel() == wheel() && tracoid.sector() == sector() &&
326  tracoid.station() == station()))
327  return nullptr;
328  std::cout << "DTTracoChip::trigger: trigger not belonging to this card! ";
329  std::cout << "card=(" << wheel() << "," << station() << "," << sector()
330  << ") ";
331  std::cout << "trig=(" << tracoid.wheel() << "," << tracoid.station() << ","
332  << tracoid.sector() << ")";
333  // get the appropriate Traco
334  DTTracoChip *traco = activeGetTRACO(tracoid.traco());
335  // create a new trigger in the Traco
336  DTTracoTrig *trig = new DTTracoTrig(traco, td);
337  // add the trigger to the Traco
338  traco->addTrig(td.step(), trig);
339  // return the trigger
340  return trig;
341 }
int sector() const
Return sector number.
void addTrig(int step, DTTracoTrig *)
Add a TRACO trigger.
DTTracoChip * activeGetTRACO(int)
Returns the required DTTracoChip. Create it if it doesn&#39;t exist.
Definition: DTTracoCard.cc:286
int step() const
Return step.
int sector() const
Returns sector number.
Definition: DTTracoId.h:68
int station() const
Return station number.
int traco() const
Returns the traco.
Definition: DTTracoId.h:70
int station() const
Returns station number.
Definition: DTTracoId.h:66
int wheel() const
Return wheel number.
DTTracoId parentId() const
Return parent TRACO identifier.
int wheel() const
Returns wheel number.
Definition: DTTracoId.h:64
std::vector< DTTracoChip * > DTTracoCard::tracoList ( )

Returns the active TRACO list.

Definition at line 310 of file DTTracoCard.cc.

References _tracomap, AlCaHLTBitMon_ParallelJobs::p, and DTCache< T, Coll >::size().

Referenced by getTRACO().

310  {
311 
312  std::vector<DTTracoChip *> blist;
313 
314  if (size() < 1)
315  return blist;
316 
317  for (TRACO_const_iter p = _tracomap.begin(); p != _tracomap.end(); p++) {
318  blist.push_back((*p).second);
319  }
320  return blist;
321 }
TRACOContainer _tracomap
Definition: DTTracoCard.h:144
TRACOContainer::const_iterator TRACO_const_iter
Definition: DTTracoCard.h:51
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:44
DTTSTheta* DTTracoCard::TSTh ( ) const
inline

Return TSTheta.

Definition at line 78 of file DTTracoCard.h.

References _tstheta, getTRACO(), and gen::n.

Referenced by DTTracoChip::storeUncorr().

78 { return _tstheta; }
DTTSTheta * _tstheta
Definition: DTTracoCard.h:142
bool DTTracoCard::useAcceptParamFlag ( )
inline

Return acceptance flag.

Definition at line 114 of file DTTracoCard.h.

References _flag_acc.

Referenced by DTTracoChip::add_btiT().

114 { return _flag_acc; }
bool _flag_acc
Definition: DTTracoCard.h:151

Member Data Documentation

DTBtiCard* DTTracoCard::_bticard
private

Definition at line 141 of file DTTracoCard.h.

Referenced by loadTRACO().

const DTConfigLUTs* DTTracoCard::_conf_luts
private

Definition at line 147 of file DTTracoCard.h.

Referenced by config_luts(), and setConfig().

ConfTracoMap DTTracoCard::_conf_traco_map
private

Definition at line 145 of file DTTracoCard.h.

Referenced by config_traco(), and setConfig().

bool DTTracoCard::_debug
private
bool DTTracoCard::_flag_acc
private

Definition at line 151 of file DTTracoCard.h.

Referenced by loadTRACO(), setConfig(), and useAcceptParamFlag().

bool DTTracoCard::_lut_from_db
private

Definition at line 152 of file DTTracoCard.h.

Referenced by lutFromDBFlag(), and setConfig().

TRACOContainer DTTracoCard::_tracomap
private

Definition at line 144 of file DTTracoCard.h.

Referenced by activeGetTRACO(), getTRACO(), localClear(), runTRACO(), and tracoList().

DTTSTheta* DTTracoCard::_tstheta
private

Definition at line 142 of file DTTracoCard.h.

Referenced by TSTh().