CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
L1MuDTExtrapolationUnit Class Reference

#include <L1MuDTExtrapolationUnit.h>

Inheritance diagram for L1MuDTExtrapolationUnit:
L1AbstractProcessor

Public Types

typedef std::pair< Extrapolation, unsigned int > SEUId
 
typedef std::map< SEUId, L1MuDTSEU *, std::less< SEUId > > SEUmap
 

Public Member Functions

unsigned short int getAddress (Extrapolation ext, unsigned int startAdr, int id) const
 get extrapolation address from a given ERS More...
 
const std::bitset< 12 > & getEXTable (Extrapolation ext, unsigned int startAdr) const
 get Extrapolator table for a given SEU More...
 
const std::bitset< 12 > & getQSTable (Extrapolation ext, unsigned int startAdr) const
 get Quality Sorter table for a given SEU More...
 
unsigned short int getQuality (Extrapolation ext, unsigned int startAdr, int id) const
 get extrapolation quality from a given ERS More...
 
 L1MuDTExtrapolationUnit (const L1MuDTSectorProcessor &)
 constructor More...
 
int numberOfExt () const
 return number of successful extrapolations More...
 
void print (int level=0) const
 print all successful extrapolations More...
 
void reset () override
 reset Extrapolation Unit More...
 
void reset (Extrapolation ext, unsigned int startAdr, unsigned int relAdr)
 reset a single extrapolation More...
 
void run (const edm::EventSetup &c) override
 run Extrapolation Unit More...
 
 ~L1MuDTExtrapolationUnit () override
 destructor More...
 
- Public Member Functions inherited from L1AbstractProcessor
virtual void run ()
 run processor logic More...
 
virtual void run ()
 run processor logic More...
 
virtual ~L1AbstractProcessor ()
 destructor More...
 
virtual ~L1AbstractProcessor ()
 destructor More...
 

Static Public Member Functions

static std::pair< int, int > which_ext (Extrapolation ext)
 return station of start and target track segment for a given extrapolation More...
 

Private Attributes

SEUmap m_SEUs
 
const L1MuDTSectorProcessorm_sp
 
edm::ESHandle< L1MuDTTFParameterspars
 

Detailed Description

Extrapolation Unit:

The Extrapolation Unit attempts to join track segment pairs of different stations. it contains 12 Single Extrapolation Units to perform all extrapolations in its own wheel and 6 Single Extrapolation Units to perform all extrapolations in the adjacent wheel (next wheel neighbour)

N. Neumeister CERN EP

Definition at line 52 of file L1MuDTExtrapolationUnit.h.

Member Typedef Documentation

typedef std::pair<Extrapolation, unsigned int> L1MuDTExtrapolationUnit::SEUId

Definition at line 54 of file L1MuDTExtrapolationUnit.h.

typedef std::map<SEUId, L1MuDTSEU*, std::less<SEUId> > L1MuDTExtrapolationUnit::SEUmap

Definition at line 55 of file L1MuDTExtrapolationUnit.h.

Constructor & Destructor Documentation

L1MuDTExtrapolationUnit::L1MuDTExtrapolationUnit ( const L1MuDTSectorProcessor sp)

constructor

Definition at line 55 of file L1MuDTExtrapolationUnit.cc.

References gather_cfg::cout, L1MuDTTFConfig::Debug(), EX12, EX13, EX14, EX21, EX23, EX24, EX34, triggerObjects_cff::id, m_SEUs, and MAX_EXT.

55  : m_sp(sp), m_SEUs() {
56  for (int ext_idx = 0; ext_idx < MAX_EXT; ext_idx++) {
57  Extrapolation ext = static_cast<Extrapolation>(ext_idx);
58 
59  if (ext == EX12 || ext == EX13 || ext == EX14 || ext == EX21 || ext == EX23 || ext == EX24 || ext == EX34) {
60  unsigned int maxaddr = 4;
61 
62  if (ext == EX12 || ext == EX13 || ext == EX14)
63  maxaddr = 2;
64 
65  for (unsigned int startAddress = 0; startAddress < maxaddr; startAddress++) {
66  SEUId id = make_pair(ext, startAddress);
67  m_SEUs[id] = new L1MuDTSEU(sp, ext, startAddress);
68  if (L1MuDTTFConfig::Debug(6))
69  cout << " creating SEU " << ext << " " << startAddress << endl;
70  }
71  }
72  }
73 }
std::pair< Extrapolation, unsigned int > SEUId
const L1MuDTSectorProcessor & m_sp
const int MAX_EXT
static bool Debug()
Extrapolation
Definition: memstream.h:15
L1MuDTExtrapolationUnit::~L1MuDTExtrapolationUnit ( )
override

destructor

Definition at line 79 of file L1MuDTExtrapolationUnit.cc.

References m_SEUs.

79  {
80  for (SEUmap::iterator iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++) {
81  delete (*iter).second;
82  (*iter).second = nullptr;
83  }
84  m_SEUs.clear();
85 }

Member Function Documentation

unsigned short int L1MuDTExtrapolationUnit::getAddress ( Extrapolation  ext,
unsigned int  startAdr,
int  id 
) const

get extrapolation address from a given ERS

Definition at line 167 of file L1MuDTExtrapolationUnit.cc.

References m_SEUs.

167  {
168  // get extrapolation address from ERS
169  // startAdr = 0, 1 : own wheel
170  // startAdr = 2, 3 : next wheel neighbour
171 
172  // assert( startAdr >= 0 && startAdr <= 3 );
173  // assert( id == 0 || id == 1 );
174 
175  unsigned short int address = 15;
176 
177  SEUId seuid = make_pair(ext, startAdr);
178  SEUmap::const_iterator iter = m_SEUs.find(seuid);
179  if (iter != m_SEUs.end())
180  address = ((*iter).second)->ers()->address(id);
181 
182  return address;
183 }
std::pair< Extrapolation, unsigned int > SEUId
Definition: memstream.h:15
const bitset< 12 > & L1MuDTExtrapolationUnit::getEXTable ( Extrapolation  ext,
unsigned int  startAdr 
) const

get Extrapolator table for a given SEU

Definition at line 209 of file L1MuDTExtrapolationUnit.cc.

References m_SEUs.

Referenced by run().

209  {
210  // startAdr = 0, 1 : own wheel
211  // startAdr = 2, 3 : next wheel neighbour
212 
213  // assert( startAdr >= 0 && startAdr <= 3 );
214 
215  SEUId seuid = make_pair(ext, startAdr);
216  return m_SEUs[seuid]->exTable();
217 }
std::pair< Extrapolation, unsigned int > SEUId
Definition: memstream.h:15
const bitset< 12 > & L1MuDTExtrapolationUnit::getQSTable ( Extrapolation  ext,
unsigned int  startAdr 
) const

get Quality Sorter table for a given SEU

Definition at line 222 of file L1MuDTExtrapolationUnit.cc.

References m_SEUs.

Referenced by L1MuDTTrackAssembler::run().

222  {
223  // startAdr = 0, 1 : own wheel
224  // startAdr = 2, 3 : next wheel neighbour
225 
226  // assert( startAdr >= 0 && startAdr <= 3 );
227 
228  SEUId seuid = make_pair(ext, startAdr);
229  return m_SEUs[seuid]->qsTable();
230 }
std::pair< Extrapolation, unsigned int > SEUId
Definition: memstream.h:15
unsigned short int L1MuDTExtrapolationUnit::getQuality ( Extrapolation  ext,
unsigned int  startAdr,
int  id 
) const

get extrapolation quality from a given ERS

Definition at line 188 of file L1MuDTExtrapolationUnit.cc.

References m_SEUs, and qcdUeDQM_cfi::quality.

188  {
189  // get extrapolation quality from ERS
190  // startAdr = 0, 1 : own wheel
191  // startAdr = 2, 3 : next wheel neighbour
192 
193  // assert( startAdr >= 0 && startAdr <= 3 );
194  // assert( id == 0 || id == 1 );
195 
196  unsigned short int quality = 0;
197 
198  SEUId seuid = make_pair(ext, startAdr);
199  SEUmap::const_iterator iter = m_SEUs.find(seuid);
200  if (iter != m_SEUs.end())
201  quality = ((*iter).second)->ers()->quality(id);
202 
203  return quality;
204 }
std::pair< Extrapolation, unsigned int > SEUId
Definition: memstream.h:15
int L1MuDTExtrapolationUnit::numberOfExt ( ) const

return number of successful extrapolations

Definition at line 235 of file L1MuDTExtrapolationUnit.cc.

References m_SEUs, and contentValuesFiles::number.

Referenced by L1MuDTSectorProcessor::run().

235  {
236  int number = 0;
237  SEUmap::const_iterator iter;
238  for (iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++) {
239  number += ((*iter).second)->numberOfExt();
240  }
241 
242  return number;
243 }
int numberOfExt() const
return number of successful extrapolations
void L1MuDTExtrapolationUnit::print ( int  level = 0) const

print all successful extrapolations

Definition at line 248 of file L1MuDTExtrapolationUnit.cc.

References gather_cfg::cout, L1MuDTSectorProcessor::id(), m_SEUs, and m_sp.

Referenced by L1MuDTSectorProcessor::run().

248  {
249  SEUmap::const_iterator iter_seu;
250 
251  if (level == 0) {
252  for (iter_seu = m_SEUs.begin(); iter_seu != m_SEUs.end(); iter_seu++) {
253  vector<L1MuDTEUX*> vec_eux = ((*iter_seu).second)->eux();
254  vector<L1MuDTEUX*>::const_iterator iter_eux;
255  for (iter_eux = vec_eux.begin(); iter_eux != vec_eux.end(); iter_eux++) {
256  if ((*iter_eux)->result()) {
257  cout << ((*iter_seu).second)->ext() << " " << ((*iter_seu).second)->tsId() << " " << (*iter_eux)->id()
258  << endl;
259  cout << "start : " << *(*iter_eux)->ts().first << endl;
260  cout << "target : " << *(*iter_eux)->ts().second << endl;
261  cout << "result : "
262  << "quality = " << (*iter_eux)->quality() << '\t' << "address = " << (*iter_eux)->address() << endl;
263  }
264  }
265  }
266  }
267 
268  //
269  // print all results from Extrapolator and Quality Sorter
270  //
271  if (level == 1) {
272  cout << "Results from Extrapolator and Quality Sorter of " << m_sp.id() << " : \n" << endl;
273 
274  cout << " EXT QSU " << endl;
275  cout << " S E U 11 11 " << endl;
276  cout << " 109876543210 109876543210 " << endl;
277  cout << "-------------------------------------" << endl;
278  for (iter_seu = m_SEUs.begin(); iter_seu != m_SEUs.end(); iter_seu++) {
279  cout << ((*iter_seu).second)->ext() << "_ " << ((*iter_seu).second)->tsId() << ": "
280  << ((*iter_seu).second)->exTable() << " " << ((*iter_seu).second)->qsTable() << endl;
281  }
282 
283  cout << endl;
284  }
285 }
const L1MuDTSectorProcessor & m_sp
const L1MuDTSecProcId & id() const
return Sector Processor identifier
Definition: memstream.h:15
void L1MuDTExtrapolationUnit::reset ( void  )
overridevirtual

reset Extrapolation Unit

Implements L1AbstractProcessor.

Definition at line 144 of file L1MuDTExtrapolationUnit.cc.

References m_SEUs.

Referenced by L1MuDTSectorProcessor::reset(), and run().

144  {
145  SEUmap::const_iterator iter;
146  for (iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++) {
147  ((*iter).second)->reset();
148  }
149 }
void reset() override
reset Extrapolation Unit
void L1MuDTExtrapolationUnit::reset ( Extrapolation  ext,
unsigned int  startAdr,
unsigned int  relAdr 
)

reset a single extrapolation

Definition at line 154 of file L1MuDTExtrapolationUnit.cc.

References m_SEUs.

154  {
155  // assert( startAdr >= 0 && startAdr <= 3 );
156  // assert( relAdr >= 0 && relAdr <= 12 );
157 
158  SEUId seuid = make_pair(ext, startAdr);
159  SEUmap::const_iterator iter = m_SEUs.find(seuid);
160  if (iter != m_SEUs.end())
161  ((*iter).second)->reset(relAdr);
162 }
std::pair< Extrapolation, unsigned int > SEUId
Definition: memstream.h:15
void L1MuDTExtrapolationUnit::run ( const edm::EventSetup c)
overridevirtual

run Extrapolation Unit

Reimplemented from L1AbstractProcessor.

Definition at line 94 of file L1MuDTExtrapolationUnit.cc.

References L1MuDTTrackFinder::config(), gather_cfg::cout, L1MuDTSectorProcessor::data(), L1MuDTTFConfig::Debug(), L1MuDTTrackSegPhi::empty(), EX12, EX21, L1MuDTSEU::ext(), edm::EventSetup::get(), L1MuDTTFParameters::get_soc_run_21(), getEXTable(), L1MuDTDataBuffer::getTSphi(), L1MuDTTFConfig::getUseEX21(), L1MuDTSectorProcessor::id(), svgfig::load(), m_SEUs, m_sp, pars, reset(), L1AbstractProcessor::run(), L1MuDTSecProcId::sector(), L1MuDTSectorProcessor::tf(), L1MuDTSEU::tsId(), L1MuDTSecProcId::wheel(), and which_ext().

Referenced by L1MuDTSectorProcessor::run().

94  {
95  c.get<L1MuDTTFParametersRcd>().get(pars);
96 
97  SEUmap::const_iterator iter;
98  for (iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++) {
99  pair<int, int> ext_pair = which_ext(((*iter).second)->ext());
100  int start = ext_pair.first;
101 
102  const L1MuDTTrackSegPhi* ts = nullptr;
103 
104  //get start track segment
105  ts = m_sp.data()->getTSphi(start, ((*iter).second)->tsId());
106 
107  if (ts != nullptr && !ts->empty()) {
108  ((*iter).second)->load(ts);
109  ((*iter).second)->run(c);
110  }
111  }
112 
113  //
114  // use EX21 to cross-check EX12
115  //
116  bool run_21 = pars->get_soc_run_21(m_sp.id().wheel(), m_sp.id().sector());
117  if (m_sp.tf().config()->getUseEX21() || run_21) {
118  // search for EX12 + EX21 single extrapolation units
119  for (unsigned int startAdr = 0; startAdr < 2; startAdr++) {
120  bitset<12> extab12 = this->getEXTable(EX12, startAdr);
121  bitset<12> extab21 = this->getEXTable(EX21, startAdr);
122 
123  for (int eux = 0; eux < 12; eux++) {
124  if (extab12.test(eux) && !extab21.test(eux)) {
125  reset(EX12, startAdr, eux);
126  if (L1MuDTTFConfig::Debug(6)) {
127  SEUId seuid = make_pair(EX12, startAdr);
128  L1MuDTSEU* SEU12 = m_SEUs[seuid];
129  cout << " EX12 - EX21 mismatch : "
130  << " EX12 : " << extab12 << " , "
131  << " EX21 : " << extab21 << endl
132  << " Cancel: " << SEU12->ext() << " start addr = " << SEU12->tsId() << " target addr = " << eux
133  << endl;
134  }
135  }
136  }
137  }
138  }
139 }
Definition: start.py:1
Extrapolation ext() const
return extrapolation type
Definition: L1MuDTSEU.h:78
const std::bitset< 12 > & getEXTable(Extrapolation ext, unsigned int startAdr) const
get Extrapolator table for a given SEU
void reset() override
reset Extrapolation Unit
std::pair< Extrapolation, unsigned int > SEUId
edm::ESHandle< L1MuDTTFParameters > pars
int sector() const
return sector number
const L1MuDTDataBuffer * data() const
return pointer to Data Buffer
const L1MuDTSectorProcessor & m_sp
virtual void run()
run processor logic
bool empty() const
is it an empty phi track segment?
bool getUseEX21() const
static bool Debug()
const L1MuDTSecProcId & id() const
return Sector Processor identifier
static std::pair< int, int > which_ext(Extrapolation ext)
return station of start and target track segment for a given extrapolation
const TSPhivector & getTSphi() const
get all track segments from the buffer
def load(fileName)
Definition: svgfig.py:547
static L1MuDTTFConfig * config()
return configuration
bool get_soc_run_21(int wh, int sc) const
T get() const
Definition: EventSetup.h:73
const L1MuDTTrackFinder & tf() const
return reference to barrel MTTF
int wheel() const
return wheel number
unsigned int tsId() const
return start track segment identifier (relative address)
Definition: L1MuDTSEU.h:81
pair< int, int > L1MuDTExtrapolationUnit::which_ext ( Extrapolation  ext)
static

return station of start and target track segment for a given extrapolation

Definition at line 292 of file L1MuDTExtrapolationUnit.cc.

References EX12, EX13, EX14, EX15, EX21, EX23, EX24, EX25, EX34, source, and filterCSVwithJSON::target.

Referenced by L1MuDTSEU::run(), and run().

292  {
293  int source = 0;
294  int target = 0;
295 
296  // assert( ext >= 0 && ext < MAX_EXT );
297 
298  switch (ext) {
299  case EX12: {
300  source = 1;
301  target = 2;
302  break;
303  }
304  case EX13: {
305  source = 1;
306  target = 3;
307  break;
308  }
309  case EX14: {
310  source = 1;
311  target = 4;
312  break;
313  }
314  case EX21: {
315  source = 1;
316  target = 2;
317  break;
318  }
319  case EX23: {
320  source = 2;
321  target = 3;
322  break;
323  }
324  case EX24: {
325  source = 2;
326  target = 4;
327  break;
328  }
329  case EX34: {
330  source = 3;
331  target = 4;
332  break;
333  }
334  case EX15: {
335  source = 1;
336  target = 3;
337  break;
338  }
339  case EX25: {
340  source = 2;
341  target = 3;
342  break;
343  }
344  default: {
345  source = 1;
346  target = 2;
347  break;
348  }
349  }
350 
351  return pair<int, int>(source, target);
352 }
Definition: memstream.h:15
static std::string const source
Definition: EdmProvDump.cc:47

Member Data Documentation

SEUmap L1MuDTExtrapolationUnit::m_SEUs
mutableprivate
const L1MuDTSectorProcessor& L1MuDTExtrapolationUnit::m_sp
private

Definition at line 94 of file L1MuDTExtrapolationUnit.h.

Referenced by print(), and run().

edm::ESHandle<L1MuDTTFParameters> L1MuDTExtrapolationUnit::pars
private

Definition at line 98 of file L1MuDTExtrapolationUnit.h.

Referenced by run().