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
DTBtiCard Class Reference

#include <DTBtiCard.h>

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

Public Member Functions

std::vector< DTBtiChip * > btiList (int)
 Returns the active BTI list in a given superlayer. More...
 
void clearCache ()
 Clear all BTI stuff (map & cache) More...
 
DTConfigBticonfig_bti (DTBtiId &btiid) const
 Return bti chip configuration. More...
 
bool debug () const
 Return TU debug flag. More...
 
 DTBtiCard (DTTrigGeom *)
 Constructor. More...
 
DTBtiChipgetBTI (int sl, int n) const
 Returns the required BTI. Return 0 if it doesn't exist. More...
 
DTBtiChipgetBTI (const DTBtiId &btiid) const
 Returns the required BTI. 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...
 
virtual void reconstruct (const DTDigiCollection dtDigis)
 
void setConfig (const DTConfigManager *conf)
 Set configuration. More...
 
DTBtiTrigstoreTrigger (DTBtiTrigData)
 
bool useAcceptParamFlag ()
 Return acceptance flag. More...
 
 ~DTBtiCard ()
 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...
 
virtual void reconstruct ()
 Virtual reconstruct member. 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

DTBtiChipactiveGetBTI (int sl, int n)
 Returns the required DTBtiChip. Create it if it doesn't exist. More...
 
DTBtiChipactiveGetBTI (const DTBtiId &btiid)
 Returns the required DTBtiChip. Create it if it doesn't exist. More...
 
void loadBTI (const DTDigiCollection dtDigis)
 store digi's in DTBtiChip's More...
 
void localClear ()
 clear the BTI maps More...
 
void runBTI ()
 run DTBtiChip algorithm More...
 

Private Attributes

BTIContainer _btimap [3]
 
ConfBtiMap _conf_bti_map
 
bool _debug
 
std::vector< DTDigi * > _digis
 
bool _flag_acc
 
const DTConfigPedestals_pedestals
 

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 DTBtiChips

Author
C. Grandi, S. Vanini

Modifications: V/05 S.Vanini : modified to run with new geometry III/07 : SV configuration with DTConfigManager

Definition at line 59 of file DTBtiCard.h.

Constructor & Destructor Documentation

DTBtiCard::DTBtiCard ( DTTrigGeom geom)

Constructor.

Definition at line 62 of file DTBtiCard.cc.

62  :
63  DTGeomSupplier(geom) {
64 
65  //_configBti = new DTConfigBti(bti_pset);
66  //_configBti->print();
67 
68  //DTChamberId sid = ChamberId();
69  //_conf_bti_map = conf_manager->getDTConfigBtiMap(sid);
70  //_debug = conf_manager->getDTTPGDebug();
71 
72  //_finedelay = conf_manager->getDTConfigTrigUnit(sid)->MCSetupTime();
73  //_MCdelay = conf_manager->getDTConfigTrigUnit(sid)->MCDigiOffset();
74 
75 
76 
77 }
DTGeomSupplier(DTTrigGeom *geom)
Constructor.
DTBtiCard::~DTBtiCard ( )

Destructor.

Definition at line 83 of file DTBtiCard.cc.

References localClear().

83  {
84 
85  localClear();
86  //delete _conf_Bti;
87 
88 }
void localClear()
clear the BTI maps
Definition: DTBtiCard.cc:117

Member Function Documentation

DTBtiChip * DTBtiCard::activeGetBTI ( int  sl,
int  n 
)
private

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

Definition at line 406 of file DTBtiCard.cc.

References _btimap, config_bti(), gather_cfg::cout, DTConfigBti::debug(), debug(), DTCache< T, Coll >::end(), DTGeomSupplier::geom(), gen::n, DTTrigGeom::nCell(), and DTTrigGeom::statId().

Referenced by activeGetBTI(), loadBTI(), and storeTrigger().

406  {
407 
408  DTBtiChip* bti=0;
409  //check if BTi is out of range before all
410  if( n<1 || n>geom()->nCell(sl) ){
411  if(debug()){
412  std::cout << "DTBtiCard::activeGetBTI :";
413  std::cout << " invalid bti number: " << n;
414  std::cout << " not in range [1," << geom()->nCell(sl) << "]";
415  std::cout << " dummy BTI returned!" << std::endl;
416  }
417  sl = 1;
418  n = 999;
419  return bti;
420  }
421 
422  // get configuration for this chip Identifier
423  DTChamberId sid = geom()->statId();
424  DTBtiId _id = DTBtiId(sid, sl, n);
425 
426  //debug this chip
427  int _debug_bti = config_bti(_id)->debug();
428 
429  if(_debug_bti==3){
430  std::cout << "DTBtiCard::activeGetBTI :";
431  std::cout << " bti number: " << n << std::endl;
432  }
433 
434  if( sl<1 || sl>3){
435  if(_debug_bti>1){
436  std::cout << "DTBtiCard::activeGetBTI :";
437  std::cout << " invalid superlayer number: " << sl;
438  std::cout << " dummy BTI returned!" << std::endl;
439  }
440  sl = 1;
441  n = 999;
442  return bti;
443  }
444 
445  BTI_iter pbti = _btimap[sl-1].find(n);
446  if( pbti!=_btimap[sl-1].end() ) {
447  bti = (*pbti).second;
448  } else {
449  bti = new DTBtiChip(this, geom(),sl,n, config_bti(_id));
450  _btimap[sl-1][n]=bti;
451  }
452  return bti;
453 }
BTIContainer _btimap[3]
Definition: DTBtiCard.h:130
DTConfigBti * config_bti(DTBtiId &btiid) const
Return bti chip configuration.
Definition: DTBtiCard.cc:676
int debug() const
Debug flag.
Definition: DTConfigBti.h:62
DTTrigGeom * geom() const
Associated geometry.
bool debug() const
Return TU debug flag.
Definition: DTBtiCard.h:76
BTIContainer::iterator BTI_iter
Definition: DTBtiCard.h:53
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTTrigGeom.h:55
tuple cout
Definition: gather_cfg.py:121
const_iterator end() const
Get last cache element.
Definition: DTCache.h:43
int nCell(int sl) const
Number of BTIs in a required superlayer (i.e. nCells in lay 1)
Definition: DTTrigGeom.h:90
DTBtiChip* DTBtiCard::activeGetBTI ( const DTBtiId btiid)
inlineprivate

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

Definition at line 121 of file DTBtiCard.h.

References activeGetBTI(), DTBtiId::bti(), and DTBtiId::superlayer().

121  {
122  return activeGetBTI(btiid.superlayer(),btiid.bti());
123  }
DTBtiChip * activeGetBTI(int sl, int n)
Returns the required DTBtiChip. Create it if it doesn&#39;t exist.
Definition: DTBtiCard.cc:406
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:73
int bti() const
Returns the bti.
Definition: DTBtiId.h:75
std::vector< DTBtiChip * > DTBtiCard::btiList ( int  sl)

Returns the active BTI list in a given superlayer.

Definition at line 471 of file DTBtiCard.cc.

References _btimap, DTCache< T, Coll >::begin(), gather_cfg::cout, AlCaHLTBitMon_ParallelJobs::p, and DTCache< T, Coll >::size().

471  {
472 
473  std::vector<DTBtiChip*> blist;
474 
475  if(size()<1)return blist;
476 
477  if(sl<1||sl>3){
478  std::cout << "DTBtiCard::btiList :";
479  std::cout << " invalid superlayer number: " << sl;
480  std::cout << " empty list returned" << std::endl;
481  return blist;
482  }
483 
484  for(BTI_const_iter p=_btimap[sl-1].begin();p!=_btimap[sl-1].end();p++){
485  blist.push_back((*p).second);
486  }
487  return blist;
488 
489 }
BTIContainer _btimap[3]
Definition: DTBtiCard.h:130
BTIContainer::const_iterator BTI_const_iter
Definition: DTBtiCard.h:52
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
tuple cout
Definition: gather_cfg.py:121
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:46
void DTBtiCard::clearCache ( )

Clear all BTI stuff (map & cache)

Definition at line 95 of file DTBtiCard.cc.

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

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

95  {
96 
98  localClear();
99 
100 }
void clearCache()
Clear cache vector.
Definition: DTCache.h:49
void localClear()
clear the BTI maps
Definition: DTBtiCard.cc:117
DTConfigBti * DTBtiCard::config_bti ( DTBtiId btiid) const

Return bti chip configuration.

Definition at line 676 of file DTBtiCard.cc.

References _conf_bti_map, DTBtiId::bti(), gather_cfg::cout, DTBtiId::sector(), DTBtiId::station(), DTBtiId::superlayer(), and DTBtiId::wheel().

Referenced by activeGetBTI(), DTTracoCard::loadTRACO(), localDirection(), and localPosition().

677 {
678  //loop on map to find bti
679  ConfBtiMap::const_iterator biter = _conf_bti_map.find(btiid);
680  if (biter == _conf_bti_map.end()){
681  std::cout << "DTBtiCard::config_bti : BTI (" << btiid.wheel()
682  << "," << btiid.sector()
683  << "," << btiid.station()
684  << "," << btiid.superlayer()
685  << "," << btiid.bti()
686  << ") not found, return 0" << std::endl;
687  return 0;
688  }
689 
690  return const_cast<DTConfigBti*>(&(*biter).second);
691 
692 }
ConfBtiMap _conf_bti_map
Definition: DTBtiCard.h:131
int wheel() const
Returns wheel number.
Definition: DTBtiId.h:67
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:73
int sector() const
Returns sector number.
Definition: DTBtiId.h:71
int station() const
Returns station number.
Definition: DTBtiId.h:69
int bti() const
Returns the bti.
Definition: DTBtiId.h:75
tuple cout
Definition: gather_cfg.py:121
bool DTBtiCard::debug ( ) const
inline

Return TU debug flag.

Definition at line 76 of file DTBtiCard.h.

References _debug.

Referenced by activeGetBTI(), loadBTI(), localDirection(), localPosition(), and runBTI().

76 {return _debug;}
bool _debug
Definition: DTBtiCard.h:135
DTBtiChip * DTBtiCard::getBTI ( int  sl,
int  n 
) const

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

Definition at line 456 of file DTBtiCard.cc.

References _btimap, gather_cfg::cout, and DTCache< T, Coll >::end().

Referenced by getBTI().

456  {
457  if(sl<1||sl>3||n==999){
458  std::cout << "DTBtiCard::getBTI :";
459  std::cout << " invalid superlayer number: " << sl;
460  std::cout << " 0 returned!" << std::endl;
461  return 0;
462  }
463  BTI_const_iter pbti = _btimap[sl-1].find(n);
464  if( pbti==_btimap[sl-1].end() ){
465  return 0;
466  }
467  return (*pbti).second;
468 }
BTIContainer _btimap[3]
Definition: DTBtiCard.h:130
BTIContainer::const_iterator BTI_const_iter
Definition: DTBtiCard.h:52
tuple cout
Definition: gather_cfg.py:121
const_iterator end() const
Get last cache element.
Definition: DTCache.h:43
DTBtiChip* DTBtiCard::getBTI ( const DTBtiId btiid) const
inline

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

Definition at line 82 of file DTBtiCard.h.

References DTBtiId::bti(), getBTI(), and DTBtiId::superlayer().

82  {
83  return getBTI(btiid.superlayer(),btiid.bti());
84  }
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:73
DTBtiChip * getBTI(int sl, int n) const
Returns the required BTI. Return 0 if it doesn&#39;t exist.
Definition: DTBtiCard.cc:456
int bti() const
Returns the bti.
Definition: DTBtiId.h:75
void DTBtiCard::loadBTI ( const DTDigiCollection  dtDigis)
private

store digi's in DTBtiChip's

Definition at line 258 of file DTBtiCard.cc.

References _digis, _pedestals, activeGetBTI(), DTBtiChip::add_digi(), gather_cfg::cout, debug(), DTGeomSupplier::geom(), DTConfigPedestals::getOffset(), localClear(), DTTrigGeom::mapTubeInFEch(), redigi_cff::pdigi, DTGeomSupplier::sector(), DTGeomSupplier::station(), DTSuperLayerId::superlayer(), and DTGeomSupplier::wheel().

Referenced by reconstruct().

258  {
259 
260  localClear();
261 
262  if(debug()){
263  std::cout << "DTBtiCard::loadBTI called for wheel=" << wheel() ;
264  std::cout << ", station=" << station();
265  std::cout << ", sector=" << sector() << std::endl;
266  }
267 
269  for (detUnitIt=dtDigis.begin();
270  detUnitIt!=dtDigis.end();
271  ++detUnitIt){
272 
273  const DTLayerId& id = (*detUnitIt).first;
274  const DTDigiCollection::Range& range = (*detUnitIt).second;
275 
276  // DTLayerId print-out
277  if(debug()){
278  std::cout<<"--------------"<<std::endl;
279  std::cout<<"id: "<<id;
280  }
281 
282  // Loop over the digis of this DetUnit
283  for (DTDigiCollection::const_iterator digiIt = range.first;
284  digiIt!=range.second;
285  ++digiIt){
286 
287  int tube = (*digiIt).wire();
288  const DTWireId tubeid(id,tube);
289  float tdrift = (*digiIt).time() - _pedestals->getOffset(tubeid);
290 
291  if ( debug() ){
292  std::cout << " digi time : " << (*digiIt).time();
293  std::cout << " pedestal offset : " << _pedestals->getOffset(tubeid) << std::endl;
294  std::cout << " drift time after subtraction : " << tdrift << std::endl;
295  }
296 
297 
298  if(tdrift<500 && tdrift>-500){
299  if(debug())
300  (*digiIt).print();
301 
302  // get bti number for access to the configuration for this bti chip : SV
303  // FIX: for the moment take first bti configuration!!!!! ok fixed
304  DTSuperLayerId slnum = id.superlayerId();
305  //DTChamberId dtcham =id.chamberId();
306  int sln = slnum.superlayer();
307  int layn = id.layer();
308  //int tube = (*digiIt).wire();
309 
310  // map in FE channel number: SL theta tubes are numbered inversely w.r.t. hardware setup in new geometry 19/06/06
311  // assign ch numbers to btis: in new geometry does not depend on layer staggering anymore! Same staggering anywhere.
312  //int nch = geom()->mapTubeInFEch(sln,layn,tube);
313  // int nbti = nch + geom()->layerFEStaggering(sln,layn);
314 
315  int nch = geom()->mapTubeInFEch(sln,layn,tube);
316  int nbti = nch ;
317 
318  if(debug()){
319  std::cout << "FE ch " << nch;
320  std::cout << " of bti " << nbti;
321 // std::cout << " staggering " << geom()->layerFEStaggering(sln,layn);
322  std::cout << " now nbti is " << nch << std::endl;
323 // std::cout << " SL phi offset " << geom()->phiSLOffset() << std::endl;
324  }
325 
326  // FIXED get configuration for the nbti chip Identifier, and from it MCdelay + finedelay
327  //DTChamberId sid = geom()->statId();
328  //DTBtiId _id = DTBtiId(sid, sln, nbti);
329 
330  DTDigi* pdigi = new DTDigi((*digiIt).wire(),tdrift);
331  _digis.push_back(pdigi);
332 
333 
334  switch(layn) {
335  case 1:
336  if(activeGetBTI(sln, nbti )) activeGetBTI(sln, nbti )->add_digi(4, pdigi);
337  if(activeGetBTI(sln, nbti-1)) activeGetBTI(sln, nbti-1)->add_digi(8, pdigi);
338  break;
339  case 2:
340  if(activeGetBTI(sln, nbti )) activeGetBTI(sln, nbti )->add_digi(2, pdigi);
341  if(activeGetBTI(sln, nbti-1)) activeGetBTI(sln, nbti-1)->add_digi(6, pdigi);
342  break;
343  case 3:
344  if(activeGetBTI(sln, nbti )) activeGetBTI(sln, nbti )->add_digi(3, pdigi);
345  if(activeGetBTI(sln, nbti-1)) activeGetBTI(sln, nbti-1)->add_digi(7, pdigi);
346  break;
347  case 4:
348  if(activeGetBTI(sln, nbti )) activeGetBTI(sln, nbti )->add_digi(1, pdigi);
349  if(activeGetBTI(sln, nbti-1)) activeGetBTI(sln, nbti-1)->add_digi(5, pdigi);
350  if(activeGetBTI(sln, nbti-2)) activeGetBTI(sln, nbti-2)->add_digi(9, pdigi);
351  break;
352  }
353  }//end loop on digi
354  // }//end loop on lay
355  // }//end loop on sl
356  }
357  }
358 }
std::vector< DTDigi * > _digis
Definition: DTBtiCard.h:133
DTTrigGeom * geom() const
Associated geometry.
int mapTubeInFEch(int nsl, int nlay, int ntube) const
Staggering of first wire of layer respect to default: obsolete 19/6/06.
Definition: DTTrigGeom.cc:144
int sector() const
Return sector number.
DTBtiChip * activeGetBTI(int sl, int n)
Returns the required DTBtiChip. Create it if it doesn&#39;t exist.
Definition: DTBtiCard.cc:406
int station() const
Return station number.
const DTConfigPedestals * _pedestals
Definition: DTBtiCard.h:136
bool debug() const
Return TU debug flag.
Definition: DTBtiCard.h:76
int wheel() const
Return wheel number.
tuple pdigi
Definition: redigi_cff.py:10
float getOffset(const DTWireId &wire) const
Get wire by wire delay.
Definition: DTDigi.h:17
int superlayer() const
Return the superlayer number (deprecated method name)
std::vector< DTDigi >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
tuple cout
Definition: gather_cfg.py:121
void add_digi(int cell, const DTDigi *digi)
Add a digi to the DTBtiChip.
Definition: DTBtiChip.cc:327
void localClear()
clear the BTI maps
Definition: DTBtiCard.cc:117
void DTBtiCard::localClear ( )
private

clear the BTI maps

Definition at line 117 of file DTBtiCard.cc.

References _btimap, _digis, DTCache< T, Coll >::begin(), i, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by clearCache(), loadBTI(), and ~DTBtiCard().

117  {
118 // Clear the maps
119  for(int i=0; i<3; i++){
120  for(BTI_iter p=_btimap[i].begin();p!=_btimap[i].end();p++){
121  delete (*p).second;
122  }
123  _btimap[i].clear();
124  }
125 
126  //clear digis
127  std::vector<DTDigi*>::const_iterator p;
128  for(p=_digis.begin();p<_digis.end();p++)
129  delete (*p);
130  _digis.clear();
131 }
BTIContainer _btimap[3]
Definition: DTBtiCard.h:130
int i
Definition: DBlmapReader.cc:9
std::vector< DTDigi * > _digis
Definition: DTBtiCard.h:133
BTIContainer::iterator BTI_iter
Definition: DTBtiCard.h:53
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
LocalVector DTBtiCard::localDirection ( const DTTrigData tr) const
virtual

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

Implements DTGeomSupplier.

Definition at line 600 of file DTBtiCard.cc.

References DTBtiTrigData::btiSL(), DTTrigGeom::cellH(), DTTrigGeom::cellPitch(), config_bti(), funct::cos(), gather_cfg::cout, debug(), DTGeomSupplier::geom(), DTBtiTrigData::K(), DTTrigGeom::localPosition(), DTBtiTrigData::parentId(), DTBtiTrigData::print(), funct::sin(), DTConfigBti::ST(), x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

600  {
601 //NEWGEO
602  const DTBtiTrigData* trig = dynamic_cast<const DTBtiTrigData*>(tr);
603  //this method is only for check purpose
604  if(!trig) {
605  std::cout << "DTBtiCard::localDirection called with wrong argument!" << std::endl;
606  return LocalVector(0,0,0);
607  }
608 
609  //FE position
610  //int FE = geom()->posFE(trig->parentId().superlayer());
611 
612  // psi in BTI frame
613  DTBtiId _btiid = trig->parentId();
614  float psi = atan((float)(trig->K() - config_bti(_btiid)->ST())*geom()->cellPitch()
615  /(2*geom()->cellH() * config_bti(_btiid)->ST()));
616  // (xd,yd,zd) in chamber frame
617  float xd=0;
618  float yd=0;
619  float zd=-cos(psi);
620  if(trig->btiSL()==2)
621  yd = sin(psi);
622  else
623  xd = -sin(psi);
624 
625 // 17/07/06 Ths should be obsolete in CMSSW
626 // if(FE==1){//FE in negative y
627 // xd = - xd;
628 // yd = - yd;
629 // }
630 
631  if(debug()){
632  //BTI position in chamber frame
633  float xb = geom()->localPosition(trig->parentId()).x();
634  float yb = geom()->localPosition(trig->parentId()).y();
635  float zb = geom()->localPosition(trig->parentId()).z();
636 
637  std::cout << "DTBtiCard::localDirection of BTI in ("<<xb<<","<<yb<<","<<zb<<")"<<std::endl;
638  std::cout << " called for trig ";
639  trig->print();
640  std::cout << "in Local Direction ("<<xd<<","<<yd<<","<<zd<<")"<<std::endl;
641  }
642 
643  return LocalVector(xd,yd,zd);
644 }
DTConfigBti * config_bti(DTBtiId &btiid) const
Return bti chip configuration.
Definition: DTBtiCard.cc:676
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
DTBtiId parentId() const
Return parent BTI identifier.
float ST() const
Max drift time in 12.5 ns steps.
Definition: DTConfigBti.h:65
float float float z
std::map< std::string, int, std::less< std::string > > psi
bool debug() const
Return TU debug flag.
Definition: DTBtiCard.h:76
float cellH() const
Height of a cell (cm)
Definition: DTTrigGeom.h:75
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int btiSL() const
Return parent BTI superlayer.
int K() const
Return trigger K parameter.
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:523
void print() const
Print.
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
LocalPoint DTBtiCard::localPosition ( const DTTrigData tr) const
virtual

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

Implements DTGeomSupplier.

Definition at line 553 of file DTBtiCard.cc.

References DTBtiTrigData::btiSL(), DTTrigGeom::cellPitch(), config_bti(), gather_cfg::cout, debug(), DTGeomSupplier::geom(), DTTrigGeom::localPosition(), DTBtiTrigData::parentId(), DTBtiTrigData::print(), DTConfigBti::ST(), x, DTBtiTrigData::X(), detailsBasic3DVector::y, and detailsBasic3DVector::z.

553  {
554 //NEWGEO!!!
555  const DTBtiTrigData* trig = dynamic_cast<const DTBtiTrigData*>(tr);
556  if(!trig) {
557  std::cout << "DTBtiCard::localPosition called with wrong argument!" << std::endl;
558  return LocalPoint(0,0,0);
559  }
560 
561  //BTI position in chamber frame
562  float x = geom()->localPosition(trig->parentId()).x();
563  float y = geom()->localPosition(trig->parentId()).y();
564  float z = geom()->localPosition(trig->parentId()).z();
565 
566  //FE position
567  //int FE = geom()->posFE(trig->parentId().superlayer());
568 
569  //trigger position in the BTI frame
570  float xt = 0;
571  float yt = 0;
572 
573  DTBtiId _btiid = trig->parentId();
574  float xtrig = (float)trig->X() * geom()->cellPitch() / (config_bti(_btiid)->ST());
575  if(trig->btiSL()==2)
576  yt = - xtrig;
577  else
578  xt = + xtrig;
579 
580 // 17/07/06 Should be obsolete in CMSSW
581 // if(FE==1){//FE in negative y
582 // xt = - xt;
583 // yt = - yt;
584 // }
585 
586 
587 
588  if(debug()){
589  std::cout << "DTBtiCard::localPosition of BTI in ("<<x<<","<<y<<","<<z<<")"<<std::endl;
590  std::cout << " called for trig ";
591  trig->print();
592  std::cout << "in Local Point ("<<x+xt<<","<<y+yt<<","<<z<<")"<<std::endl;
593  }
594 
595  return LocalPoint(x+xt,y+yt,z);
596 }
DTConfigBti * config_bti(DTBtiId &btiid) const
Return bti chip configuration.
Definition: DTBtiCard.cc:676
DTTrigGeom * geom() const
Associated geometry.
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
Definition: DTTrigGeom.h:78
DTBtiId parentId() const
Return parent BTI identifier.
float ST() const
Max drift time in 12.5 ns steps.
Definition: DTConfigBti.h:65
float float float z
bool debug() const
Return TU debug flag.
Definition: DTBtiCard.h:76
int X() const
Return trigger X parameter.
int btiSL() const
Return parent BTI superlayer.
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:523
void print() const
Print.
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
virtual void DTBtiCard::reconstruct ( const DTDigiCollection  dtDigis)
inlinevirtual

Definition at line 101 of file DTBtiCard.h.

References clearCache(), loadBTI(), and runBTI().

Referenced by DTTrig::triggerReco().

101 { clearCache();loadBTI(dtDigis); runBTI(); }
void clearCache()
Clear all BTI stuff (map &amp; cache)
Definition: DTBtiCard.cc:95
void loadBTI(const DTDigiCollection dtDigis)
store digi&#39;s in DTBtiChip&#39;s
Definition: DTBtiCard.cc:258
void runBTI()
run DTBtiChip algorithm
Definition: DTBtiCard.cc:361
void DTBtiCard::runBTI ( )
private

run DTBtiChip algorithm

Definition at line 361 of file DTBtiCard.cc.

References _btimap, DTCache< T, Coll >::_cache, DTCache< T, Coll >::begin(), gather_cfg::cout, debug(), DTConfig::NSTEPF, DTConfig::NSTEPL, DTBtiChip::nTrig(), DTBtiChip::number(), DTBtiChip::run(), DTGeomSupplier::sector(), DTCache< T, Coll >::size(), DTGeomSupplier::station(), relval_parameters_module::step, DTBtiChip::triggerData(), and DTGeomSupplier::wheel().

Referenced by reconstruct().

361  {
362 
363  int nbtisig = _btimap[0].size()+_btimap[1].size()+_btimap[2].size();
364 
365  if(debug()){
366  std::cout << "DTBtiCard::runBTI called for wheel=" << wheel() ;
367  std::cout << ", station=" << station();
368  std::cout << ", sector=" << sector();
369  std::cout << ", " << nbtisig
370  << " BTIs with signal" << std::endl;
371  }
372 
373  if( nbtisig){
374 
375  if(debug()){
376  std::cout << "====================================================" << std::endl;
377  std::cout << " BTI triggers " << std::endl;
378  }
379 
380 
381  // run DTBtiChip algorithm on all non-empty BTI
382  for(int sl=1;sl<=3;sl++){
383  if(_btimap[sl-1].size()>0){
384  BTI_iter pbti;
385  for(pbti=_btimap[sl-1].begin(); pbti!=_btimap[sl-1].end(); pbti++) {
386  DTBtiChip* bti = (*pbti).second;
387  if(bti->number()<200)
388  bti->run();
390  if(bti->nTrig(step)>0) {
391  _cache.push_back( bti->triggerData(step,1) );
392  //localPosition(&(bti->triggerData(step,1)));
393  //localDirection(&(bti->triggerData(step,1)));
394  }
395  }
396  }
397  }
398  }
399 
400  if(debug())
401  std::cout << "====================================================" << std::endl;
402  }//end if(nbtisig)
403 }
BTIContainer _btimap[3]
Definition: DTBtiCard.h:130
my_collection _cache
Definition: DTCache.h:56
int sector() const
Return sector number.
static const int NSTEPF
Definition: DTConfig.h:36
int station() const
Return station number.
bool debug() const
Return TU debug flag.
Definition: DTBtiCard.h:76
void run()
Run DTBtiChip algorithm.
Definition: DTBtiChip.cc:630
DTBtiTrigData triggerData(int step, unsigned n) const
Return the data part of the requested trigger.
Definition: DTBtiChip.cc:491
int wheel() const
Return wheel number.
int nTrig(int step) const
Number of triggers found.
Definition: DTBtiChip.cc:455
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
int number() const
Return DTBtiChip number.
Definition: DTBtiChip.h:87
BTIContainer::iterator BTI_iter
Definition: DTBtiCard.h:53
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:40
tuple cout
Definition: gather_cfg.py:121
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:46
void DTBtiCard::setConfig ( const DTConfigManager conf)

Set configuration.

Definition at line 103 of file DTBtiCard.cc.

References _conf_bti_map, _debug, _flag_acc, _pedestals, DTGeomSupplier::ChamberId(), DTConfigManager::getDTConfigBtiMap(), DTConfigManager::getDTConfigPedestals(), DTConfigManager::getDTTPGDebug(), and DTConfigManager::useAcceptParam().

Referenced by DTSCTrigUnit::setConfig().

103  {
104 
105  DTChamberId sid = ChamberId();
106  _conf_bti_map = conf->getDTConfigBtiMap(sid);
107  _debug = conf->getDTTPGDebug();
109 
110  // get bti acceptance flag
111  _flag_acc = conf->useAcceptParam();
112 
113 }
ConfBtiMap _conf_bti_map
Definition: DTBtiCard.h:131
const DTConfigPedestals * _pedestals
Definition: DTBtiCard.h:136
bool _debug
Definition: DTBtiCard.h:135
const std::map< DTBtiId, DTConfigBti > & getDTConfigBtiMap(DTChamberId) const
Get desired BTI configuration map for a given DTChamber.
DTChamberId ChamberId() const
Identifier of the associated chamber.
bool getDTTPGDebug() const
Get global debug flag.
bool useAcceptParam() const
Use Bti acceptance parameters (LL,LH,CL,CH,RL,RH)
bool _flag_acc
Definition: DTBtiCard.h:138
const DTConfigPedestals * getDTConfigPedestals() const
Get desired Pedestals configuration.
DTBtiTrig * DTBtiCard::storeTrigger ( DTBtiTrigData  td)

Returns a DTBtiTrig corresponding to a DTBtiTrigData. Creates the corresponding BTI chip if needed and stores the trigger

Definition at line 492 of file DTBtiCard.cc.

References activeGetBTI(), DTBtiChip::addTrig(), DTBtiId::bti(), gather_cfg::cout, DTBtiTrigData::parentId(), DTGeomSupplier::sector(), DTBtiId::sector(), DTGeomSupplier::station(), DTBtiId::station(), DTBtiTrigData::step(), DTBtiId::superlayer(), DTGeomSupplier::wheel(), and DTBtiId::wheel().

492  {
493  DTBtiId btiid = td.parentId();
494  if(!(btiid.wheel()==wheel() &&
495  btiid.sector()==sector() &&
496  btiid.station()==station()) ) return 0;
497  std::cout << "DTBtiCard::trigger: trigger not belonging to this card! ";
498  std::cout << "card=(" << wheel() << "," << station() << "," << sector() << ") ";
499  std::cout << "trig=(" << btiid.wheel() << "," << btiid.station() << ","
500  << btiid.sector() << ")";
501  // get the appropriate BTI
502  DTBtiChip* bti = activeGetBTI(btiid.superlayer(), btiid.bti());
503  // create a new trigger in the BTI
504  DTBtiTrig* trig = new DTBtiTrig(bti,td);
505  // add the trigger to the BTI
506  bti->addTrig(td.step(),trig);
507  // return the trigger
508  return trig;
509 }
int sector() const
Return sector number.
DTBtiId parentId() const
Return parent BTI identifier.
DTBtiChip * activeGetBTI(int sl, int n)
Returns the required DTBtiChip. Create it if it doesn&#39;t exist.
Definition: DTBtiCard.cc:406
int station() const
Return station number.
int wheel() const
Returns wheel number.
Definition: DTBtiId.h:67
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:73
int sector() const
Returns sector number.
Definition: DTBtiId.h:71
int wheel() const
Return wheel number.
int station() const
Returns station number.
Definition: DTBtiId.h:69
int bti() const
Returns the bti.
Definition: DTBtiId.h:75
void addTrig(int step, DTBtiTrig *btitrig)
Definition: DTBtiChip.cc:441
tuple cout
Definition: gather_cfg.py:121
int step() const
Return trigger step.
bool DTBtiCard::useAcceptParamFlag ( )
inline

Return acceptance flag.

Definition at line 107 of file DTBtiCard.h.

References _flag_acc.

Referenced by DTBtiChip::DTBtiChip().

107 { return _flag_acc; }
bool _flag_acc
Definition: DTBtiCard.h:138

Member Data Documentation

BTIContainer DTBtiCard::_btimap[3]
private

Definition at line 130 of file DTBtiCard.h.

Referenced by activeGetBTI(), btiList(), getBTI(), localClear(), and runBTI().

ConfBtiMap DTBtiCard::_conf_bti_map
private

Definition at line 131 of file DTBtiCard.h.

Referenced by config_bti(), and setConfig().

bool DTBtiCard::_debug
private
std::vector<DTDigi*> DTBtiCard::_digis
private

Definition at line 133 of file DTBtiCard.h.

Referenced by loadBTI(), and localClear().

bool DTBtiCard::_flag_acc
private

Definition at line 138 of file DTBtiCard.h.

Referenced by setConfig(), and useAcceptParamFlag().

const DTConfigPedestals* DTBtiCard::_pedestals
private

Definition at line 136 of file DTBtiCard.h.

Referenced by loadBTI(), and setConfig().