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 std::shared_ptr< L1MuDTTFConfigm_config
 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 57 of file L1MuDTTrackFinder.h.

Member Typedef Documentation

◆ TFtracks_const_iter

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

container for muon candidates

Definition at line 60 of file L1MuDTTrackFinder.h.

◆ TFtracks_iter

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

Definition at line 61 of file L1MuDTTrackFinder.h.

Constructor & Destructor Documentation

◆ L1MuDTTrackFinder()

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

constructor

Definition at line 54 of file L1MuDTTrackFinder.cc.

References gather_cfg::cout, relativeConstraints::empty, and groupFilesInBlocks::temp.

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

◆ ~L1MuDTTrackFinder()

L1MuDTTrackFinder::~L1MuDTTrackFinder ( )
virtual

destructor

Definition at line 84 of file L1MuDTTrackFinder.cc.

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

Member Function Documentation

◆ begin()

L1MuDTTrackFinder::TFtracks_const_iter L1MuDTTrackFinder::begin ( void  )

Definition at line 300 of file L1MuDTTrackFinder.cc.

300 { return _cache.begin(); }
std::vector< L1MuRegionalCand > _cache

◆ clear()

void L1MuDTTrackFinder::clear ( void  )

Definition at line 304 of file L1MuDTTrackFinder.cc.

Referenced by DTTrackFinder::produce().

304  {
305  _cache.clear();
306  _cache0.clear();
307 }
std::vector< L1MuDTTrackCand > _cache0
std::vector< L1MuRegionalCand > _cache

◆ config()

static L1MuDTTFConfig* L1MuDTTrackFinder::config ( void  )
inlinestatic

◆ end()

L1MuDTTrackFinder::TFtracks_const_iter L1MuDTTrackFinder::end ( void  )

Definition at line 302 of file L1MuDTTrackFinder.cc.

302 { return _cache.end(); }
std::vector< L1MuRegionalCand > _cache

◆ ep()

const L1MuDTEtaProcessor* L1MuDTTrackFinder::ep ( int  id) const
inline

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

Definition at line 82 of file L1MuDTTrackFinder.h.

References triggerObjects_cff::id, and m_epvec.

82 { return m_epvec[id]; }
std::vector< L1MuDTEtaProcessor * > m_epvec
Eta Processors.

◆ getcache()

std::vector<L1MuRegionalCand>& L1MuDTTrackFinder::getcache ( )
inline

Definition at line 107 of file L1MuDTTrackFinder.h.

References _cache.

Referenced by DTTrackFinder::produce().

107 { return _cache; }
std::vector< L1MuRegionalCand > _cache

◆ getcache0()

std::vector<L1MuDTTrackCand>& L1MuDTTrackFinder::getcache0 ( )
inline

Definition at line 105 of file L1MuDTTrackFinder.h.

References _cache0.

Referenced by DTTrackFinder::produce().

105 { return _cache0; }
std::vector< L1MuDTTrackCand > _cache0

◆ ms()

const L1MuDTMuonSorter* L1MuDTTrackFinder::ms ( ) const
inline

get a pointer to the DT Muon Sorter

Definition at line 88 of file L1MuDTTrackFinder.h.

References m_ms.

88 { return m_ms; }
L1MuDTMuonSorter * m_ms
DT Muon Sorter.

◆ numberOfTracks() [1/2]

int L1MuDTTrackFinder::numberOfTracks ( )

get number of muon candidates found by the barrel MTTF

Definition at line 298 of file L1MuDTTrackFinder.cc.

Referenced by DTTrackFinder::produce().

298 { return _cache.size(); }
std::vector< L1MuRegionalCand > _cache

◆ numberOfTracks() [2/2]

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 simKBmtfDigis_cfi::bx, and contentValuesFiles::number.

312  {
313  int number = 0;
314  for (TFtracks_const_iter it = _cache.begin(); it != _cache.end(); it++) {
315  if ((*it).bx() == bx)
316  number++;
317  }
318 
319  return number;
320 }
std::vector< L1MuRegionalCand > _cache
std::vector< L1MuRegionalCand >::const_iterator TFtracks_const_iter
container for muon candidates

◆ reconstruct()

virtual void L1MuDTTrackFinder::reconstruct ( const edm::Event e,
const edm::EventSetup c 
)
inlineprivatevirtual

run Track Finder and store candidates in cache

Definition at line 111 of file L1MuDTTrackFinder.h.

References c, MillePedeFileConverter_cfg::e, reset(), and run().

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

◆ reset()

void L1MuDTTrackFinder::reset ( void  )

reset the barrel MTTF

Definition at line 264 of file L1MuDTTrackFinder.cc.

Referenced by reconstruct().

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

◆ run()

void L1MuDTTrackFinder::run ( const edm::Event e,
const edm::EventSetup c 
)

run the barrel MTTF

Definition at line 155 of file L1MuDTTrackFinder.cc.

References simKBmtfDigis_cfi::bx, L1MuDTChambPhContainer::bxEmpty(), c, gather_cfg::cout, MillePedeFileConverter_cfg::e, L1MuDTChambPhContainer::getContainer(), contentValuesFiles::number, and reset().

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

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

◆ setup()

void L1MuDTTrackFinder::setup ( edm::ConsumesCollector &&  iC)

build the structure of the barrel MTTF

Definition at line 111 of file L1MuDTTrackFinder.cc.

References gather_cfg::cout, SiStripBadComponentsDQMServiceTemplate_cfg::ep, eostools::move(), and gpuVertexFinder::ws.

Referenced by L1MuDTTFSetup::L1MuDTTFSetup().

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

◆ sp()

const L1MuDTSectorProcessor * L1MuDTTrackFinder::sp ( const L1MuDTSecProcId id) const

get a pointer to a Sector Processor

Definition at line 293 of file L1MuDTTrackFinder.cc.

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

293 { return m_spmap->sp(id); }
L1MuDTSecProcMap * m_spmap
Sector Processors.
L1MuDTSectorProcessor * sp(const L1MuDTSecProcId &) const
return pointer to Sector Processor

◆ ws()

const L1MuDTWedgeSorter* L1MuDTTrackFinder::ws ( int  id) const
inline

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

Definition at line 85 of file L1MuDTTrackFinder.h.

References triggerObjects_cff::id, and m_wsvec.

Referenced by L1MuDTMuonSorter::run().

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

Member Data Documentation

◆ _cache

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

◆ _cache0

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

Definition at line 117 of file L1MuDTTrackFinder.h.

Referenced by getcache0().

◆ m_config

std::shared_ptr< L1MuDTTFConfig > L1MuDTTrackFinder::m_config
staticprivate

Track Finder configuration.

Definition at line 125 of file L1MuDTTrackFinder.h.

Referenced by config().

◆ m_DTDigiToken

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

Definition at line 123 of file L1MuDTTrackFinder.h.

◆ m_epvec

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

Eta Processors.

Definition at line 120 of file L1MuDTTrackFinder.h.

Referenced by ep().

◆ m_ms

L1MuDTMuonSorter* L1MuDTTrackFinder::m_ms
private

DT Muon Sorter.

Definition at line 122 of file L1MuDTTrackFinder.h.

Referenced by ms().

◆ m_spmap

L1MuDTSecProcMap* L1MuDTTrackFinder::m_spmap
private

Sector Processors.

Definition at line 119 of file L1MuDTTrackFinder.h.

◆ m_wsvec

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

Wedge Sorters.

Definition at line 121 of file L1MuDTTrackFinder.h.

Referenced by ws().