CMS 3D CMS Logo

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 (edm::ConsumesCollector &&iC)
 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
 
edm::EDGetTokenT< L1MuDTChambPhContainerm_DTDigiToken
 
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 59 of file L1MuDTTrackFinder.h.

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

Definition at line 60 of file L1MuDTTrackFinder.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 54 of file L1MuDTTrackFinder.cc.

References gather_cfg::cout.

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

destructor

Definition at line 81 of file L1MuDTTrackFinder.cc.

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)
101  delete m_config;
102  m_config = nullptr;
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 301 of file L1MuDTTrackFinder.cc.

Referenced by ms().

301 { return _cache.begin(); }
std::vector< L1MuRegionalCand > _cache
void L1MuDTTrackFinder::clear ( void  )

Definition at line 305 of file L1MuDTTrackFinder.cc.

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

305  {
306  _cache.clear();
307  _cache0.clear();
308 }
std::vector< L1MuDTTrackCand > _cache0
std::vector< L1MuRegionalCand > _cache
static L1MuDTTFConfig* L1MuDTTrackFinder::config ( void  )
inlinestatic
L1MuDTTrackFinder::TFtracks_const_iter L1MuDTTrackFinder::end ( void  )

Definition at line 303 of file L1MuDTTrackFinder.cc.

Referenced by ms().

303 { return _cache.end(); }
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 81 of file L1MuDTTrackFinder.h.

References triggerObjects_cff::id, and m_epvec.

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

Definition at line 106 of file L1MuDTTrackFinder.h.

References _cache.

Referenced by DTTrackFinder::produce().

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

Definition at line 104 of file L1MuDTTrackFinder.h.

References _cache0.

Referenced by DTTrackFinder::produce().

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

get a pointer to the DT Muon Sorter

Definition at line 87 of file L1MuDTTrackFinder.h.

References begin(), l1GtPatternGenerator_cfi::bx, clear(), end(), m_ms, and numberOfTracks().

87 { 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 299 of file L1MuDTTrackFinder.cc.

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

299 { return _cache.size(); }
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 313 of file L1MuDTTrackFinder.cc.

References l1GtPatternGenerator_cfi::bx, m_config, and contentValuesFiles::number.

313  {
314  int number = 0;
315  for (TFtracks_const_iter it = _cache.begin(); it != _cache.end(); it++) {
316  if ((*it).bx() == bx)
317  number++;
318  }
319 
320  return number;
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 110 of file L1MuDTTrackFinder.h.

References reset(), and run().

110  {
111  reset();
112  run(e, c);
113  }
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 265 of file L1MuDTTrackFinder.cc.

Referenced by reconstruct().

265  {
267  while (it_sp != m_spmap->end()) {
268  if ((*it_sp).second)
269  (*it_sp).second->reset();
270  it_sp++;
271  }
272 
273  vector<L1MuDTEtaProcessor*>::iterator it_ep = m_epvec.begin();
274  while (it_ep != m_epvec.end()) {
275  if (*it_ep)
276  (*it_ep)->reset();
277  it_ep++;
278  }
279 
280  vector<L1MuDTWedgeSorter*>::iterator it_ws = m_wsvec.begin();
281  while (it_ws != m_wsvec.end()) {
282  if (*it_ws)
283  (*it_ws)->reset();
284  it_ws++;
285  }
286 
287  if (m_ms)
288  m_ms->reset();
289 }
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
void reset() override
reset Muon Sorter
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 156 of file L1MuDTTrackFinder.cc.

References L1MuDTTrack::address(), l1GtPatternGenerator_cfi::bx, L1MuRegionalCand::bx(), L1MuDTChambPhContainer::bxEmpty(), gather_cfg::cout, L1MuDTTrack::empty(), edm::Event::getByToken(), L1MuDTChambPhContainer::getContainer(), L1MuRegionalCand::getDataWord(), contentValuesFiles::number, reset(), L1MuDTSecProcId::sector(), L1MuDTTrack::spid(), L1MuDTTrack::tc(), and L1MuDTSecProcId::wheel().

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

156  {
157  // run the barrel Muon Trigger Track Finder
158 
160  e.getByToken(m_DTDigiToken, dttrig);
161  if (dttrig->getContainer()->empty())
162  return;
163 
164  if (m_config->Debug(2))
165  cout << endl;
166  if (m_config->Debug(2))
167  cout << "**** L1MuDTTrackFinder processing ****" << endl;
168  if (m_config->Debug(2))
169  cout << endl;
170 
171  int bx_min = m_config->getBxMin();
172  int bx_max = m_config->getBxMax();
173 
174  for (int bx = bx_min; bx <= bx_max; bx++) {
175  if (dttrig->bxEmpty(bx))
176  continue;
177 
178  if (m_config->Debug(2))
179  cout << "L1MuDTTrackFinder processing bunch-crossing : " << bx << endl;
180 
181  // reset MTTF
182  reset();
183 
184  // run sector processors
186  while (it_sp != m_spmap->end()) {
187  if (m_config->Debug(2))
188  cout << "running " << (*it_sp).second->id() << endl;
189  if ((*it_sp).second)
190  (*it_sp).second->run(bx, e, c);
191  if (m_config->Debug(2) && (*it_sp).second)
192  (*it_sp).second->print();
193  it_sp++;
194  }
195 
196  // run eta processors
197  vector<L1MuDTEtaProcessor*>::iterator it_ep = m_epvec.begin();
198  while (it_ep != m_epvec.end()) {
199  if (m_config->Debug(2))
200  cout << "running Eta Processor " << (*it_ep)->id() << endl;
201  if (*it_ep)
202  (*it_ep)->run(bx, e, c);
203  if (m_config->Debug(2) && *it_ep)
204  (*it_ep)->print();
205  it_ep++;
206  }
207 
208  // read sector processors
209  it_sp = m_spmap->begin();
210  while (it_sp != m_spmap->end()) {
211  if (m_config->Debug(2))
212  cout << "reading " << (*it_sp).second->id() << endl;
213  for (int number = 0; number < 2; number++) {
214  const L1MuDTTrack* cand = (*it_sp).second->tracK(number);
215  if (cand && !cand->empty())
216  _cache0.push_back(L1MuDTTrackCand(cand->getDataWord(),
217  cand->bx(),
218  cand->spid().wheel(),
219  cand->spid().sector(),
220  number,
221  cand->address(1),
222  cand->address(2),
223  cand->address(3),
224  cand->address(4),
225  cand->tc()));
226  }
227  it_sp++;
228  }
229 
230  // run wedge sorters
231  vector<L1MuDTWedgeSorter*>::iterator it_ws = m_wsvec.begin();
232  while (it_ws != m_wsvec.end()) {
233  if (m_config->Debug(2))
234  cout << "running Wedge Sorter " << (*it_ws)->id() << endl;
235  if (*it_ws)
236  (*it_ws)->run();
237  if (m_config->Debug(2) && *it_ws)
238  (*it_ws)->print();
239  it_ws++;
240  }
241 
242  // run muon sorter
243  if (m_config->Debug(2))
244  cout << "running DT Muon Sorter" << endl;
245  if (m_ms)
246  m_ms->run();
247  if (m_config->Debug(2) && m_ms)
248  m_ms->print();
249 
250  // store found track candidates in container (cache)
251  if (m_ms->numberOfTracks() > 0) {
252  const vector<const L1MuDTTrack*>& mttf_cont = m_ms->tracks();
253  vector<const L1MuDTTrack*>::const_iterator iter;
254  for (iter = mttf_cont.begin(); iter != mttf_cont.end(); iter++) {
255  if (*iter)
256  _cache.push_back(L1MuRegionalCand((*iter)->getDataWord(), (*iter)->bx()));
257  }
258  }
259  }
260 }
L1MuDTAddressArray address() const
get address-array for this muon candidate
Definition: L1MuDTTrack.h:92
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
L1MuDTSecProcMap * m_spmap
Sector Processors.
TrackClass tc() const
get track-class
Definition: L1MuDTTrack.h:83
L1MuDTMuonSorter * m_ms
DT Muon Sorter.
bool bxEmpty(int step) const
void print() const
print results after sorting
std::vector< L1MuDTTrackCand > _cache0
edm::EDGetTokenT< L1MuDTChambPhContainer > m_DTDigiToken
int sector() const
return sector number
void reset()
reset the barrel MTTF
bool empty() const override
is it an empty muon candidate?
Definition: L1MuDTTrack.h:86
unsigned getDataWord() const
return data word
void run() override
run Muon Sorter
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:89
std::vector< L1MuRegionalCand > _cache
std::vector< L1MuDTEtaProcessor * > m_epvec
Eta Processors.
int getBxMax() const
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
Phi_Container const * getContainer() const
int bx() const
return bunch crossing identifier
int getBxMin() const
int wheel() const
return wheel number
static L1MuDTTFConfig * m_config
Track Finder configuration.
SPmap_iter begin()
return iterator which points to the first entry of the container
std::vector< L1MuDTWedgeSorter * > m_wsvec
Wedge Sorters.
void L1MuDTTrackFinder::setup ( edm::ConsumesCollector &&  iC)

build the structure of the barrel MTTF

Definition at line 112 of file L1MuDTTrackFinder.cc.

References gather_cfg::cout, SiStripBadComponentsDQMServiceTemplate_cfg::ep, eostools::move(), and SimDataFormats::CaloAnalysis::sc.

Referenced by L1MuDTTFSetup::L1MuDTTFSetup().

112  {
113  // build the barrel Muon Trigger Track Finder
114 
115  if (m_config->Debug(1))
116  cout << endl;
117  if (m_config->Debug(1))
118  cout << "**** L1MuDTTrackFinder building ****" << endl;
119  if (m_config->Debug(1))
120  cout << endl;
121 
122  // create new sector processors
123  for (int wh = -3; wh <= 3; wh++) {
124  if (wh == 0)
125  continue;
126  for (int sc = 0; sc < 12; sc++) {
127  L1MuDTSecProcId tmpspid(wh, sc);
128  L1MuDTSectorProcessor* sp = new L1MuDTSectorProcessor(*this, tmpspid, std::move(iC));
129  if (m_config->Debug(2))
130  cout << "creating " << tmpspid << endl;
131  m_spmap->insert(tmpspid, sp);
132  }
133  }
134 
135  // create new eta processors and wedge sorters
136  for (int sc = 0; sc < 12; sc++) {
138  if (m_config->Debug(2))
139  cout << "creating Eta Processor " << sc << endl;
140  m_epvec.push_back(ep);
141  L1MuDTWedgeSorter* ws = new L1MuDTWedgeSorter(*this, sc);
142  if (m_config->Debug(2))
143  cout << "creating Wedge Sorter " << sc << endl;
144  m_wsvec.push_back(ws);
145  }
146 
147  // create new muon sorter
148  if (m_config->Debug(2))
149  cout << "creating DT Muon Sorter " << endl;
150  m_ms = new L1MuDTMuonSorter(*this);
151 }
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]
static L1MuDTTFConfig * m_config
Track Finder configuration.
def move(src, dest)
Definition: eostools.py:511
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 294 of file L1MuDTTrackFinder.cc.

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

294 { return m_spmap->sp(id); }
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 84 of file L1MuDTTrackFinder.h.

References triggerObjects_cff::id, and m_wsvec.

Referenced by L1MuDTMuonSorter::run().

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

Member Data Documentation

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

Definition at line 116 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(), and numberOfTracks().

edm::EDGetTokenT<L1MuDTChambPhContainer> L1MuDTTrackFinder::m_DTDigiToken
private

Definition at line 122 of file L1MuDTTrackFinder.h.

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

Eta Processors.

Definition at line 119 of file L1MuDTTrackFinder.h.

Referenced by ep().

L1MuDTMuonSorter* L1MuDTTrackFinder::m_ms
private

DT Muon Sorter.

Definition at line 121 of file L1MuDTTrackFinder.h.

Referenced by ms().

L1MuDTSecProcMap* L1MuDTTrackFinder::m_spmap
private

Sector Processors.

Definition at line 118 of file L1MuDTTrackFinder.h.

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

Wedge Sorters.

Definition at line 120 of file L1MuDTTrackFinder.h.

Referenced by ws().