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

51  : m_sp(sp),
52  m_seu(seu),
53  m_id(id),
54  m_result(false),
55  m_quality(0),
56  m_address(15),
57  m_start(nullptr),
58  m_target(nullptr),
60  nbit_phi(sp.tf().config()->getNbitsExtPhi()),
61  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
const L1MuDTTFConfig * config() const
return configuration
int getExtTSFilter() const
int const theExtFilter
Definition: L1MuDTEUX.h:117
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 67 of file L1MuDTEUX.cc.

67 {}

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

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

209  {
210  m_start = start_ts;
211  m_target = target_ts;
212 
213  // in case of EX34 and EX21 exchange start and target
214  if ((m_seu.ext() == EX34) || (m_seu.ext() == EX21)) {
215  m_start = target_ts;
216  m_target = start_ts;
217  }
218 }
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 76 of file L1MuDTEUX.cc.

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

76  {
77  if (m_id != eux.id())
78  return false;
79  if (m_result != eux.result())
80  return false;
81  if (m_quality != eux.quality())
82  return false;
83  if (m_address != eux.address())
84  return false;
85  return true;
86 }
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 224 of file L1MuDTEUX.cc.

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

224  {
225  m_result = false;
226  m_quality = 0;
227  m_address = 15;
228 
229  m_start = nullptr;
230  m_target = nullptr;
231 }
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 91 of file L1MuDTEUX.cc.

References funct::abs(), l1t::bitShift(), 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, HLT_IsoTrack_cff::offset, L1MuDTTrackSegPhi::phi(), L1MuDTTrackSegPhi::phib(), L1MuDTTrackSegPhi::quality(), sec_mod(), L1MuDTSecProcId::sector(), L1MuDTTrackSegPhi::sector(), L1MuDTSectorProcessor::tf(), L1MuDTSecProcId::wheel(), and L1MuDTTrackSegPhi::wheel().

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

References nano_mu_digi_cff::sector.

Referenced by run().

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

◆ ts()

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

return pointer to start and target track segment

Definition at line 236 of file L1MuDTEUX.cc.

References m_start, and m_target.

236  {
237  return pair<const L1MuDTTrackSegPhi*, const L1MuDTTrackSegPhi*>(m_start, m_target);
238 }
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.