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

Enumerator
EX12 
EX13 
EX14 
EX21 
EX23 
EX24 
EX34 
EX15 
EX16 
EX25 
EX26 
EX56 

Definition at line 70 of file L1MuBMLUTHandler.h.

70 { EX12, EX13, EX14, EX21, EX23, EX24, EX34, EX15, EX16, EX25, EX26, EX56 };

◆ 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.

77  {
78  PT12L,
79  PT12H,
80  PT13L,
81  PT13H,
82  PT14L,
83  PT14H,
84  PT23L,
85  PT23H,
86  PT24L,
87  PT24H,
88  PT34L,
89  PT34H,
90  PB12H,
91  PB13H,
92  PB14H,
93  PB21H,
94  PB23H,
95  PB24H,
96  PB34H,
97  NODEF
98  };

Constructor & Destructor Documentation

◆ L1MuBMLUTHandler()

L1MuBMLUTHandler::L1MuBMLUTHandler ( const L1TMuonBarrelParams l1params)

constructor

Definition at line 52 of file L1MuBMLUTHandler.cc.

52  {
53  // l1tbmparams = &l1params;
55 }

◆ ~L1MuBMLUTHandler()

L1MuBMLUTHandler::~L1MuBMLUTHandler ( )
virtual

destructor

Definition at line 61 of file L1MuBMLUTHandler.cc.

61 { delete 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.

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 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, mps_fire::end, and heavyIonCSV_trainingSettings::idx.

Referenced by L1MuBMAssignmentUnit::PhiAU().

◆ 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.

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 }

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

Referenced by L1MuBMEUX::run().

◆ 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.

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 }

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

Referenced by L1MuBMEUX::run().

◆ 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 }

◆ 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.

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 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, and mps_fire::end.

Referenced by L1MuBMAssignmentUnit::PtAU().

◆ getPtLutThreshold()

int L1MuBMLUTHandler::getPtLutThreshold ( int  pta_ind) const

get pt-assignment LUT threshold

Definition at line 148 of file L1MuBMLUTHandler.cc.

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 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, and MAX_PTASSMETH.

Referenced by L1MuBMAssignmentUnit::getPtMethod().

◆ print_ext_lut()

void L1MuBMLUTHandler::print_ext_lut ( ) const

print extrapolation look-up tables

Definition at line 275 of file L1MuBMLUTHandler.cc.

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 }

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

◆ print_phi_lut()

void L1MuBMLUTHandler::print_phi_lut ( ) const

print phi-assignment look-up tables

Definition at line 182 of file L1MuBMLUTHandler.cc.

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 }

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

◆ print_pta_lut()

void L1MuBMLUTHandler::print_pta_lut ( ) const

print pt-assignment look-up tables

Definition at line 70 of file L1MuBMLUTHandler.cc.

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 }

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

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.

L1MuBMLUTHandler::PT34L
Definition: L1MuBMLUTHandler.h:88
L1TMuonBarrelParamsAllPublic::get_PHI_Assignment_nbits_PhiB
int get_PHI_Assignment_nbits_PhiB() const
Definition: L1TMuonBarrelParamsAllPublic.h:61
ext
Definition: memstream.h:15
L1MuBMLUTHandler::l1tbmparams
const L1TMuonBarrelParamsAllPublic * l1tbmparams
Definition: L1MuBMLUTHandler.h:63
L1MuBMLUTHandler::EX14
Definition: L1MuBMLUTHandler.h:70
L1MuBMLUTHandler::PB21H
Definition: L1MuBMLUTHandler.h:93
mps_fire.i
i
Definition: mps_fire.py:428
L1MuBMLUTHandler::EX16
Definition: L1MuBMLUTHandler.h:70
L1MuBMLUTHandler::PB34H
Definition: L1MuBMLUTHandler.h:96
L1TMuonBarrelParamsAllPublic::get_PHI_Assignment_nbits_Phi
int get_PHI_Assignment_nbits_Phi() const
Definition: L1TMuonBarrelParamsAllPublic.h:60
L1MuBMLUTHandler::PB14H
Definition: L1MuBMLUTHandler.h:92
L1MuBMLUTHandler::PT23H
Definition: L1MuBMLUTHandler.h:85
L1MuBMLUTHandler::PT12L
Definition: L1MuBMLUTHandler.h:78
DTTFBitArray
Definition: DTTFBitArray.h:28
L1MuBMLUTHandler::PB13H
Definition: L1MuBMLUTHandler.h:91
L1MuBMLUTHandler::EX26
Definition: L1MuBMLUTHandler.h:70
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1MuBMLUTHandler::EX13
Definition: L1MuBMLUTHandler.h:70
L1TMuonBarrelParamsAllPublic::pta_lut
std::vector< LUT > pta_lut() const
Definition: L1TMuonBarrelParamsAllPublic.h:26
L1MuBMLUTHandler::getPtLutThreshold
int getPtLutThreshold(int pta_ind) const
get pt-assignment LUT threshold
Definition: L1MuBMLUTHandler.cc:148
L1MuBMLUTHandler::EX12
Definition: L1MuBMLUTHandler.h:70
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
mps_fire.end
end
Definition: mps_fire.py:242
L1MuBMLUTHandler::PT13L
Definition: L1MuBMLUTHandler.h:80
L1MuBMLUTHandler::EX25
Definition: L1MuBMLUTHandler.h:70
L1MuBMLUTHandler::PT24H
Definition: L1MuBMLUTHandler.h:87
L1TMuonBarrelParamsAllPublic::phi_lut
std::vector< LUT > phi_lut() const
Definition: L1TMuonBarrelParamsAllPublic.h:31
L1MuBMLUTHandler::PB12H
Definition: L1MuBMLUTHandler.h:90
L1MuBMLUTHandler::PT34H
Definition: L1MuBMLUTHandler.h:89
L1MuBMLUTHandler::NODEF
Definition: L1MuBMLUTHandler.h:97
L1MuBMLUTHandler::PT23L
Definition: L1MuBMLUTHandler.h:84
L1MuBMLUTHandler::MAX_EXT
const int MAX_EXT
Definition: L1MuBMLUTHandler.h:67
value
Definition: value.py:1
L1MuBMLUTHandler::EX34
Definition: L1MuBMLUTHandler.h:70
L1TMuonBarrelParamsAllPublic::get_PT_Assignment_nbits_Phi
int get_PT_Assignment_nbits_Phi() const
Definition: L1TMuonBarrelParamsAllPublic.h:58
L1MuBMLUTHandler::PB23H
Definition: L1MuBMLUTHandler.h:94
L1TMuonBarrelParamsAllPublic::ext_lut
std::vector< LUTParams::extLUT > ext_lut() const
Definition: L1TMuonBarrelParamsAllPublic.h:34
L1MuBMLUTHandler::PT14L
Definition: L1MuBMLUTHandler.h:82
LaserClient_cfi.high
high
Definition: LaserClient_cfi.py:50
L1MuBMLUTHandler::PT24L
Definition: L1MuBMLUTHandler.h:86
L1MuBMLUTHandler::EX15
Definition: L1MuBMLUTHandler.h:70
L1MuBMLUTHandler::EX24
Definition: L1MuBMLUTHandler.h:70
L1MuBMLUTHandler::EX21
Definition: L1MuBMLUTHandler.h:70
L1TMuonBarrelParamsAllPublic
Definition: L1TMuonBarrelParamsAllPublic.h:8
L1MuBMLUTHandler::MAX_PTASSMETH
const int MAX_PTASSMETH
Definition: L1MuBMLUTHandler.h:73
L1MuBMLUTHandler::PB24H
Definition: L1MuBMLUTHandler.h:95
L1MuBMLUTHandler::PT12H
Definition: L1MuBMLUTHandler.h:79
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1MuBMLUTHandler::EX23
Definition: L1MuBMLUTHandler.h:70
L1MuBMLUTHandler::EX56
Definition: L1MuBMLUTHandler.h:70
L1TMuonBarrelParamsAllPublic::pta_threshold
std::vector< int > pta_threshold() const
Definition: L1TMuonBarrelParamsAllPublic.h:28
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52
L1MuBMLUTHandler::PT13H
Definition: L1MuBMLUTHandler.h:81
L1MuBMLUTHandler::MAX_PTASSMETHA
const int MAX_PTASSMETHA
Definition: L1MuBMLUTHandler.h:74
L1MuBMLUTHandler::PT14H
Definition: L1MuBMLUTHandler.h:83