CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
DTTrig Class Reference

#include <DTTrig.h>

Public Types

typedef std::map< DTChamberId,
DTDigiCollection, std::less
< DTChamberId > > 
DTDigiMap
 
typedef DTDigiMap::const_iterator DTDigiMap_const_iterator
 
typedef DTDigiMap::iterator DTDigiMap_iterator
 
typedef std::pair< TU_iterator,
TU_iterator
Range
 
typedef SCcontainer::const_iterator SC_const_iterator
 
typedef SCcontainer::iterator SC_iterator
 
typedef std::map< DTSectCollId,
DTSectColl *, std::less
< DTSectCollId > > 
SCcontainer
 
typedef std::pair< SC_iterator,
SC_iterator
SCRange
 
typedef TUcontainer::const_iterator TU_const_iterator
 
typedef TUcontainer::iterator TU_iterator
 
typedef std::map< DTChamberId,
DTSCTrigUnit *, std::less
< DTChamberId > > 
TUcontainer
 

Public Member Functions

TU_iterator begin ()
 Begin of the trigger units store. More...
 
SC_iterator begin1 ()
 Begin of the sector collector store. More...
 
std::vector< DTBtiTrigDataBtiTrigs ()
 Return a copy of all the BTI triggers. More...
 
Range cache ()
 Begin of the trigger units store. More...
 
SCRange cache1 ()
 Range of the sector collector store. More...
 
DTChambPhSegmchPhiSegm1 (DTChamberId sid, int step)
 Return the first phi track segment in req. chamber/step. More...
 
DTChambPhSegmchPhiSegm1 (DTSCTrigUnit *unit, int step)
 Return the first phi track segment in req. chamber/step. More...
 
DTChambPhSegmchPhiSegm1 (int wheel, int stat, int sect, int step)
 Return the first phi track segment in req. chamber/step, MTTF numbering. More...
 
DTChambPhSegmchPhiSegm2 (DTChamberId sid, int step)
 Return the second phi track segment in req. chamber/step. More...
 
DTChambPhSegmchPhiSegm2 (DTSCTrigUnit *unit, int step)
 Return the second phi track segment in req. chamber/step. More...
 
DTChambPhSegmchPhiSegm2 (int wheel, int stat, int sect, int step)
 Return the second phi track segment in req. chamber/step, MTTF numbering. More...
 
DTSectCollPhSegmchSectCollPhSegm1 (DTSectColl *unit, int step)
 Return the first phi track segment in req. chamber/step [SC step]. More...
 
DTSectCollPhSegmchSectCollPhSegm1 (int wheel, int sect, int step)
 Return the first phi track segment in req. chamber/step, [MTTF numbering & SC step]. More...
 
DTSectCollPhSegmchSectCollPhSegm2 (DTSectColl *unit, int step)
 Return the second phi track segment in req. chamber/step [SC step]. More...
 
DTSectCollPhSegmchSectCollPhSegm2 (int wheel, int sect, int step)
 Return the second phi track segment in req. chamber/step, [MTTF numbering & SC step]. More...
 
DTSectCollThSegmchSectCollThSegm (DTSectColl *unit, int step)
 Return the theta track segment in req. chamber/step [SC step]. More...
 
DTSectCollThSegmchSectCollThSegm (int wheel, int sect, int step)
 Return the theta track segment in req. chamber/step, [MTTF numbering & SC step]. More...
 
DTChambThSegmchThetaSegm (DTChamberId sid, int step)
 Return the theta candidates in req. chamber/step. More...
 
DTChambThSegmchThetaSegm (DTSCTrigUnit *unit, int step)
 Return the theta candidates in req. chamber/step. More...
 
DTChambThSegmchThetaSegm (int wheel, int stat, int sect, int step)
 Return the theta candidates in req. chamber/step, MTTF numbering. More...
 
void clear ()
 Clear the trigger units cache. More...
 
GlobalVector CMSDirection (const DTTrigData *trig) const
 Direction of a trigger-data object in CMS frame. More...
 
GlobalPoint CMSPosition (const DTTrigData *trig) const
 Coordinate of a trigger-data object in CMS frame. More...
 
void createTUs (const edm::EventSetup &iSetup)
 Create the trigger units and store them in the cache. More...
 
 DTTrig (const edm::ParameterSet &params)
 Constructors. More...
 
void dumpGeom ()
 Dump the geometry. More...
 
void dumpLuts (short int lut_btic, const DTConfigManager *conf)
 Dump the LUT files. More...
 
TU_iterator end ()
 End of the trigger units store. More...
 
SC_iterator end1 ()
 End of the sectoor collector store. More...
 
TU_iterator find (DTChamberId id)
 Find a trigger unit in the map. More...
 
SC_iterator find1 (DTSectCollId id)
 Find a Sector Collector in the map. More...
 
int getBXOffset ()
 Get BX Offset. More...
 
LocalVector localDirection (const DTTrigData *trig) const
 Direction of a trigger-data object in chamber frame. More...
 
LocalPoint localPosition (const DTTrigData *trig) const
 Coordinate of a trigger-data object in chamber frame. More...
 
void print (DTTrigData *trig) const
 Print a trigger-data object. More...
 
std::vector< DTSectCollPhSegmSCPhTrigs ()
 Return a copy of all the Sector Collector (Phi) triggers. More...
 
std::vector< DTSectCollThSegmSCThTrigs ()
 Return a copy of all the Sector Collector (Theta) triggers. More...
 
int size ()
 Size of the trigger units store. More...
 
int size1 ()
 Size of the sector collector store. More...
 
std::vector< DTTracoTrigDataTracoTrigs ()
 Return a copy of all the TRACO triggers. More...
 
void triggerReco (const edm::Event &iEvent, const edm::EventSetup &iSetup)
 Run the whole trigger reconstruction chain. More...
 
DTSCTrigUnittrigUnit (DTChamberId sid)
 Return a trigger unit - Muon numbering. More...
 
DTSCTrigUnittrigUnit (int wheel, int stat, int sect)
 Return a trigger unit - Muon numbering, MTTF numbering. More...
 
std::vector< DTChambPhSegmTSPhTrigs ()
 Return a copy of all the Trigger Server (Phi) triggers. More...
 
std::vector< DTChambThSegmTSThTrigs ()
 Return a copy of all the Trigger Server (Theta) triggers. More...
 
void updateES (const edm::EventSetup &iSetup)
 update the eventsetup info More...
 
 ~DTTrig ()
 Destructor. More...
 

Private Member Functions

DTSCTrigUnitconstTrigUnit (DTChamberId sid) const
 Return a trigger unit - Muon numbering - const version. More...
 
DTSCTrigUnitconstTrigUnit (int wheel, int stat, int sect) const
 Return a trigger unit - Muon numbering, MTTF numbering - const version. More...
 
DTSectCollSCUnit (DTSectCollId scid) const
 Return a SC unit - Muon numbering - const version. More...
 
DTSectCollSCUnit (int wheel, int sect) const
 Return a SC Unit Muon Numbering, MTTF numbering - const version. More...
 

Private Attributes

TUcontainer _cache
 
SCcontainer _cache1
 
const DTConfigManager_conf_manager
 
unsigned long long _configid
 
bool _debug
 
DTTTrigBaseSync_digi_sync
 
edm::InputTag _digitag
 
unsigned long long _geomid
 
bool _inputexist
 
unsigned long long _t0id
 
unsigned long long _ttrigid
 
bool _usesyncdb
 

Detailed Description

Steering routine for L1 trigger simulation in a muon barrel station

Date:
2009/11/02 14:18:30
Revision:
1.12
Author
C.Grandi

Definition at line 54 of file DTTrig.h.

Member Typedef Documentation

Definition at line 66 of file DTTrig.h.

typedef DTDigiMap::const_iterator DTTrig::DTDigiMap_const_iterator

Definition at line 68 of file DTTrig.h.

typedef DTDigiMap::iterator DTTrig::DTDigiMap_iterator

Definition at line 67 of file DTTrig.h.

Definition at line 64 of file DTTrig.h.

typedef SCcontainer::const_iterator DTTrig::SC_const_iterator

Definition at line 63 of file DTTrig.h.

typedef SCcontainer::iterator DTTrig::SC_iterator

Definition at line 62 of file DTTrig.h.

typedef std::map< DTSectCollId,DTSectColl*,std::less<DTSectCollId> > DTTrig::SCcontainer

Definition at line 61 of file DTTrig.h.

Definition at line 65 of file DTTrig.h.

typedef TUcontainer::const_iterator DTTrig::TU_const_iterator

Definition at line 60 of file DTTrig.h.

typedef TUcontainer::iterator DTTrig::TU_iterator

Definition at line 59 of file DTTrig.h.

typedef std::map< DTChamberId,DTSCTrigUnit*,std::less<DTChamberId> > DTTrig::TUcontainer

Definition at line 58 of file DTTrig.h.

Constructor & Destructor Documentation

DTTrig::DTTrig ( const edm::ParameterSet params)

Constructors.

Definition at line 56 of file DTTrig.cc.

References _debug, _digi_sync, _digitag, _usesyncdb, gather_cfg::cout, reco::get(), edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

56  :
57  _inputexist(1) , _configid(0) , _geomid(0) , _t0id(0) , _ttrigid(0) {
58 
59  // Set configuration parameters
60  // _debug = _conf_manager->getDTTPGDebug();
61  _debug = params.getUntrackedParameter<bool>("debug"); // CB FIXME: update when debug will be fully configured from parameter set
62 
63  if(_debug){
64  std::cout << std::endl;
65  std::cout << "**** Initialization of DTTrigger ****" << std::endl;
66  std::cout << std::endl;
67  std::cout << "DTTrig::DTTrig creating synchronizer" << std::endl;
68  }
69 
70  _digitag = params.getParameter<edm::InputTag>("digiTag");
71  _digi_sync = DTTTrigSyncFactory::get()->create(params.getParameter<std::string>("tTrigMode"),
72  params.getParameter<edm::ParameterSet>("tTrigModeConfig"));
73  _usesyncdb = params.getParameter<std::string>("tTrigMode")!="DTTTrigSyncTOFCorr";
74 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned long long _ttrigid
Definition: DTTrig.h:260
bool _debug
Definition: DTTrig.h:253
bool _usesyncdb
Definition: DTTrig.h:254
unsigned long long _geomid
Definition: DTTrig.h:258
edm::InputTag _digitag
Definition: DTTrig.h:252
DTTTrigBaseSync * _digi_sync
Definition: DTTrig.h:251
unsigned long long _t0id
Definition: DTTrig.h:259
bool _inputexist
Definition: DTTrig.h:255
tuple cout
Definition: gather_cfg.py:41
T get(const Candidate &c)
Definition: component.h:56
unsigned long long _configid
Definition: DTTrig.h:257
DTTrig::~DTTrig ( )

Destructor.

Definition at line 80 of file DTTrig.cc.

References _digi_sync, and clear().

80  {
81 
82  clear();
83  delete _digi_sync; //CB check if it is really needed
84 
85 }
DTTTrigBaseSync * _digi_sync
Definition: DTTrig.h:251
void clear()
Clear the trigger units cache.
Definition: DTTrig.cc:355

Member Function Documentation

TU_iterator DTTrig::begin ( void  )
inline

Begin of the trigger units store.

Definition at line 94 of file DTTrig.h.

References _cache.

94 { /*check();*/ return _cache.begin(); }
TUcontainer _cache
Definition: DTTrig.h:248
SC_iterator DTTrig::begin1 ( )
inline

Begin of the sector collector store.

Definition at line 111 of file DTTrig.h.

References _cache1.

111 { /*check();*/ return _cache1.begin(); }
SCcontainer _cache1
Definition: DTTrig.h:249
std::vector< DTBtiTrigData > DTTrig::BtiTrigs ( )

Return a copy of all the BTI triggers.

Definition at line 570 of file DTTrig.cc.

References _cache, DTCache< T, Coll >::begin(), DTSCTrigUnit::BtiTrigs(), DTCache< T, Coll >::end(), and L1TEmulatorMonitor_cff::p.

Referenced by DTTrigTest::analyze().

570  {
571  /*check();*/
572  std::vector<DTBtiTrigData> trigs;
573  TU_iterator ptu;
574  for(ptu=_cache.begin();ptu!=_cache.end();ptu++) {
575  DTSCTrigUnit* tu = (*ptu).second;
576  std::vector<DTBtiTrigData>::const_iterator p; //p=0;
577  std::vector<DTBtiTrigData>::const_iterator peb=tu->BtiTrigs()->end();
578  for(p=tu->BtiTrigs()->begin();p!=peb;p++){
579  trigs.push_back(*p);
580  }
581  }
582  return trigs;
583 }
TUcontainer _cache
Definition: DTTrig.h:248
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:59
DTBtiCard * BtiTrigs() const
Return container of BTI triggers.
Definition: DTSCTrigUnit.h:91
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:42
const_iterator end() const
Get last cache element.
Definition: DTCache.h:45
Range DTTrig::cache ( )
inline

Begin of the trigger units store.

Definition at line 103 of file DTTrig.h.

References _cache.

103 { /*check();*/ return Range(_cache.begin(), _cache.end()); }
TUcontainer _cache
Definition: DTTrig.h:248
std::pair< TU_iterator, TU_iterator > Range
Definition: DTTrig.h:64
SCRange DTTrig::cache1 ( )
inline

Range of the sector collector store.

Definition at line 120 of file DTTrig.h.

References _cache1.

120 { /*check();*/ return SCRange(_cache1.begin(), _cache1.end()); }
SCcontainer _cache1
Definition: DTTrig.h:249
std::pair< SC_iterator, SC_iterator > SCRange
Definition: DTTrig.h:65
DTChambPhSegm * DTTrig::chPhiSegm1 ( DTChamberId  sid,
int  step 
)

Return the first phi track segment in req. chamber/step.

Definition at line 451 of file DTTrig.cc.

References trigUnit().

Referenced by chPhiSegm1().

451  {
452  return chPhiSegm1(trigUnit(sid),step);
453 }
DTChambPhSegm * chPhiSegm1(DTChamberId sid, int step)
Return the first phi track segment in req. chamber/step.
Definition: DTTrig.cc:451
DTSCTrigUnit * trigUnit(DTChamberId sid)
Return a trigger unit - Muon numbering.
Definition: DTTrig.cc:372
DTChambPhSegm * DTTrig::chPhiSegm1 ( DTSCTrigUnit unit,
int  step 
)

Return the first phi track segment in req. chamber/step.

Definition at line 430 of file DTTrig.cc.

References DTSCTrigUnit::nPhiSegm(), and DTSCTrigUnit::phiSegment().

430  {
431  if(unit==0)return 0;
432  if(unit->nPhiSegm(step)<1)return 0;
433  return const_cast<DTChambPhSegm*>(unit->phiSegment(step,1));
434 }
const DTChambPhSegm * phiSegment(int step, int n)
Return output segments, phi view.
Definition: DTSCTrigUnit.h:147
int nPhiSegm(int step)
Number of Phi segments for a given step.
Definition: DTSCTrigUnit.h:143
DTChambPhSegm * DTTrig::chPhiSegm1 ( int  wheel,
int  stat,
int  sect,
int  step 
)

Return the first phi track segment in req. chamber/step, MTTF numbering.

Definition at line 467 of file DTTrig.cc.

References chPhiSegm1(), and trigUnit().

467  {
468  return chPhiSegm1(trigUnit(wheel,stat,sect),step);
469  // to make it transparent to the outside world
470  // return chSectCollSegm1(wheel,stat,sect,step);
471 
472 }
DTChambPhSegm * chPhiSegm1(DTChamberId sid, int step)
Return the first phi track segment in req. chamber/step.
Definition: DTTrig.cc:451
DTSCTrigUnit * trigUnit(DTChamberId sid)
Return a trigger unit - Muon numbering.
Definition: DTTrig.cc:372
DTChambPhSegm * DTTrig::chPhiSegm2 ( DTChamberId  sid,
int  step 
)

Return the second phi track segment in req. chamber/step.

Definition at line 456 of file DTTrig.cc.

References trigUnit().

Referenced by chPhiSegm2().

456  {
457  return chPhiSegm2(trigUnit(sid),step);
458 }
DTChambPhSegm * chPhiSegm2(DTChamberId sid, int step)
Return the second phi track segment in req. chamber/step.
Definition: DTTrig.cc:456
DTSCTrigUnit * trigUnit(DTChamberId sid)
Return a trigger unit - Muon numbering.
Definition: DTTrig.cc:372
DTChambPhSegm * DTTrig::chPhiSegm2 ( DTSCTrigUnit unit,
int  step 
)

Return the second phi track segment in req. chamber/step.

Definition at line 437 of file DTTrig.cc.

References DTSCTrigUnit::nPhiSegm(), and DTSCTrigUnit::phiSegment().

437  {
438  if(unit==0)return 0;
439  if(unit->nPhiSegm(step)<2)return 0;
440  return const_cast<DTChambPhSegm*>(unit->phiSegment(step,2));
441 }
const DTChambPhSegm * phiSegment(int step, int n)
Return output segments, phi view.
Definition: DTSCTrigUnit.h:147
int nPhiSegm(int step)
Number of Phi segments for a given step.
Definition: DTSCTrigUnit.h:143
DTChambPhSegm * DTTrig::chPhiSegm2 ( int  wheel,
int  stat,
int  sect,
int  step 
)

Return the second phi track segment in req. chamber/step, MTTF numbering.

Definition at line 475 of file DTTrig.cc.

References chPhiSegm2(), and trigUnit().

475  {
476  // if(stat==4&&(sect==3||sect==9)) {
477  // if hrizontal chambers of MB4 get first track of twin chamber (flag=1)
478  // return chPhiSegm1(trigUnit(wheel,stat,sect,1),step);
479  // } else {
480  return chPhiSegm2(trigUnit(wheel,stat,sect),step);
481  // to make it transparent to the outside world
482  // return chSectCollSegm2(wheel,stat,sect,step);
483  //}
484 }
DTChambPhSegm * chPhiSegm2(DTChamberId sid, int step)
Return the second phi track segment in req. chamber/step.
Definition: DTTrig.cc:456
DTSCTrigUnit * trigUnit(DTChamberId sid)
Return a trigger unit - Muon numbering.
Definition: DTTrig.cc:372
DTSectCollPhSegm * DTTrig::chSectCollPhSegm1 ( DTSectColl unit,
int  step 
)

Return the first phi track segment in req. chamber/step [SC step].

Definition at line 494 of file DTTrig.cc.

References DTSectColl::nSegmPh(), and DTSectColl::SectCollPhSegment().

Referenced by chSectCollPhSegm1().

494  {
495 
496  if(unit==0)return 0;
497  if(unit->nSegmPh(step)<1)return 0;
498  return const_cast<DTSectCollPhSegm*>(unit->SectCollPhSegment(step,1));
499 }
int nSegmPh(int step)
Return number of DTSectCollPhi segments (SC step)
Definition: DTSectColl.cc:483
const DTSectCollPhSegm * SectCollPhSegment(int step, unsigned n)
Return requested Sector Collector Phi Segment 1st/2nd.
Definition: DTSectColl.cc:512
DTSectCollPhSegm * DTTrig::chSectCollPhSegm1 ( int  wheel,
int  sect,
int  step 
)

Return the first phi track segment in req. chamber/step, [MTTF numbering & SC step].

Definition at line 510 of file DTTrig.cc.

References chSectCollPhSegm1(), and SCUnit().

510  {
511 
512  return chSectCollPhSegm1(SCUnit(wheel,sect),step);
513 }
DTSectColl * SCUnit(DTSectCollId scid) const
Return a SC unit - Muon numbering - const version.
Definition: DTTrig.cc:396
DTSectCollPhSegm * chSectCollPhSegm1(DTSectColl *unit, int step)
Return the first phi track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:494
DTSectCollPhSegm * DTTrig::chSectCollPhSegm2 ( DTSectColl unit,
int  step 
)

Return the second phi track segment in req. chamber/step [SC step].

Definition at line 502 of file DTTrig.cc.

References DTSectColl::nSegmPh(), and DTSectColl::SectCollPhSegment().

Referenced by chSectCollPhSegm2().

502  {
503  if(unit==0)return 0;
504  if(unit->nSegmPh(step)<2)return 0;
505  return const_cast<DTSectCollPhSegm*>(unit->SectCollPhSegment(step,2));
506 }
int nSegmPh(int step)
Return number of DTSectCollPhi segments (SC step)
Definition: DTSectColl.cc:483
const DTSectCollPhSegm * SectCollPhSegment(int step, unsigned n)
Return requested Sector Collector Phi Segment 1st/2nd.
Definition: DTSectColl.cc:512
DTSectCollPhSegm * DTTrig::chSectCollPhSegm2 ( int  wheel,
int  sect,
int  step 
)

Return the second phi track segment in req. chamber/step, [MTTF numbering & SC step].

Definition at line 516 of file DTTrig.cc.

References chSectCollPhSegm2(), and SCUnit().

516  {
517  // if(stat==4&&(sect==3||sect==9)) {
518  // if hrizontal chambers of MB4 get first track of twin chamber (flag=1)
519  //return chSectCollSegm1(trigUnit(wheel,stat,sect,1),step);
520  //} else {
521  return chSectCollPhSegm2(SCUnit(wheel,sect),step);
522  //}
523 }
DTSectColl * SCUnit(DTSectCollId scid) const
Return a SC unit - Muon numbering - const version.
Definition: DTTrig.cc:396
DTSectCollPhSegm * chSectCollPhSegm2(DTSectColl *unit, int step)
Return the second phi track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:502
DTSectCollThSegm * DTTrig::chSectCollThSegm ( DTSectColl unit,
int  step 
)

Return the theta track segment in req. chamber/step [SC step].

Definition at line 526 of file DTTrig.cc.

References DTSectColl::nSegmTh(), and DTSectColl::SectCollThSegment().

Referenced by chSectCollThSegm().

526  {
527 
528  if(unit==0)return 0;
529  if(unit->nSegmTh(step)<1)return 0;
530  return const_cast<DTSectCollThSegm*>(unit->SectCollThSegment(step));
531 }
int nSegmTh(int step)
Return number of DTSectCollTheta segments (SC step)
Definition: DTSectColl.cc:497
const DTSectCollThSegm * SectCollThSegment(int step)
Return requested Sector Collector Theta Segment.
Definition: DTSectColl.cc:526
DTSectCollThSegm * DTTrig::chSectCollThSegm ( int  wheel,
int  sect,
int  step 
)

Return the theta track segment in req. chamber/step, [MTTF numbering & SC step].

Definition at line 534 of file DTTrig.cc.

References chSectCollThSegm(), and SCUnit().

534  {
535 
536  return chSectCollThSegm(SCUnit(wheel,sect),step);
537 }
DTSectColl * SCUnit(DTSectCollId scid) const
Return a SC unit - Muon numbering - const version.
Definition: DTTrig.cc:396
DTSectCollThSegm * chSectCollThSegm(DTSectColl *unit, int step)
Return the theta track segment in req. chamber/step [SC step].
Definition: DTTrig.cc:526
DTChambThSegm * DTTrig::chThetaSegm ( DTChamberId  sid,
int  step 
)

Return the theta candidates in req. chamber/step.

Definition at line 461 of file DTTrig.cc.

References DTChamberId::station(), and trigUnit().

Referenced by chThetaSegm().

461  {
462  if(sid.station()==4)return 0;
463  return chThetaSegm(trigUnit(sid),step);
464 }
DTSCTrigUnit * trigUnit(DTChamberId sid)
Return a trigger unit - Muon numbering.
Definition: DTTrig.cc:372
DTChambThSegm * chThetaSegm(DTChamberId sid, int step)
Return the theta candidates in req. chamber/step.
Definition: DTTrig.cc:461
int station() const
Return the station number.
Definition: DTChamberId.h:53
DTChambThSegm * DTTrig::chThetaSegm ( DTSCTrigUnit unit,
int  step 
)

Return the theta candidates in req. chamber/step.

Definition at line 444 of file DTTrig.cc.

References DTSCTrigUnit::nThetaSegm(), and DTSCTrigUnit::thetaSegment().

444  {
445  if(unit==0)return 0;
446  if(unit->nThetaSegm(step)<1)return 0;
447  return const_cast<DTChambThSegm*>(unit->thetaSegment(step,1));
448 }
const DTChambThSegm * thetaSegment(int step, int n)
Return output segments, theta view.
Definition: DTSCTrigUnit.h:155
int nThetaSegm(int step)
Number of theta segments for a given step.
Definition: DTSCTrigUnit.h:152
DTChambThSegm * DTTrig::chThetaSegm ( int  wheel,
int  stat,
int  sect,
int  step 
)

Return the theta candidates in req. chamber/step, MTTF numbering.

Definition at line 487 of file DTTrig.cc.

References chThetaSegm(), and trigUnit().

487  {
488  if(stat==4)return 0;
489  return chThetaSegm(trigUnit(wheel,stat,sect),step);
490 }
DTSCTrigUnit * trigUnit(DTChamberId sid)
Return a trigger unit - Muon numbering.
Definition: DTTrig.cc:372
DTChambThSegm * chThetaSegm(DTChamberId sid, int step)
Return the theta candidates in req. chamber/step.
Definition: DTTrig.cc:461
void DTTrig::clear ( void  )

Clear the trigger units cache.

Definition at line 355 of file DTTrig.cc.

References _cache, and _cache1.

Referenced by python.Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), python.Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), python.Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and ~DTTrig().

355  {
356  // Delete the map
357  for (TU_iterator it=_cache.begin();it!=_cache.end();it++){
358  // Delete all the trigger units
359  delete (*it).second;
360  }
361  _cache.clear();
362 
363  for (SC_iterator it=_cache1.begin();it!=_cache1.end();it++){
364  // Delete all the Sector Collectors
365  delete (*it).second;
366  }
367  _cache1.clear();
368 
369 }
SCcontainer::iterator SC_iterator
Definition: DTTrig.h:62
SCcontainer _cache1
Definition: DTTrig.h:249
TUcontainer _cache
Definition: DTTrig.h:248
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:59
GlobalVector DTTrig::CMSDirection ( const DTTrigData trig) const
inline

Direction of a trigger-data object in CMS frame.

Definition at line 222 of file DTTrig.h.

References DTTrigData::ChamberId(), and constTrigUnit().

Referenced by DTTrigTest::analyze().

222  {
223  return constTrigUnit(trig->ChamberId())->CMSDirection(trig);
224  }
virtual DTChamberId ChamberId() const =0
Identifier of the associated chamber.
DTSCTrigUnit * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:380
GlobalVector CMSDirection(const DTTrigData *trig) const
Direction of a trigger-data object in CMS frame.
Definition: DTTrig.h:222
GlobalPoint DTTrig::CMSPosition ( const DTTrigData trig) const
inline

Coordinate of a trigger-data object in CMS frame.

Definition at line 212 of file DTTrig.h.

References DTTrigData::ChamberId(), and constTrigUnit().

Referenced by DTTrigTest::analyze().

212  {
213  return constTrigUnit(trig->ChamberId())->CMSPosition(trig);
214  }
virtual DTChamberId ChamberId() const =0
Identifier of the associated chamber.
DTSCTrigUnit * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:380
GlobalPoint CMSPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in CMS frame.
Definition: DTTrig.h:212
DTSCTrigUnit * DTTrig::constTrigUnit ( DTChamberId  sid) const
private

Return a trigger unit - Muon numbering - const version.

Definition at line 380 of file DTTrig.cc.

References _cache, gather_cfg::cout, DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by CMSDirection(), CMSPosition(), constTrigUnit(), localDirection(), localPosition(), print(), and trigUnit().

380  {
381 // std::cout << " SC: running DTTrig::constTrigUnit(DTChamberId chid)" << std::endl;
382  TU_const_iterator it = _cache.find(chid);
383  if ( it == _cache.end()) {
384  std::cout << "DTTrig::trigUnit: Trigger Unit not in the map: ";
385  std::cout << " wheel=" << chid.wheel() ;
386  std::cout << ", station=" << chid.station();
387  std::cout << ", sector=" << chid.sector();
388  std::cout << std::endl;
389  return 0;
390  }
391 
392  return (*it).second;
393 }
TUcontainer _cache
Definition: DTTrig.h:248
TUcontainer::const_iterator TU_const_iterator
Definition: DTTrig.h:60
tuple cout
Definition: gather_cfg.py:41
DTSCTrigUnit * DTTrig::constTrigUnit ( int  wheel,
int  stat,
int  sect 
) const
private

Return a trigger unit - Muon numbering, MTTF numbering - const version.

Definition at line 422 of file DTTrig.cc.

References constTrigUnit(), and DTChamberId.

422  {
423  sect++; // offset 1 for sector number ([0,11] --> [1,12])
424  return constTrigUnit(DTChamberId(wheel,stat,sect));
425 
426 }
DTSCTrigUnit * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:380
void DTTrig::createTUs ( const edm::EventSetup iSetup)

Create the trigger units and store them in the cache.

Definition at line 88 of file DTTrig.cc.

References _cache, _cache1, _debug, _digi_sync, DTSectColl::addTU(), gather_cfg::cout, edm::EventSetup::get(), DTChamber::id(), DTSectCollId::sector(), DTChamberId::sector(), DTSectCollId::wheel(), and DTChamberId::wheel().

Referenced by DTTrigProd::beginRun(), and DTTrigTest::beginRun().

88  {
89 
90  // build up Sector Collectors and then
91  // build the trrigger units (one for each chamber)
92  for(int iwh=-2;iwh<=2;iwh++){
93  for(int ise=1;ise<=12;ise++){
94  if(_debug){
95  std::cout << "calling sectcollid wh sc " << iwh << " " << ise << std::endl;}
96  DTSectCollId scid(iwh,ise);
97  SC_iterator it = _cache1.find(scid);
98  if ( it != _cache1.end()) {
99  std::cout << "DTTrig::createTUs: Sector Collector unit already exists"<<std::endl;
100  continue;
101  }
102  // add a sector collector to the map
103  // SCConf_iterator scit = _scconf.find(scid);
104  //edm::ParameterSet sc_pset = _conf_pset.getParameter<edm::ParameterSet>("SectCollParameters");
105  DTSectColl* sc;
106  //sc = new DTSectColl(sc_pset);
107  sc = new DTSectColl(scid);
108 
109  // if ( scit != _scconf.end()){
110  // sc = new DTSectColl( (*scit).second);
111  // }
112  // else {
113  // std::cout << "DTTrig::createTUs: SC config file does not exist. Using default one";
114  // sc = new DTSectColl(config());
115  // }
116  if(_debug){
117  std::cout << " DTTrig::createTUs new SC sc = " << sc
118  << " at scid.sector() " << scid.sector()
119  << " at scid.wheel() " << scid.wheel()
120  << std::endl;
121  }
122  _cache1[scid] = sc;
123  }
124  }
125 
127  iSetup.get<MuonGeometryRecord>().get(pDD);
128  for (std::vector<DTChamber*>::const_iterator ich=pDD->chambers().begin(); ich!=pDD->chambers().end();ich++){
129 
130  DTChamber* chamb = (*ich);
131  DTChamberId chid = chamb->id();
132  TU_iterator it = _cache.find(chid);
133  if ( it != _cache.end()) {
134  std::cout << "DTTrig::init: Trigger unit already exists" << std::endl;
135  continue;
136  }
137  // Conf_iterator cit = _truconf.find(chid);
138  // if ( cit == _truconf.end()) {
139  // std::cout << "DTTrig::init: Local Config File not found using default config" << std::endl;
140  // DTSCTrigUnit* tru = new DTSCTrigUnit(chamb,config());
141  // _cache[chid] = tru;
142  // continue;
143  // }
144 
145  // add a trigger unit to the map with a link to the station
146  //edm::ParameterSet tu_pset = _conf_pset.getParameter<edm::ParameterSet>("TUParameters");
147  //DTSCTrigUnit* tru = new DTSCTrigUnit(chamb,tu_pset);
148  DTSCTrigUnit* tru = new DTSCTrigUnit(chamb,_digi_sync);
149  _cache[chid] = tru;
150 
151  //----------- add TU to corresponding SC
152  // returning correspondent SC id
153  DTSectCollId scid;
154  if(chid.sector()==13) {
155  scid = DTSectCollId(chid.wheel(), 4);}
156  else if(chid.sector()==14) {
157  scid = DTSectCollId(chid.wheel(), 10);}
158  else {
159  scid = DTSectCollId(chid.wheel(), chid.sector() );}
160 
161  SC_iterator it1 = _cache1.find(scid);
162 
163  if ( it1 != _cache1.end()) {
164 
165  DTSectColl* sc = (*it1).second;
166  if(_debug) {
167  std::cout << "DTTrig::init: adding TU in SC << "
168  << " sector = " << scid.sector()
169  << " wheel = " << scid.wheel()
170  << std::endl;}
171  sc->addTU(tru);
172  }
173  else {
174  std::cout << "DTTrig::createTUs: Trigger Unit not in the map: ";
175  }
176 
177  }
178 
179 }
SCcontainer::iterator SC_iterator
Definition: DTTrig.h:62
SCcontainer _cache1
Definition: DTTrig.h:249
bool _debug
Definition: DTTrig.h:253
TUcontainer _cache
Definition: DTTrig.h:248
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:59
DTChamberId id() const
Return the DTChamberId of this chamber.
Definition: DTChamber.cc:35
int sector() const
Definition: DTSectCollId.h:42
void addTU(DTSCTrigUnit *tru)
Add a Trigger Unit to the Sector Collector.
Definition: DTSectColl.cc:128
const T & get() const
Definition: EventSetup.h:55
int wheel() const
Definition: DTSectCollId.h:41
DTTTrigBaseSync * _digi_sync
Definition: DTTrig.h:251
int sector() const
Definition: DTChamberId.h:63
tuple cout
Definition: gather_cfg.py:41
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
void DTTrig::dumpGeom ( )

Dump the geometry.

Definition at line 543 of file DTTrig.cc.

References _cache.

543  {
544  /*check();*/
545  for (TU_const_iterator it=_cache.begin();it!=_cache.end();it++){
546  ((*it).second)->dumpGeom();
547  }
548 }
TUcontainer _cache
Definition: DTTrig.h:248
void dumpGeom()
Dump the geometry.
Definition: DTTrig.cc:543
TUcontainer::const_iterator TU_const_iterator
Definition: DTTrig.h:60
void DTTrig::dumpLuts ( short int  lut_btic,
const DTConfigManager conf 
)

Dump the LUT files.

Definition at line 551 of file DTTrig.cc.

References _cache, DTSCTrigUnit::dumpLUT(), DTConfigManager::dumpLUTParam(), and DTSCTrigUnit::statId().

Referenced by DTTrigProd::beginRun().

551  {
552  for (TU_const_iterator it=_cache.begin();it!=_cache.end();it++){
553 
554  DTSCTrigUnit* thisTU = (*it).second;
555 
556  // dump lut command file from geometry
557  thisTU->dumpLUT(lut_btic);
558 
559  // dump lut command file from parameters (DB or CMSSW)
560  DTChamberId chid = thisTU->statId();
561  conf->dumpLUTParam(chid);
562 
563  }
564 
565  return;
566 
567 }
void dumpLUTParam(DTChamberId &chambid) const
SV 091111 Dump luts string commands from configuration parameters.
TUcontainer _cache
Definition: DTTrig.h:248
void dumpLUT(short int btic) const
Dump the Lut file.
Definition: DTSCTrigUnit.h:134
TUcontainer::const_iterator TU_const_iterator
Definition: DTTrig.h:60
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTSCTrigUnit.h:79
TU_iterator DTTrig::end ( void  )
inline

End of the trigger units store.

Definition at line 97 of file DTTrig.h.

References _cache.

97 { /*check();*/ return _cache.end(); }
TUcontainer _cache
Definition: DTTrig.h:248
SC_iterator DTTrig::end1 ( )
inline

End of the sectoor collector store.

Definition at line 114 of file DTTrig.h.

References _cache1.

114 { /*check();*/ return _cache1.end(); }
SCcontainer _cache1
Definition: DTTrig.h:249
TU_iterator DTTrig::find ( DTChamberId  id)
inline

Find a trigger unit in the map.

Definition at line 100 of file DTTrig.h.

References _cache.

Referenced by BeautifulSoup.Tag::_invert(), and BeautifulSoup.PageElement::insert().

100 { /*check();*/ return _cache.find(id); }
TUcontainer _cache
Definition: DTTrig.h:248
SC_iterator DTTrig::find1 ( DTSectCollId  id)
inline

Find a Sector Collector in the map.

Definition at line 117 of file DTTrig.h.

References _cache1.

117 { /*check();*/ return _cache1.find(id); }
SCcontainer _cache1
Definition: DTTrig.h:249
int DTTrig::getBXOffset ( )
inline

Get BX Offset.

Definition at line 184 of file DTTrig.h.

References _conf_manager, and DTConfigManager::getBXOffset().

Referenced by DTTrigProd::produce().

184 { return _conf_manager->getBXOffset(); }
int getBXOffset() const
Get BX Offset.
const DTConfigManager * _conf_manager
Definition: DTTrig.h:250
LocalVector DTTrig::localDirection ( const DTTrigData trig) const
inline

Direction of a trigger-data object in chamber frame.

Definition at line 217 of file DTTrig.h.

References DTTrigData::ChamberId(), and constTrigUnit().

217  {
218  return constTrigUnit(trig->ChamberId())->localDirection(trig);
219  }
virtual DTChamberId ChamberId() const =0
Identifier of the associated chamber.
DTSCTrigUnit * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:380
LocalVector localDirection(const DTTrigData *trig) const
Direction of a trigger-data object in chamber frame.
Definition: DTTrig.h:217
LocalPoint DTTrig::localPosition ( const DTTrigData trig) const
inline

Coordinate of a trigger-data object in chamber frame.

Definition at line 207 of file DTTrig.h.

References DTTrigData::ChamberId(), and constTrigUnit().

207  {
208  return constTrigUnit(trig->ChamberId())->localPosition(trig);
209  }
LocalPoint localPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in chamber frame.
Definition: DTTrig.h:207
virtual DTChamberId ChamberId() const =0
Identifier of the associated chamber.
DTSCTrigUnit * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:380
void DTTrig::print ( DTTrigData trig) const
inline

Print a trigger-data object.

Definition at line 227 of file DTTrig.h.

References DTTrigData::ChamberId(), and constTrigUnit().

227  {
228  constTrigUnit(trig->ChamberId())->print(trig);
229  }
virtual DTChamberId ChamberId() const =0
Identifier of the associated chamber.
void print(DTTrigData *trig) const
Print a trigger-data object.
Definition: DTTrig.h:227
DTSCTrigUnit * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:380
std::vector< DTSectCollPhSegm > DTTrig::SCPhTrigs ( )

Return a copy of all the Sector Collector (Phi) triggers.

Definition at line 634 of file DTTrig.cc.

References _cache1, DTSectColl::beginPh(), DTSectColl::endPh(), and L1TEmulatorMonitor_cff::p.

Referenced by DTTrigTest::analyze(), and DTTrigProd::produce().

634  {
635  /*check();*/
636  std::vector<DTSectCollPhSegm> trigs;
637  // SC_iterator ptu;
638  SC_iterator psc;
639  for(psc=_cache1.begin();psc!=_cache1.end();psc++) {
640  // DTSCTrigUnit* tu = (*ptu).second;
641  //
642  // old SMDB:
643  // DTSectColl* tu = (*ptu).second;
644  // std::vector<DTChambPhSegm>::const_iterator p=0;
645  // std::vector<DTChambPhSegm>::const_iterator peb=tu->SCTrigs()->end();
646  // for(p=tu->SCTrigs()->begin();p!=peb;p++){
647  // trigs.push_back(*p);
648  // }
649 
650  DTSectColl* sc = (*psc).second;
651  std::vector<DTSectCollPhSegm>::const_iterator p;
652  std::vector<DTSectCollPhSegm>::const_iterator peb=sc->endPh();
653  for(p=sc->beginPh();p!=peb;p++){
654  trigs.push_back(*p);
655  }
656 
657  }
658  return trigs;
659 }
SCcontainer::iterator SC_iterator
Definition: DTTrig.h:62
SCcontainer _cache1
Definition: DTTrig.h:249
std::vector< DTSectCollPhSegm >::const_iterator endPh()
Return iterator to the end of Phi cache.
Definition: DTSectColl.h:157
std::vector< DTSectCollPhSegm >::const_iterator beginPh()
Return iterator to the beghin of Phi cache.
Definition: DTSectColl.h:151
std::vector< DTSectCollThSegm > DTTrig::SCThTrigs ( )

Return a copy of all the Sector Collector (Theta) triggers.

Definition at line 663 of file DTTrig.cc.

References _cache1, DTSectColl::beginTh(), DTSectColl::endTh(), and L1TEmulatorMonitor_cff::p.

Referenced by DTTrigTest::analyze(), and DTTrigProd::produce().

663  {
664  /*check();*/
665  std::vector<DTSectCollThSegm> trigs;
666  SC_iterator psc;
667  for(psc=_cache1.begin();psc!=_cache1.end();psc++) {
668  DTSectColl* sc = (*psc).second;
669  std::vector<DTSectCollThSegm>::const_iterator p; //p=0;
670  std::vector<DTSectCollThSegm>::const_iterator peb=sc->endTh();
671  for(p=sc->beginTh();p!=peb;p++){
672  trigs.push_back(*p);
673  }
674 
675  }
676  return trigs;
677 }
SCcontainer::iterator SC_iterator
Definition: DTTrig.h:62
SCcontainer _cache1
Definition: DTTrig.h:249
std::vector< DTSectCollThSegm >::const_iterator beginTh()
Return iterator to the begni of Theta cache.
Definition: DTSectColl.h:160
std::vector< DTSectCollThSegm >::const_iterator endTh()
Return iterator to the end of Theta cache.
Definition: DTSectColl.h:166
DTSectColl * DTTrig::SCUnit ( DTSectCollId  scid) const
private

Return a SC unit - Muon numbering - const version.

Definition at line 396 of file DTTrig.cc.

References _cache1, gather_cfg::cout, DTSectCollId::sector(), and DTSectCollId::wheel().

Referenced by chSectCollPhSegm1(), chSectCollPhSegm2(), chSectCollThSegm(), and SCUnit().

396  {
397 SC_const_iterator it = _cache1.find(scid);
398  if ( it == _cache1.end()) {
399  std::cout << "DTTrig::SCUnit: Trigger Unit not in the map: ";
400  std::cout << " wheel=" << scid.wheel() ;
401  std::cout << ", sector=" << scid.sector();
402  std::cout << std::endl;
403  return 0;
404  }
405 
406  return (*it).second;
407 }
SCcontainer _cache1
Definition: DTTrig.h:249
int sector() const
Definition: DTSectCollId.h:42
int wheel() const
Definition: DTSectCollId.h:41
tuple cout
Definition: gather_cfg.py:41
SCcontainer::const_iterator SC_const_iterator
Definition: DTTrig.h:63
DTSectColl * DTTrig::SCUnit ( int  wheel,
int  sect 
) const
private

Return a SC Unit Muon Numbering, MTTF numbering - const version.

Definition at line 415 of file DTTrig.cc.

References SCUnit().

415  {
416  sect++;
417  return SCUnit(DTSectCollId(wheel,sect));
418 }
DTSectColl * SCUnit(DTSectCollId scid) const
Return a SC unit - Muon numbering - const version.
Definition: DTTrig.cc:396
int DTTrig::size ( void  )
inline

Size of the trigger units store.

Definition at line 91 of file DTTrig.h.

References _cache.

91 { return _cache.size(); }
TUcontainer _cache
Definition: DTTrig.h:248
int DTTrig::size1 ( )
inline

Size of the sector collector store.

Definition at line 108 of file DTTrig.h.

References _cache1.

108 { /*check();*/ return _cache1.size(); }
SCcontainer _cache1
Definition: DTTrig.h:249
std::vector< DTTracoTrigData > DTTrig::TracoTrigs ( )

Return a copy of all the TRACO triggers.

Definition at line 586 of file DTTrig.cc.

References _cache, DTCache< T, Coll >::begin(), DTCache< T, Coll >::end(), L1TEmulatorMonitor_cff::p, and DTSCTrigUnit::TracoTrigs().

Referenced by DTTrigTest::analyze().

586  {
587  std::vector<DTTracoTrigData> trigs;
588  TU_iterator ptu;
589  /*check();*/
590  for(ptu=_cache.begin();ptu!=_cache.end();ptu++) {
591  DTSCTrigUnit* tu = (*ptu).second;
592  std::vector<DTTracoTrigData>::const_iterator p; //p=0;
593  std::vector<DTTracoTrigData>::const_iterator peb=tu->TracoTrigs()->end();
594  for(p=tu->TracoTrigs()->begin();p!=peb;p++){
595  trigs.push_back(*p);
596  }
597  }
598  return trigs;
599 }
TUcontainer _cache
Definition: DTTrig.h:248
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:59
DTTracoCard * TracoTrigs() const
Return container of TRACO triggers.
Definition: DTSCTrigUnit.h:94
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:42
const_iterator end() const
Get last cache element.
Definition: DTCache.h:45
void DTTrig::triggerReco ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Run the whole trigger reconstruction chain.

Definition at line 183 of file DTTrig.cc.

References _cache, _cache1, _digitag, _inputexist, DTSCTrigUnit::BtiTrigs(), DTSuperLayerId::chamberId(), DTCache< T, Coll >::clearCache(), DTTracoCard::clearCache(), DTBtiCard::clearCache(), DTSectColl::clearCache(), edm::Event::getByLabel(), DTSectColl::getTSPhi(), DTSectColl::getTSTheta(), i, edm::HandleBase::isValid(), LogDebug, DTTSPhi::reconstruct(), DTTSTheta::reconstruct(), DTBtiCard::reconstruct(), DTTracoCard::reconstruct(), DTSectColl::reconstruct(), DTSectCollId::sector(), DTCache< T, Coll >::size(), DTSectColl::sizePh(), DTSectColl::sizeTh(), DTSCTrigUnit::statId(), DTLayerId::superlayerId(), DTSCTrigUnit::TracoTrigs(), DTSCTrigUnit::TSPhTrigs(), DTSCTrigUnit::TSThTrigs(), and updateES().

Referenced by DTTrigTest::analyze(), and DTTrigProd::produce().

183  {
184 
185  updateES(iSetup);
186  if (!_inputexist) return;
187 
188  DTDigiMap digiMap;
189  //Sort digis by chamber so they can be used by BTIs
191  iEvent.getByLabel(_digitag, dtDigis);
192 
193  if (!dtDigis.isValid()) {
194  LogDebug("DTTrig")
195  << "DTTrig::triggerReco DTDigiCollection with input tag " << _digitag
196  << "requested in configuration, but not found in the event." << std::endl;
197 
198  _inputexist = false;
199  return;
200  }
201 
203 
204  for (detUnitIt=dtDigis->begin();
205  detUnitIt!=dtDigis->end();
206  ++detUnitIt){
207  const DTLayerId& layId = (*detUnitIt).first;
208  const DTChamberId chambId=layId.superlayerId().chamberId();
209  const DTDigiCollection::Range& range = (*detUnitIt).second;
210  // DTDigiCollection tmpDTDigiColl;
211  //tmpDTDigiColl.put(range,layId);
212  digiMap[chambId].put(range,layId);
213 // const DTDigiCollection::Range& range = (*detUnitIt).second;
214 // for (DTDigiCollection::const_iterator digiIt = range.first;
215 // digiIt!=range.second;
216 // ++digiIt){
217 // DTDigiCollection tmp;
218 
219 // digiMap[chambId].push_back((*digiIt));
220 // }
221  }
222 
223  // CB the commented because we don't use config()->debug() anymore in future will probably be possible to avoid the digis sorting
224 // if(config()->debug()>2){
225 // std::cout << "----------DTDigis ordered by chamber:" << std::endl;
226 // for (DTDigiMap_const_iterator digiMapIt=digiMap.begin();
227 // digiMapIt!=digiMap.end();
228 // digiMapIt++){
229 // DTChamberId chambId = (*digiMapIt).first;
230 // DTDigiCollection digis = (*digiMapIt).second;
231 // std::cout << "Chamber id " << chambId << std::endl;
232 // DTDigiCollection::DigiRangeIterator RangeIt;
233 // for (RangeIt=digis.begin();
234 // RangeIt!=digis.end();
235 // RangeIt++){
236 // std::cout << "Digi's layer " << (*RangeIt).first << std::endl;
237 // const DTDigiCollection::Range& range = (*RangeIt).second;
238 // for (DTDigiCollection::const_iterator digiIt = range.first;
239 // digiIt!=range.second;
240 // ++digiIt){
241 // std::cout << "Digi's data " << (*digiIt) << std::endl;
242 // }
243 
244 
245 // }
246 // }
247 // }
248 
249  //Run reconstruct for single trigger subsystem (Bti, Traco TS)
250  for (TU_iterator it=_cache.begin();it!=_cache.end();it++){
251  DTSCTrigUnit* thisTU=(*it).second;
252  if (thisTU->BtiTrigs()->size()>0){
253  thisTU->BtiTrigs()->clearCache();
254  thisTU->TSThTrigs()->clearCache();
255  thisTU->TracoTrigs()->clearCache();
256  thisTU->TSPhTrigs()->clearCache();
257  }
258  DTChamberId chid=thisTU->statId();
259  DTDigiMap_iterator dmit = digiMap.find(chid);
260  if (dmit !=digiMap.end()){
261  thisTU->BtiTrigs()->reconstruct((*dmit).second);
262  if(thisTU->BtiTrigs()->size()>0){
263  thisTU->TSThTrigs()->reconstruct();
264  thisTU->TracoTrigs()->reconstruct();
265  if(thisTU->TracoTrigs()->size()>0)
266  thisTU->TSPhTrigs()->reconstruct();
267  }
268  }
269  }
270  //Run reconstruct for Sector Collector
271  for (SC_iterator it=_cache1.begin();it!=_cache1.end();it++){
272  DTSectColl* sectcoll = (*it).second;
273  DTSectCollId scid = (*it).first;
274  if (sectcoll->sizePh()>0 || sectcoll->sizeTh()>0)
275  sectcoll->clearCache();
276  bool mustreco = false;
277  for (int i=1;i<5;i++) {
278  if (sectcoll->getTSPhi(i)->size()>0) {
279  mustreco = true;
280  break;
281  }
282  }
283  for (int i=1;i<4;i++) {
284  if (sectcoll->getTSTheta(i)->size()>0) {
285  mustreco = true;
286  break;
287  }
288  }
289  if (scid.sector()==4 || scid.sector()==10){
290  if (sectcoll->getTSPhi(5)->size()>0)
291  mustreco = true;
292  }
293  if (mustreco)
294  sectcoll->reconstruct();
295  }
296 
297 }
#define LogDebug(id)
virtual void reconstruct()
Load Trigger Units triggers and run Sector Collector algorithm.
Definition: DTSectColl.h:178
int sizePh()
Return Phi cache size.
Definition: DTSectColl.h:154
virtual void reconstruct(const DTDigiCollection dtDigis)
Definition: DTBtiCard.h:104
void clearCache()
Clear all traco stuff (cache &amp; map)
Definition: DTTracoCard.cc:70
int i
Definition: DBlmapReader.cc:9
SCcontainer::iterator SC_iterator
Definition: DTTrig.h:62
SCcontainer _cache1
Definition: DTTrig.h:249
DTChamberId chamberId() const
Return the corresponding ChamberId.
DTTSTheta * TSThTrigs() const
Return the chamber Trigger Server (Theta)
Definition: DTSCTrigUnit.h:100
void clearCache()
Clear all BTI stuff (map &amp; cache)
Definition: DTBtiCard.cc:92
int sizeTh()
Return Theta cache size.
Definition: DTSectColl.h:163
DTTSPhi * TSPhTrigs() const
Return the chamber Trigger Server (Phi)
Definition: DTSCTrigUnit.h:97
TUcontainer _cache
Definition: DTTrig.h:248
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:61
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:59
DTBtiCard * BtiTrigs() const
Return container of BTI triggers.
Definition: DTSCTrigUnit.h:91
void updateES(const edm::EventSetup &iSetup)
update the eventsetup info
Definition: DTTrig.cc:300
edm::InputTag _digitag
Definition: DTTrig.h:252
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
DTDigiMap::iterator DTDigiMap_iterator
Definition: DTTrig.h:67
int sector() const
Definition: DTSectCollId.h:42
DTTracoCard * TracoTrigs() const
Return container of TRACO triggers.
Definition: DTSCTrigUnit.h:94
void reconstruct()
Load BTIs triggers and run TSTheta algoritm.
Definition: DTTSTheta.h:85
void clearCache()
Local position in chamber of a trigger-data object.
Definition: DTSectColl.h:175
std::map< DTChamberId, DTDigiCollection, std::less< DTChamberId > > DTDigiMap
Definition: DTTrig.h:66
bool _inputexist
Definition: DTTrig.h:255
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTSCTrigUnit.h:79
virtual void reconstruct()
Load TRACO triggers and run TSPhi algorithm.
Definition: DTTSPhi.h:84
virtual void reconstruct()
Load BTIs triggers and run TRACOs algorithm.
Definition: DTTracoCard.h:107
std::pair< const_iterator, const_iterator > Range
void clearCache()
Clear cache vector.
Definition: DTCache.h:51
DTTSPhi * getTSPhi(int istat) const
Return TSPhi.
Definition: DTSectColl.h:72
int size() const
Get cache vector&#39;s size.
Definition: DTCache.h:48
DTTSTheta * getTSTheta(int istat) const
Return TSTheta.
Definition: DTSectColl.h:75
DTSCTrigUnit * DTTrig::trigUnit ( DTChamberId  sid)

Return a trigger unit - Muon numbering.

Definition at line 372 of file DTTrig.cc.

References constTrigUnit().

Referenced by chPhiSegm1(), chPhiSegm2(), and chThetaSegm().

372  {
373  /*check();*/ return constTrigUnit(chid);
374 
375 }
DTSCTrigUnit * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:380
DTSCTrigUnit * DTTrig::trigUnit ( int  wheel,
int  stat,
int  sect 
)

Return a trigger unit - Muon numbering, MTTF numbering.

Definition at line 410 of file DTTrig.cc.

References constTrigUnit().

410  {
411  return constTrigUnit(wheel, stat, sect);
412 }
DTSCTrigUnit * constTrigUnit(DTChamberId sid) const
Return a trigger unit - Muon numbering - const version.
Definition: DTTrig.cc:380
std::vector< DTChambPhSegm > DTTrig::TSPhTrigs ( )

Return a copy of all the Trigger Server (Phi) triggers.

Definition at line 602 of file DTTrig.cc.

References _cache, DTCache< T, Coll >::begin(), DTCache< T, Coll >::end(), L1TEmulatorMonitor_cff::p, and DTSCTrigUnit::TSPhTrigs().

Referenced by DTTrigTest::analyze().

602  {
603  /*check();*/
604  std::vector<DTChambPhSegm> trigs;
605  TU_iterator ptu;
606  for(ptu=_cache.begin();ptu!=_cache.end();ptu++) {
607  DTSCTrigUnit* tu = (*ptu).second;
608  std::vector<DTChambPhSegm>::const_iterator p; //p=0;
609  std::vector<DTChambPhSegm>::const_iterator peb=tu->TSPhTrigs()->end();
610  for(p=tu->TSPhTrigs()->begin();p!=peb;p++){
611  trigs.push_back(*p);
612  }
613  }
614  return trigs;
615 }
DTTSPhi * TSPhTrigs() const
Return the chamber Trigger Server (Phi)
Definition: DTSCTrigUnit.h:97
TUcontainer _cache
Definition: DTTrig.h:248
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:59
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:42
const_iterator end() const
Get last cache element.
Definition: DTCache.h:45
std::vector< DTChambThSegm > DTTrig::TSThTrigs ( )

Return a copy of all the Trigger Server (Theta) triggers.

Definition at line 618 of file DTTrig.cc.

References _cache, DTCache< T, Coll >::begin(), DTCache< T, Coll >::end(), L1TEmulatorMonitor_cff::p, and DTSCTrigUnit::TSThTrigs().

Referenced by DTTrigTest::analyze().

618  {
619  /*check();*/
620  std::vector<DTChambThSegm> trigs;
621  TU_iterator ptu;
622  for(ptu=_cache.begin();ptu!=_cache.end();ptu++) {
623  DTSCTrigUnit* tu = (*ptu).second;
624  std::vector<DTChambThSegm>::const_iterator p; //p=0;
625  std::vector<DTChambThSegm>::const_iterator peb=tu->TSThTrigs()->end();
626  for(p=tu->TSThTrigs()->begin();p!=peb;p++){
627  trigs.push_back(*p);
628  }
629  }
630  return trigs;
631 }
DTTSTheta * TSThTrigs() const
Return the chamber Trigger Server (Theta)
Definition: DTSCTrigUnit.h:100
TUcontainer _cache
Definition: DTTrig.h:248
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:59
const_iterator begin() const
Get first cache element.
Definition: DTCache.h:42
const_iterator end() const
Get last cache element.
Definition: DTCache.h:45
void DTTrig::updateES ( const edm::EventSetup iSetup)

update the eventsetup info

Definition at line 300 of file DTTrig.cc.

References _cache, _cache1, _conf_manager, _configid, _debug, _digi_sync, _geomid, _t0id, _ttrigid, _usesyncdb, edm::eventsetup::EventSetupRecord::cacheIdentifier(), gather_cfg::cout, edm::EventSetup::get(), edm::ESHandle< class >::product(), and DTTTrigBaseSync::setES().

Referenced by triggerReco().

300  {
301 
302  // Check for updatets in config
304  edm::ESHandle<DTGeometry> geomHandle;
305  edm::ESHandle<DTT0> t0Handle;
306  edm::ESHandle<DTTtrig> ttrigHandle;
307 
308  if (iSetup.get<DTConfigManagerRcd>().cacheIdentifier()!=_configid) {
309 
310  if (_debug)
311  std::cout << "DTTrig::updateES updating DTTPG configuration" << std::endl;
312 
313  _configid = iSetup.get<DTConfigManagerRcd>().cacheIdentifier();
314  iSetup.get<DTConfigManagerRcd>().get(confHandle);
315  _conf_manager = confHandle.product();
316  for (TU_iterator it=_cache.begin();it!=_cache.end();it++){
317  (*it).second->setConfig(_conf_manager);
318  }
319  for (SC_iterator it=_cache1.begin();it!=_cache1.end();it++){
320  (*it).second->setConfig(_conf_manager);
321  }
322 
323  }
324 
325  if (iSetup.get<MuonGeometryRecord>().cacheIdentifier()!=_configid) {
326 
327  if (_debug)
328  std::cout << "DTTrig::updateES updating muon geometry" << std::endl;
329 
330  _geomid = iSetup.get<MuonGeometryRecord>().cacheIdentifier();
331  iSetup.get<MuonGeometryRecord>().get(geomHandle);
332  for (TU_iterator it=_cache.begin();it!=_cache.end();it++){
333  (*it).second->setGeom(geomHandle->chamber((*it).second->statId()));
334  }
335 
336  }
337 
338  if (_usesyncdb &&
339  (iSetup.get<DTT0Rcd>().cacheIdentifier()!=_t0id ||
340  iSetup.get<DTTtrigRcd>().cacheIdentifier()!=_ttrigid)) {
341 
342  if (_debug)
343  std::cout << "DTTrig::updateES updating synchronizer" << std::endl;
344 
345  _t0id = iSetup.get<DTT0Rcd>().cacheIdentifier();
346  _ttrigid = iSetup.get<DTTtrigRcd>().cacheIdentifier();
347  _digi_sync->setES(iSetup);
348 
349  }
350 
351 }
unsigned long long cacheIdentifier() const
SCcontainer::iterator SC_iterator
Definition: DTTrig.h:62
SCcontainer _cache1
Definition: DTTrig.h:249
unsigned long long _ttrigid
Definition: DTTrig.h:260
bool _debug
Definition: DTTrig.h:253
TUcontainer _cache
Definition: DTTrig.h:248
bool _usesyncdb
Definition: DTTrig.h:254
TUcontainer::iterator TU_iterator
Definition: DTTrig.h:59
unsigned long long _geomid
Definition: DTTrig.h:258
virtual void setES(const edm::EventSetup &setup)=0
Pass the Event Setup to the synchronization module at each event.
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
Definition: DTT0Rcd.h:9
DTTTrigBaseSync * _digi_sync
Definition: DTTrig.h:251
unsigned long long _t0id
Definition: DTTrig.h:259
const DTConfigManager * _conf_manager
Definition: DTTrig.h:250
tuple cout
Definition: gather_cfg.py:41
unsigned long long _configid
Definition: DTTrig.h:257

Member Data Documentation

TUcontainer DTTrig::_cache
private
SCcontainer DTTrig::_cache1
private
const DTConfigManager* DTTrig::_conf_manager
private

Definition at line 250 of file DTTrig.h.

Referenced by getBXOffset(), and updateES().

unsigned long long DTTrig::_configid
private

Definition at line 257 of file DTTrig.h.

Referenced by updateES().

bool DTTrig::_debug
private
DTTTrigBaseSync* DTTrig::_digi_sync
private

Definition at line 251 of file DTTrig.h.

Referenced by createTUs(), DTTrig(), updateES(), and ~DTTrig().

edm::InputTag DTTrig::_digitag
private

Definition at line 252 of file DTTrig.h.

Referenced by DTTrig(), and triggerReco().

unsigned long long DTTrig::_geomid
private

Definition at line 258 of file DTTrig.h.

Referenced by updateES().

bool DTTrig::_inputexist
private

Definition at line 255 of file DTTrig.h.

Referenced by triggerReco().

unsigned long long DTTrig::_t0id
private

Definition at line 259 of file DTTrig.h.

Referenced by updateES().

unsigned long long DTTrig::_ttrigid
private

Definition at line 260 of file DTTrig.h.

Referenced by updateES().

bool DTTrig::_usesyncdb
private

Definition at line 254 of file DTTrig.h.

Referenced by DTTrig(), and updateES().