CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 NEWGEO Local direction in chamber of a trigger-data object. More...
 
LocalPoint localPosition (const DTTrigData *) const
 NEWGEO Local position in chamber of a trigger-data object. More...
 
bool lutFromDBFlag ()
 Return lut computation option (DB/geometry) More...
 
virtual void reconstruct ()
 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 ()
 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 49 of file DTTracoCard.cc.

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

Destructor.

Definition at line 59 of file DTTracoCard.cc.

References localClear().

59  {
60 
61 localClear();
62 
63 }
void localClear()
clear the TRACO map
Definition: DTTracoCard.cc:98

Member Function Documentation

DTTracoChip * DTTracoCard::activeGetTRACO ( int  n)
private

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

Definition at line 289 of file DTTracoCard.cc.

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

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

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

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

Definition at line 128 of file DTTracoCard.h.

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

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

Clear all traco stuff (cache & map)

Definition at line 70 of file DTTracoCard.cc.

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

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

70  {
71 
73  localClear();
74 
75 }
void localClear()
clear the TRACO map
Definition: DTTracoCard.cc:98
void clearCache()
Clear cache vector.
Definition: DTCache.h:49
const DTConfigLUTs* DTTracoCard::config_luts ( ) const
inline

Return LUTS config for this chamber (=minicrate)

Definition at line 108 of file DTTracoCard.h.

References _conf_luts.

Referenced by DTTracoChip::DTTracoChip().

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

Return single TRACO config.

Definition at line 464 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()
471  << "," << tracoid.station()
472  << "," << tracoid.traco()
473  << ") not found, return 0" << std::endl;
474  return 0;
475  }
476 
477  return const_cast<DTConfigTraco*>(&(*titer).second);
478 }
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:144
int station() const
Returns station number.
Definition: DTTracoId.h:66
int wheel() const
Returns wheel number.
Definition: DTTracoId.h:64
tuple cout
Definition: gather_cfg.py:121
bool DTTracoCard::debug ( )
inline

Return TU debug flag.

Definition at line 76 of file DTTracoCard.h.

References _debug.

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

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

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

Definition at line 307 of file DTTracoCard.cc.

References _tracomap.

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

307  {
308  TRACO_const_iter ptraco = _tracomap.find(n);
309  if( ptraco==_tracomap.end() ) return 0;
310  return (*ptraco).second;
311 }
TRACOContainer _tracomap
Definition: DTTracoCard.h:143
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 85 of file DTTracoCard.h.

References getTRACO(), and DTTracoId::traco().

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

store BTI triggers in TRACO's

Definition at line 107 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(), DTConfigBti::LH(), DTConfigBti::LL(), localClear(), DTConfig::NBTITC, AlCaHLTBitMon_ParallelJobs::p, DTConfigBti::RH(), DTConfigBti::RL(), DTGeomSupplier::sector(), DTGeomSupplier::station(), relval_parameters_module::step, and DTGeomSupplier::wheel().

Referenced by reconstruct().

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

clear the TRACO map

Definition at line 98 of file DTTracoCard.cc.

References _tracomap, and AlCaHLTBitMon_ParallelJobs::p.

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

98  {
99  // Clear the map
100  for(TRACO_iter p=_tracomap.begin();p!=_tracomap.end();p++){
101  delete (*p).second;
102  }
103  _tracomap.clear();
104 }
TRACOContainer _tracomap
Definition: DTTracoCard.h:143
TRACOContainer::iterator TRACO_iter
Definition: DTTracoCard.h:52
LocalVector DTTracoCard::localDirection ( const DTTrigData tr) const
virtual

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

Implements DTGeomSupplier.

Definition at line 429 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(), and DTTSPhi::localDirection().

429  {
430  //NEWGEO
431  DTTracoTrigData* trig = dynamic_cast<DTTracoTrigData*>(const_cast<DTTrigData*>(tr));
432  if(!trig) {
433  std::cout << "DTtracoCard::localDirection called with wrong argument!" << std::endl;
434  return LocalVector(0,0,0);
435  }
436 
437  //FE position
438  //int FE = geom()->posFE(3);
439 
440  float psi = atan((float)(trig->K())*geom()->cellPitch()
441  /( geom()->distSL() * config_traco(trig->parentId())->BTIC()) );
442 
443  if(config_traco(trig->parentId())->debug()==4)
444  std::cout << "K " << trig->K() << " == psi " << psi << " in FE frame " << std::endl;
445 
446  // (xd,yd,zd) in chamber frame
447  float xd=-sin(psi);
448  float yd=0;
449  float zd=-cos(psi);
450 
451  // 10/07/06 Not needed anymore (chages in geometry)
452  // if(FE==1){//FE in negative y
453  // xd = - xd;
454  //}
455 
456 
457  if(config_traco(trig->parentId())->debug()==4)
458  std::cout << "Direction in chamber frame is (" << xd << "," << yd << "," << zd << ")" << std::endl;
459 
460  return LocalVector(xd,yd,zd);
461 }
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:78
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:81
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:76
DTConfigTraco * config_traco(const DTTracoId &tracoid) const
Return single TRACO config.
Definition: DTTracoCard.cc:464
int K() const
Return trigger K parameter.
tuple cout
Definition: gather_cfg.py:121
LocalPoint DTTracoCard::localPosition ( const DTTrigData tr) const
virtual

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

Implements DTGeomSupplier.

Definition at line 376 of file DTTracoCard.cc.

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

Referenced by DTTSPhi::localPosition().

376  {
377  //NEWGEO
378  DTTracoTrigData* trig = dynamic_cast<DTTracoTrigData*>(const_cast<DTTrigData*>(tr));
379  if(!trig) {
380  std::cout << "DTTracoCard::localPosition called with wrong argument!" << std::endl;
381  return LocalPoint(0,0,0);
382  }
383  float x = geom()->localPosition(trig->parentId()).x();
384  float y = geom()->localPosition(trig->parentId()).y();
385  float z = geom()->localPosition(trig->parentId()).z();
386 
387  float trig_pos = geom()->cellPitch() * ( (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  }
400  else if(trig->posOut()==0) {
401  z += 0.5 * geom()->distSL(); // no outer ==> only inner
402  }
403  return LocalPoint(x,y,z);
404 }
DTTrigGeom * geom() const
Associated geometry.
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
Definition: DTTrigGeom.h:78
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 float float z
float distSL() const
Distance between the phi view superlayers (cms)
Definition: DTTrigGeom.h:81
DTTracoId parentId() const
Return parent TRACO identifier.
DTConfigTraco * config_traco(const DTTracoId &tracoid) const
Return single TRACO config.
Definition: DTTracoCard.cc:464
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:523
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
bool DTTracoCard::lutFromDBFlag ( )
inline

Return lut computation option (DB/geometry)

Definition at line 114 of file DTTracoCard.h.

References _lut_from_db.

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

114 { return _lut_from_db; }
bool _lut_from_db
Definition: DTTracoCard.h:151
virtual void DTTracoCard::reconstruct ( )
inlinevirtual

Load BTIs triggers and run TRACOs algorithm.

Reimplemented from DTCache< T, Coll >.

Definition at line 105 of file DTTracoCard.h.

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

Referenced by DTTrig::triggerReco().

105 { clearCache(); loadTRACO(); runTRACO(); }
void clearCache()
Clear all traco stuff (cache &amp; map)
Definition: DTTracoCard.cc:70
void runTRACO()
run TRACO algorithm
Definition: DTTracoCard.cc:235
void loadTRACO()
store BTI triggers in TRACO&#39;s
Definition: DTTracoCard.cc:107
void DTTracoCard::runTRACO ( )
private

run TRACO algorithm

Definition at line 235 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(), relval_parameters_module::step, DTTracoChip::triggerData(), DTTracoChip::useSecondTrack(), and DTGeomSupplier::wheel().

Referenced by reconstruct().

235  {
236 
237  if(debug()){
238  std::cout << "DTTracoCard:runTRACO called for wheel=" << wheel() ;
239  std::cout << ", station=" << station();
240  std::cout << ", sector=" << sector();
241  std::cout << ", " << _tracomap.size() << " TRACOs with signal" << std::endl;
242  }
243 
244  // run TRACO algorithm on all non-empty TRACO
245  if(_tracomap.size()>0){
246 
247  if(debug()){
248  std::cout << "====================================================" << std::endl;
249  std::cout << " TRACO triggers " << std::endl;
250  }
251 
252 
253  TRACO_iter ptraco;
254  for(ptraco=_tracomap.begin(); ptraco!=_tracomap.end(); ptraco++) {
255  DTTracoChip* traco = (*ptraco).second;
256  traco->run();
258  if( traco->nTrig(step)>0 ){
259  _cache.push_back( traco->triggerData(step,1) );
260  /*
261  std::cout<<"first bti sl3: "<<geom()->localPosition(DTBtiId(wheel(),station(),sector(),3,1))<<std::endl;
262  std::cout<<"traco pos: " << geom()->localPosition((traco->triggerData(step,1).parentId()))<<std::endl;
263  traco->triggerData(step,1).print();
264  std::cout<<"pos: " << localPosition(&(traco->triggerData(step,1))) << std::endl;
265  std::cout<<"dir: " << localDirection(&(traco->triggerData(step,1))) << std::endl;
266  std::cout << std::endl;
267  */
268  }
269  // Store second track only if no first track at previous BX
270  if( traco->nTrig(step)>1 && traco->useSecondTrack(step) ){
271  _cache.push_back( traco->triggerData(step,2) );
272  /*
273  std::cout<<"first bti sl3: "<<geom()->localPosition(DTBtiId(wheel(),station(),sector(),3,1))<<std::endl;
274  std::cout<<"traco pos: " << geom()->localPosition((traco->triggerData(step,2).parentId()))<<std::endl;
275  traco->triggerData(step,2).print();
276  std::cout<<"pos: " << localPosition(&(traco->triggerData(step,2))) << std::endl;
277  std::cout<<"dir: " << localDirection(&(traco->triggerData(step,2))) << std::endl;
278  std::cout << std::endl;
279  */
280  }
281  }
282  }
283  if(debug())
284  std::cout << "====================================================" << std::endl;
285  }
286 }
my_collection _cache
Definition: DTCache.h:56
void run()
Run TRACO algorithm.
Definition: DTTracoChip.cc:255
TRACOContainer _tracomap
Definition: DTTracoCard.h:143
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:76
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.
tuple cout
Definition: gather_cfg.py:121
int useSecondTrack(int step) const
a flag for a usable second track
int nTrig(int step) const
Return the number of trigger candidates.
void DTTracoCard::setConfig ( const DTConfigManager conf)

Set configuration.

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

78  {
79  // get traco configuration map
80  DTChamberId sid = ChamberId();
82  _debug = conf->getDTTPGDebug();
83 
84  // get bti acceptance flag
85  _flag_acc = conf->useAcceptParam();
86 
87  // get lut computation flag
88  _lut_from_db = conf->lutFromDB();
89 
90  // get lut configuration for this chamber
91  // 100511 SV only if luts are read from OMDS
92  if(_lut_from_db)
93  _conf_luts = conf->getDTConfigLUTs(sid);
94 
95 }
const DTConfigLUTs * getDTConfigLUTs(DTChamberId) const
Get desired LUT configuration.
bool _flag_acc
Definition: DTTracoCard.h:150
ConfTracoMap _conf_traco_map
Definition: DTTracoCard.h:144
DTChamberId ChamberId() const
Identifier of the associated chamber.
bool _lut_from_db
Definition: DTTracoCard.h:151
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:146
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 328 of file DTTracoCard.cc.

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

328  {
329  DTTracoId tracoid = td.parentId();
330  if(!(tracoid.wheel()==wheel() &&
331  tracoid.sector()==sector() &&
332  tracoid.station()==station()) ) return 0;
333  std::cout << "DTTracoChip::trigger: trigger not belonging to this card! ";
334  std::cout << "card=(" << wheel() << "," << station() << "," << sector() << ") ";
335  std::cout << "trig=(" << tracoid.wheel() << "," << tracoid.station() << ","
336  << tracoid.sector() << ")";
337  // get the appropriate Traco
338  DTTracoChip* traco = activeGetTRACO(tracoid.traco());
339  // create a new trigger in the Traco
340  DTTracoTrig* trig = new DTTracoTrig(traco,td);
341  // add the trigger to the Traco
342  traco->addTrig(td.step(),trig);
343  // return the trigger
344  return trig;
345 }
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:289
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
tuple cout
Definition: gather_cfg.py:121
std::vector< DTTracoChip * > DTTracoCard::tracoList ( )

Returns the active TRACO list.

Definition at line 314 of file DTTracoCard.cc.

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

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

Return TSTheta.

Definition at line 79 of file DTTracoCard.h.

References _tstheta.

Referenced by DTTracoChip::storeUncorr().

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

Return acceptance flag.

Definition at line 111 of file DTTracoCard.h.

References _flag_acc.

Referenced by DTTracoChip::add_btiT().

111 { return _flag_acc; }
bool _flag_acc
Definition: DTTracoCard.h:150

Member Data Documentation

DTBtiCard* DTTracoCard::_bticard
private

Definition at line 140 of file DTTracoCard.h.

Referenced by loadTRACO().

const DTConfigLUTs* DTTracoCard::_conf_luts
private

Definition at line 146 of file DTTracoCard.h.

Referenced by config_luts(), and setConfig().

ConfTracoMap DTTracoCard::_conf_traco_map
private

Definition at line 144 of file DTTracoCard.h.

Referenced by config_traco(), and setConfig().

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

Definition at line 150 of file DTTracoCard.h.

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

bool DTTracoCard::_lut_from_db
private

Definition at line 151 of file DTTracoCard.h.

Referenced by lutFromDBFlag(), and setConfig().

TRACOContainer DTTracoCard::_tracomap
private

Definition at line 143 of file DTTracoCard.h.

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

DTTSTheta* DTTracoCard::_tstheta
private

Definition at line 141 of file DTTracoCard.h.

Referenced by TSTh().