test
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,
  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 L1TMuonBarrelParamsl1tbmparams
 

Detailed Description

Definition at line 28 of file L1MuBMLUTHandler.h.

Member Enumeration Documentation

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

Definition at line 84 of file L1MuBMLUTHandler.h.

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 169 of file L1MuBMLUTHandler.cc.

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

Referenced by L1MuBMAssignmentUnit::PhiAU().

169  {
170  std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
171  L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[idx].find(address);
172  if ( iter != phi_lut[idx].end() ) {
173  return (*iter).second;
174  }
175  else {
176  cerr << "PhiLut::getDeltaPhi : can not find address " << address << endl;
177  return 0;
178  }
179 
180 }
#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 274 of file L1MuBMLUTHandler.cc.

References ecal_dqm_sourceclient-live_cfg::cerr.

274  {
275 
276  std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
277  L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].high.find(address);
278  if ( iter != ext_lut[ext_ind].high.end() ) {
279  return (*iter).second;
280  }
281  else {
282  cerr << "ExtLut::getHigh : can not find address " << address << endl;
283  return 99999;
284  }
285 }
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 257 of file L1MuBMLUTHandler.cc.

References ecal_dqm_sourceclient-live_cfg::cerr.

257  {
258 
259  std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut = l1tbmparams->ext_lut();
260  L1TMuonBarrelParams::LUT::const_iterator iter = ext_lut[ext_ind].low.find(address);
261  if ( iter != ext_lut[ext_ind].low.end() ) {
262  return (*iter).second;
263  }
264  else {
265  cerr << "ExtLut::getLow : can not find address " << address << endl;
266  return 99999;
267  }
268 }
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 185 of file L1MuBMLUTHandler.cc.

185  {
186 
187  return pair<unsigned short, unsigned short>(l1tbmparams->get_PHI_Assignment_nbits_Phi()
189 
190 }
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 133 of file L1MuBMLUTHandler.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, and end.

Referenced by L1MuBMAssignmentUnit::PtAU().

133  {
134 
135  std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
136 
137  L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pta_ind].find(address);
138  if ( iter != pta_lut[pta_ind].end() ) {
139  //std::cout<<"pta_ind "<<pta_ind<<" address "<<address<<" pt "<<(*iter).second<<std::endl;
140 
141  return (*iter).second;
142  }
143  else {
144  cerr << "PtaLut::getPt : can not find address " << address << endl;
145  return 0;
146  }
147 
148 }
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 154 of file L1MuBMLUTHandler.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, and MAX_PTASSMETH.

Referenced by L1MuBMAssignmentUnit::getPtMethod().

154  {
155 std::vector<int> pta_threshold = l1tbmparams->pta_threshold();
156  if ( pta_ind >= 0 && pta_ind < L1MuBMLUTHandler::MAX_PTASSMETH /2 ) {
157  return pta_threshold[pta_ind];
158  }
159  else {
160  cerr << "PtaLut::getPtLutThreshold : can not find threshold " << pta_ind << endl;
161  return 0;
162  }
163 
164 }
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 291 of file L1MuBMLUTHandler.cc.

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

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

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

197  {
198  unsigned short int nbit_phi = l1tbmparams->get_PHI_Assignment_nbits_Phi();
199  unsigned short int nbit_phib = l1tbmparams->get_PHI_Assignment_nbits_PhiB();
200 
201  cout << endl;
202  cout << "L1 barrel Track Finder Phi-Assignment look-up tables :" << endl;
203  cout << "======================================================" << endl;
204  cout << endl;
205  cout << "Precision : " << endl;
206  cout << '\t' << setw(2) << nbit_phi << " bits are used for phi " << endl;
207  cout << '\t' << setw(2) << nbit_phib << " bits are used for phib " << endl;
208 
209  // loop over all phi-assignment methods
210  for ( int idx = 0; idx < 2; idx++ ) {
211 
212  cout << endl;
213  if ( idx == 0 ) cout << "Phi-Assignment Method : " << "PHI12" << endl;
214  if ( idx == 1 ) cout << "Phi-Assignment Method : " << "PHI42" << endl;
215  cout << "=============================" << endl;
216  cout << endl;
217 
218  cout << " address";
219  for ( int i = 0; i < nbit_phib; i++ ) cout << ' ';
220  cout << " value" << endl;
221  for ( int i = 0; i < nbit_phi + nbit_phib; i++ ) cout << '-';
222  cout << "----------------------" << endl;
223  std::vector<L1TMuonBarrelParams::LUT> phi_lut = l1tbmparams->phi_lut();
224 
225  L1TMuonBarrelParams::LUT::const_iterator iter = phi_lut[idx].begin();
226  while ( iter != phi_lut[idx].end() ) {
227  int address = (*iter).first;
228  int value = (*iter).second;
229 
230  DTTFBitArray<10> b_address(static_cast<unsigned>(abs(address)));
231  DTTFBitArray<12> b_value(static_cast<unsigned>(abs(value)));
232 
233  if ( address < 0 ) b_address.twoComplement();
234  if ( value < 0 ) b_value.twoComplement();
235 
236  cout.setf(ios::right,ios::adjustfield);
237  cout << " " << setbase(10) << setw(5) << address << " (";
238  for ( int i = nbit_phib-1; i >= 0; i-- ) cout << b_address[i];
239  cout << ") " << setw(5) << value << " (";
240  for ( int i = nbit_phi-1; i >= 0; i-- ) cout << b_value[i];
241  cout << ") " << endl;
242 
243  iter++;
244  }
245 
246  }
247 
248  cout << endl;
249 
250 }
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  if (pam >= MAX_PTASSMETHA) maxbits = nbit_phi-2;
95 
96  cout << " address";
97  for ( int i = 0; i < maxbits; i++ ) cout << ' ';
98  cout << " value" << endl;
99  for ( int i = 0; i < maxbits; i++ ) cout << '-';
100  cout << "-------------------------" << endl;
101  std::vector<L1TMuonBarrelParams::LUT> pta_lut = l1tbmparams->pta_lut();
102 
103  L1TMuonBarrelParams::LUT::const_iterator iter = pta_lut[pam].begin();
104  while ( iter != pta_lut[pam].end() ) {
105  int address = (*iter).first;
106  int value = (*iter).second;
107 
108  DTTFBitArray<12> b_address(static_cast<unsigned>(abs(address)));
109  DTTFBitArray<9> b_value(static_cast<unsigned>(abs(value)));
110 
111  if ( address < 0 ) 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-- ) cout << b_address[i];
116  cout << ") " << setw(3) << value << " (";
117  b_value.print();
118  cout << ")" << endl;
119 
120  iter++;
121  }
122 
123  }
124 
125  cout << endl;
126 
127 }
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
const int MAX_PTASSMETHA
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 = 19

Definition at line 80 of file L1MuBMLUTHandler.h.

Referenced by getPtLutThreshold(), and print_pta_lut().

const int L1MuBMLUTHandler::MAX_PTASSMETHA = 12

Definition at line 81 of file L1MuBMLUTHandler.h.