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

◆ SEUId

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

Definition at line 54 of file L1MuDTExtrapolationUnit.h.

◆ SEUmap

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

Definition at line 55 of file L1MuDTExtrapolationUnit.h.

Constructor & Destructor Documentation

◆ L1MuDTExtrapolationUnit()

L1MuDTExtrapolationUnit::L1MuDTExtrapolationUnit ( const L1MuDTSectorProcessor sp)

constructor

Definition at line 55 of file L1MuDTExtrapolationUnit.cc.

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 }

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

◆ ~L1MuDTExtrapolationUnit()

L1MuDTExtrapolationUnit::~L1MuDTExtrapolationUnit ( )
override

destructor

Definition at line 79 of file L1MuDTExtrapolationUnit.cc.

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 }

References m_SEUs.

Member Function Documentation

◆ getAddress()

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.

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 }

References m_SEUs.

◆ getEXTable()

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.

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 }

References m_SEUs.

Referenced by run().

◆ getQSTable()

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.

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 }

References m_SEUs.

Referenced by L1MuDTTrackAssembler::run().

◆ getQuality()

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.

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 }

References m_SEUs, and quality.

◆ numberOfExt()

int L1MuDTExtrapolationUnit::numberOfExt ( ) const

return number of successful extrapolations

Definition at line 235 of file L1MuDTExtrapolationUnit.cc.

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 }

References m_SEUs, and contentValuesFiles::number.

Referenced by L1MuDTSectorProcessor::run().

◆ print()

void L1MuDTExtrapolationUnit::print ( int  level = 0) const

print all successful extrapolations

Definition at line 248 of file L1MuDTExtrapolationUnit.cc.

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 }

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

Referenced by L1MuDTSectorProcessor::run().

◆ reset() [1/2]

void L1MuDTExtrapolationUnit::reset ( void  )
overridevirtual

reset Extrapolation Unit

Implements L1AbstractProcessor.

Definition at line 144 of file L1MuDTExtrapolationUnit.cc.

144  {
145  SEUmap::const_iterator iter;
146  for (iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++) {
147  ((*iter).second)->reset();
148  }
149 }

References m_SEUs.

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

◆ reset() [2/2]

void L1MuDTExtrapolationUnit::reset ( Extrapolation  ext,
unsigned int  startAdr,
unsigned int  relAdr 
)

reset a single extrapolation

Definition at line 154 of file L1MuDTExtrapolationUnit.cc.

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 }

References m_SEUs.

◆ run()

void L1MuDTExtrapolationUnit::run ( const edm::EventSetup c)
overridevirtual

run Extrapolation Unit

Reimplemented from L1AbstractProcessor.

Definition at line 94 of file L1MuDTExtrapolationUnit.cc.

94  {
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 }

References c, L1MuDTTrackFinder::config(), gather_cfg::cout, L1MuDTSectorProcessor::data(), L1MuDTTFConfig::Debug(), L1MuDTTrackSegPhi::empty(), EX12, EX21, L1MuDTSEU::ext(), 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().

◆ which_ext()

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.

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 }

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

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

Member Data Documentation

◆ m_SEUs

SEUmap L1MuDTExtrapolationUnit::m_SEUs
mutableprivate

◆ m_sp

const L1MuDTSectorProcessor& L1MuDTExtrapolationUnit::m_sp
private

Definition at line 94 of file L1MuDTExtrapolationUnit.h.

Referenced by print(), and run().

◆ pars

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

Definition at line 98 of file L1MuDTExtrapolationUnit.h.

Referenced by run().

personalPlayback.level
level
Definition: personalPlayback.py:22
ext
Definition: memstream.h:15
start
Definition: start.py:1
L1MuDTTFParameters::get_soc_run_21
bool get_soc_run_21(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:234
MAX_EXT
const int MAX_EXT
Definition: L1MuDTExtParam.h:19
EX13
Definition: L1MuDTExtParam.h:22
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1MuDTExtrapolationUnit::pars
edm::ESHandle< L1MuDTTFParameters > pars
Definition: L1MuDTExtrapolationUnit.h:98
L1MuDTSectorProcessor::tf
const L1MuDTTrackFinder & tf() const
return reference to barrel MTTF
Definition: L1MuDTSectorProcessor.h:77
EX34
Definition: L1MuDTExtParam.h:22
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
EX15
Definition: L1MuDTExtParam.h:22
L1MuDTSectorProcessor::id
const L1MuDTSecProcId & id() const
return Sector Processor identifier
Definition: L1MuDTSectorProcessor.h:74
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
L1MuDTSecProcId::wheel
int wheel() const
return wheel number
Definition: L1MuDTSecProcId.h:55
Extrapolation
Extrapolation
Definition: L1MuDTExtParam.h:22
L1MuDTTFConfig::getUseEX21
bool getUseEX21() const
Definition: L1MuDTTFConfig.h:62
L1MuDTExtrapolationUnit::reset
void reset() override
reset Extrapolation Unit
Definition: L1MuDTExtrapolationUnit.cc:144
source
static const std::string source
Definition: EdmProvDump.cc:47
L1MuDTSectorProcessor::data
const L1MuDTDataBuffer * data() const
return pointer to Data Buffer
Definition: L1MuDTSectorProcessor.h:86
svgfig.load
def load(fileName)
Definition: svgfig.py:547
EX21
Definition: L1MuDTExtParam.h:22
L1MuDTSEU::ext
Extrapolation ext() const
return extrapolation type
Definition: L1MuDTSEU.h:78
L1MuDTSecProcId::sector
int sector() const
return sector number
Definition: L1MuDTSecProcId.h:58
EX23
Definition: L1MuDTExtParam.h:22
EX12
Definition: L1MuDTExtParam.h:22
L1MuDTExtrapolationUnit::m_SEUs
SEUmap m_SEUs
Definition: L1MuDTExtrapolationUnit.h:96
EX25
Definition: L1MuDTExtParam.h:22
L1AbstractProcessor::run
virtual void run()
run processor logic
Definition: L1AbstractProcessor.h:40
L1MuDTTrackSegPhi::empty
bool empty() const
is it an empty phi track segment?
Definition: L1MuDTTrackSegPhi.h:110
EX24
Definition: L1MuDTExtParam.h:22
L1MuDTTrackFinder::config
static L1MuDTTFConfig * config()
return configuration
Definition: L1MuDTTrackFinder.h:102
get
#define get
L1MuDTExtrapolationUnit::numberOfExt
int numberOfExt() const
return number of successful extrapolations
Definition: L1MuDTExtrapolationUnit.cc:235
L1MuDTExtrapolationUnit::SEUId
std::pair< Extrapolation, unsigned int > SEUId
Definition: L1MuDTExtrapolationUnit.h:54
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
L1MuDTSEU::tsId
unsigned int tsId() const
return start track segment identifier (relative address)
Definition: L1MuDTSEU.h:81
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
L1MuDTTrackSegPhi
Definition: L1MuDTTrackSegPhi.h:36
L1MuDTExtrapolationUnit::which_ext
static std::pair< int, int > which_ext(Extrapolation ext)
return station of start and target track segment for a given extrapolation
Definition: L1MuDTExtrapolationUnit.cc:292
L1MuDTDataBuffer::getTSphi
const TSPhivector & getTSphi() const
get all track segments from the buffer
Definition: L1MuDTDataBuffer.h:56
L1MuDTExtrapolationUnit::m_sp
const L1MuDTSectorProcessor & m_sp
Definition: L1MuDTExtrapolationUnit.h:94
EX14
Definition: L1MuDTExtParam.h:22
L1MuDTTFConfig::Debug
static bool Debug()
Definition: L1MuDTTFConfig.h:49
L1MuDTSEU
Definition: L1MuDTSEU.h:48
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
L1MuDTExtrapolationUnit::getEXTable
const std::bitset< 12 > & getEXTable(Extrapolation ext, unsigned int startAdr) const
get Extrapolator table for a given SEU
Definition: L1MuDTExtrapolationUnit.cc:209
L1MuDTTFParametersRcd
Definition: L1MuDTTFParametersRcd.h:10