CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | 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 ()
 
const L1MuDTTFConfigconfig () const
 return configuration More...
 
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...
 
 ~L1MuDTTrackFinder ()
 destructor More...
 

Private Attributes

std::vector< L1MuRegionalCand_cache
 
std::vector< L1MuDTTrackCand_cache0
 
std::unique_ptr< L1MuDTTFConfigm_config
 Track Finder configuration. More...
 
edm::EDGetTokenT< L1MuDTChambPhContainerm_DTDigiToken
 
std::vector< std::unique_ptr< L1MuDTEtaProcessor > > m_epvec
 Eta Processors. More...
 
std::unique_ptr< L1MuDTMuonSorterm_ms
 DT Muon Sorter. More...
 
std::unique_ptr< L1MuDTSecProcMapm_spmap
 Sector Processors. More...
 
std::vector< std::unique_ptr< L1MuDTWedgeSorter > > m_wsvec
 Wedge Sorters. 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.

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

◆ ~L1MuDTTrackFinder()

L1MuDTTrackFinder::~L1MuDTTrackFinder ( )
default

destructor

Member Function Documentation

◆ begin()

L1MuDTTrackFinder::TFtracks_const_iter L1MuDTTrackFinder::begin ( void  )

Definition at line 261 of file L1MuDTTrackFinder.cc.

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

◆ clear()

void L1MuDTTrackFinder::clear ( void  )

Definition at line 265 of file L1MuDTTrackFinder.cc.

Referenced by DTTrackFinder::produce().

265  {
266  _cache.clear();
267  _cache0.clear();
268 }
std::vector< L1MuDTTrackCand > _cache0
std::vector< L1MuRegionalCand > _cache

◆ config()

const L1MuDTTFConfig* L1MuDTTrackFinder::config ( void  ) const
inline

◆ end()

L1MuDTTrackFinder::TFtracks_const_iter L1MuDTTrackFinder::end ( void  )

Definition at line 263 of file L1MuDTTrackFinder.cc.

263 { 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 l1ctLayer2EG_cff::id, and m_epvec.

82 { return m_epvec[id].get(); }
std::vector< std::unique_ptr< 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.get(); }
std::unique_ptr< 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 259 of file L1MuDTTrackFinder.cc.

Referenced by DTTrackFinder::produce().

259 { 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 273 of file L1MuDTTrackFinder.cc.

References nano_mu_digi_cff::bx, and contentValuesFiles::number.

273  {
274  int number = 0;
275  for (auto const& elem : _cache) {
276  if (elem.bx() == bx)
277  number++;
278  }
279 
280  return number;
281 }
std::vector< L1MuRegionalCand > _cache

◆ reset()

void L1MuDTTrackFinder::reset ( void  )

reset the barrel MTTF

Definition at line 231 of file L1MuDTTrackFinder.cc.

References SiStripBadComponentsDQMServiceTemplate_cfg::ep, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::ws.

231  {
232  for (auto& sp : *m_spmap) {
233  if (sp.second)
234  sp.second->reset();
235  }
236 
237  for (auto& ep : m_epvec) {
238  if (ep)
239  ep->reset();
240  }
241 
242  for (auto& ws : m_wsvec) {
243  if (ws)
244  ws->reset();
245  }
246 
247  if (m_ms)
248  m_ms->reset();
249 }
const L1MuDTEtaProcessor * ep(int id) const
get a pointer to an Eta Processor, index [0-11]
std::vector< std::unique_ptr< L1MuDTWedgeSorter > > m_wsvec
Wedge Sorters.
virtual void reset()
reset the Sector Processor
const L1MuDTWedgeSorter * ws(int id) const
get a pointer to a Wedge Sorter, index [0-11]
std::unique_ptr< L1MuDTSecProcMap > m_spmap
Sector Processors.
std::unique_ptr< L1MuDTMuonSorter > m_ms
DT Muon Sorter.
const L1MuDTSectorProcessor * sp(const L1MuDTSecProcId &) const
get a pointer to a Sector Processor
void reset()
reset Wedge Sorter
std::vector< std::unique_ptr< L1MuDTEtaProcessor > > m_epvec
Eta Processors.
virtual void reset()
reset the Eta Processor

◆ run()

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

run the barrel MTTF

Definition at line 132 of file L1MuDTTrackFinder.cc.

References nano_mu_digi_cff::bx, L1MuDTChambPhContainer::bxEmpty(), HltBtagPostValidation_cff::c, gather_cfg::cout, MillePedeFileConverter_cfg::e, SiStripBadComponentsDQMServiceTemplate_cfg::ep, L1MuDTChambPhContainer::getContainer(), contentValuesFiles::number, reset(), and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::ws.

Referenced by DTTrackFinder::produce().

132  {
133  // run the barrel Muon Trigger Track Finder
134 
136  e.getByToken(m_DTDigiToken, dttrig);
137  if (dttrig->getContainer()->empty())
138  return;
139 
140  if (m_config->Debug(2))
141  cout << endl;
142  if (m_config->Debug(2))
143  cout << "**** L1MuDTTrackFinder processing ****" << endl;
144  if (m_config->Debug(2))
145  cout << endl;
146 
147  int bx_min = m_config->getBxMin();
148  int bx_max = m_config->getBxMax();
149 
150  for (int bx = bx_min; bx <= bx_max; bx++) {
151  if (dttrig->bxEmpty(bx))
152  continue;
153 
154  if (m_config->Debug(2))
155  cout << "L1MuDTTrackFinder processing bunch-crossing : " << bx << endl;
156 
157  // reset MTTF
158  reset();
159 
160  // run sector processors
161  for (auto& sp : *m_spmap) {
162  if (m_config->Debug(2))
163  cout << "running " << sp.second->id() << endl;
164  if (sp.second)
165  sp.second->run(bx, e, c);
166  if (m_config->Debug(2) && sp.second)
167  sp.second->print();
168  }
169 
170  // run eta processors
171  for (auto& ep : m_epvec) {
172  if (m_config->Debug(2))
173  cout << "running Eta Processor " << ep->id() << endl;
174  if (ep)
175  ep->run(bx, e, c);
176  if (m_config->Debug(2) && ep)
177  ep->print();
178  }
179 
180  // read sector processors
181  for (auto& sp : *m_spmap) {
182  if (m_config->Debug(2))
183  cout << "reading " << sp.second->id() << endl;
184  for (int number = 0; number < 2; number++) {
185  const L1MuDTTrack* cand = sp.second->tracK(number);
186  if (cand && !cand->empty())
187  _cache0.push_back(L1MuDTTrackCand(cand->getDataWord(),
188  cand->bx(),
189  cand->spid().wheel(),
190  cand->spid().sector(),
191  number,
192  cand->address(1),
193  cand->address(2),
194  cand->address(3),
195  cand->address(4),
196  cand->tc()));
197  }
198  }
199 
200  // run wedge sorters
201  for (auto& ws : m_wsvec) {
202  if (m_config->Debug(2))
203  cout << "running Wedge Sorter " << ws->id() << endl;
204  if (ws)
205  ws->run();
206  if (m_config->Debug(2) && ws)
207  ws->print();
208  }
209 
210  // run muon sorter
211  if (m_config->Debug(2))
212  cout << "running DT Muon Sorter" << endl;
213  if (m_ms)
214  m_ms->run();
215  if (m_config->Debug(2) && m_ms)
216  m_ms->print();
217 
218  // store found track candidates in container (cache)
219  if (m_ms->numberOfTracks() > 0) {
220  for (auto const& mttf : m_ms->tracks()) {
221  if (mttf)
222  _cache.push_back(L1MuRegionalCand(mttf->getDataWord(), mttf->bx()));
223  }
224  }
225  }
226 }
const L1MuDTEtaProcessor * ep(int id) const
get a pointer to an Eta Processor, index [0-11]
void print() const
print results after sorting
const L1MuDTTrack * tracK(int id) const
return pointer to muon candidate, index [0,1]
void run()
run Wedge Sorter
std::vector< L1MuDTTrackCand > _cache0
std::vector< std::unique_ptr< L1MuDTWedgeSorter > > m_wsvec
Wedge Sorters.
edm::EDGetTokenT< L1MuDTChambPhContainer > m_DTDigiToken
const L1MuDTWedgeSorter * ws(int id) const
get a pointer to a Wedge Sorter, index [0-11]
int id() const
return Eta Processor identifier (0-11)
void reset()
reset the barrel MTTF
const L1MuDTSecProcId & id() const
return Sector Processor identifier
virtual void run(int bx, const edm::Event &e, const edm::EventSetup &c)
run the Eta Processor
std::unique_ptr< L1MuDTSecProcMap > m_spmap
Sector Processors.
int id() const
return Wedge Sorter identifier (0-11)
std::unique_ptr< L1MuDTMuonSorter > m_ms
DT Muon Sorter.
std::unique_ptr< L1MuDTTFConfig > m_config
Track Finder configuration.
const L1MuDTSectorProcessor * sp(const L1MuDTSecProcId &) const
get a pointer to a Sector Processor
std::vector< L1MuRegionalCand > _cache
bool bxEmpty(int step) const
Phi_Container const * getContainer() const
std::vector< std::unique_ptr< L1MuDTEtaProcessor > > m_epvec
Eta Processors.
virtual void run(int bx, const edm::Event &e, const edm::EventSetup &c)
run the Sector Processor
void print() const
print muon candidates found by the Eta Processor
void print() const
print muon candidates found by the Sector Processor

◆ setup()

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

build the structure of the barrel MTTF

Definition at line 88 of file L1MuDTTrackFinder.cc.

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

Referenced by L1MuDTTFSetup::L1MuDTTFSetup().

88  {
89  // build the barrel Muon Trigger Track Finder
90 
91  if (m_config->Debug(1))
92  cout << endl;
93  if (m_config->Debug(1))
94  cout << "**** L1MuDTTrackFinder building ****" << endl;
95  if (m_config->Debug(1))
96  cout << endl;
97 
98  // create new sector processors
99  for (int wh = -3; wh <= 3; wh++) {
100  if (wh == 0)
101  continue;
102  for (int sc = 0; sc < 12; sc++) {
103  L1MuDTSecProcId tmpspid(wh, sc);
104  auto sp = std::make_unique<L1MuDTSectorProcessor>(*this, tmpspid, iC);
105  if (m_config->Debug(2))
106  cout << "creating " << tmpspid << endl;
107  m_spmap->insert(tmpspid, std::move(sp));
108  }
109  }
110 
111  // create new eta processors and wedge sorters
112  for (int sc = 0; sc < 12; sc++) {
113  auto ep = std::make_unique<L1MuDTEtaProcessor>(*this, sc, iC);
114  if (m_config->Debug(2))
115  cout << "creating Eta Processor " << sc << endl;
116  m_epvec.push_back(std::move(ep));
117  auto ws = std::make_unique<L1MuDTWedgeSorter>(*this, sc);
118  if (m_config->Debug(2))
119  cout << "creating Wedge Sorter " << sc << endl;
120  m_wsvec.push_back(std::move(ws));
121  }
122 
123  // create new muon sorter
124  if (m_config->Debug(2))
125  cout << "creating DT Muon Sorter " << endl;
126  m_ms = std::make_unique<L1MuDTMuonSorter>(*this);
127 }
const L1MuDTEtaProcessor * ep(int id) const
get a pointer to an Eta Processor, index [0-11]
std::vector< std::unique_ptr< L1MuDTWedgeSorter > > m_wsvec
Wedge Sorters.
const L1MuDTWedgeSorter * ws(int id) const
get a pointer to a Wedge Sorter, index [0-11]
std::unique_ptr< L1MuDTSecProcMap > m_spmap
Sector Processors.
std::unique_ptr< L1MuDTMuonSorter > m_ms
DT Muon Sorter.
std::unique_ptr< L1MuDTTFConfig > m_config
Track Finder configuration.
const L1MuDTSectorProcessor * sp(const L1MuDTSecProcId &) const
get a pointer to a Sector Processor
std::vector< std::unique_ptr< L1MuDTEtaProcessor > > m_epvec
Eta Processors.
def move(src, dest)
Definition: eostools.py:511

◆ sp()

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

get a pointer to a Sector Processor

Definition at line 254 of file L1MuDTTrackFinder.cc.

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

254 { return m_spmap->sp(id); }
std::unique_ptr< L1MuDTSecProcMap > m_spmap
Sector Processors.

◆ 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 l1ctLayer2EG_cff::id, and m_wsvec.

Referenced by L1MuDTMuonSorter::run().

85 { return m_wsvec[id].get(); }
std::vector< std::unique_ptr< 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 110 of file L1MuDTTrackFinder.h.

Referenced by getcache0().

◆ m_config

std::unique_ptr<L1MuDTTFConfig> L1MuDTTrackFinder::m_config
private

Track Finder configuration.

Definition at line 118 of file L1MuDTTrackFinder.h.

Referenced by config().

◆ m_DTDigiToken

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

Definition at line 116 of file L1MuDTTrackFinder.h.

◆ m_epvec

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

Eta Processors.

Definition at line 113 of file L1MuDTTrackFinder.h.

Referenced by ep().

◆ m_ms

std::unique_ptr<L1MuDTMuonSorter> L1MuDTTrackFinder::m_ms
private

DT Muon Sorter.

Definition at line 115 of file L1MuDTTrackFinder.h.

Referenced by ms().

◆ m_spmap

std::unique_ptr<L1MuDTSecProcMap> L1MuDTTrackFinder::m_spmap
private

Sector Processors.

Definition at line 112 of file L1MuDTTrackFinder.h.

◆ m_wsvec

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

Wedge Sorters.

Definition at line 114 of file L1MuDTTrackFinder.h.

Referenced by ws().