test
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 | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
L1MuDTTrackFinder Class Reference

#include <L1MuDTTrackFinder.h>

Public Types

typedef std::vector
< L1MuRegionalCand >
::const_iterator 
TFtracks_const_iter
 container for muon candidates More...
 
typedef std::vector
< L1MuRegionalCand >::iterator 
TFtracks_iter
 

Public Member Functions

TFtracks_const_iter begin ()
 
void clear ()
 
TFtracks_const_iter end ()
 
const L1MuDTEtaProcessorep (int id) const
 get a pointer to an Eta Processor, index [0-11] More...
 
std::vector< L1MuRegionalCand > & getcache ()
 
std::vector< L1MuDTTrackCand > & getcache0 ()
 
 L1MuDTTrackFinder (const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
 constructor More...
 
const L1MuDTMuonSorterms () const
 get a pointer to the DT Muon Sorter More...
 
int numberOfTracks ()
 get number of muon candidates found by the barrel MTTF More...
 
int numberOfTracks (int bx)
 get number of muon candidates found by the barrel MTTF at a given bx More...
 
void reset ()
 reset the barrel MTTF More...
 
void run (const edm::Event &e, const edm::EventSetup &c)
 run the barrel MTTF More...
 
void setup ()
 build the structure of the barrel MTTF More...
 
const L1MuDTSectorProcessorsp (const L1MuDTSecProcId &) const
 get a pointer to a Sector Processor More...
 
const L1MuDTWedgeSorterws (int id) const
 get a pointer to a Wedge Sorter, index [0-11] More...
 
virtual ~L1MuDTTrackFinder ()
 destructor More...
 

Static Public Member Functions

static L1MuDTTFConfigconfig ()
 return configuration More...
 

Private Member Functions

virtual void reconstruct (const edm::Event &e, const edm::EventSetup &c)
 run Track Finder and store candidates in cache More...
 

Private Attributes

std::vector< L1MuRegionalCand_cache
 
std::vector< L1MuDTTrackCand_cache0
 
std::vector< L1MuDTEtaProcessor * > m_epvec
 Eta Processors. More...
 
L1MuDTMuonSorterm_ms
 DT Muon Sorter. More...
 
L1MuDTSecProcMapm_spmap
 Sector Processors. More...
 
std::vector< L1MuDTWedgeSorter * > m_wsvec
 Wedge Sorters. More...
 

Static Private Attributes

static L1MuDTTFConfigm_config = 0
 Track Finder configuration. More...
 

Detailed Description

L1 barrel Muon Trigger Track Finder (MTTF)

The barrel MTTF consists of:

N. Neumeister CERN EP J. Troconiz UAM Madrid

Definition at line 56 of file L1MuDTTrackFinder.h.

Member Typedef Documentation

typedef std::vector<L1MuRegionalCand>::const_iterator L1MuDTTrackFinder::TFtracks_const_iter

container for muon candidates

Definition at line 61 of file L1MuDTTrackFinder.h.

typedef std::vector<L1MuRegionalCand>::iterator L1MuDTTrackFinder::TFtracks_iter

Definition at line 62 of file L1MuDTTrackFinder.h.

Constructor & Destructor Documentation

L1MuDTTrackFinder::L1MuDTTrackFinder ( const edm::ParameterSet ps,
edm::ConsumesCollector &&  iC 
)

constructor

Definition at line 55 of file L1MuDTTrackFinder.cc.

References gather_cfg::cout, L1MuDTTFConfig::Debug(), and L1MuDTTFConfig::getDTDigiInputTag().

55  {
56 
57  // set configuration parameters
58  if ( m_config == 0 ) m_config = new L1MuDTTFConfig(ps);
59 
60  if ( L1MuDTTFConfig::Debug(1) ) cout << endl;
61  if ( L1MuDTTFConfig::Debug(1) ) cout << "**** entering L1MuDTTrackFinder ****" << endl;
62  if ( L1MuDTTFConfig::Debug(1) ) cout << endl;
63 
64  m_spmap = new L1MuDTSecProcMap();
65  m_epvec.reserve(12);
66  m_wsvec.reserve(12);
67  m_ms = 0;
68 
69  _cache.reserve(4*17);
70  _cache0.reserve(144*17);
71 
73 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
L1MuDTSecProcMap * m_spmap
Sector Processors.
L1MuDTMuonSorter * m_ms
DT Muon Sorter.
std::vector< L1MuDTTrackCand > _cache0
static bool Debug()
std::vector< L1MuRegionalCand > _cache
std::vector< L1MuDTEtaProcessor * > m_epvec
Eta Processors.
static edm::InputTag getDTDigiInputTag()
tuple cout
Definition: gather_cfg.py:121
static L1MuDTTFConfig * m_config
Track Finder configuration.
std::vector< L1MuDTWedgeSorter * > m_wsvec
Wedge Sorters.
L1MuDTTrackFinder::~L1MuDTTrackFinder ( )
virtual

destructor

Definition at line 80 of file L1MuDTTrackFinder.cc.

80  {
81 
82  delete m_spmap;
83 
84  vector<L1MuDTEtaProcessor*>::iterator it_ep = m_epvec.begin();
85  while ( it_ep != m_epvec.end() ) {
86  delete (*it_ep);
87  it_ep++;
88  }
89  m_epvec.clear();
90 
91  vector<L1MuDTWedgeSorter*>::iterator it_ws = m_wsvec.begin();
92  while ( it_ws != m_wsvec.end() ) {
93  delete (*it_ws);
94  it_ws++;
95  }
96  m_wsvec.clear();
97 
98  delete m_ms;
99 
100  if ( m_config ) delete m_config;
101  m_config = 0;
102 
103 }
L1MuDTSecProcMap * m_spmap
Sector Processors.
L1MuDTMuonSorter * m_ms
DT Muon Sorter.
std::vector< L1MuDTEtaProcessor * > m_epvec
Eta Processors.
static L1MuDTTFConfig * m_config
Track Finder configuration.
std::vector< L1MuDTWedgeSorter * > m_wsvec
Wedge Sorters.

Member Function Documentation

L1MuDTTrackFinder::TFtracks_const_iter L1MuDTTrackFinder::begin ( void  )

Definition at line 287 of file L1MuDTTrackFinder.cc.

287  {
288 
289  return _cache.begin();
290 
291 }
std::vector< L1MuRegionalCand > _cache
void L1MuDTTrackFinder::clear ( void  )

Definition at line 301 of file L1MuDTTrackFinder.cc.

Referenced by DTTrackFinder::produce().

301  {
302 
303  _cache.clear();
304  _cache0.clear();
305 
306 }
std::vector< L1MuDTTrackCand > _cache0
std::vector< L1MuRegionalCand > _cache
static L1MuDTTFConfig* L1MuDTTrackFinder::config ( void  )
inlinestatic

return configuration

Definition at line 104 of file L1MuDTTrackFinder.h.

References m_config.

104 { return m_config; }
static L1MuDTTFConfig * m_config
Track Finder configuration.
L1MuDTTrackFinder::TFtracks_const_iter L1MuDTTrackFinder::end ( void  )

Definition at line 294 of file L1MuDTTrackFinder.cc.

294  {
295 
296  return _cache.end();
297 
298 }
std::vector< L1MuRegionalCand > _cache
const L1MuDTEtaProcessor* L1MuDTTrackFinder::ep ( int  id) const
inline

get a pointer to an Eta Processor, index [0-11]

Definition at line 83 of file L1MuDTTrackFinder.h.

References m_epvec.

83 { return m_epvec[id]; }
std::vector< L1MuDTEtaProcessor * > m_epvec
Eta Processors.
std::vector<L1MuRegionalCand>& L1MuDTTrackFinder::getcache ( )
inline

Definition at line 108 of file L1MuDTTrackFinder.h.

References _cache.

Referenced by DTTrackFinder::produce().

108 { return _cache; }
std::vector< L1MuRegionalCand > _cache
std::vector<L1MuDTTrackCand>& L1MuDTTrackFinder::getcache0 ( )
inline

Definition at line 106 of file L1MuDTTrackFinder.h.

References _cache0.

Referenced by DTTrackFinder::produce().

106 { return _cache0; }
std::vector< L1MuDTTrackCand > _cache0
const L1MuDTMuonSorter* L1MuDTTrackFinder::ms ( ) const
inline

get a pointer to the DT Muon Sorter

Definition at line 89 of file L1MuDTTrackFinder.h.

References m_ms.

89 { return m_ms; }
L1MuDTMuonSorter * m_ms
DT Muon Sorter.
int L1MuDTTrackFinder::numberOfTracks ( )

get number of muon candidates found by the barrel MTTF

Definition at line 280 of file L1MuDTTrackFinder.cc.

Referenced by DTTrackFinder::produce().

280  {
281 
282  return _cache.size();
283 
284 }
std::vector< L1MuRegionalCand > _cache
int L1MuDTTrackFinder::numberOfTracks ( int  bx)

get number of muon candidates found by the barrel MTTF at a given bx

Definition at line 312 of file L1MuDTTrackFinder.cc.

References contentValuesFiles::number.

312  {
313 
314  int number = 0;
315  for ( TFtracks_const_iter it = _cache.begin(); it != _cache.end(); it++ ) {
316  if ( (*it).bx() == bx ) number++;
317  }
318 
319  return number;
320 
321 }
std::vector< L1MuRegionalCand > _cache
std::vector< L1MuRegionalCand >::const_iterator TFtracks_const_iter
container for muon candidates
virtual void L1MuDTTrackFinder::reconstruct ( const edm::Event e,
const edm::EventSetup c 
)
inlineprivatevirtual

run Track Finder and store candidates in cache

Definition at line 113 of file L1MuDTTrackFinder.h.

References reset(), and run().

113 { reset(); run(e,c); }
void run(const edm::Event &e, const edm::EventSetup &c)
run the barrel MTTF
void reset()
reset the barrel MTTF
void L1MuDTTrackFinder::reset ( void  )

reset the barrel MTTF

Definition at line 242 of file L1MuDTTrackFinder.cc.

Referenced by reconstruct().

242  {
243 
245  while ( it_sp != m_spmap->end() ) {
246  if ( (*it_sp).second ) (*it_sp).second->reset();
247  it_sp++;
248  }
249 
250  vector<L1MuDTEtaProcessor*>::iterator it_ep = m_epvec.begin();
251  while ( it_ep != m_epvec.end() ) {
252  if ( *it_ep ) (*it_ep)->reset();
253  it_ep++;
254  }
255 
256  vector<L1MuDTWedgeSorter*>::iterator it_ws = m_wsvec.begin();
257  while ( it_ws != m_wsvec.end() ) {
258  if ( *it_ws ) (*it_ws)->reset();
259  it_ws++;
260  }
261 
262  if ( m_ms ) m_ms->reset();
263 
264 }
virtual void reset()
reset Muon Sorter
L1MuDTSecProcMap * m_spmap
Sector Processors.
L1MuDTMuonSorter * m_ms
DT Muon Sorter.
SPmap_iter end()
return iterator which points to the one-past-last entry of the container
std::vector< L1MuDTEtaProcessor * > m_epvec
Eta Processors.
SPmap::iterator SPmap_iter
SPmap_iter begin()
return iterator which points to the first entry of the container
std::vector< L1MuDTWedgeSorter * > m_wsvec
Wedge Sorters.
void L1MuDTTrackFinder::run ( const edm::Event e,
const edm::EventSetup c 
)

run the barrel MTTF

Definition at line 152 of file L1MuDTTrackFinder.cc.

References L1MuDTTrack::address(), L1MuRegionalCand::bx(), gather_cfg::cout, L1MuDTTFConfig::Debug(), L1MuDTTrack::empty(), L1MuDTTFConfig::getBxMax(), L1MuDTTFConfig::getBxMin(), edm::Event::getByLabel(), L1MuRegionalCand::getDataWord(), L1MuDTTFConfig::getDTDigiInputTag(), getDQMSummary::iter, contentValuesFiles::number, reset(), L1MuDTSecProcId::sector(), L1MuDTTrack::spid(), L1MuDTTrack::tc(), and L1MuDTSecProcId::wheel().

Referenced by DTTrackFinder::produce(), and reconstruct().

152  {
153 
154  // run the barrel Muon Trigger Track Finder
155 
158  if ( dttrig->getContainer()->size() == 0 ) return;
159 
160  if ( L1MuDTTFConfig::Debug(2) ) cout << endl;
161  if ( L1MuDTTFConfig::Debug(2) ) cout << "**** L1MuDTTrackFinder processing ****" << endl;
162  if ( L1MuDTTFConfig::Debug(2) ) cout << endl;
163 
164  int bx_min = L1MuDTTFConfig::getBxMin();
165  int bx_max = L1MuDTTFConfig::getBxMax();
166 
167  for ( int bx = bx_min; bx <= bx_max; bx++ ) {
168 
169  if ( dttrig->bxEmpty(bx) ) continue;
170 
171  if ( L1MuDTTFConfig::Debug(2) ) cout << "L1MuDTTrackFinder processing bunch-crossing : " << bx << endl;
172 
173  // reset MTTF
174  reset();
175 
176  // run sector processors
178  while ( it_sp != m_spmap->end() ) {
179  if ( L1MuDTTFConfig::Debug(2) ) cout << "running "
180  << (*it_sp).second->id() << endl;
181  if ( (*it_sp).second ) (*it_sp).second->run(bx,e,c);
182  if ( L1MuDTTFConfig::Debug(2) && (*it_sp).second ) (*it_sp).second->print();
183  it_sp++;
184  }
185 
186  // run eta processors
187  vector<L1MuDTEtaProcessor*>::iterator it_ep = m_epvec.begin();
188  while ( it_ep != m_epvec.end() ) {
189  if ( L1MuDTTFConfig::Debug(2) ) cout << "running Eta Processor "
190  << (*it_ep)->id() << endl;
191  if ( *it_ep ) (*it_ep)->run(bx,e,c);
192  if ( L1MuDTTFConfig::Debug(2) && *it_ep ) (*it_ep)->print();
193  it_ep++;
194  }
195 
196  // read sector processors
197  it_sp = m_spmap->begin();
198  while ( it_sp != m_spmap->end() ) {
199  if ( L1MuDTTFConfig::Debug(2) ) cout << "reading "
200  << (*it_sp).second->id() << endl;
201  for ( int number = 0; number < 2; number++ ) {
202  const L1MuDTTrack* cand = (*it_sp).second->tracK(number);
203  if ( cand && !cand->empty() ) _cache0.push_back(L1MuDTTrackCand(cand->getDataWord(),cand->bx(),
204  cand->spid().wheel(),cand->spid().sector(),number,cand->address(1),
205  cand->address(2),cand->address(3),cand->address(4),cand->tc()));
206  }
207  it_sp++;
208  }
209 
210  // run wedge sorters
211  vector<L1MuDTWedgeSorter*>::iterator it_ws = m_wsvec.begin();
212  while ( it_ws != m_wsvec.end() ) {
213  if ( L1MuDTTFConfig::Debug(2) ) cout << "running Wedge Sorter "
214  << (*it_ws)->id() << endl;
215  if ( *it_ws ) (*it_ws)->run();
216  if ( L1MuDTTFConfig::Debug(2) && *it_ws ) (*it_ws)->print();
217  it_ws++;
218  }
219 
220  // run muon sorter
221  if ( L1MuDTTFConfig::Debug(2) ) cout << "running DT Muon Sorter" << endl;
222  if ( m_ms ) m_ms->run();
223  if ( L1MuDTTFConfig::Debug(2) && m_ms ) m_ms->print();
224 
225  // store found track candidates in container (cache)
226  if ( m_ms->numberOfTracks() > 0 ) {
227  const vector<const L1MuDTTrack*>& mttf_cont = m_ms->tracks();
228  vector<const L1MuDTTrack*>::const_iterator iter;
229  for ( iter = mttf_cont.begin(); iter != mttf_cont.end(); iter++ ) {
230  if ( *iter ) _cache.push_back(L1MuRegionalCand((*iter)->getDataWord(),(*iter)->bx()));
231  }
232  }
233 
234  }
235 
236 }
static int getBxMax()
L1MuDTAddressArray address() const
get address-array for this muon candidate
Definition: L1MuDTTrack.h:96
L1MuDTSecProcMap * m_spmap
Sector Processors.
TrackClass tc() const
get track-class
Definition: L1MuDTTrack.h:87
L1MuDTMuonSorter * m_ms
DT Muon Sorter.
void print() const
print results after sorting
std::vector< L1MuDTTrackCand > _cache0
int sector() const
return sector number
void reset()
reset the barrel MTTF
unsigned getDataWord() const
return data word
static int getBxMin()
static bool Debug()
SPmap_iter end()
return iterator which points to the one-past-last entry of the container
const L1MuDTSecProcId & spid() const
return Sector Processor in which the muon candidate was found
Definition: L1MuDTTrack.h:93
std::vector< L1MuRegionalCand > _cache
bool empty() const
is it an empty muon candidate?
Definition: L1MuDTTrack.h:90
std::vector< L1MuDTEtaProcessor * > m_epvec
Eta Processors.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
int numberOfTracks() const
return number of found muon candidates after sorter
SPmap::iterator SPmap_iter
const std::vector< const L1MuDTTrack * > & tracks() const
return vector of muon candidates
static edm::InputTag getDTDigiInputTag()
int bx() const
return bunch crossing identifier
virtual void run()
run Muon Sorter
int wheel() const
return wheel number
tuple cout
Definition: gather_cfg.py:121
SPmap_iter begin()
return iterator which points to the first entry of the container
std::vector< L1MuDTWedgeSorter * > m_wsvec
Wedge Sorters.
void L1MuDTTrackFinder::setup ( void  )

build the structure of the barrel MTTF

Definition at line 113 of file L1MuDTTrackFinder.cc.

References gather_cfg::cout, and L1MuDTTFConfig::Debug().

Referenced by L1MuDTTFSetup::L1MuDTTFSetup().

113  {
114 
115  // build the barrel Muon Trigger Track Finder
116 
117  if ( L1MuDTTFConfig::Debug(1) ) cout << endl;
118  if ( L1MuDTTFConfig::Debug(1) ) cout << "**** L1MuDTTrackFinder building ****" << endl;
119  if ( L1MuDTTFConfig::Debug(1) ) cout << endl;
120 
121  // create new sector processors
122  for ( int wh = -3; wh <= 3; wh++ ) {
123  if ( wh == 0 ) continue;
124  for ( int sc = 0; sc < 12; sc++ ) {
125  L1MuDTSecProcId tmpspid(wh,sc);
126  L1MuDTSectorProcessor* sp = new L1MuDTSectorProcessor(*this,tmpspid);
127  if ( L1MuDTTFConfig::Debug(2) ) cout << "creating " << tmpspid << endl;
128  m_spmap->insert(tmpspid,sp);
129  }
130  }
131 
132  // create new eta processors and wedge sorters
133  for ( int sc = 0; sc < 12; sc++ ) {
134  L1MuDTEtaProcessor* ep = new L1MuDTEtaProcessor(*this,sc);
135  if ( L1MuDTTFConfig::Debug(2) ) cout << "creating Eta Processor " << sc << endl;
136  m_epvec.push_back(ep);
137  L1MuDTWedgeSorter* ws = new L1MuDTWedgeSorter(*this,sc);
138  if ( L1MuDTTFConfig::Debug(2) ) cout << "creating Wedge Sorter " << sc << endl;
139  m_wsvec.push_back(ws);
140  }
141 
142  // create new muon sorter
143  if ( L1MuDTTFConfig::Debug(2) ) cout << "creating DT Muon Sorter " << endl;
144  m_ms = new L1MuDTMuonSorter(*this);
145 
146 }
L1MuDTSecProcMap * m_spmap
Sector Processors.
L1MuDTMuonSorter * m_ms
DT Muon Sorter.
const L1MuDTSectorProcessor * sp(const L1MuDTSecProcId &) const
get a pointer to a Sector Processor
const L1MuDTEtaProcessor * ep(int id) const
get a pointer to an Eta Processor, index [0-11]
static bool Debug()
std::vector< L1MuDTEtaProcessor * > m_epvec
Eta Processors.
void insert(const L1MuDTSecProcId &, L1MuDTSectorProcessor *sp)
insert a Sector Processor into the container
const L1MuDTWedgeSorter * ws(int id) const
get a pointer to a Wedge Sorter, index [0-11]
tuple cout
Definition: gather_cfg.py:121
std::vector< L1MuDTWedgeSorter * > m_wsvec
Wedge Sorters.
const L1MuDTSectorProcessor * L1MuDTTrackFinder::sp ( const L1MuDTSecProcId id) const

get a pointer to a Sector Processor

Definition at line 270 of file L1MuDTTrackFinder.cc.

Referenced by L1MuDTSectorProcessor::neighbour(), L1MuDTEtaProcessor::receiveAddresses(), and L1MuDTWedgeSorter::run().

270  {
271 
272  return m_spmap->sp(id);
273 
274 }
L1MuDTSecProcMap * m_spmap
Sector Processors.
L1MuDTSectorProcessor * sp(const L1MuDTSecProcId &) const
return pointer to Sector Processor
const L1MuDTWedgeSorter* L1MuDTTrackFinder::ws ( int  id) const
inline

get a pointer to a Wedge Sorter, index [0-11]

Definition at line 86 of file L1MuDTTrackFinder.h.

References m_wsvec.

Referenced by L1MuDTMuonSorter::run().

86 { return m_wsvec[id]; }
std::vector< L1MuDTWedgeSorter * > m_wsvec
Wedge Sorters.

Member Data Documentation

std::vector<L1MuRegionalCand> L1MuDTTrackFinder::_cache
private

Definition at line 118 of file L1MuDTTrackFinder.h.

Referenced by getcache().

std::vector<L1MuDTTrackCand> L1MuDTTrackFinder::_cache0
private

Definition at line 117 of file L1MuDTTrackFinder.h.

Referenced by getcache0().

L1MuDTTFConfig * L1MuDTTrackFinder::m_config = 0
staticprivate

Track Finder configuration.

Definition at line 124 of file L1MuDTTrackFinder.h.

Referenced by config().

std::vector<L1MuDTEtaProcessor*> L1MuDTTrackFinder::m_epvec
private

Eta Processors.

Definition at line 120 of file L1MuDTTrackFinder.h.

Referenced by ep().

L1MuDTMuonSorter* L1MuDTTrackFinder::m_ms
private

DT Muon Sorter.

Definition at line 122 of file L1MuDTTrackFinder.h.

Referenced by ms().

L1MuDTSecProcMap* L1MuDTTrackFinder::m_spmap
private

Sector Processors.

Definition at line 119 of file L1MuDTTrackFinder.h.

std::vector<L1MuDTWedgeSorter*> L1MuDTTrackFinder::m_wsvec
private

Wedge Sorters.

Definition at line 121 of file L1MuDTTrackFinder.h.

Referenced by ws().