CMS 3D CMS Logo

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

#include <L1MuBMLUTHandler.h>

Public Types

enum  Extrapolation {
  EX12, EX13, EX14, EX21,
  EX23, EX24, EX34, EX15,
  EX16, EX25, EX26, EX56
}
 
enum  PtAssMethod {
  PT12L, PT12H, PT13L, PT13H,
  PT14L, PT14H, PT23L, PT23H,
  PT24L, PT24H, PT34L, PT34H,
  PB12H, PB13H, PB14H, PB21H,
  PB23H, PB24H, PB34H, NODEF
}
 

Public Member Functions

int getDeltaPhi (int idx, int address) const
 get delta-phi for a given address (bend-angle) More...
 
int getHigh (int ext_ind, int address) const
 get high_value for a given address More...
 
int getLow (int ext_ind, int address) const
 get low_value for a given address More...
 
std::pair< unsigned short, unsigned short > getPrecision () const
 get precision for look-up tables More...
 
int getPt (int pta_ind, int address) const
 get pt-value for a given address More...
 
int getPtLutThreshold (int pta_ind) const
 get pt-assignment LUT threshold More...
 
 L1MuBMLUTHandler (const L1TMuonBarrelParams &l1params)
 constructor More...
 
void print_ext_lut () const
 print extrapolation look-up tables More...
 
void print_phi_lut () const
 print phi-assignment look-up tables More...
 
void print_pta_lut () const
 print pt-assignment look-up tables More...
 
virtual ~L1MuBMLUTHandler ()
 destructor More...
 

Public Attributes

const int MAX_EXT = 12
 
const int MAX_PTASSMETH = 19
 
const int MAX_PTASSMETHA = 12
 

Private Attributes

const L1TMuonBarrelParamsAllPublicl1tbmparams
 

Detailed Description

Definition at line 26 of file L1MuBMLUTHandler.h.

Member Enumeration Documentation

◆ Extrapolation

◆ PtAssMethod

Enumerator
PT12L 
PT12H 
PT13L 
PT13H 
PT14L 
PT14H 
PT23L 
PT23H 
PT24L 
PT24H 
PT34L 
PT34H 
PB12H 
PB13H 
PB14H 
PB21H 
PB23H 
PB24H 
PB34H 
NODEF 

Definition at line 77 of file L1MuBMLUTHandler.h.

Constructor & Destructor Documentation

◆ L1MuBMLUTHandler()

L1MuBMLUTHandler::L1MuBMLUTHandler ( const L1TMuonBarrelParams l1params)

constructor

Definition at line 52 of file L1MuBMLUTHandler.cc.

52  {
53  // l1tbmparams = &l1params;
55 }
const L1TMuonBarrelParamsAllPublic * l1tbmparams

◆ ~L1MuBMLUTHandler()

L1MuBMLUTHandler::~L1MuBMLUTHandler ( )
virtual

destructor

Definition at line 61 of file L1MuBMLUTHandler.cc.

61 { delete l1tbmparams; }
const L1TMuonBarrelParamsAllPublic * l1tbmparams

Member Function Documentation

◆ getDeltaPhi()

int L1MuBMLUTHandler::getDeltaPhi ( int  idx,
int  address 
) const

get delta-phi for a given address (bend-angle)

Definition at line 161 of file L1MuBMLUTHandler.cc.

References DMR_cfg::cerr, and heavyIonCSV_trainingSettings::idx.

Referenced by L1MuBMAssignmentUnit::PhiAU().

161  {
162  std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
163  L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[idx].find(address);
164  if (iter != phi_lut[idx].end()) {
165  return (*iter).second;
166  } else {
167  cerr << "PhiLut::getDeltaPhi : can not find address " << address << endl;
168  return 0;
169  }
170 }
const L1TMuonBarrelParamsAllPublic * l1tbmparams

◆ getHigh()

int L1MuBMLUTHandler::getHigh ( int  ext_ind,
int  address 
) const

get high_value for a given address

Definition at line 261 of file L1MuBMLUTHandler.cc.

References DMR_cfg::cerr, and LaserClient_cfi::high.

Referenced by L1MuBMEUX::run().

261  {
262  std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
263  L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].high.find(address);
264  if (iter != ext_lut[ext_ind].high.end()) {
265  return (*iter).second;
266  } else {
267  cerr << "ExtLut::getHigh : can not find address " << address << endl;
268  return 99999;
269  }
270 }
std::vector< LUTParams::extLUT > ext_lut() const
const L1TMuonBarrelParamsAllPublic * l1tbmparams

◆ getLow()

int L1MuBMLUTHandler::getLow ( int  ext_ind,
int  address 
) const

get low_value for a given address

Definition at line 247 of file L1MuBMLUTHandler.cc.

References DMR_cfg::cerr, and LaserClient_cfi::low.

Referenced by L1MuBMEUX::run().

247  {
248  std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
249  L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].low.find(address);
250  if (iter != ext_lut[ext_ind].low.end()) {
251  return (*iter).second;
252  } else {
253  cerr << "ExtLut::getLow : can not find address " << address << endl;
254  return 99999;
255  }
256 }
std::vector< LUTParams::extLUT > ext_lut() const
const L1TMuonBarrelParamsAllPublic * l1tbmparams

◆ getPrecision()

pair< unsigned short, unsigned short > L1MuBMLUTHandler::getPrecision ( ) const

get precision for look-up tables

Definition at line 175 of file L1MuBMLUTHandler.cc.

175  {
176  return pair<unsigned short, unsigned short>(l1tbmparams->get_PHI_Assignment_nbits_Phi(),
178 }
const L1TMuonBarrelParamsAllPublic * l1tbmparams

◆ getPt()

int L1MuBMLUTHandler::getPt ( int  pta_ind,
int  address 
) const

get pt-value for a given address

Definition at line 131 of file L1MuBMLUTHandler.cc.

References DMR_cfg::cerr.

Referenced by L1MuBMAssignmentUnit::PtAU().

131  {
132  std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
133 
134  L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pta_ind].find(address);
135  if (iter != pta_lut[pta_ind].end()) {
136  //std::cout<<"pta_ind "<<pta_ind<<" address "<<address<<" pt "<<(*iter).second<<std::endl;
137 
138  return (*iter).second;
139  } else {
140  cerr << "PtaLut::getPt : can not find address " << address << endl;
141  return 0;
142  }
143 }
const L1TMuonBarrelParamsAllPublic * l1tbmparams

◆ getPtLutThreshold()

int L1MuBMLUTHandler::getPtLutThreshold ( int  pta_ind) const

get pt-assignment LUT threshold

Definition at line 148 of file L1MuBMLUTHandler.cc.

References DMR_cfg::cerr, and MAX_PTASSMETH.

Referenced by L1MuBMAssignmentUnit::getPtMethod().

148  {
149  std::vector<int> pta_threshold = l1tbmparams->pta_threshold();
150  if (pta_ind >= 0 && pta_ind < L1MuBMLUTHandler::MAX_PTASSMETH / 2) {
151  return pta_threshold[pta_ind];
152  } else {
153  cerr << "PtaLut::getPtLutThreshold : can not find threshold " << pta_ind << endl;
154  return 0;
155  }
156 }
std::vector< int > pta_threshold() const
const int MAX_PTASSMETH
const L1TMuonBarrelParamsAllPublic * l1tbmparams

◆ print_ext_lut()

void L1MuBMLUTHandler::print_ext_lut ( ) const

print extrapolation look-up tables

Definition at line 275 of file L1MuBMLUTHandler.cc.

References funct::abs(), gather_cfg::cout, LaserClient_cfi::high, mps_fire::i, LaserClient_cfi::low, MAX_EXT, and DTTFBitArray< N >::twoComplement().

275  {
276  unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
277  unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
278  cout << endl;
279  cout << "L1 barrel Track Finder Extrapolation look-up tables :" << endl;
280  cout << "=====================================================" << endl;
281  cout << endl;
282  cout << "Precision : " << endl;
283  cout << '\t' << setw(2) << nbit_phi << " bits are used for phi " << endl;
284  cout << '\t' << setw(2) << nbit_phib << " bits are used for phib " << endl;
285 
286  // loop over all extrapolations
287  for (int ext = 0; ext < L1MuBMLUTHandler::MAX_EXT; ext++) {
288  cout << endl;
289  cout << "Extrapolation : " << static_cast<L1MuBMLUTHandler::Extrapolation>(ext) << endl;
290  cout << "====================" << endl;
291  cout << endl;
292 
293  cout << " address";
294  for (int i = 0; i < nbit_phib; i++)
295  cout << ' ';
296  cout << " low-value";
297  for (int i = 0; i < nbit_phi; i++)
298  cout << ' ';
299  cout << " high-value " << endl;
300  for (int i = 0; i < 2 * nbit_phi + nbit_phib; i++)
301  cout << '-';
302  cout << "---------------------------------" << endl;
303  std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
304  L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext].low.begin();
305  L1TMuonBarrelParams::LUT::const_iterator iter1;
306  while (iter != ext_lut[ext].low.end()) {
307  int address = (*iter).first;
308  int low = (*iter).second;
309  iter1 = ext_lut[ext].high.find(address);
310  int high = (*iter1).second;
311 
312  DTTFBitArray<10> b_address(static_cast<unsigned>(abs(address)));
313  DTTFBitArray<12> b_low(static_cast<unsigned>(abs(low)));
314  DTTFBitArray<12> b_high(static_cast<unsigned>(abs(high)));
315 
316  if (address < 0)
317  b_address.twoComplement();
318  if (low < 0)
319  b_low.twoComplement();
320  if (high < 0)
321  b_high.twoComplement();
322 
323  cout.setf(ios::right, ios::adjustfield);
324  cout << " " << setbase(10) << setw(5) << address << " (";
325  for (int i = nbit_phib - 1; i >= 0; i--)
326  cout << b_address[i];
327  cout << ") " << setw(5) << low << " (";
328  for (int i = nbit_phi - 1; i >= 0; i--)
329  cout << b_low[i];
330  cout << ") " << setw(5) << high << " (";
331  for (int i = nbit_phi - 1; i >= 0; i--)
332  cout << b_high[i];
333  cout << ") " << endl;
334 
335  iter++;
336  }
337  }
338 
339  cout << endl;
340 }
std::vector< LUTParams::extLUT > ext_lut() const
const L1TMuonBarrelParamsAllPublic * l1tbmparams
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: memstream.h:15

◆ print_phi_lut()

void L1MuBMLUTHandler::print_phi_lut ( ) const

print phi-assignment look-up tables

Definition at line 182 of file L1MuBMLUTHandler.cc.

References funct::abs(), gather_cfg::cout, mps_fire::i, heavyIonCSV_trainingSettings::idx, and DTTFBitArray< N >::twoComplement().

182  {
183  unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
184  unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
185 
186  cout << endl;
187  cout << "L1 barrel Track Finder Phi-Assignment look-up tables :" << endl;
188  cout << "======================================================" << endl;
189  cout << endl;
190  cout << "Precision : " << endl;
191  cout << '\t' << setw(2) << nbit_phi << " bits are used for phi " << endl;
192  cout << '\t' << setw(2) << nbit_phib << " bits are used for phib " << endl;
193 
194  // loop over all phi-assignment methods
195  for (int idx = 0; idx < 2; idx++) {
196  cout << endl;
197  if (idx == 0)
198  cout << "Phi-Assignment Method : "
199  << "PHI12" << endl;
200  if (idx == 1)
201  cout << "Phi-Assignment Method : "
202  << "PHI42" << endl;
203  cout << "=============================" << endl;
204  cout << endl;
205 
206  cout << " address";
207  for (int i = 0; i < nbit_phib; i++)
208  cout << ' ';
209  cout << " value" << endl;
210  for (int i = 0; i < nbit_phi + nbit_phib; i++)
211  cout << '-';
212  cout << "----------------------" << endl;
213  std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
214 
215  L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[idx].begin();
216  while (iter != phi_lut[idx].end()) {
217  int address = (*iter).first;
218  int value = (*iter).second;
219 
220  DTTFBitArray<10> b_address(static_cast<unsigned>(abs(address)));
221  DTTFBitArray<12> b_value(static_cast<unsigned>(abs(value)));
222 
223  if (address < 0)
224  b_address.twoComplement();
225  if (value < 0)
226  b_value.twoComplement();
227 
228  cout.setf(ios::right, ios::adjustfield);
229  cout << " " << setbase(10) << setw(5) << address << " (";
230  for (int i = nbit_phib - 1; i >= 0; i--)
231  cout << b_address[i];
232  cout << ") " << setw(5) << value << " (";
233  for (int i = nbit_phi - 1; i >= 0; i--)
234  cout << b_value[i];
235  cout << ") " << endl;
236 
237  iter++;
238  }
239  }
240 
241  cout << endl;
242 }
const L1TMuonBarrelParamsAllPublic * l1tbmparams
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: value.py:1

◆ print_pta_lut()

void L1MuBMLUTHandler::print_pta_lut ( ) const

print pt-assignment look-up tables

Definition at line 70 of file L1MuBMLUTHandler.cc.

References funct::abs(), gather_cfg::cout, mps_fire::i, MAX_PTASSMETH, DTTFBitArray< N >::print(), and DTTFBitArray< N >::twoComplement().

70  {
71  int nbit_phi = l1tbmparams->get_PT_Assignment_nbits_Phi();
72 
73  cout << endl;
74  cout << "L1 barrel Track Finder Pt-Assignment look-up tables :" << endl;
75  cout << "=====================================================" << endl;
76  cout << endl;
77  cout << "Precision : " << endl;
78  cout << '\t' << setw(2) << nbit_phi << " bits are used for phi " << endl;
79 
80  // loop over all pt-assignment methods
81  for (int pam = 0; pam < L1MuBMLUTHandler::MAX_PTASSMETH; pam++) {
82  cout << endl;
83  cout << "Pt-Assignment Method : " << static_cast<L1MuBMLUTHandler::PtAssMethod>(pam) << endl;
84  cout << "============================" << endl;
85  cout << endl;
86 
87  cout << "\t Threshold : " << getPtLutThreshold(pam / 2) << endl << endl;
88 
89  int maxbits = nbit_phi;
90  if (pam >= MAX_PTASSMETHA)
91  maxbits = nbit_phi - 2;
92 
93  cout << " address";
94  for (int i = 0; i < maxbits; i++)
95  cout << ' ';
96  cout << " value" << endl;
97  for (int i = 0; i < maxbits; i++)
98  cout << '-';
99  cout << "-------------------------" << endl;
100  std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
101 
102  L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pam].begin();
103  while (iter != pta_lut[pam].end()) {
104  int address = (*iter).first;
105  int value = (*iter).second;
106 
107  DTTFBitArray<12> b_address(static_cast<unsigned>(abs(address)));
108  DTTFBitArray<9> b_value(static_cast<unsigned>(abs(value)));
109 
110  if (address < 0)
111  b_address.twoComplement();
112 
113  cout.setf(ios::right, ios::adjustfield);
114  cout << " " << setbase(10) << setw(9) << address << " (";
115  for (int i = maxbits - 1; i >= 0; i--)
116  cout << b_address[i];
117  cout << ") " << setw(3) << value << " (";
118  b_value.print();
119  cout << ")" << endl;
120 
121  iter++;
122  }
123  }
124 
125  cout << endl;
126 }
const int MAX_PTASSMETH
const L1TMuonBarrelParamsAllPublic * l1tbmparams
const int MAX_PTASSMETHA
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: value.py:1
int getPtLutThreshold(int pta_ind) const
get pt-assignment LUT threshold

Member Data Documentation

◆ l1tbmparams

const L1TMuonBarrelParamsAllPublic* L1MuBMLUTHandler::l1tbmparams
private

Definition at line 63 of file L1MuBMLUTHandler.h.

◆ MAX_EXT

const int L1MuBMLUTHandler::MAX_EXT = 12

Definition at line 67 of file L1MuBMLUTHandler.h.

Referenced by print_ext_lut().

◆ MAX_PTASSMETH

const int L1MuBMLUTHandler::MAX_PTASSMETH = 19

Definition at line 73 of file L1MuBMLUTHandler.h.

Referenced by getPtLutThreshold(), and print_pta_lut().

◆ MAX_PTASSMETHA

const int L1MuBMLUTHandler::MAX_PTASSMETHA = 12

Definition at line 74 of file L1MuBMLUTHandler.h.