CMS 3D CMS Logo

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 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...
 
virtual void reconstruct ()
 Virtual reconstruct member. More...
 
virtual void reconstruct (const DTDigiCollection dtDigis)
 
void setConfig (const DTConfigManager *conf)
 Set configuration. More...
 
DTBtiTrigstoreTrigger (DTBtiTrigData)
 
bool useAcceptParamFlag ()
 Return acceptance flag. More...
 
 ~DTBtiCard () 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...
 
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 62 of file DTBtiCard.h.

Constructor & Destructor Documentation

◆ DTBtiCard()

DTBtiCard::DTBtiCard ( DTTrigGeom geom)

Constructor.

Definition at line 60 of file DTBtiCard.cc.

60  : DTGeomSupplier(geom) {
61  //_configBti = new DTConfigBti(bti_pset);
62  //_configBti->print();
63 
64  //DTChamberId sid = ChamberId();
65  //_conf_bti_map = conf_manager->getDTConfigBtiMap(sid);
66  //_debug = conf_manager->getDTTPGDebug();
67 
68  //_finedelay = conf_manager->getDTConfigTrigUnit(sid)->MCSetupTime();
69  //_MCdelay = conf_manager->getDTConfigTrigUnit(sid)->MCDigiOffset();
70 }
DTTrigGeom * geom() const
Associated geometry.
DTGeomSupplier(DTTrigGeom *geom)
Constructor.

◆ ~DTBtiCard()

DTBtiCard::~DTBtiCard ( )
override

Destructor.

Definition at line 76 of file DTBtiCard.cc.

References localClear().

76  {
77  localClear();
78  //delete _conf_Bti;
79 }
void localClear()
clear the BTI maps
Definition: DTBtiCard.cc:100

Member Function Documentation

◆ activeGetBTI() [1/2]

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

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

Definition at line 379 of file DTBtiCard.cc.

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

Referenced by loadBTI(), and storeTrigger().

379  {
380  DTBtiChip* bti = nullptr;
381  //check if BTi is out of range before all
382  if (n < 1 || n > geom()->nCell(sl)) {
383  if (debug()) {
384  std::cout << "DTBtiCard::activeGetBTI :";
385  std::cout << " invalid bti number: " << n;
386  std::cout << " not in range [1," << geom()->nCell(sl) << "]";
387  std::cout << " dummy BTI returned!" << std::endl;
388  }
389  sl = 1;
390  n = 999;
391  return bti;
392  }
393 
394  // get configuration for this chip Identifier
395  DTChamberId sid = geom()->statId();
396  DTBtiId _id = DTBtiId(sid, sl, n);
397 
398  //debug this chip
399  int _debug_bti = config_bti(_id)->debug();
400 
401  if (_debug_bti == 3) {
402  std::cout << "DTBtiCard::activeGetBTI :";
403  std::cout << " bti number: " << n << std::endl;
404  }
405 
406  if (sl < 1 || sl > 3) {
407  if (_debug_bti > 1) {
408  std::cout << "DTBtiCard::activeGetBTI :";
409  std::cout << " invalid superlayer number: " << sl;
410  std::cout << " dummy BTI returned!" << std::endl;
411  }
412  sl = 1;
413  n = 999;
414  return bti;
415  }
416 
417  BTI_iter pbti = _btimap[sl - 1].find(n);
418  if (pbti != _btimap[sl - 1].end()) {
419  bti = (*pbti).second;
420  } else {
421  bti = new DTBtiChip(this, geom(), sl, n, config_bti(_id));
422  _btimap[sl - 1][n] = bti;
423  }
424  return bti;
425 }
BTIContainer _btimap[3]
Definition: DTBtiCard.h:130
DTTrigGeom * geom() const
Associated geometry.
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTTrigGeom.h:53
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41
DTConfigBti * config_bti(DTBtiId &btiid) const
Return bti chip configuration.
Definition: DTBtiCard.cc:637
BTIContainer::iterator BTI_iter
Definition: DTBtiCard.h:56
int debug() const
Debug flag.
Definition: DTConfigBti.h:58
bool debug() const
Return TU debug flag.
Definition: DTBtiCard.h:77
int nCell(int sl) const
Number of BTIs in a required superlayer (i.e. nCells in lay 1)
Definition: DTTrigGeom.h:88

◆ activeGetBTI() [2/2]

DTBtiChip* DTBtiCard::activeGetBTI ( const DTBtiId btiid)
inlineprivate

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

Definition at line 124 of file DTBtiCard.h.

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

Referenced by activeGetBTI().

124 { return activeGetBTI(btiid.superlayer(), btiid.bti()); }
DTBtiChip * activeGetBTI(int sl, int n)
Returns the required DTBtiChip. Create it if it doesn&#39;t exist.
Definition: DTBtiCard.cc:379
int bti() const
Returns the bti.
Definition: DTBtiId.h:63
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:61

◆ btiList()

std::vector< DTBtiChip * > DTBtiCard::btiList ( int  sl)

Returns the active BTI list in a given superlayer.

Definition at line 441 of file DTBtiCard.cc.

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

441  {
442  std::vector<DTBtiChip*> blist;
443 
444  if (size() < 1)
445  return blist;
446 
447  if (sl < 1 || sl > 3) {
448  std::cout << "DTBtiCard::btiList :";
449  std::cout << " invalid superlayer number: " << sl;
450  std::cout << " empty list returned" << std::endl;
451  return blist;
452  }
453 
454  for (BTI_const_iter p = _btimap[sl - 1].begin(); p != _btimap[sl - 1].end(); p++) {
455  blist.push_back((*p).second);
456  }
457  return blist;
458 }
BTIContainer _btimap[3]
Definition: DTBtiCard.h:130
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:44
BTIContainer::const_iterator BTI_const_iter
Definition: DTBtiCard.h:55
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38

◆ clearCache()

void DTBtiCard::clearCache ( )

Clear all BTI stuff (map & cache)

Definition at line 85 of file DTBtiCard.cc.

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

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

85  {
87  localClear();
88 }
void clearCache()
Clear cache vector.
Definition: DTCache.h:47
void localClear()
clear the BTI maps
Definition: DTBtiCard.cc:100

◆ config_bti()

DTConfigBti * DTBtiCard::config_bti ( DTBtiId btiid) const

Return bti chip configuration.

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

637  {
638  //loop on map to find bti
639  ConfBtiMap::const_iterator biter = _conf_bti_map.find(btiid);
640  if (biter == _conf_bti_map.end()) {
641  std::cout << "DTBtiCard::config_bti : BTI (" << btiid.wheel() << "," << btiid.sector() << "," << btiid.station()
642  << "," << btiid.superlayer() << "," << btiid.bti() << ") not found, return 0" << std::endl;
643  return nullptr;
644  }
645 
646  return const_cast<DTConfigBti*>(&(*biter).second);
647 }
ConfBtiMap _conf_bti_map
Definition: DTBtiCard.h:131
int sector() const
Returns sector number.
Definition: DTBtiId.h:59
int bti() const
Returns the bti.
Definition: DTBtiId.h:63
int wheel() const
Returns wheel number.
Definition: DTBtiId.h:55
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:61
int station() const
Returns station number.
Definition: DTBtiId.h:57

◆ debug()

bool DTBtiCard::debug ( ) const
inline

Return TU debug flag.

Definition at line 77 of file DTBtiCard.h.

References _debug.

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

77 { return _debug; }
bool _debug
Definition: DTBtiCard.h:135

◆ getBTI() [1/2]

DTBtiChip * DTBtiCard::getBTI ( int  sl,
int  n 
) const

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

Definition at line 427 of file DTBtiCard.cc.

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

427  {
428  if (sl < 1 || sl > 3 || n == 999) {
429  std::cout << "DTBtiCard::getBTI :";
430  std::cout << " invalid superlayer number: " << sl;
431  std::cout << " 0 returned!" << std::endl;
432  return nullptr;
433  }
434  BTI_const_iter pbti = _btimap[sl - 1].find(n);
435  if (pbti == _btimap[sl - 1].end()) {
436  return nullptr;
437  }
438  return (*pbti).second;
439 }
BTIContainer _btimap[3]
Definition: DTBtiCard.h:130
BTIContainer::const_iterator BTI_const_iter
Definition: DTBtiCard.h:55
const_iterator end() const
Get last cache element.
Definition: DTCache.h:41

◆ getBTI() [2/2]

DTBtiChip* DTBtiCard::getBTI ( const DTBtiId btiid) const
inline

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

Definition at line 83 of file DTBtiCard.h.

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

Referenced by getBTI().

83 { return getBTI(btiid.superlayer(), btiid.bti()); }
int bti() const
Returns the bti.
Definition: DTBtiId.h:63
DTBtiChip * getBTI(int sl, int n) const
Returns the required BTI. Return 0 if it doesn&#39;t exist.
Definition: DTBtiCard.cc:427
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:61

◆ loadBTI()

void DTBtiCard::loadBTI ( const DTDigiCollection  dtDigis)
private

store digi's in DTBtiChip's

Definition at line 237 of file DTBtiCard.cc.

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

Referenced by reconstruct().

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

◆ localClear()

void DTBtiCard::localClear ( )
private

clear the BTI maps

Definition at line 100 of file DTBtiCard.cc.

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

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

100  {
101  // Clear the maps
102  for (int i = 0; i < 3; i++) {
103  for (BTI_iter p = _btimap[i].begin(); p != _btimap[i].end(); p++) {
104  delete (*p).second;
105  }
106  _btimap[i].clear();
107  }
108 
109  //clear digis
110  std::vector<DTDigi*>::const_iterator p;
111  for (p = _digis.begin(); p < _digis.end(); p++)
112  delete (*p);
113  _digis.clear();
114 }
BTIContainer _btimap[3]
Definition: DTBtiCard.h:130
std::vector< DTDigi * > _digis
Definition: DTBtiCard.h:133
BTIContainer::iterator BTI_iter
Definition: DTBtiCard.h:56
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38

◆ localDirection()

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

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

Implements DTGeomSupplier.

Definition at line 562 of file DTBtiCard.cc.

References DTTrigGeom::cellH(), DTTrigGeom::cellPitch(), config_bti(), funct::cos(), gather_cfg::cout, debug(), DTGeomSupplier::geom(), DTTrigGeom::localPosition(), funct::sin(), DTConfigBti::ST(), ClusterTask_cfi::trig, x, y, and z.

562  {
563  //NEWGEO
564  const DTBtiTrigData* trig = dynamic_cast<const DTBtiTrigData*>(tr);
565  //this method is only for check purpose
566  if (!trig) {
567  std::cout << "DTBtiCard::localDirection called with wrong argument!" << std::endl;
568  return LocalVector(0, 0, 0);
569  }
570 
571  //FE position
572  //int FE = geom()->posFE(trig->parentId().superlayer());
573 
574  // psi in BTI frame
575  DTBtiId _btiid = trig->parentId();
576  float psi = atan((float)(trig->K() - config_bti(_btiid)->ST()) * geom()->cellPitch() /
577  (2 * geom()->cellH() * config_bti(_btiid)->ST()));
578  // (xd,yd,zd) in chamber frame
579  float xd = 0;
580  float yd = 0;
581  float zd = -cos(psi);
582  if (trig->btiSL() == 2)
583  yd = sin(psi);
584  else
585  xd = -sin(psi);
586 
587  // 17/07/06 Ths should be obsolete in CMSSW
588  // if(FE==1){//FE in negative y
589  // xd = - xd;
590  // yd = - yd;
591  // }
592 
593  if (debug()) {
594  //BTI position in chamber frame
595  float xb = geom()->localPosition(trig->parentId()).x();
596  float yb = geom()->localPosition(trig->parentId()).y();
597  float zb = geom()->localPosition(trig->parentId()).z();
598 
599  std::cout << "DTBtiCard::localDirection of BTI in (" << xb << "," << yb << "," << zb << ")" << std::endl;
600  std::cout << " called for trig ";
601  trig->print();
602  std::cout << "in Local Direction (" << xd << "," << yd << "," << zd << ")" << std::endl;
603  }
604 
605  return LocalVector(xd, yd, zd);
606 }
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:508
Local3DVector LocalVector
Definition: LocalVector.h:12
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
Definition: DTTrigGeom.h:76
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::map< std::string, int, std::less< std::string > > psi
DTTrigGeom * geom() const
Associated geometry.
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DTConfigBti * config_bti(DTBtiId &btiid) const
Return bti chip configuration.
Definition: DTBtiCard.cc:637
float cellH() const
Height of a cell (cm)
Definition: DTTrigGeom.h:73
float ST() const
Max drift time in 12.5 ns steps.
Definition: DTConfigBti.h:61
bool debug() const
Return TU debug flag.
Definition: DTBtiCard.h:77

◆ localPosition()

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

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

Implements DTGeomSupplier.

Definition at line 519 of file DTBtiCard.cc.

References DTTrigGeom::cellPitch(), config_bti(), gather_cfg::cout, debug(), dqmMemoryStats::float, DTGeomSupplier::geom(), DTTrigGeom::localPosition(), DTConfigBti::ST(), ClusterTask_cfi::trig, x, y, and z.

519  {
520  //NEWGEO!!!
521  const DTBtiTrigData* trig = dynamic_cast<const DTBtiTrigData*>(tr);
522  if (!trig) {
523  std::cout << "DTBtiCard::localPosition called with wrong argument!" << std::endl;
524  return LocalPoint(0, 0, 0);
525  }
526 
527  //BTI position in chamber frame
528  float x = geom()->localPosition(trig->parentId()).x();
529  float y = geom()->localPosition(trig->parentId()).y();
530  float z = geom()->localPosition(trig->parentId()).z();
531 
532  //FE position
533  //int FE = geom()->posFE(trig->parentId().superlayer());
534 
535  //trigger position in the BTI frame
536  float xt = 0;
537  float yt = 0;
538 
539  DTBtiId _btiid = trig->parentId();
540  float xtrig = (float)trig->X() * geom()->cellPitch() / (config_bti(_btiid)->ST());
541  if (trig->btiSL() == 2)
542  yt = -xtrig;
543  else
544  xt = +xtrig;
545 
546  // 17/07/06 Should be obsolete in CMSSW
547  // if(FE==1){//FE in negative y
548  // xt = - xt;
549  // yt = - yt;
550  // }
551 
552  if (debug()) {
553  std::cout << "DTBtiCard::localPosition of BTI in (" << x << "," << y << "," << z << ")" << std::endl;
554  std::cout << " called for trig ";
555  trig->print();
556  std::cout << "in Local Point (" << x + xt << "," << y + yt << "," << z << ")" << std::endl;
557  }
558 
559  return LocalPoint(x + xt, y + yt, z);
560 }
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:508
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
Definition: DTTrigGeom.h:76
DTTrigGeom * geom() const
Associated geometry.
DTConfigBti * config_bti(DTBtiId &btiid) const
Return bti chip configuration.
Definition: DTBtiCard.cc:637
float ST() const
Max drift time in 12.5 ns steps.
Definition: DTConfigBti.h:61
bool debug() const
Return TU debug flag.
Definition: DTBtiCard.h:77

◆ reconstruct() [1/2]

virtual void DTCache< T, Coll >::reconstruct
inline

Virtual reconstruct member.

Definition at line 50 of file DTCache.h.

50 {}

◆ reconstruct() [2/2]

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  {
102  clearCache();
103  loadBTI(dtDigis);
104  runBTI();
105  }
void clearCache()
Clear all BTI stuff (map & cache)
Definition: DTBtiCard.cc:85
void loadBTI(const DTDigiCollection dtDigis)
store digi&#39;s in DTBtiChip&#39;s
Definition: DTBtiCard.cc:237
void runBTI()
run DTBtiChip algorithm
Definition: DTBtiCard.cc:339

◆ runBTI()

void DTBtiCard::runBTI ( )
private

run DTBtiChip algorithm

Definition at line 339 of file DTBtiCard.cc.

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

Referenced by reconstruct().

339  {
340  int nbtisig = _btimap[0].size() + _btimap[1].size() + _btimap[2].size();
341 
342  if (debug()) {
343  std::cout << "DTBtiCard::runBTI called for wheel=" << wheel();
344  std::cout << ", station=" << station();
345  std::cout << ", sector=" << sector();
346  std::cout << ", " << nbtisig << " BTIs with signal" << std::endl;
347  }
348 
349  if (nbtisig) {
350  if (debug()) {
351  std::cout << "====================================================" << std::endl;
352  std::cout << " BTI triggers " << std::endl;
353  }
354 
355  // run DTBtiChip algorithm on all non-empty BTI
356  for (int sl = 1; sl <= 3; sl++) {
357  if (!_btimap[sl - 1].empty()) {
358  BTI_iter pbti;
359  for (pbti = _btimap[sl - 1].begin(); pbti != _btimap[sl - 1].end(); pbti++) {
360  DTBtiChip* bti = (*pbti).second;
361  if (bti->number() < 200)
362  bti->run();
363  for (int step = DTConfig::NSTEPF; step <= DTConfig::NSTEPL; step++) {
364  if (bti->nTrig(step) > 0) {
365  _cache.push_back(bti->triggerData(step, 1));
366  //localPosition(&(bti->triggerData(step,1)));
367  //localDirection(&(bti->triggerData(step,1)));
368  }
369  }
370  }
371  }
372  }
373 
374  if (debug())
375  std::cout << "====================================================" << std::endl;
376  } //end if(nbtisig)
377 }
DTBtiTrigData triggerData(int step, unsigned n) const
Return the data part of the requested trigger.
Definition: DTBtiChip.cc:360
int station() const
Return station number.
BTIContainer _btimap[3]
Definition: DTBtiCard.h:130
my_collection _cache
Definition: DTCache.h:53
static const int NSTEPF
Definition: DTConfig.h:35
void run()
Run DTBtiChip algorithm.
Definition: DTBtiChip.cc:482
int number() const
Return DTBtiChip number.
Definition: DTBtiChip.h:89
int wheel() const
Return wheel number.
int sector() const
Return sector number.
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
BTIContainer::iterator BTI_iter
Definition: DTBtiCard.h:56
int nTrig(int step) const
Number of triggers found.
Definition: DTBtiChip.cc:327
step
Definition: StallMonitor.cc:98
bool debug() const
Return TU debug flag.
Definition: DTBtiCard.h:77
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:38

◆ setConfig()

void DTBtiCard::setConfig ( const DTConfigManager conf)

Set configuration.

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

90  {
91  DTChamberId sid = ChamberId();
92  _conf_bti_map = conf->getDTConfigBtiMap(sid);
93  _debug = conf->getDTTPGDebug();
95 
96  // get bti acceptance flag
97  _flag_acc = conf->useAcceptParam();
98 }
bool getDTTPGDebug() const
Get global debug flag.
ConfBtiMap _conf_bti_map
Definition: DTBtiCard.h:131
const std::map< DTBtiId, DTConfigBti > & getDTConfigBtiMap(DTChamberId) const
Get desired BTI configuration map for a given DTChamber.
const DTConfigPedestals * _pedestals
Definition: DTBtiCard.h:136
bool _debug
Definition: DTBtiCard.h:135
bool useAcceptParam() const
Use Bti acceptance parameters (LL,LH,CL,CH,RL,RH)
const DTConfigPedestals * getDTConfigPedestals() const
Get desired Pedestals configuration.
DTChamberId ChamberId() const
Identifier of the associated chamber.
bool _flag_acc
Definition: DTBtiCard.h:138

◆ storeTrigger()

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 460 of file DTBtiCard.cc.

References activeGetBTI(), DTBtiId::bti(), gather_cfg::cout, eostools::move(), DTBtiTrigData::parentId(), DTBtiId::sector(), DTGeomSupplier::sector(), DTBtiId::station(), DTGeomSupplier::station(), DTBtiTrigData::step(), DTBtiId::superlayer(), ClusterTask_cfi::trig, DTBtiId::wheel(), and DTGeomSupplier::wheel().

460  {
461  DTBtiId btiid = td.parentId();
462  if (!(btiid.wheel() == wheel() && btiid.sector() == sector() && btiid.station() == station()))
463  return nullptr;
464  std::cout << "DTBtiCard::trigger: trigger not belonging to this card! ";
465  std::cout << "card=(" << wheel() << "," << station() << "," << sector() << ") ";
466  std::cout << "trig=(" << btiid.wheel() << "," << btiid.station() << "," << btiid.sector() << ")";
467  // get the appropriate BTI
468  DTBtiChip* bti = activeGetBTI(btiid.superlayer(), btiid.bti());
469  // create a new trigger in the BTI
470  auto trig = std::make_unique<DTBtiTrig>(bti, td);
471  auto pTrig = trig.get();
472  // add the trigger to the BTI
473  bti->addTrig(td.step(), std::move(trig));
474  // return the trigger
475  return pTrig;
476 }
int station() const
Return station number.
int sector() const
Returns sector number.
Definition: DTBtiId.h:59
DTBtiChip * activeGetBTI(int sl, int n)
Returns the required DTBtiChip. Create it if it doesn&#39;t exist.
Definition: DTBtiCard.cc:379
int bti() const
Returns the bti.
Definition: DTBtiId.h:63
int wheel() const
Returns wheel number.
Definition: DTBtiId.h:55
int wheel() const
Return wheel number.
int sector() const
Return sector number.
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:61
DTBtiId parentId() const
Return parent BTI identifier.
Definition: DTBtiTrigData.h:90
int station() const
Returns station number.
Definition: DTBtiId.h:57
int step() const
Return trigger step.
def move(src, dest)
Definition: eostools.py:511

◆ useAcceptParamFlag()

bool DTBtiCard::useAcceptParamFlag ( )
inline

Return acceptance flag.

Definition at line 111 of file DTBtiCard.h.

References _flag_acc.

Referenced by DTBtiChip::DTBtiChip().

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

Member Data Documentation

◆ _btimap

BTIContainer DTBtiCard::_btimap[3]
private

Definition at line 130 of file DTBtiCard.h.

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

◆ _conf_bti_map

ConfBtiMap DTBtiCard::_conf_bti_map
private

Definition at line 131 of file DTBtiCard.h.

Referenced by config_bti(), and setConfig().

◆ _debug

bool DTBtiCard::_debug
private

Definition at line 135 of file DTBtiCard.h.

Referenced by debug(), and setConfig().

◆ _digis

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

Definition at line 133 of file DTBtiCard.h.

Referenced by loadBTI(), and localClear().

◆ _flag_acc

bool DTBtiCard::_flag_acc
private

Definition at line 138 of file DTBtiCard.h.

Referenced by setConfig(), and useAcceptParamFlag().

◆ _pedestals

const DTConfigPedestals* DTBtiCard::_pedestals
private

Definition at line 136 of file DTBtiCard.h.

Referenced by loadBTI(), and setConfig().