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 = nullptr
 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

◆ TFtracks_const_iter

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

container for muon candidates

Definition at line 59 of file L1MuDTTrackFinder.h.

◆ TFtracks_iter

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

Definition at line 60 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.

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 }

References gather_cfg::cout.

◆ ~L1MuDTTrackFinder()

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 }

Member Function Documentation

◆ begin()

L1MuDTTrackFinder::TFtracks_const_iter L1MuDTTrackFinder::begin ( void  )

Definition at line 301 of file L1MuDTTrackFinder.cc.

301 { return _cache.begin(); }

◆ clear()

void L1MuDTTrackFinder::clear ( void  )

Definition at line 305 of file L1MuDTTrackFinder.cc.

305  {
306  _cache.clear();
307  _cache0.clear();
308 }

Referenced by DTTrackFinder::produce().

◆ config()

static L1MuDTTFConfig* L1MuDTTrackFinder::config ( void  )
inlinestatic

◆ end()

L1MuDTTrackFinder::TFtracks_const_iter L1MuDTTrackFinder::end ( void  )

Definition at line 303 of file L1MuDTTrackFinder.cc.

303 { return _cache.end(); }

◆ ep()

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.

81 { return m_epvec[id]; }

References triggerObjects_cff::id, and m_epvec.

◆ getcache()

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

Definition at line 106 of file L1MuDTTrackFinder.h.

106 { return _cache; }

References _cache.

Referenced by DTTrackFinder::produce().

◆ getcache0()

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

Definition at line 104 of file L1MuDTTrackFinder.h.

104 { return _cache0; }

References _cache0.

Referenced by DTTrackFinder::produce().

◆ ms()

const L1MuDTMuonSorter* L1MuDTTrackFinder::ms ( ) const
inline

get a pointer to the DT Muon Sorter

Definition at line 87 of file L1MuDTTrackFinder.h.

87 { return m_ms; }

References m_ms.

◆ numberOfTracks() [1/2]

int L1MuDTTrackFinder::numberOfTracks ( )

get number of muon candidates found by the barrel MTTF

Definition at line 299 of file L1MuDTTrackFinder.cc.

299 { return _cache.size(); }

Referenced by DTTrackFinder::produce().

◆ 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 313 of file L1MuDTTrackFinder.cc.

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 }

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

◆ 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 110 of file L1MuDTTrackFinder.h.

110  {
111  reset();
112  run(e, c);
113  }

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

◆ reset()

void L1MuDTTrackFinder::reset ( void  )

reset the barrel MTTF

Definition at line 265 of file L1MuDTTrackFinder.cc.

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 }

Referenced by reconstruct().

◆ run()

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

run the barrel MTTF

Definition at line 156 of file L1MuDTTrackFinder.cc.

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 }

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

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

◆ setup()

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

build the structure of the barrel MTTF

Definition at line 112 of file L1MuDTTrackFinder.cc.

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++) {
137  L1MuDTEtaProcessor* ep = new L1MuDTEtaProcessor(*this, sc, std::move(iC));
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 }

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

Referenced by L1MuDTTFSetup::L1MuDTTFSetup().

◆ sp()

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

get a pointer to a Sector Processor

Definition at line 294 of file L1MuDTTrackFinder.cc.

294 { return m_spmap->sp(id); }

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

◆ ws()

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.

84 { return m_wsvec[id]; }

References triggerObjects_cff::id, and m_wsvec.

Referenced by L1MuDTMuonSorter::run().

Member Data Documentation

◆ _cache

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

◆ _cache0

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

Definition at line 116 of file L1MuDTTrackFinder.h.

Referenced by getcache0().

◆ m_config

L1MuDTTFConfig * L1MuDTTrackFinder::m_config = nullptr
staticprivate

Track Finder configuration.

Definition at line 124 of file L1MuDTTrackFinder.h.

Referenced by config().

◆ m_DTDigiToken

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

Definition at line 122 of file L1MuDTTrackFinder.h.

◆ m_epvec

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

Eta Processors.

Definition at line 119 of file L1MuDTTrackFinder.h.

Referenced by ep().

◆ m_ms

L1MuDTMuonSorter* L1MuDTTrackFinder::m_ms
private

DT Muon Sorter.

Definition at line 121 of file L1MuDTTrackFinder.h.

Referenced by ms().

◆ m_spmap

L1MuDTSecProcMap* L1MuDTTrackFinder::m_spmap
private

Sector Processors.

Definition at line 118 of file L1MuDTTrackFinder.h.

◆ m_wsvec

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

Wedge Sorters.

Definition at line 120 of file L1MuDTTrackFinder.h.

Referenced by ws().

L1MuDTTFConfig::getBxMax
int getBxMax() const
Definition: L1MuDTTFConfig.h:58
L1MuDTMuonSorter::print
void print() const
print results after sorting
Definition: L1MuDTMuonSorter.cc:131
L1MuDTTrackFinder::ep
const L1MuDTEtaProcessor * ep(int id) const
get a pointer to an Eta Processor, index [0-11]
Definition: L1MuDTTrackFinder.h:81
L1MuDTTFConfig::getBxMin
int getBxMin() const
Definition: L1MuDTTFConfig.h:57
L1MuDTTrackFinder::m_ms
L1MuDTMuonSorter * m_ms
DT Muon Sorter.
Definition: L1MuDTTrackFinder.h:121
L1MuDTTrackFinder::m_wsvec
std::vector< L1MuDTWedgeSorter * > m_wsvec
Wedge Sorters.
Definition: L1MuDTTrackFinder.h:120
L1MuDTTFConfig
Definition: L1MuDTTFConfig.h:38
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1MuDTSecProcMap::sp
L1MuDTSectorProcessor * sp(const L1MuDTSecProcId &) const
return pointer to Sector Processor
Definition: L1MuDTSecProcMap.cc:65
L1MuDTWedgeSorter
Definition: L1MuDTWedgeSorter.h:45
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1MuDTTrackFinder::_cache0
std::vector< L1MuDTTrackCand > _cache0
Definition: L1MuDTTrackFinder.h:116
L1MuDTTrackFinder::ws
const L1MuDTWedgeSorter * ws(int id) const
get a pointer to a Wedge Sorter, index [0-11]
Definition: L1MuDTTrackFinder.h:84
L1MuDTTrackFinder::run
void run(const edm::Event &e, const edm::EventSetup &c)
run the barrel MTTF
Definition: L1MuDTTrackFinder.cc:156
L1MuDTSecProcMap::SPmap_iter
SPmap::iterator SPmap_iter
Definition: L1MuDTSecProcMap.h:41
edm::Handle< L1MuDTChambPhContainer >
L1MuDTSecProcMap
Definition: L1MuDTSecProcMap.h:38
L1MuDTChambPhContainer
Definition: L1MuDTChambPhContainer.h:33
L1MuDTChambPhContainer::getContainer
Phi_Container const * getContainer() const
Definition: L1MuDTChambPhContainer.cc:41
L1MuDTTrackCand
Definition: L1MuDTTrackCand.h:33
L1MuDTTrackFinder::m_DTDigiToken
edm::EDGetTokenT< L1MuDTChambPhContainer > m_DTDigiToken
Definition: L1MuDTTrackFinder.h:122
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
L1MuDTMuonSorter
Definition: L1MuDTMuonSorter.h:45
L1MuDTMuonSorter::numberOfTracks
int numberOfTracks() const
return number of found muon candidates after sorter
Definition: L1MuDTMuonSorter.h:63
L1MuRegionalCand
Definition: L1MuRegionalCand.h:26
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
L1MuDTTrackFinder::reset
void reset()
reset the barrel MTTF
Definition: L1MuDTTrackFinder.cc:265
L1MuDTTrackFinder::sp
const L1MuDTSectorProcessor * sp(const L1MuDTSecProcId &) const
get a pointer to a Sector Processor
Definition: L1MuDTTrackFinder.cc:294
L1MuDTTrackFinder::_cache
std::vector< L1MuRegionalCand > _cache
Definition: L1MuDTTrackFinder.h:117
L1MuDTSecProcMap::begin
SPmap_iter begin()
return iterator which points to the first entry of the container
Definition: L1MuDTSecProcMap.h:59
L1MuDTSecProcId
Definition: L1MuDTSecProcId.h:40
L1MuDTEtaProcessor
Definition: L1MuDTEtaProcessor.h:55
cand
Definition: decayParser.h:32
L1MuDTTrack
Definition: L1MuDTTrack.h:47
L1MuDTMuonSorter::tracks
const std::vector< const L1MuDTTrack * > & tracks() const
return vector of muon candidates
Definition: L1MuDTMuonSorter.h:69
L1MuDTTFConfig::getDTDigiInputTag
edm::InputTag getDTDigiInputTag() const
Definition: L1MuDTTFConfig.h:46
L1MuDTTrackFinder::m_epvec
std::vector< L1MuDTEtaProcessor * > m_epvec
Eta Processors.
Definition: L1MuDTTrackFinder.h:119
L1MuDTSectorProcessor
Definition: L1MuDTSectorProcessor.h:53
eostools.move
def move(src, dest)
Definition: eostools.py:511
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
L1MuDTTrackFinder::m_config
static L1MuDTTFConfig * m_config
Track Finder configuration.
Definition: L1MuDTTrackFinder.h:124
L1MuDTMuonSorter::run
void run() override
run Muon Sorter
Definition: L1MuDTMuonSorter.cc:63
L1MuDTTrackFinder::TFtracks_const_iter
std::vector< L1MuRegionalCand >::const_iterator TFtracks_const_iter
container for muon candidates
Definition: L1MuDTTrackFinder.h:59
L1MuDTTFConfig::Debug
static bool Debug()
Definition: L1MuDTTFConfig.h:49
L1MuDTSecProcMap::end
SPmap_iter end()
return iterator which points to the one-past-last entry of the container
Definition: L1MuDTSecProcMap.h:62
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
L1MuDTChambPhContainer::bxEmpty
bool bxEmpty(int step) const
Definition: L1MuDTChambPhContainer.cc:43
L1MuDTMuonSorter::reset
void reset() override
reset Muon Sorter
Definition: L1MuDTMuonSorter.cc:120
L1MuDTSecProcMap::insert
void insert(const L1MuDTSecProcId &, L1MuDTSectorProcessor *sp)
insert a Sector Processor into the container
Definition: L1MuDTSecProcMap.cc:77
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
L1MuDTTrackFinder::m_spmap
L1MuDTSecProcMap * m_spmap
Sector Processors.
Definition: L1MuDTTrackFinder.h:118