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 | Private Attributes
L1TMuonBarrelParamsESProducer Class Reference
Inheritance diagram for L1TMuonBarrelParamsESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef boost::shared_ptr
< L1TMuonBarrelParams
ReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey,
edm::propagate_const
< std::shared_ptr< DataProxy > > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

int getPtLutThreshold (int, std::vector< int > &) const
 
 L1TMuonBarrelParamsESProducer (const edm::ParameterSet &)
 
int load_ext (std::vector< L1TMuonBarrelParams::LUTParams::extLUT > &, unsigned short int, unsigned short int)
 
int load_phi (std::vector< LUT > &, unsigned short int, unsigned short int, std::string)
 
int load_pt (std::vector< LUT > &, std::vector< int > &, unsigned short int, std::string)
 
ReturnType produce (const L1TMuonBarrelParamsRcd &)
 
 ~L1TMuonBarrelParamsESProducer ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

Private Attributes

L1TMuonBarrelParams m_params
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Definition at line 33 of file L1TMuonBarrelParamsESProducer.cc.

Member Typedef Documentation

Definition at line 42 of file L1TMuonBarrelParamsESProducer.cc.

Constructor & Destructor Documentation

L1TMuonBarrelParamsESProducer::L1TMuonBarrelParamsESProducer ( const edm::ParameterSet iConfig)

Read Pt assignment Luts

Read Phi assignment Luts

Read Extrapolation Luts

Definition at line 60 of file L1TMuonBarrelParamsESProducer.cc.

References EnergyCorrector::c, gather_cfg::cout, stage2BMTFBufferRaw_cfi::fwVersion, edm::ParameterSet::getParameter(), L1TMuonBarrelParams::l1mudttfmasks, load_phi(), load_pt(), m_params, L1TMuonBarrelParams::set_BX_max(), L1TMuonBarrelParams::set_BX_min(), L1TMuonBarrelParams::set_EtaTrackFinder(), L1MuDTTFMasks::set_etsoc_chdis_st1(), L1MuDTTFMasks::set_etsoc_chdis_st2(), L1MuDTTFMasks::set_etsoc_chdis_st3(), L1TMuonBarrelParams::set_Extrapolation_21(), L1TMuonBarrelParams::set_Extrapolation_Filter(), L1TMuonBarrelParams::set_Extrapolation_nbits_Phi(), L1TMuonBarrelParams::set_Extrapolation_nbits_PhiB(), L1MuDTTFMasks::set_inrec_chdis_csc(), L1MuDTTFMasks::set_inrec_chdis_st1(), L1MuDTTFMasks::set_inrec_chdis_st2(), L1MuDTTFMasks::set_inrec_chdis_st3(), L1MuDTTFMasks::set_inrec_chdis_st4(), L1TMuonBarrelParams::set_Open_LUTs(), L1TMuonBarrelParams::set_OutOfTime_Filter(), L1TMuonBarrelParams::set_OutOfTime_Filter_Window(), L1TMuonBarrelParams::set_PHI_Assignment_nbits_Phi(), L1TMuonBarrelParams::set_PHI_Assignment_nbits_PhiB(), L1TMuonBarrelParams::set_PT_Assignment_nbits_Phi(), L1TMuonBarrelParams::set_PT_Assignment_nbits_PhiB(), L1TMuonBarrelParams::setAssLUTPath(), L1TMuonBarrelParams::setFwVersion(), L1TMuonBarrelParams::setphi_lut(), L1TMuonBarrelParams::setpta_lut(), L1TMuonBarrelParams::setpta_threshold(), edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

61 {
62  //the following line is needed to tell the framework what
63  // data is being produced
64  setWhatProduced(this);
65  // Firmware version
66  unsigned fwVersion = iConfig.getParameter<unsigned>("fwVersion");
67 
68  m_params.setFwVersion(fwVersion);
69  //cout<<"FW VERSION "<<fwVersion<<endl;
70  std::string AssLUTpath = iConfig.getParameter<std::string>("AssLUTPath");
71  m_params.setAssLUTPath(AssLUTpath);
72 
73  int PT_Assignment_nbits_Phi = iConfig.getParameter<int>("PT_Assignment_nbits_Phi");
74  int PT_Assignment_nbits_PhiB = iConfig.getParameter<int>("PT_Assignment_nbits_PhiB");
75  int PHI_Assignment_nbits_Phi = iConfig.getParameter<int>("PHI_Assignment_nbits_Phi");
76  int PHI_Assignment_nbits_PhiB = iConfig.getParameter<int>("PHI_Assignment_nbits_PhiB");
77  int Extrapolation_nbits_Phi = iConfig.getParameter<int>("Extrapolation_nbits_Phi");
78  int Extrapolation_nbits_PhiB = iConfig.getParameter<int>("Extrapolation_nbits_PhiB");
79  int BX_min = iConfig.getParameter<int>("BX_min");
80  int BX_max = iConfig.getParameter<int>("BX_max");
81  int Extrapolation_Filter = iConfig.getParameter<int>("Extrapolation_Filter");
82  int OutOfTime_Filter_Window = iConfig.getParameter<int>("OutOfTime_Filter_Window");
83  bool OutOfTime_Filter = iConfig.getParameter<bool>("OutOfTime_Filter");
84  bool Open_LUTs = iConfig.getParameter<bool>("Open_LUTs");
85  bool EtaTrackFinder = iConfig.getParameter<bool>("EtaTrackFinder");
86  bool Extrapolation_21 = iConfig.getParameter<bool>("Extrapolation_21");
87 
88  m_params.set_PT_Assignment_nbits_Phi(PT_Assignment_nbits_Phi);
89  m_params.set_PT_Assignment_nbits_PhiB(PT_Assignment_nbits_PhiB);
90  m_params.set_PHI_Assignment_nbits_Phi(PHI_Assignment_nbits_Phi);
91  m_params.set_PHI_Assignment_nbits_PhiB(PHI_Assignment_nbits_PhiB);
92  m_params.set_Extrapolation_nbits_Phi(Extrapolation_nbits_Phi);
93  m_params.set_Extrapolation_nbits_PhiB(Extrapolation_nbits_PhiB);
94  m_params.set_BX_min(BX_min);
95  m_params.set_BX_max(BX_max);
96  m_params.set_Extrapolation_Filter(Extrapolation_Filter);
97  m_params.set_OutOfTime_Filter_Window(OutOfTime_Filter_Window);
98  m_params.set_OutOfTime_Filter(OutOfTime_Filter);
99  m_params.set_Open_LUTs(Open_LUTs);
100  m_params.set_EtaTrackFinder(EtaTrackFinder);
101  m_params.set_Extrapolation_21(Extrapolation_21);
102 
103 
105  std::vector<LUT> pta_lut; pta_lut.reserve(19);
106  std::vector<int> pta_threshold(10);
107  if ( load_pt(pta_lut,pta_threshold, PT_Assignment_nbits_Phi, AssLUTpath) != 0 ) {
108  cout << "Can not open files to load pt-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
109  }
110  m_params.setpta_lut(pta_lut);
111  m_params.setpta_threshold(pta_threshold);
112 
114  std::vector<LUT> phi_lut; phi_lut.reserve(2);
115  if ( load_phi(phi_lut, PHI_Assignment_nbits_Phi, PHI_Assignment_nbits_PhiB, AssLUTpath) != 0 ) {
116  cout << "Can not open files to load phi-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
117  }
118  m_params.setphi_lut(phi_lut);
119 
120 
122  //std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut(0); ext_lut.reserve(12);
123  //if ( load_ext(ext_lut, PHI_Assignment_nbits_Phi, PHI_Assignment_nbits_PhiB) != 0 ) {
124  // cout << "Can not open files to load extrapolation look-up tables for L1TMuonBarrelTrackProducer!" << endl;
125  //}
126  //m_params.setext_lut(ext_lut);
127  //m_params.l1mudttfparams.set_soc_openlut_extr(1,1,false);
128 
129  std::vector <std::string> mask_phtf_st1 = iConfig.getParameter< std::vector <string> >("mask_phtf_st1");
130  std::vector <std::string> mask_phtf_st2 = iConfig.getParameter< std::vector <string> >("mask_phtf_st2");
131  std::vector <std::string> mask_phtf_st3 = iConfig.getParameter< std::vector <string> >("mask_phtf_st3");
132  std::vector <std::string> mask_phtf_st4 = iConfig.getParameter< std::vector <string> >("mask_phtf_st4");
133 
134  std::vector <std::string> mask_ettf_st1 = iConfig.getParameter< std::vector <string> >("mask_ettf_st1");
135  std::vector <std::string> mask_ettf_st2 = iConfig.getParameter< std::vector <string> >("mask_ettf_st2");
136  std::vector <std::string> mask_ettf_st3 = iConfig.getParameter< std::vector <string> >("mask_ettf_st3");
137 
138  for( int wh=-3; wh<4; wh++ ) {
139  int sec = 0;
140  for(char& c : mask_phtf_st1[wh+3]) {
141  int mask = c - '0';
143  sec++;
144  }
145  sec = 0;
146  for(char& c : mask_phtf_st2[wh+3]) {
147  int mask = c - '0';
149  sec++;
150  }
151  sec = 0;
152  for(char& c : mask_phtf_st3[wh+3]) {
153  int mask = c - '0';
155  sec++;
156  }
157  sec = 0;
158  for(char& c : mask_phtf_st4[wh+3]) {
159  int mask = c - '0';
161  sec++;
162  }
163  sec = 0;
164  for(char& c : mask_ettf_st1[wh+3]) {
165  int mask = c - '0';
167  sec++;
168  }
169  sec = 0;
170  for(char& c : mask_ettf_st2[wh+3]) {
171  int mask = c - '0';
173  sec++;
174  }
175  sec = 0;
176  for(char& c : mask_ettf_st3[wh+3]) {
177  int mask = c - '0';
179  sec++;
180  //Not used in BMTF init to false
182 
183  }
184 
185  }
186  /*
187 cout<<"===="<<endl;
188  for( int wh=-3; wh<4; wh++ ) {
189  for( int sec=0; sec<12; sec++ ) {
190  // m_params.l1mudttfmasks.set_inrec_chdis_st1(wh,sec,false);
191  m_params.l1mudttfmasks.set_inrec_chdis_st2(wh,sec,false);
192  m_params.l1mudttfmasks.set_inrec_chdis_st3(wh,sec,false);
193  m_params.l1mudttfmasks.set_inrec_chdis_st4(wh,sec,false);
194  m_params.l1mudttfmasks.set_etsoc_chdis_st1(wh,sec,false);
195  m_params.l1mudttfmasks.set_etsoc_chdis_st2(wh,sec,false);
196  m_params.l1mudttfmasks.set_etsoc_chdis_st3(wh,sec,false);
197  m_params.l1mudttfmasks.set_inrec_chdis_csc(wh,sec,false);
198 
199  //if(wh==3 || wh==-3) m_params.l1mudttfmasks.set_inrec_chdis_st1(wh,sec,true);
200 
201  }
202  }
203 */
204 
205 
206 }
T getParameter(std::string const &) const
void set_Extrapolation_Filter(int par1)
void set_etsoc_chdis_st1(int wh, int sc, const bool val)
int load_phi(std::vector< LUT > &, unsigned short int, unsigned short int, std::string)
void setAssLUTPath(std::string path)
void set_etsoc_chdis_st2(int wh, int sc, const bool val)
void setFwVersion(unsigned fwVersion)
void set_Extrapolation_nbits_Phi(int par1)
void set_EtaTrackFinder(bool par1)
void setpta_threshold(std::vector< int > ptathresh)
void set_Extrapolation_nbits_PhiB(int par1)
void setpta_lut(std::vector< LUT > ptalut)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void set_Open_LUTs(bool par1)
L1MuDTTFMasks l1mudttfmasks
void set_inrec_chdis_st4(int wh, int sc, const bool val)
void set_Extrapolation_21(bool par1)
int load_pt(std::vector< LUT > &, std::vector< int > &, unsigned short int, std::string)
void set_inrec_chdis_st2(int wh, int sc, const bool val)
void set_PT_Assignment_nbits_PhiB(int par1)
void set_inrec_chdis_st3(int wh, int sc, const bool val)
void set_PT_Assignment_nbits_Phi(int par1)
void set_etsoc_chdis_st3(int wh, int sc, const bool val)
void set_PHI_Assignment_nbits_Phi(int par1)
void setphi_lut(std::vector< LUT > philut)
void set_OutOfTime_Filter_Window(int par1)
void set_PHI_Assignment_nbits_PhiB(int par1)
tuple cout
Definition: gather_cfg.py:145
void set_OutOfTime_Filter(bool par1)
void set_inrec_chdis_csc(int wh, int sc, const bool val)
void set_inrec_chdis_st1(int wh, int sc, const bool val)
L1TMuonBarrelParamsESProducer::~L1TMuonBarrelParamsESProducer ( )

Definition at line 209 of file L1TMuonBarrelParamsESProducer.cc.

210 {
211 
212 }

Member Function Documentation

int L1TMuonBarrelParamsESProducer::getPtLutThreshold ( int  pta_ind,
std::vector< int > &  pta_threshold 
) const

Definition at line 386 of file L1TMuonBarrelParamsESProducer.cc.

References ecal_dqm_sourceclient-live_cfg::cerr.

386  {
387 
388  if ( pta_ind >= 0 && pta_ind < 13/2 ) {
389  return pta_threshold[pta_ind];
390  }
391  else {
392  cerr << "PtaLut::getPtLutThreshold : can not find threshold " << pta_ind << endl;
393  return 0;
394  }
395 
396 }
int L1TMuonBarrelParamsESProducer::load_ext ( std::vector< L1TMuonBarrelParams::LUTParams::extLUT > &  ext_lut,
unsigned short int  nbit_phi,
unsigned short int  nbit_phib 
)

Definition at line 406 of file L1TMuonBarrelParamsESProducer.cc.

References L1TriggerLutFile::close(), EX12, EX13, EX14, EX15, EX16, EX21, EX23, EX24, EX25, EX26, EX34, EX56, mergeVDriftHistosByStation::file, edm::FileInPath::fullPath(), L1TriggerLutFile::good(), L1TMuonBarrelParams::LUTParams::extLUT::high, L1TMuonBarrelParams::LUTParams::extLUT::low, MAX_EXT, contentValuesFiles::number, L1TriggerLutFile::open(), and L1TriggerLutFile::readInteger().

408  {
409 
410  //max. number of Extrapolations
411  const int MAX_EXT = 12;
412 
413  // extrapolation types
414  enum Extrapolation { EX12, EX13, EX14, EX21, EX23, EX24, EX34,
415  EX15, EX16, EX25, EX26, EX56 };
416 
417  // get directory name
418  string defaultPath = "L1TriggerConfig/DTTrackFinder/parameters/";
419  string ext_dir = "L1TriggerData/DTTrackFinder/Ext/";
420  string ext_str = "";
421 
422  // precision : in the look-up tables the following precision is used :
423  // phi ...12 bits (low, high), phib ...10 bits (address)
424  // now convert phi and phib to the required precision
425 
426  int sh_phi = 12 - nbit_phi;
427  int sh_phib = 10 - nbit_phib;
428 
429  // loop over all extrapolations
430  for ( int ext = 0; ext < MAX_EXT; ext++ ) {
431  switch (ext) {
432  case EX12 : ext_str = "ext12"; break;
433  case EX13 : ext_str = "ext13"; break;
434  case EX14 : ext_str = "ext14"; break;
435  case EX21 : ext_str = "ext21"; break;
436  case EX23 : ext_str = "ext23"; break;
437  case EX24 : ext_str = "ext24"; break;
438  case EX34 : ext_str = "ext34"; break;
439  case EX15 : ext_str = "ext15"; break;
440  case EX16 : ext_str = "ext16"; break;
441  case EX25 : ext_str = "ext25"; break;
442  case EX26 : ext_str = "ext26"; break;
443  case EX56 : ext_str = "ext56"; break;
444  }
445 
446  // assemble file name
447  edm::FileInPath lut_f = edm::FileInPath(string(defaultPath + ext_dir + ext_str + ".lut"));
448  string ext_file = lut_f.fullPath();
449 
450  // open file
451  L1TriggerLutFile file(ext_file);
452  if ( file.open() != 0 ) return -1;
453  // if ( L1MuDTTFConfig::Debug(1) ) cout << "Reading file : "
454  // << file.getName() << endl;
455 
457 
458  int number = -1;
459  int adr_old = -512 >> sh_phib;
460  int sum_low = 0;
461  int sum_high = 0;
462 
463  // read values and shift to correct precision
464  while ( file.good() ) {
465 
466  int adr = ( file.readInteger() ) >> sh_phib; // address (phib)
467  int low = ( file.readInteger() ); // low value (phi)
468  int high = ( file.readInteger() ); // high value (phi)
469 
470  number++;
471 
472  if ( adr != adr_old ) {
473 
474  tmplut.low[adr_old] = sum_low >> sh_phi;
475  tmplut.high[adr_old] = sum_high >> sh_phi;
476 
477  adr_old = adr;
478  number = 0;
479  sum_low = 0;
480  sum_high = 0;
481 
482  }
483 
484  if (number == 0) sum_low = low;
485  if (number == 0) sum_high = high;
486 
487  if ( !file.good() ) file.close();
488  }
489 
490  file.close();
491  ext_lut.push_back(tmplut);
492  }
493  return 0;
494 
495 }
const int MAX_EXT
Extrapolation
std::string fullPath() const
Definition: FileInPath.cc:184
int L1TMuonBarrelParamsESProducer::load_phi ( std::vector< LUT > &  phi_lut,
unsigned short int  nbit_phi,
unsigned short int  nbit_phib,
std::string  AssLUTpath 
)

Definition at line 321 of file L1TMuonBarrelParamsESProducer.cc.

References assert(), L1TriggerLutFile::close(), mergeVDriftHistosByStation::file, edm::FileInPath::fullPath(), L1TriggerLutFile::good(), customizeTrackingMonitorSeedNumber::idx, contentValuesFiles::number, L1TriggerLutFile::open(), phi, and L1TriggerLutFile::readInteger().

Referenced by L1TMuonBarrelParamsESProducer().

325  {
326 
327 
328  // precision : in the look-up tables the following precision is used :
329  // address (phib) ...10 bits, phi ... 12 bits
330 
331  int sh_phi = 12 - nbit_phi;
332  int sh_phib = 10 - nbit_phib;
333 
334  string phi_str;
335  // loop over all phi-assignment methods
336  for ( int idx = 0; idx < 2; idx++ ) {
337  switch ( idx ) {
338  case 0 : { phi_str = "phi12"; break; }
339  case 1 : { phi_str = "phi42"; break; }
340  }
341 
342  // assemble file name
343  edm::FileInPath lut_f = edm::FileInPath(string(AssLUTpath + phi_str + ".lut"));
344  string phi_file = lut_f.fullPath();
345 
346  // open file
347  L1TriggerLutFile file(phi_file);
348  if ( file.open() != 0 ) return -1;
349 
350  LUT tmplut;
351 
352  int number = -1;
353  int adr_old = -512 >> sh_phib;
354  int sum_phi = 0;
355 
356  // read values
357  while ( file.good() ) {
358 
359  int adr = (file.readInteger()) >> sh_phib;
360  int phi = file.readInteger();
361 
362  number++;
363 
364  if ( adr != adr_old ) {
365  assert(number);
366  tmplut.insert(make_pair( adr_old, ((sum_phi/number) >> sh_phi) ));
367 
368  adr_old = adr;
369  number = 0;
370  sum_phi = 0;
371  }
372 
373  sum_phi += phi;
374 
375  if ( !file.good() ) file.close();
376 
377  }
378 
379  file.close();
380  phi_lut.push_back(tmplut);
381  }
382  return 0;
383 
384 }
assert(m_qm.get())
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::string fullPath() const
Definition: FileInPath.cc:184
std::vector< unsigned short int > LUT
Definition: DTTracoLUTs.h:32
int L1TMuonBarrelParamsESProducer::load_pt ( std::vector< LUT > &  pta_lut,
std::vector< int > &  pta_threshold,
unsigned short int  nbitphi,
std::string  AssLUTpath 
)

Definition at line 214 of file L1TMuonBarrelParamsESProducer.cc.

References assert(), L1TriggerLutFile::close(), mergeVDriftHistosByStation::file, edm::FileInPath::fullPath(), L1TriggerLutFile::good(), MAX_PTASSMETH, NODEF, contentValuesFiles::number, L1TriggerLutFile::open(), EnergyCorrector::pt, PT12H, PT12L, PT13H, PT13L, PT14H, PT14L, PT23H, PT23L, PT24H, PT24L, PT34H, PT34L, L1TriggerLutFile::readInteger(), edm::shift, and dtDQMClient_cfg::threshold.

Referenced by L1TMuonBarrelParamsESProducer().

218  {
219 
220 
221 // maximal number of pt assignment methods
222 const int MAX_PTASSMETH = 19;
223 const int MAX_PTASSMETHA = 12;
224 
225 // pt assignment methods
228  PB12H, PB13H, PB14H, PB21H, PB23H, PB24H, PB34H,
229  NODEF };
230 
231  // get directory name
232  string pta_str = "";
233  // precision : in the look-up tables the following precision is used :
234  // phi ...12 bits (address) and pt ...5 bits
235  // now convert phi and phib to the required precision
236  int nbit_phi = nbitphi;
237  int sh_phi = 12 - nbit_phi;
238 
239  // loop over all pt-assignment methods
240  for ( int pam = 0; pam < MAX_PTASSMETH; pam++ ) {
241  switch ( pam ) {
242  case PT12L : { pta_str = "pta12l"; break; }
243  case PT12H : { pta_str = "pta12h"; break; }
244  case PT13L : { pta_str = "pta13l"; break; }
245  case PT13H : { pta_str = "pta13h"; break; }
246  case PT14L : { pta_str = "pta14l"; break; }
247  case PT14H : { pta_str = "pta14h"; break; }
248  case PT23L : { pta_str = "pta23l"; break; }
249  case PT23H : { pta_str = "pta23h"; break; }
250  case PT24L : { pta_str = "pta24l"; break; }
251  case PT24H : { pta_str = "pta24h"; break; }
252  case PT34L : { pta_str = "pta34l"; break; }
253  case PT34H : { pta_str = "pta34h"; break; }
254  case PB12H : { pta_str = "ptb12h_Feb2016"; break; }
255  case PB13H : { pta_str = "ptb13h_Feb2016"; break; }
256  case PB14H : { pta_str = "ptb14h_Feb2016"; break; }
257  case PB21H : { pta_str = "ptb21h_Feb2016"; break; }
258  case PB23H : { pta_str = "ptb23h_Feb2016"; break; }
259  case PB24H : { pta_str = "ptb24h_Feb2016"; break; }
260  case PB34H : { pta_str = "ptb34h_Feb2016"; break; }
261 
262  }
263 
264  // assemble file name
265  string lutpath = AssLUTpath;
266  edm::FileInPath lut_f = edm::FileInPath(string(lutpath + pta_str + ".lut"));
267  string pta_file = lut_f.fullPath();
268 
269  // open file
270  L1TriggerLutFile file(pta_file);
271  if ( file.open() != 0 ) return -1;
272 
273  // get the right shift factor
274  int shift = sh_phi;
275  int adr_old = -2048 >> shift;
276  if (pam >= MAX_PTASSMETHA) adr_old = -512 >> shift;
277 
278  LUT tmplut;
279 
280  int number = -1;
281  int sum_pt = 0;
282 
283  if ( file.good() ) {
284  int threshold = file.readInteger();
285  pta_threshold[pam/2] = threshold;
286  }
287 
288  // read values and shift to correct precision
289  while ( file.good() ) {
290 
291  int adr = (file.readInteger()) >> shift;
292  int pt = file.readInteger();
293 
294  number++;
295  //cout<<pam<<" "<<number<<" "<<MAX_PTASSMETHA<<endl;
296  if ( adr != adr_old ) {
297  assert(number);
298  tmplut.insert(make_pair( adr_old, (sum_pt/number) ));
299 
300  adr_old = adr;
301  number = 0;
302  sum_pt = 0;
303  }
304 
305  sum_pt += pt;
306 
307  if ( !file.good() ) file.close();
308 
309  }
310 
311  file.close();
312  pta_lut.push_back(tmplut);
313  }
314  return 0;
315 
316 }
assert(m_qm.get())
static unsigned int const shift
std::string fullPath() const
Definition: FileInPath.cc:184
std::vector< unsigned short int > LUT
Definition: DTTracoLUTs.h:32
const int MAX_PTASSMETH
PtAssMethod
L1TMuonBarrelParamsESProducer::ReturnType L1TMuonBarrelParamsESProducer::produce ( const L1TMuonBarrelParamsRcd iRecord)

Definition at line 504 of file L1TMuonBarrelParamsESProducer.cc.

References m_params.

505 {
506  using namespace edm::es;
507  boost::shared_ptr<L1TMuonBarrelParams> pBMTFParams;
508 
509  pBMTFParams = boost::shared_ptr<L1TMuonBarrelParams>(new L1TMuonBarrelParams(m_params));
510  return pBMTFParams;
511 }

Member Data Documentation

L1TMuonBarrelParams L1TMuonBarrelParamsESProducer::m_params
private

Definition at line 46 of file L1TMuonBarrelParamsESProducer.cc.

Referenced by L1TMuonBarrelParamsESProducer(), and produce().