CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
L1MuDTEUX Class Reference

#include <L1MuDTEUX.h>

Inheritance diagram for L1MuDTEUX:
L1AbstractProcessor

Classes

class  EUX_Comp
 helper class for finding the best and second best extrapolation More...
 

Public Member Functions

unsigned short int address () const
 return extrapolation address (0-11) (address = 15 indicates negative ext. result) More...
 
int id () const
 return Extrapolation identifier More...
 
 L1MuDTEUX (const L1MuDTSectorProcessor &sp, const L1MuDTSEU &seu, int id)
 constructor More...
 
void load (const L1MuDTTrackSegPhi *start_ts, const L1MuDTTrackSegPhi *target_ts)
 load data into EUX More...
 
bool operator== (const L1MuDTEUX &) const
 equal operator More...
 
unsigned int quality () const
 return extrapolation quality More...
 
void reset () override
 reset Extrapolator More...
 
bool result () const
 return extrapolation result More...
 
void run (const edm::EventSetup &c) override
 run Extrapolator More...
 
std::pair< const L1MuDTTrackSegPhi *, const L1MuDTTrackSegPhi * > ts () const
 return pointer to start and target track segment More...
 
 ~L1MuDTEUX () 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...
 

Private Member Functions

int sec_mod (int) const
 output sector numbers in the range -6 to +5 More...
 

Private Attributes

unsigned short int m_address
 
int m_id
 
unsigned short int m_quality
 
bool m_result
 
const L1MuDTSEUm_seu
 
const L1MuDTSectorProcessorm_sp
 
const L1MuDTTrackSegPhim_start
 
const L1MuDTTrackSegPhim_target
 
unsigned const short nbit_phi = 12
 
unsigned const short nbit_phib = 10
 
edm::ESHandle< L1MuDTTFParameterspars
 
const int theExtFilter = 1
 
edm::ESHandle< L1MuDTExtLuttheExtLUTs
 

Detailed Description

Extrapolator:

The Extrapolator receives a start and a target track segment and performs the actual extrapolation

N. Neumeister CERN EP

Definition at line 48 of file L1MuDTEUX.h.

Constructor & Destructor Documentation

◆ L1MuDTEUX()

L1MuDTEUX::L1MuDTEUX ( const L1MuDTSectorProcessor sp,
const L1MuDTSEU seu,
int  id 
)

constructor

Definition at line 51 of file L1MuDTEUX.cc.

52  : m_sp(sp),
53  m_seu(seu),
54  m_id(id),
55  m_result(false),
56  m_quality(0),
57  m_address(15),
58  m_start(nullptr),
59  m_target(nullptr),
61  nbit_phi(sp.tf().config()->getNbitsExtPhi()),
62  nbit_phib(sp.tf().config()->getNbitsExtPhib()) {}

◆ ~L1MuDTEUX()

L1MuDTEUX::~L1MuDTEUX ( )
override

destructor

Definition at line 68 of file L1MuDTEUX.cc.

68 {}

Member Function Documentation

◆ address()

unsigned short int L1MuDTEUX::address ( ) const
inline

return extrapolation address (0-11) (address = 15 indicates negative ext. result)

Definition at line 99 of file L1MuDTEUX.h.

99 { return m_address; }

References m_address.

Referenced by operator==().

◆ id()

int L1MuDTEUX::id ( void  ) const
inline

return Extrapolation identifier

Definition at line 90 of file L1MuDTEUX.h.

90 { return m_id; }

References m_id.

Referenced by operator==().

◆ load()

void L1MuDTEUX::load ( const L1MuDTTrackSegPhi start_ts,
const L1MuDTTrackSegPhi target_ts 
)

load data into EUX

Definition at line 213 of file L1MuDTEUX.cc.

213  {
214  m_start = start_ts;
215  m_target = target_ts;
216 
217  // in case of EX34 and EX21 exchange start and target
218  if ((m_seu.ext() == EX34) || (m_seu.ext() == EX21)) {
219  m_start = target_ts;
220  m_target = start_ts;
221  }
222 }

References EX21, EX34, L1MuDTSEU::ext(), m_seu, m_start, and m_target.

◆ operator==()

bool L1MuDTEUX::operator== ( const L1MuDTEUX eux) const

equal operator

Definition at line 77 of file L1MuDTEUX.cc.

77  {
78  if (m_id != eux.id())
79  return false;
80  if (m_result != eux.result())
81  return false;
82  if (m_quality != eux.quality())
83  return false;
84  if (m_address != eux.address())
85  return false;
86  return true;
87 }

References address(), id(), m_address, m_id, m_quality, m_result, quality(), and result().

◆ quality()

unsigned int L1MuDTEUX::quality ( void  ) const
inline

return extrapolation quality

Definition at line 96 of file L1MuDTEUX.h.

96 { return m_quality; }

References m_quality.

Referenced by operator==().

◆ reset()

void L1MuDTEUX::reset ( void  )
overridevirtual

reset Extrapolator

Implements L1AbstractProcessor.

Definition at line 228 of file L1MuDTEUX.cc.

228  {
229  m_result = false;
230  m_quality = 0;
231  m_address = 15;
232 
233  m_start = nullptr;
234  m_target = nullptr;
235 }

References m_address, m_quality, m_result, m_start, and m_target.

◆ result()

bool L1MuDTEUX::result ( ) const
inline

return extrapolation result

Definition at line 93 of file L1MuDTEUX.h.

93 { return m_result; }

References m_result.

Referenced by operator==().

◆ run()

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

run Extrapolator

Reimplemented from L1AbstractProcessor.

Definition at line 92 of file L1MuDTEUX.cc.

92  {
95 
96  const bool debug4 = m_sp.tf().config()->Debug(4);
97  if (debug4)
98  cout << "Run EUX " << m_id << endl;
99  if (debug4)
100  cout << "start : " << *m_start << endl;
101  if (debug4)
102  cout << "target : " << *m_target << endl;
103 
104  if (m_start == nullptr || m_target == nullptr) {
105  if (debug4)
106  cout << "Error: EUX has no data loaded" << endl;
107  return;
108  }
109 
110  // start sector
111  int sector_st = m_start->sector();
112 
113  // target sector
114  int sector_ta = m_target->sector();
115 
116  // get index of look-up table
117  int lut_idx = m_seu.ext();
118  if (abs(m_target->wheel()) == 3) {
119  switch (m_seu.ext()) {
120  case EX13: {
121  lut_idx = EX15;
122  break;
123  }
124  case EX23: {
125  lut_idx = EX25;
126  break;
127  }
128  default: {
129  lut_idx = m_seu.ext();
130  break;
131  }
132  }
133  }
134 
135  if (m_sp.tf().config()->Debug(5))
136  cout << "EUX : using look-up table : " << static_cast<Extrapolation>(lut_idx) << endl;
137 
138  // Extrapolation TS quality filter
139  int qcut = 0;
140  if (m_seu.ext() == EX12)
141  qcut = pars->get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
142  if (m_seu.ext() == EX13)
143  qcut = pars->get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
144  if (m_seu.ext() == EX14)
145  qcut = pars->get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
146  if (m_seu.ext() == EX21)
147  qcut = pars->get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
148  if (m_seu.ext() == EX23)
149  qcut = pars->get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
150  if (m_seu.ext() == EX24)
151  qcut = pars->get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
152  if (m_seu.ext() == EX34)
153  qcut = pars->get_soc_qcut_st4(m_sp.id().wheel(), m_sp.id().sector());
154 
155  if (m_start->quality() < qcut)
156  return;
157 
158  // calculate bit shift
159  int sh_phi = 12 - nbit_phi;
160  int sh_phib = 10 - nbit_phib;
161 
162  int phi_target = m_target->phi() >> sh_phi;
163  int phi_start = m_start->phi() >> sh_phi;
164  int phib_start = (m_start->phib() >> sh_phib) << sh_phib;
165  if (phib_start < 0)
166  phib_start += (1 << sh_phib) - 1;
167 
168  // compute difference in phi
169  int diff = phi_target - phi_start;
170 
171  // get low and high values from look-up table
172  // and add offset (30 degrees ) for extrapolation to adjacent sector
173  int offset = -2144 >> sh_phi;
174  offset *= sec_mod(sector_ta - sector_st);
175  int low = theExtLUTs->getLow(lut_idx, phib_start);
176  int high = theExtLUTs->getHigh(lut_idx, phib_start);
177  if (low < 0)
178  low += (1 << sh_phi) - 1;
179  if (high < 0)
180  high += (1 << sh_phi) - 1;
181  low = (low >> sh_phi) + offset;
182  high = (high >> sh_phi) + offset;
183 
184  int phi_offset = phi_target - offset;
185  if ((lut_idx == EX34) || (lut_idx == EX21))
186  phi_offset = phi_start + offset;
187  if (phi_offset >= (1 << (nbit_phi - 1)) - 1)
188  return;
189  if (phi_offset < -(1 << (nbit_phi - 1)) + 1)
190  return;
191 
192  // is phi-difference within the extrapolation window?
193  bool openlut = pars->get_soc_openlut_extr(m_sp.id().wheel(), m_sp.id().sector());
194  if ((diff >= low && diff <= high) || m_sp.tf().config()->getopenLUTs() || openlut) {
195  m_result = true;
196  int qual_st = m_start->quality();
197  int qual_ta = m_target->quality();
198  if (m_seu.ext() == EX34 || m_seu.ext() == EX21) {
199  m_quality = (qual_st == 7) ? 0 : qual_st + 1;
200  } else {
201  m_quality = (qual_ta == 7) ? 0 : qual_ta + 1;
202  }
203  m_address = m_id;
204  }
205 
206  if (m_sp.tf().config()->Debug(5))
207  cout << "diff : " << low << " " << diff << " " << high << " : " << m_result << " " << endl;
208 }

References funct::abs(), c, L1MuDTTrackFinder::config(), gather_cfg::cout, L1MuDTTFConfig::Debug(), change_name::diff, EX12, EX13, EX14, EX15, EX21, EX23, EX24, EX25, EX34, L1MuDTSEU::ext(), get, L1MuDTTFParameters::get_soc_openlut_extr(), L1MuDTTFParameters::get_soc_qcut_st1(), L1MuDTTFParameters::get_soc_qcut_st2(), L1MuDTTFParameters::get_soc_qcut_st4(), L1MuDTExtLut::getHigh(), L1MuDTExtLut::getLow(), L1MuDTTFConfig::getopenLUTs(), LaserClient_cfi::high, L1MuDTSectorProcessor::id(), LaserClient_cfi::low, m_address, m_id, m_quality, m_result, m_seu, m_sp, m_start, m_target, nbit_phi, nbit_phib, hltrates_dqm_sourceclient-live_cfg::offset, pars, L1MuDTTrackSegPhi::phi(), L1MuDTTrackSegPhi::phib(), L1MuDTTrackSegPhi::quality(), sec_mod(), L1MuDTSecProcId::sector(), L1MuDTTrackSegPhi::sector(), L1MuDTSectorProcessor::tf(), theExtLUTs, L1MuDTSecProcId::wheel(), and L1MuDTTrackSegPhi::wheel().

◆ sec_mod()

int L1MuDTEUX::sec_mod ( int  sector) const
private

output sector numbers in the range -6 to +5

Definition at line 248 of file L1MuDTEUX.cc.

248  {
249  int new_sector = sector % 12;
250  if (new_sector >= 6)
251  new_sector = new_sector - 12;
252  if (new_sector < -6)
253  new_sector = new_sector + 12;
254 
255  return new_sector;
256 }

Referenced by run().

◆ ts()

pair< const L1MuDTTrackSegPhi *, const L1MuDTTrackSegPhi * > L1MuDTEUX::ts ( ) const

return pointer to start and target track segment

Definition at line 240 of file L1MuDTEUX.cc.

240  {
241  return pair<const L1MuDTTrackSegPhi*, const L1MuDTTrackSegPhi*>(m_start, m_target);
242 }

References m_start, and m_target.

Member Data Documentation

◆ m_address

unsigned short int L1MuDTEUX::m_address
private

Definition at line 112 of file L1MuDTEUX.h.

Referenced by address(), operator==(), reset(), and run().

◆ m_id

int L1MuDTEUX::m_id
private

Definition at line 108 of file L1MuDTEUX.h.

Referenced by id(), operator==(), and run().

◆ m_quality

unsigned short int L1MuDTEUX::m_quality
private

Definition at line 111 of file L1MuDTEUX.h.

Referenced by operator==(), quality(), reset(), and run().

◆ m_result

bool L1MuDTEUX::m_result
private

Definition at line 110 of file L1MuDTEUX.h.

Referenced by operator==(), reset(), result(), and run().

◆ m_seu

const L1MuDTSEU& L1MuDTEUX::m_seu
private

Definition at line 107 of file L1MuDTEUX.h.

Referenced by load(), and run().

◆ m_sp

const L1MuDTSectorProcessor& L1MuDTEUX::m_sp
private

Definition at line 106 of file L1MuDTEUX.h.

Referenced by run().

◆ m_start

const L1MuDTTrackSegPhi* L1MuDTEUX::m_start
private

Definition at line 114 of file L1MuDTEUX.h.

Referenced by load(), reset(), run(), and ts().

◆ m_target

const L1MuDTTrackSegPhi* L1MuDTEUX::m_target
private

Definition at line 115 of file L1MuDTEUX.h.

Referenced by load(), reset(), run(), and ts().

◆ nbit_phi

unsigned const short L1MuDTEUX::nbit_phi = 12
private

Definition at line 119 of file L1MuDTEUX.h.

Referenced by run().

◆ nbit_phib

unsigned const short L1MuDTEUX::nbit_phib = 10
private

Definition at line 120 of file L1MuDTEUX.h.

Referenced by run().

◆ pars

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

Definition at line 122 of file L1MuDTEUX.h.

Referenced by run().

◆ theExtFilter

const int L1MuDTEUX::theExtFilter = 1
private

Definition at line 118 of file L1MuDTEUX.h.

◆ theExtLUTs

edm::ESHandle<L1MuDTExtLut> L1MuDTEUX::theExtLUTs
private

Definition at line 117 of file L1MuDTEUX.h.

Referenced by run().

change_name.diff
diff
Definition: change_name.py:13
EX13
Definition: L1MuDTExtParam.h:22
L1MuDTTFParameters::get_soc_openlut_extr
bool get_soc_openlut_extr(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:270
L1MuDTEUX::m_start
const L1MuDTTrackSegPhi * m_start
Definition: L1MuDTEUX.h:114
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1MuDTTrackSegPhi::phib
int phib() const
return phib
Definition: L1MuDTTrackSegPhi.h:95
L1MuDTEUX::quality
unsigned int quality() const
return extrapolation quality
Definition: L1MuDTEUX.h:96
L1MuDTEUX::result
bool result() const
return extrapolation result
Definition: L1MuDTEUX.h:93
L1MuDTSectorProcessor::tf
const L1MuDTTrackFinder & tf() const
return reference to barrel MTTF
Definition: L1MuDTSectorProcessor.h:77
L1MuDTEUX::pars
edm::ESHandle< L1MuDTTFParameters > pars
Definition: L1MuDTEUX.h:122
EX34
Definition: L1MuDTExtParam.h:22
EX15
Definition: L1MuDTExtParam.h:22
L1MuDTEUX::sec_mod
int sec_mod(int) const
output sector numbers in the range -6 to +5
Definition: L1MuDTEUX.cc:248
L1MuDTSectorProcessor::id
const L1MuDTSecProcId & id() const
return Sector Processor identifier
Definition: L1MuDTSectorProcessor.h:74
L1MuDTTFParameters::get_soc_qcut_st4
unsigned short int get_soc_qcut_st4(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:210
L1MuDTSecProcId::wheel
int wheel() const
return wheel number
Definition: L1MuDTSecProcId.h:55
L1MuDTEUX::address
unsigned short int address() const
return extrapolation address (0-11) (address = 15 indicates negative ext. result)
Definition: L1MuDTEUX.h:99
L1MuDTEUX::id
int id() const
return Extrapolation identifier
Definition: L1MuDTEUX.h:90
L1MuDTEUX::nbit_phi
unsigned const short nbit_phi
Definition: L1MuDTEUX.h:119
EX21
Definition: L1MuDTExtParam.h:22
L1MuDTTFConfig::getNbitsExtPhi
int getNbitsExtPhi() const
Definition: L1MuDTTFConfig.h:67
L1MuDTTrackSegPhi::phi
int phi() const
return phi
Definition: L1MuDTTrackSegPhi.h:92
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
L1MuDTTrackSegPhi::sector
int sector() const
return sector
Definition: L1MuDTTrackSegPhi.h:83
EX12
Definition: L1MuDTExtParam.h:22
L1MuDTEUX::m_target
const L1MuDTTrackSegPhi * m_target
Definition: L1MuDTEUX.h:115
L1MuDTEUX::theExtFilter
const int theExtFilter
Definition: L1MuDTEUX.h:118
L1MuDTEUX::m_seu
const L1MuDTSEU & m_seu
Definition: L1MuDTEUX.h:107
L1MuDTEUX::nbit_phib
unsigned const short nbit_phib
Definition: L1MuDTEUX.h:120
EX25
Definition: L1MuDTExtParam.h:22
EX24
Definition: L1MuDTExtParam.h:22
L1MuDTTFConfig::getopenLUTs
bool getopenLUTs() const
Definition: L1MuDTTFConfig.h:61
L1MuDTTrackFinder::config
static L1MuDTTFConfig * config()
return configuration
Definition: L1MuDTTrackFinder.h:102
get
#define get
L1MuDTTFParameters::get_soc_qcut_st2
unsigned short int get_soc_qcut_st2(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:198
L1MuDTEUX::m_sp
const L1MuDTSectorProcessor & m_sp
Definition: L1MuDTEUX.h:106
L1MuDTEUX::m_result
bool m_result
Definition: L1MuDTEUX.h:110
L1MuDTEUX::m_id
int m_id
Definition: L1MuDTEUX.h:108
LaserClient_cfi.high
high
Definition: LaserClient_cfi.py:50
L1MuDTExtLut::getLow
int getLow(int ext_ind, int address) const
get low_value for a given address
Definition: L1MuDTExtLut.cc:264
EX14
Definition: L1MuDTExtParam.h:22
L1MuDTTrackSegPhi::quality
int quality() const
return quality code
Definition: L1MuDTTrackSegPhi.h:98
L1MuDTTFConfig::Debug
static bool Debug()
Definition: L1MuDTTFConfig.h:49
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1MuDTTrackSegPhi::wheel
int wheel() const
return wheel
Definition: L1MuDTTrackSegPhi.h:80
L1MuDTExtLut::getHigh
int getHigh(int ext_ind, int address) const
get high_value for a given address
Definition: L1MuDTExtLut.cc:277
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
L1MuDTEUX::m_quality
unsigned short int m_quality
Definition: L1MuDTEUX.h:111
L1MuDTEUX::theExtLUTs
edm::ESHandle< L1MuDTExtLut > theExtLUTs
Definition: L1MuDTEUX.h:117
L1MuDTTFConfig::getNbitsExtPhib
int getNbitsExtPhib() const
Definition: L1MuDTTFConfig.h:68
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
L1MuDTExtLutRcd
Definition: L1MuDTExtLutRcd.h:12
L1MuDTEUX::m_address
unsigned short int m_address
Definition: L1MuDTEUX.h:112
L1MuDTTFParameters::get_soc_qcut_st1
unsigned short int get_soc_qcut_st1(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:186
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52
L1MuDTTFConfig::getExtTSFilter
int getExtTSFilter() const
Definition: L1MuDTTFConfig.h:60
L1MuDTTFParametersRcd
Definition: L1MuDTTFParametersRcd.h:10