CMS 3D CMS Logo

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

#include <L1MuBMExtrapolationUnit.h>

Inheritance diagram for L1MuBMExtrapolationUnit:
L1AbstractProcessor

Public Types

typedef std::pair< Extrapolation, unsigned int > SEUId
 
typedef std::map< SEUId, L1MuBMSEU *, 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...
 
 L1MuBMExtrapolationUnit (const L1MuBMSectorProcessor &)
 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...
 
 ~L1MuBMExtrapolationUnit () 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

edm::ESHandle< L1TMuonBarrelParamsbmtfParamsHandle
 
SEUmap m_SEUs
 
const L1MuBMSectorProcessorm_sp
 
L1MuDTTFParameters pars
 

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 54 of file L1MuBMExtrapolationUnit.h.

Member Typedef Documentation

◆ SEUId

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

Definition at line 56 of file L1MuBMExtrapolationUnit.h.

◆ SEUmap

typedef std::map<SEUId, L1MuBMSEU*, std::less<SEUId> > L1MuBMExtrapolationUnit::SEUmap

Definition at line 57 of file L1MuBMExtrapolationUnit.h.

Constructor & Destructor Documentation

◆ L1MuBMExtrapolationUnit()

L1MuBMExtrapolationUnit::L1MuBMExtrapolationUnit ( const L1MuBMSectorProcessor sp)

constructor

Definition at line 55 of file L1MuBMExtrapolationUnit.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 L1MuBMSEU(sp, ext, startAddress);
68  if (L1MuBMTFConfig::Debug(6))
69  cout << " creating SEU " << ext << " " << startAddress << endl;
70  }
71  }
72  }
73 }

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

◆ ~L1MuBMExtrapolationUnit()

L1MuBMExtrapolationUnit::~L1MuBMExtrapolationUnit ( )
override

destructor

Definition at line 79 of file L1MuBMExtrapolationUnit.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 L1MuBMExtrapolationUnit::getAddress ( Extrapolation  ext,
unsigned int  startAdr,
int  id 
) const

get extrapolation address from a given ERS

Definition at line 171 of file L1MuBMExtrapolationUnit.cc.

171  {
172  // get extrapolation address from ERS
173  // startAdr = 0, 1 : own wheel
174  // startAdr = 2, 3 : next wheel neighbour
175 
176  // assert( startAdr >= 0 && startAdr <= 3 );
177  // assert( id == 0 || id == 1 );
178 
179  unsigned short int address = 15;
180 
181  SEUId seuid = make_pair(ext, startAdr);
182  SEUmap::const_iterator iter = m_SEUs.find(seuid);
183  if (iter != m_SEUs.end())
184  address = ((*iter).second)->ers()->address(id);
185 
186  return address;
187 }

References m_SEUs.

◆ getEXTable()

const bitset< 12 > & L1MuBMExtrapolationUnit::getEXTable ( Extrapolation  ext,
unsigned int  startAdr 
) const

get Extrapolator table for a given SEU

Definition at line 213 of file L1MuBMExtrapolationUnit.cc.

213  {
214  // startAdr = 0, 1 : own wheel
215  // startAdr = 2, 3 : next wheel neighbour
216 
217  // assert( startAdr >= 0 && startAdr <= 3 );
218 
219  SEUId seuid = make_pair(ext, startAdr);
220  return m_SEUs[seuid]->exTable();
221 }

References m_SEUs.

Referenced by run().

◆ getQSTable()

const bitset< 12 > & L1MuBMExtrapolationUnit::getQSTable ( Extrapolation  ext,
unsigned int  startAdr 
) const

get Quality Sorter table for a given SEU

Definition at line 226 of file L1MuBMExtrapolationUnit.cc.

226  {
227  // startAdr = 0, 1 : own wheel
228  // startAdr = 2, 3 : next wheel neighbour
229 
230  // assert( startAdr >= 0 && startAdr <= 3 );
231 
232  SEUId seuid = make_pair(ext, startAdr);
233  return m_SEUs[seuid]->qsTable();
234 }

References m_SEUs.

Referenced by L1MuBMTrackAssembler::run().

◆ getQuality()

unsigned short int L1MuBMExtrapolationUnit::getQuality ( Extrapolation  ext,
unsigned int  startAdr,
int  id 
) const

get extrapolation quality from a given ERS

Definition at line 192 of file L1MuBMExtrapolationUnit.cc.

192  {
193  // get extrapolation quality from ERS
194  // startAdr = 0, 1 : own wheel
195  // startAdr = 2, 3 : next wheel neighbour
196 
197  // assert( startAdr >= 0 && startAdr <= 3 );
198  // assert( id == 0 || id == 1 );
199 
200  unsigned short int quality = 0;
201 
202  SEUId seuid = make_pair(ext, startAdr);
203  SEUmap::const_iterator iter = m_SEUs.find(seuid);
204  if (iter != m_SEUs.end())
205  quality = ((*iter).second)->ers()->quality(id);
206 
207  return quality;
208 }

References m_SEUs, and quality.

◆ numberOfExt()

int L1MuBMExtrapolationUnit::numberOfExt ( ) const

return number of successful extrapolations

Definition at line 239 of file L1MuBMExtrapolationUnit.cc.

239  {
240  int number = 0;
241  SEUmap::const_iterator iter;
242  for (iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++) {
243  number += ((*iter).second)->numberOfExt();
244  }
245 
246  return number;
247 }

References m_SEUs, and contentValuesFiles::number.

Referenced by L1MuBMSectorProcessor::run().

◆ print()

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

print all successful extrapolations

Definition at line 252 of file L1MuBMExtrapolationUnit.cc.

252  {
253  SEUmap::const_iterator iter_seu;
254 
255  if (level == 0) {
256  for (iter_seu = m_SEUs.begin(); iter_seu != m_SEUs.end(); iter_seu++) {
257  vector<L1MuBMEUX*> vec_eux = ((*iter_seu).second)->eux();
258  vector<L1MuBMEUX*>::const_iterator iter_eux;
259  for (iter_eux = vec_eux.begin(); iter_eux != vec_eux.end(); iter_eux++) {
260  if ((*iter_eux)->result()) {
261  cout << ((*iter_seu).second)->ext() << " " << ((*iter_seu).second)->tsId() << " " << (*iter_eux)->id()
262  << endl;
263  cout << "start : " << *(*iter_eux)->ts().first << endl;
264  cout << "target : " << *(*iter_eux)->ts().second << endl;
265  cout << "result : "
266  << "quality = " << (*iter_eux)->quality() << '\t' << "address = " << (*iter_eux)->address() << endl;
267  }
268  }
269  }
270  }
271 
272  //
273  // print all results from Extrapolator and Quality Sorter
274  //
275  if (level == 1) {
276  cout << "Results from Extrapolator and Quality Sorter of " << m_sp.id() << " : \n" << endl;
277 
278  cout << " EXT QSU " << endl;
279  cout << " S E U 11 11 " << endl;
280  cout << " 109876543210 109876543210 " << endl;
281  cout << "-------------------------------------" << endl;
282  for (iter_seu = m_SEUs.begin(); iter_seu != m_SEUs.end(); iter_seu++) {
283  cout << ((*iter_seu).second)->ext() << "_ " << ((*iter_seu).second)->tsId() << ": "
284  << ((*iter_seu).second)->exTable() << " " << ((*iter_seu).second)->qsTable() << endl;
285  }
286 
287  cout << endl;
288  }
289 }

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

Referenced by L1MuBMSectorProcessor::run().

◆ reset() [1/2]

void L1MuBMExtrapolationUnit::reset ( void  )
overridevirtual

reset Extrapolation Unit

Implements L1AbstractProcessor.

Definition at line 148 of file L1MuBMExtrapolationUnit.cc.

148  {
149  SEUmap::const_iterator iter;
150  for (iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++) {
151  ((*iter).second)->reset();
152  }
153 }

References m_SEUs.

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

◆ reset() [2/2]

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

reset a single extrapolation

Definition at line 158 of file L1MuBMExtrapolationUnit.cc.

158  {
159  // assert( startAdr >= 0 && startAdr <= 3 );
160  // assert( relAdr >= 0 && relAdr <= 12 );
161 
162  SEUId seuid = make_pair(ext, startAdr);
163  SEUmap::const_iterator iter = m_SEUs.find(seuid);
164  if (iter != m_SEUs.end())
165  ((*iter).second)->reset(relAdr);
166 }

References m_SEUs.

◆ run()

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

run Extrapolation Unit

Reimplemented from L1AbstractProcessor.

Definition at line 94 of file L1MuBMExtrapolationUnit.cc.

94  {
95  //c.get< L1MuDTTFParametersRcd >().get( pars );
96  const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
97  bmtfParamsRcd.get(bmtfParamsHandle);
98  const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
99  pars = bmtfParams.l1mudttfparams;
100 
101  SEUmap::const_iterator iter;
102  for (iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++) {
103  pair<int, int> ext_pair = which_ext(((*iter).second)->ext());
104  int start = ext_pair.first;
105 
106  const L1MuBMTrackSegPhi* ts = nullptr;
107 
108  //get start track segment
109  ts = m_sp.data()->getTSphi(start, ((*iter).second)->tsId());
110 
111  if (ts != nullptr && !ts->empty()) {
112  ((*iter).second)->load(ts);
113  ((*iter).second)->run(c);
114  }
115  }
116 
117  //
118  // use EX21 to cross-check EX12
119  //
120  bool run_21 = pars.get_soc_run_21(m_sp.id().wheel(), m_sp.id().sector());
121  if (L1MuBMTFConfig::getUseEX21() || run_21) {
122  // search for EX12 + EX21 single extrapolation units
123  for (unsigned int startAdr = 0; startAdr < 2; startAdr++) {
124  bitset<12> extab12 = this->getEXTable(EX12, startAdr);
125  bitset<12> extab21 = this->getEXTable(EX21, startAdr);
126 
127  for (int eux = 0; eux < 12; eux++) {
128  if (extab12.test(eux) && !extab21.test(eux)) {
129  reset(EX12, startAdr, eux);
130  if (L1MuBMTFConfig::Debug(6)) {
131  SEUId seuid = make_pair(EX12, startAdr);
132  L1MuBMSEU* SEU12 = m_SEUs[seuid];
133  cout << " EX12 - EX21 mismatch : "
134  << " EX12 : " << extab12 << " , "
135  << " EX21 : " << extab21 << endl
136  << " Cancel: " << SEU12->ext() << " start addr = " << SEU12->tsId() << " target addr = " << eux
137  << endl;
138  }
139  }
140  }
141  }
142  }
143 }

References bmtfParamsHandle, c, gather_cfg::cout, L1MuBMSectorProcessor::data(), L1MuBMTFConfig::Debug(), L1MuBMTrackSegPhi::empty(), EX12, EX21, L1MuBMSEU::ext(), edm::eventsetup::EventSetupRecordImplementation< T >::get(), L1MuDTTFParameters::get_soc_run_21(), getEXTable(), L1MuBMDataBuffer::getTSphi(), L1MuBMTFConfig::getUseEX21(), L1MuBMSectorProcessor::id(), L1TMuonBarrelParams::l1mudttfparams, svgfig::load(), m_SEUs, m_sp, pars, edm::ESHandle< T >::product(), reset(), L1AbstractProcessor::run(), L1MuBMSecProcId::sector(), L1MuBMSEU::tsId(), L1MuBMSecProcId::wheel(), and which_ext().

Referenced by L1MuBMSectorProcessor::run().

◆ which_ext()

pair< int, int > L1MuBMExtrapolationUnit::which_ext ( Extrapolation  ext)
static

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

Definition at line 296 of file L1MuBMExtrapolationUnit.cc.

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

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

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

Member Data Documentation

◆ bmtfParamsHandle

edm::ESHandle<L1TMuonBarrelParams> L1MuBMExtrapolationUnit::bmtfParamsHandle
private

Definition at line 101 of file L1MuBMExtrapolationUnit.h.

Referenced by run().

◆ m_SEUs

SEUmap L1MuBMExtrapolationUnit::m_SEUs
mutableprivate

◆ m_sp

const L1MuBMSectorProcessor& L1MuBMExtrapolationUnit::m_sp
private

Definition at line 96 of file L1MuBMExtrapolationUnit.h.

Referenced by print(), and run().

◆ pars

L1MuDTTFParameters L1MuBMExtrapolationUnit::pars
private

Definition at line 102 of file L1MuBMExtrapolationUnit.h.

Referenced by run().

personalPlayback.level
level
Definition: personalPlayback.py:22
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
ext
Definition: memstream.h:15
L1MuBMExtrapolationUnit::getEXTable
const std::bitset< 12 > & getEXTable(Extrapolation ext, unsigned int startAdr) const
get Extrapolator table for a given SEU
Definition: L1MuBMExtrapolationUnit.cc:213
L1MuBMDataBuffer::getTSphi
const TSPhivector & getTSphi() const
get all track segments from the buffer
Definition: L1MuBMDataBuffer.h:56
start
Definition: start.py:1
L1MuBMTrackSegPhi
Definition: L1MuBMTrackSegPhi.h:41
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
L1MuBMSEU::tsId
unsigned int tsId() const
return start track segment identifier (relative address)
Definition: L1MuBMSEU.h:81
L1MuBMTFConfig::getUseEX21
static bool getUseEX21()
Definition: L1MuBMTFConfig.h:64
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1TMuonBarrelParams::l1mudttfparams
L1MuDTTFParameters l1mudttfparams
Definition: L1TMuonBarrelParams.h:65
L1MuBMExtrapolationUnit::pars
L1MuDTTFParameters pars
Definition: L1MuBMExtrapolationUnit.h:102
L1MuBMSecProcId::sector
int sector() const
return sector number
Definition: L1MuBMSecProcId.h:58
L1MuBMSecProcId::wheel
int wheel() const
return wheel number
Definition: L1MuBMSecProcId.h:55
EX34
Definition: L1MuDTExtParam.h:22
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:109
L1MuBMExtrapolationUnit::reset
void reset() override
reset Extrapolation Unit
Definition: L1MuBMExtrapolationUnit.cc:148
EX15
Definition: L1MuDTExtParam.h:22
L1MuBMExtrapolationUnit::m_sp
const L1MuBMSectorProcessor & m_sp
Definition: L1MuBMExtrapolationUnit.h:96
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
L1MuBMExtrapolationUnit::bmtfParamsHandle
edm::ESHandle< L1TMuonBarrelParams > bmtfParamsHandle
Definition: L1MuBMExtrapolationUnit.h:101
Extrapolation
Extrapolation
Definition: L1MuDTExtParam.h:22
source
static const std::string source
Definition: EdmProvDump.cc:47
svgfig.load
def load(fileName)
Definition: svgfig.py:547
L1MuBMTFConfig::Debug
static bool Debug()
Definition: L1MuBMTFConfig.h:54
EX21
Definition: L1MuDTExtParam.h:22
L1MuBMSectorProcessor::id
const L1MuBMSecProcId & id() const
return Sector Processor identifier
Definition: L1MuBMSectorProcessor.h:75
EX23
Definition: L1MuDTExtParam.h:22
EX12
Definition: L1MuDTExtParam.h:22
EX25
Definition: L1MuDTExtParam.h:22
L1AbstractProcessor::run
virtual void run()
run processor logic
Definition: L1AbstractProcessor.h:40
L1MuBMTrackSegPhi::empty
bool empty() const
is it an empty phi track segment?
Definition: L1MuBMTrackSegPhi.h:115
EX24
Definition: L1MuDTExtParam.h:22
L1MuBMExtrapolationUnit::numberOfExt
int numberOfExt() const
return number of successful extrapolations
Definition: L1MuBMExtrapolationUnit.cc:239
L1MuBMExtrapolationUnit::SEUId
std::pair< Extrapolation, unsigned int > SEUId
Definition: L1MuBMExtrapolationUnit.h:56
L1MuBMSEU::ext
Extrapolation ext() const
return extrapolation type
Definition: L1MuBMSEU.h:78
L1MuBMSectorProcessor::data
const L1MuBMDataBuffer * data() const
return pointer to Data Buffer
Definition: L1MuBMSectorProcessor.h:87
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
L1TMuonBarrelParams
Definition: L1TMuonBarrelParams.h:23
EX14
Definition: L1MuDTExtParam.h:22
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
L1MuBMExtrapolationUnit::m_SEUs
SEUmap m_SEUs
Definition: L1MuBMExtrapolationUnit.h:98
L1TMuonBarrelParamsRcd
Definition: L1TMuonBarrelParamsRcd.h:13
L1MuBMSEU
Definition: L1MuBMSEU.h:48
L1MuBMExtrapolationUnit::which_ext
static std::pair< int, int > which_ext(Extrapolation ext)
return station of start and target track segment for a given extrapolation
Definition: L1MuBMExtrapolationUnit.cc:296