CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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,
  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 = 13
 

Private Attributes

const L1TMuonBarrelParamsl1tbmparams
 

Detailed Description

Definition at line 28 of file L1MuBMLUTHandler.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

L1MuBMLUTHandler::L1MuBMLUTHandler ( const L1TMuonBarrelParams l1params)

constructor

Definition at line 53 of file L1MuBMLUTHandler.cc.

53  {
54  l1tbmparams = &l1params;
55 }
const L1TMuonBarrelParams * l1tbmparams
L1MuBMLUTHandler::~L1MuBMLUTHandler ( )
virtual

destructor

Definition at line 62 of file L1MuBMLUTHandler.cc.

62  {
63 }

Member Function Documentation

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

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

Definition at line 168 of file L1MuBMLUTHandler.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, end, and customizeTrackingMonitorSeedNumber::idx.

Referenced by L1MuBMAssignmentUnit::PhiAU().

168  {
169  std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
170  L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[idx].find(address);
171  if ( iter != phi_lut[idx].end() ) {
172  return (*iter).second;
173  }
174  else {
175  cerr << "PhiLut::getDeltaPhi : can not find address " << address << endl;
176  return 0;
177  }
178 
179 }
#define end
Definition: vmac.h:37
std::vector< LUT > phi_lut() const
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
const L1TMuonBarrelParams * l1tbmparams
int L1MuBMLUTHandler::getHigh ( int  ext_ind,
int  address 
) const

get high_value for a given address

Definition at line 273 of file L1MuBMLUTHandler.cc.

References ecal_dqm_sourceclient-live_cfg::cerr.

273  {
274 
275  std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
276  L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].high.find(address);
277  if ( iter != ext_lut[ext_ind].high.end() ) {
278  return (*iter).second;
279  }
280  else {
281  cerr << "ExtLut::getHigh : can not find address " << address << endl;
282  return 99999;
283  }
284 }
std::vector< LUTParams::extLUT > ext_lut() const
const L1TMuonBarrelParams * l1tbmparams
int L1MuBMLUTHandler::getLow ( int  ext_ind,
int  address 
) const

get low_value for a given address

Definition at line 256 of file L1MuBMLUTHandler.cc.

References ecal_dqm_sourceclient-live_cfg::cerr.

256  {
257 
258  std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
259  L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].low.find(address);
260  if ( iter != ext_lut[ext_ind].low.end() ) {
261  return (*iter).second;
262  }
263  else {
264  cerr << "ExtLut::getLow : can not find address " << address << endl;
265  return 99999;
266  }
267 }
std::vector< LUTParams::extLUT > ext_lut() const
const L1TMuonBarrelParams * l1tbmparams
pair< unsigned short, unsigned short > L1MuBMLUTHandler::getPrecision ( ) const

get precision for look-up tables

Definition at line 184 of file L1MuBMLUTHandler.cc.

184  {
185 
186  return pair<unsigned short, unsigned short>(l1tbmparams->get_PHI_Assignment_nbits_Phi()
188 
189 }
int get_PHI_Assignment_nbits_PhiB() const
int get_PHI_Assignment_nbits_Phi() const
const L1TMuonBarrelParams * l1tbmparams
int L1MuBMLUTHandler::getPt ( int  pta_ind,
int  address 
) const

get pt-value for a given address

Definition at line 132 of file L1MuBMLUTHandler.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, and end.

Referenced by L1MuBMAssignmentUnit::PtAU().

132  {
133 
134  std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
135 
136  L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pta_ind].find(address);
137  if ( iter != pta_lut[pta_ind].end() ) {
138  //std::cout<<"pta_ind "<<pta_ind<<" address "<<address<<" pt "<<(*iter).second<<std::endl;
139 
140  return (*iter).second;
141  }
142  else {
143  cerr << "PtaLut::getPt : can not find address " << address << endl;
144  return 0;
145  }
146 
147 }
std::vector< LUT > pta_lut() const
#define end
Definition: vmac.h:37
const L1TMuonBarrelParams * l1tbmparams
int L1MuBMLUTHandler::getPtLutThreshold ( int  pta_ind) const

get pt-assignment LUT threshold

Definition at line 153 of file L1MuBMLUTHandler.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, and MAX_PTASSMETH.

Referenced by L1MuBMAssignmentUnit::getPtMethod().

153  {
154 std::vector<int> pta_threshold = l1tbmparams->pta_threshold();
155  if ( pta_ind >= 0 && pta_ind < L1MuBMLUTHandler::MAX_PTASSMETH /2 ) {
156  return pta_threshold[pta_ind];
157  }
158  else {
159  cerr << "PtaLut::getPtLutThreshold : can not find threshold " << pta_ind << endl;
160  return 0;
161  }
162 
163 }
const int MAX_PTASSMETH
std::vector< int > pta_threshold() const
const L1TMuonBarrelParams * l1tbmparams
void L1MuBMLUTHandler::print_ext_lut ( ) const

print extrapolation look-up tables

Definition at line 290 of file L1MuBMLUTHandler.cc.

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

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

print phi-assignment look-up tables

Definition at line 196 of file L1MuBMLUTHandler.cc.

References funct::abs(), gather_cfg::cout, end, i, customizeTrackingMonitorSeedNumber::idx, DTTFBitArray< N >::twoComplement(), and relativeConstraints::value.

196  {
197  unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
198  unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
199 
200  cout << endl;
201  cout << "L1 barrel Track Finder Phi-Assignment look-up tables :" << endl;
202  cout << "======================================================" << endl;
203  cout << endl;
204  cout << "Precision : " << endl;
205  cout << '\t' << setw(2) << nbit_phi << " bits are used for phi " << endl;
206  cout << '\t' << setw(2) << nbit_phib << " bits are used for phib " << endl;
207 
208  // loop over all phi-assignment methods
209  for ( int idx = 0; idx < 2; idx++ ) {
210 
211  cout << endl;
212  if ( idx == 0 ) cout << "Phi-Assignment Method : " << "PHI12" << endl;
213  if ( idx == 1 ) cout << "Phi-Assignment Method : " << "PHI42" << endl;
214  cout << "=============================" << endl;
215  cout << endl;
216 
217  cout << " address";
218  for ( int i = 0; i < nbit_phib; i++ ) cout << ' ';
219  cout << " value" << endl;
220  for ( int i = 0; i < nbit_phi + nbit_phib; i++ ) cout << '-';
221  cout << "----------------------" << endl;
222  std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
223 
224  L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[idx].begin();
225  while ( iter != phi_lut[idx].end() ) {
226  int address = (*iter).first;
227  int value = (*iter).second;
228 
229  DTTFBitArray<10> b_address(static_cast<unsigned>(abs(address)));
230  DTTFBitArray<12> b_value(static_cast<unsigned>(abs(value)));
231 
232  if ( address < 0 ) b_address.twoComplement();
233  if ( value < 0 ) b_value.twoComplement();
234 
235  cout.setf(ios::right,ios::adjustfield);
236  cout << " " << setbase(10) << setw(5) << address << " (";
237  for ( int i = nbit_phib-1; i >= 0; i-- ) cout << b_address[i];
238  cout << ") " << setw(5) << value << " (";
239  for ( int i = nbit_phi-1; i >= 0; i-- ) cout << b_value[i];
240  cout << ") " << endl;
241 
242  iter++;
243  }
244 
245  }
246 
247  cout << endl;
248 
249 }
int i
Definition: DBlmapReader.cc:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define end
Definition: vmac.h:37
int get_PHI_Assignment_nbits_PhiB() const
std::vector< LUT > phi_lut() const
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
int get_PHI_Assignment_nbits_Phi() const
const L1TMuonBarrelParams * l1tbmparams
tuple cout
Definition: gather_cfg.py:145
void L1MuBMLUTHandler::print_pta_lut ( ) const

print pt-assignment look-up tables

Definition at line 73 of file L1MuBMLUTHandler.cc.

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

73  {
74  int nbit_phi = l1tbmparams->get_PT_Assignment_nbits_Phi();
75 
76  cout << endl;
77  cout << "L1 barrel Track Finder Pt-Assignment look-up tables :" << endl;
78  cout << "=====================================================" << endl;
79  cout << endl;
80  cout << "Precision : " << endl;
81  cout << '\t' << setw(2) << nbit_phi << " bits are used for phi " << endl;
82 
83  // loop over all pt-assignment methods
84  for ( int pam = 0; pam < L1MuBMLUTHandler::MAX_PTASSMETH; pam++ ) {
85 
86  cout << endl;
87  cout << "Pt-Assignment Method : " << static_cast<L1MuBMLUTHandler::PtAssMethod>(pam) << endl;
88  cout << "============================" << endl;
89  cout << endl;
90 
91  cout << "\t Threshold : " << getPtLutThreshold(pam/2) << endl << endl;
92 
93  int maxbits = nbit_phi;
94 
95  cout << " address";
96  for ( int i = 0; i < maxbits; i++ ) cout << ' ';
97  cout << " value" << endl;
98  for ( int i = 0; i < maxbits; i++ ) 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 ) b_address.twoComplement();
111 
112  cout.setf(ios::right,ios::adjustfield);
113  cout << " " << setbase(10) << setw(9) << address << " (";
114  for ( int i = maxbits-1; i >= 0; i-- ) cout << b_address[i];
115  cout << ") " << setw(3) << value << " (";
116  b_value.print();
117  cout << ")" << endl;
118 
119  iter++;
120  }
121 
122  }
123 
124  cout << endl;
125 
126 }
int i
Definition: DBlmapReader.cc:9
std::vector< LUT > pta_lut() const
int get_PT_Assignment_nbits_Phi() const
const int MAX_PTASSMETH
int getPtLutThreshold(int pta_ind) const
get pt-assignment LUT threshold
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define end
Definition: vmac.h:37
const L1TMuonBarrelParams * l1tbmparams
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

const L1TMuonBarrelParams* L1MuBMLUTHandler::l1tbmparams
private

Definition at line 66 of file L1MuBMLUTHandler.h.

const int L1MuBMLUTHandler::MAX_EXT = 12

Definition at line 73 of file L1MuBMLUTHandler.h.

Referenced by print_ext_lut().

const int L1MuBMLUTHandler::MAX_PTASSMETH = 13

Definition at line 80 of file L1MuBMLUTHandler.h.

Referenced by getPtLutThreshold(), and print_pta_lut().