CMS 3D CMS Logo

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

#include <L1MuDTEUX.h>

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 ()
 reset Extrapolator More...
 
bool result () const
 return extrapolation result More...
 
void run (const L1MuDTExtLut &extLUTs, const L1MuDTTFParameters &pars)
 run Extrapolator More...
 
std::pair< const L1MuDTTrackSegPhi *, const L1MuDTTrackSegPhi * > ts () const
 return pointer to start and target track segment More...
 
 ~L1MuDTEUX ()
 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 short const nbit_phi = 12
 
unsigned short const nbit_phib = 10
 
int const theExtFilter = 1
 

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 49 of file L1MuDTEUX.cc.

50  : m_sp(sp),
51  m_seu(seu),
52  m_id(id),
53  m_result(false),
54  m_quality(0),
55  m_address(15),
56  m_start(nullptr),
57  m_target(nullptr),
59  nbit_phi(sp.tf().config()->getNbitsExtPhi()),
60  nbit_phib(sp.tf().config()->getNbitsExtPhib()) {}
const L1MuDTTrackFinder & tf() const
return reference to barrel MTTF
bool m_result
Definition: L1MuDTEUX.h:110
const L1MuDTSEU & m_seu
Definition: L1MuDTEUX.h:107
unsigned short const nbit_phib
Definition: L1MuDTEUX.h:119
unsigned short const nbit_phi
Definition: L1MuDTEUX.h:118
int getExtTSFilter() const
int const theExtFilter
Definition: L1MuDTEUX.h:117
static L1MuDTTFConfig * config()
return configuration
const L1MuDTTrackSegPhi * m_target
Definition: L1MuDTEUX.h:115
unsigned short int m_quality
Definition: L1MuDTEUX.h:111
const L1MuDTSectorProcessor & m_sp
Definition: L1MuDTEUX.h:106
int getNbitsExtPhi() const
int getNbitsExtPhib() const
int m_id
Definition: L1MuDTEUX.h:108
const L1MuDTTrackSegPhi * m_start
Definition: L1MuDTEUX.h:114
unsigned short int m_address
Definition: L1MuDTEUX.h:112

◆ ~L1MuDTEUX()

L1MuDTEUX::~L1MuDTEUX ( )

destructor

Definition at line 66 of file L1MuDTEUX.cc.

66 {}

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.

References m_address.

Referenced by operator==().

99 { return m_address; }
unsigned short int m_address
Definition: L1MuDTEUX.h:112

◆ id()

int L1MuDTEUX::id ( void  ) const
inline

return Extrapolation identifier

Definition at line 90 of file L1MuDTEUX.h.

References m_id.

Referenced by operator==().

90 { return m_id; }
int m_id
Definition: L1MuDTEUX.h:108

◆ load()

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

load data into EUX

Definition at line 208 of file L1MuDTEUX.cc.

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

208  {
209  m_start = start_ts;
210  m_target = target_ts;
211 
212  // in case of EX34 and EX21 exchange start and target
213  if ((m_seu.ext() == EX34) || (m_seu.ext() == EX21)) {
214  m_start = target_ts;
215  m_target = start_ts;
216  }
217 }
const L1MuDTSEU & m_seu
Definition: L1MuDTEUX.h:107
const L1MuDTTrackSegPhi * m_target
Definition: L1MuDTEUX.h:115
Extrapolation ext() const
return extrapolation type
Definition: L1MuDTSEU.h:78
const L1MuDTTrackSegPhi * m_start
Definition: L1MuDTEUX.h:114

◆ operator==()

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

equal operator

Definition at line 75 of file L1MuDTEUX.cc.

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

75  {
76  if (m_id != eux.id())
77  return false;
78  if (m_result != eux.result())
79  return false;
80  if (m_quality != eux.quality())
81  return false;
82  if (m_address != eux.address())
83  return false;
84  return true;
85 }
bool result() const
return extrapolation result
Definition: L1MuDTEUX.h:93
bool m_result
Definition: L1MuDTEUX.h:110
int id() const
return Extrapolation identifier
Definition: L1MuDTEUX.h:90
unsigned int quality() const
return extrapolation quality
Definition: L1MuDTEUX.h:96
unsigned short int address() const
return extrapolation address (0-11) (address = 15 indicates negative ext. result) ...
Definition: L1MuDTEUX.h:99
unsigned short int m_quality
Definition: L1MuDTEUX.h:111
int m_id
Definition: L1MuDTEUX.h:108
unsigned short int m_address
Definition: L1MuDTEUX.h:112

◆ quality()

unsigned int L1MuDTEUX::quality ( void  ) const
inline

return extrapolation quality

Definition at line 96 of file L1MuDTEUX.h.

References m_quality.

Referenced by operator==().

96 { return m_quality; }
unsigned short int m_quality
Definition: L1MuDTEUX.h:111

◆ reset()

void L1MuDTEUX::reset ( void  )

reset Extrapolator

Definition at line 223 of file L1MuDTEUX.cc.

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

223  {
224  m_result = false;
225  m_quality = 0;
226  m_address = 15;
227 
228  m_start = nullptr;
229  m_target = nullptr;
230 }
bool m_result
Definition: L1MuDTEUX.h:110
const L1MuDTTrackSegPhi * m_target
Definition: L1MuDTEUX.h:115
unsigned short int m_quality
Definition: L1MuDTEUX.h:111
const L1MuDTTrackSegPhi * m_start
Definition: L1MuDTEUX.h:114
unsigned short int m_address
Definition: L1MuDTEUX.h:112

◆ result()

bool L1MuDTEUX::result ( ) const
inline

return extrapolation result

Definition at line 93 of file L1MuDTEUX.h.

References m_result.

Referenced by operator==().

93 { return m_result; }
bool m_result
Definition: L1MuDTEUX.h:110

◆ run()

void L1MuDTEUX::run ( const L1MuDTExtLut extLUTs,
const L1MuDTTFParameters pars 
)

run Extrapolator

Definition at line 90 of file L1MuDTEUX.cc.

References funct::abs(), L1MuDTTrackFinder::config(), gather_cfg::cout, L1MuDTTFConfig::Debug(), change_name::diff, EX12, EX13, EX14, EX15, EX21, EX23, EX24, EX25, EX34, L1MuDTSEU::ext(), 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, L1MuDTTrackSegPhi::phi(), L1MuDTTrackSegPhi::phib(), L1MuDTTrackSegPhi::quality(), sec_mod(), L1MuDTSecProcId::sector(), L1MuDTTrackSegPhi::sector(), L1MuDTSectorProcessor::tf(), L1MuDTSecProcId::wheel(), and L1MuDTTrackSegPhi::wheel().

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

◆ sec_mod()

int L1MuDTEUX::sec_mod ( int  sector) const
private

output sector numbers in the range -6 to +5

Definition at line 243 of file L1MuDTEUX.cc.

Referenced by run().

243  {
244  int new_sector = sector % 12;
245  if (new_sector >= 6)
246  new_sector = new_sector - 12;
247  if (new_sector < -6)
248  new_sector = new_sector + 12;
249 
250  return new_sector;
251 }

◆ ts()

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

return pointer to start and target track segment

Definition at line 235 of file L1MuDTEUX.cc.

References m_start, and m_target.

235  {
236  return pair<const L1MuDTTrackSegPhi*, const L1MuDTTrackSegPhi*>(m_start, m_target);
237 }
const L1MuDTTrackSegPhi * m_target
Definition: L1MuDTEUX.h:115
const L1MuDTTrackSegPhi * m_start
Definition: L1MuDTEUX.h:114

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 short const L1MuDTEUX::nbit_phi = 12
private

Definition at line 118 of file L1MuDTEUX.h.

Referenced by run().

◆ nbit_phib

unsigned short const L1MuDTEUX::nbit_phib = 10
private

Definition at line 119 of file L1MuDTEUX.h.

Referenced by run().

◆ theExtFilter

int const L1MuDTEUX::theExtFilter = 1
private

Definition at line 117 of file L1MuDTEUX.h.