CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
L1TMuonBarrelParamsHelper Class Reference

#include <L1TMuonBarrelParamsHelper.h>

Inheritance diagram for L1TMuonBarrelParamsHelper:
L1TMuonBarrelParams

Public Member Functions

std::string AssLUTPath () const
 
void configFromDB (l1t::TrigSystem &trgSys)
 
void configFromPy (std::map< std::string, int > &allInts, std::map< std::string, bool > &allBools, std::map< std::string, std::vector< std::string > > allMasks, unsigned int fwVersion, const std::string &AssLUTpath)
 
etaLUT eta_lut () const
 
std::vector< LUTParams::extLUT > ext_lut () const
 
unsigned fwVersion () const
 
int get_BX_max () const
 
int get_BX_min () const
 
bool get_DisableNewAlgo () const
 
bool get_EtaTrackFinder () const
 
bool get_Extrapolation_21 () const
 
int get_Extrapolation_Filter () const
 
int get_Extrapolation_nbits_Phi () const
 
int get_Extrapolation_nbits_PhiB () const
 
bool get_Open_LUTs () const
 
bool get_OutOfTime_Filter () const
 
int get_OutOfTime_Filter_Window () const
 
int get_PHI_Assignment_nbits_Phi () const
 
int get_PHI_Assignment_nbits_PhiB () const
 
int get_PT_Assignment_nbits_Phi () const
 
int get_PT_Assignment_nbits_PhiB () const
 
 L1TMuonBarrelParamsHelper ()
 
 L1TMuonBarrelParamsHelper (const L1TMuonBarrelParams &barrelParams)
 
std::vector< LUTphi_lut () const
 
void print (std::ostream &) const
 
std::vector< LUTpta_lut () const
 
std::vector< int > pta_threshold () const
 
qpLUT qp_lut () const
 
void set_BX_max (int par1)
 
void set_BX_min (int par1)
 
void set_DisableNewAlgo (bool par1)
 
void set_EtaTrackFinder (bool par1)
 
void set_Extrapolation_21 (bool par1)
 
void set_Extrapolation_Filter (int par1)
 
void set_Extrapolation_nbits_Phi (int par1)
 
void set_Extrapolation_nbits_PhiB (int par1)
 
void set_Open_LUTs (bool par1)
 
void set_OutOfTime_Filter (bool par1)
 
void set_OutOfTime_Filter_Window (int par1)
 
void set_PHI_Assignment_nbits_Phi (int par1)
 
void set_PHI_Assignment_nbits_PhiB (int par1)
 
void set_PT_Assignment_nbits_Phi (int par1)
 
void set_PT_Assignment_nbits_PhiB (int par1)
 
void setAssLUTPath (std::string path)
 
void seteta_lut (etaLUT eta_lut)
 
void setext_lut (std::vector< LUTParams::extLUT > extlut)
 
void setFwVersion (unsigned fwVersion)
 
void setphi_lut (std::vector< LUT > philut)
 
void setpta_lut (std::vector< LUT > ptalut)
 
void setpta_threshold (std::vector< int > ptathresh)
 
void setqp_lut (qpLUT qplut)
 
 ~L1TMuonBarrelParamsHelper ()
 
- Public Member Functions inherited from L1TMuonBarrelParams
 L1TMuonBarrelParams ()
 
 ~L1TMuonBarrelParams ()
 

Public Attributes

L1MuDTEtaPatternLut l1mudttfetaplut
 
L1MuDTQualPatternLut l1mudttfqualplut
 friend std::ostream& operator<<(std::ostream& o, const L1TMuonBarrelParams & p) { p.print(o); return o; } More...
 
- Public Attributes inherited from L1TMuonBarrelParams
unsigned fwVersion_
 
L1MuDTTFMasks l1mudttfmasks
 
std::vector< L1MuDTTFMasksl1mudttfmasks_
 
L1MuDTTFParameters l1mudttfparams
 
std::vector< L1MuDTTFParametersl1mudttfparams_
 
LUTParams lutparams_
 
std::vector< Nodepnodes_
 
unsigned version_
 

Private Member Functions

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)
 if configDB More...
 

Private Attributes

l1t::TrigSystem m_trgSys
 

Additional Inherited Members

- Public Types inherited from L1TMuonBarrelParams
enum  { Version = 1 }
 
enum  { CONFIG = 0, NUM_BMTF_PARAM_NODES =2 }
 
enum  {
  PT_Assignment_nbits_Phi, PT_Assignment_nbits_PhiB, PHI_Assignment_nbits_Phi, PHI_Assignment_nbits_PhiB,
  Extrapolation_nbits_Phi, Extrapolation_nbits_PhiB, BX_min, BX_max,
  Extrapolation_Filter, OutOfTime_Filter_Window, OutOfTime_Filter, Open_LUTs,
  EtaTrackFinder, Extrapolation_21, DisableNewAlgo, NUM_CONFIG_PARAMS
}
 
typedef std::map< short,
L1MuDTEtaPattern, std::less
< short > > 
etaLUT
 Eta Pattern LUT. More...
 
typedef std::map< short, short,
std::less< short > > 
LUT
 L1MuBMPtaLut. More...
 
typedef std::pair< short,
std::vector< short > > 
LUTCONT
 
typedef std::pair< short, short > LUTID
 Qual Pattern LUT. More...
 
typedef std::map< LUTID, LUTCONTqpLUT
 

Detailed Description

Definition at line 32 of file L1TMuonBarrelParamsHelper.h.

Constructor & Destructor Documentation

L1TMuonBarrelParamsHelper::L1TMuonBarrelParamsHelper ( )
inline

Definition at line 35 of file L1TMuonBarrelParamsHelper.h.

L1TMuonBarrelParamsHelper::L1TMuonBarrelParamsHelper ( const L1TMuonBarrelParams barrelParams)

Definition at line 10 of file L1TMuonBarrelParamsHelper.cc.

10  : L1TMuonBarrelParams(barrelParams) //: L1TMuonBarrelParams_PUBLIC(cast_to_L1TMuonBarrelParams_PUBLIC(barrelParams)) //: m_params_helper(barrelParams)
11 {
12 // if (pnodes_.size() != 2)
13 // pnodes_.resize(2);
14 
15 }
L1TMuonBarrelParamsHelper::~L1TMuonBarrelParamsHelper ( )
inline

Definition at line 38 of file L1TMuonBarrelParamsHelper.h.

38 {};

Member Function Documentation

std::string L1TMuonBarrelParamsHelper::AssLUTPath ( ) const
inline

Definition at line 45 of file L1TMuonBarrelParamsHelper.h.

References L1TMuonBarrelParams::CONFIG, and L1TMuonBarrelParams::pnodes_.

45 { return pnodes_[CONFIG].sparams_.size() > 0 ? pnodes_[CONFIG].sparams_[0] : ""; }
std::vector< Node > pnodes_
void L1TMuonBarrelParamsHelper::configFromDB ( l1t::TrigSystem trgSys)

Converts the last bit from str to int

All bits must be the same

if register path

for masks

for it tRow

for it procRole

Definition at line 123 of file L1TMuonBarrelParamsHelper.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, l1t::TrigSystem::getProcRole(), l1t::TrigSystem::getSettings(), L1TMuonBarrelParams::l1mudttfmasks, visualization-live-secondInstance_cfg::m, masks, NULL, set_DisableNewAlgo(), L1MuDTTFMasks::set_etsoc_chdis_st1(), L1MuDTTFMasks::set_etsoc_chdis_st2(), L1MuDTTFMasks::set_etsoc_chdis_st3(), set_Extrapolation_21(), L1MuDTTFMasks::set_inrec_chdis_st1(), L1MuDTTFMasks::set_inrec_chdis_st2(), L1MuDTTFMasks::set_inrec_chdis_st3(), L1MuDTTFMasks::set_inrec_chdis_st4(), set_Open_LUTs(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by L1TMuonBarrelParamsESProducer::L1TMuonBarrelParamsESProducer(), and L1TMuonBarrelParamsOnlineProd::newObject().

124 {
125  std::map<std::string, std::string> procRole = trgSys.getProcRole();
126 
127  for(auto it_proc=procRole.begin(); it_proc!=procRole.end(); it_proc++ )
128  {
129 
130  std::string procId = it_proc->first;
131 
132  std::map<std::string, l1t::Setting> settings = trgSys.getSettings(procId);
133  std::vector<l1t::TableRow> tRow = settings["regTable"].getTableRows();
134  for(auto it=tRow.begin(); it!=tRow.end(); it++)
135  {
136  if (it->getRowValue<std::string>("register_path").find("open_lut") != std::string::npos){
137  //std::cout << "Value is: " << it->getRowValue<bool>("register_value") << std::endl;
138  set_Open_LUTs(it->getRowValue<bool>("register_value"));
139  }
140  if (it->getRowValue<std::string>("register_path").find("sel_21") != std::string::npos){
141  //std::cout << "Value is: " << it->getRowValue<bool>("register_value") << std::endl;
142  set_Extrapolation_21(it->getRowValue<bool>("register_value"));
143  }
144 
145  if (it->getRowValue<std::string>("register_path").find("dis_newalgo") != std::string::npos){
146  //std::cout << "Value is: " << it->getRowValue<int>("register_value") << std::endl;
147  //int fwv = (it->getRowValue<int>("register_value")==1) ? 1 : 2;
148  //setFwVersion(fwv);
149  bool disnewalgo = (it->getRowValue<int>("register_value")==1);
150  set_DisableNewAlgo(disnewalgo);
151  }
152 
153  string masks[5] = {"mask_ctrl_N2", "mask_ctrl_N1", "mask_ctrl_0", "mask_ctrl_P1", "mask_ctrl_P2"};
154 
155  for(int m=0; m<5; m++)
156  {
157 
158  if (it->getRowValue<std::string>("register_path").find(masks[m]) != std::string::npos){
159  string mask_ctrl = it->getRowValue<string>("register_value");
160  const char *hexstring = mask_ctrl.c_str();
162  int mask = (int)strtol((hexstring+7), NULL, 16);
163  int mask_all = (int)strtol((hexstring), NULL, 16);
165  if(!( mask_all==0x111111 || mask_all==0x222222 || mask_all==0x333333 || mask_all==0x444444 ||
166  mask_all==0x555555 || mask_all==0x666666 || mask_all==0x777777) )
167  cerr<<"BMTF: Cannot re-emulate properly. Individual link masking cannot be handled."<<endl;
168 
169  if((mask&1)>0) {
170  for(int sec=0; sec<12; sec++){
171  if(masks[m]=="mask_ctrl_N2"){
172  l1mudttfmasks.set_inrec_chdis_st1(-3,sec,true);
173  l1mudttfmasks.set_etsoc_chdis_st1(-3,sec,true);
174  }
175  if(masks[m]=="mask_ctrl_N1"){
176  l1mudttfmasks.set_inrec_chdis_st1(-2,sec,true);
177  l1mudttfmasks.set_etsoc_chdis_st1(-2,sec,true);
178  }
179 
180  if(masks[m]=="mask_ctrl_0"){
181  l1mudttfmasks.set_inrec_chdis_st1(-1,sec,true);
183  l1mudttfmasks.set_etsoc_chdis_st1(-1,sec,true);
185  }
186  if(masks[m]=="mask_ctrl_P1"){
189  }
190  if(masks[m]=="mask_ctrl_P2"){
193  }
194  }
195 
196  }
197 
198  if((mask&2)>0) {
199  for(int sec=0; sec<12; sec++){
200  if(masks[m]=="mask_ctrl_N2"){
201  l1mudttfmasks.set_inrec_chdis_st2(-3,sec,true);
202  l1mudttfmasks.set_etsoc_chdis_st2(-3,sec,true);
203  }
204  if(masks[m]=="mask_ctrl_N1"){
205  l1mudttfmasks.set_inrec_chdis_st2(-2,sec,true);
206  l1mudttfmasks.set_etsoc_chdis_st2(-2,sec,true);
207  }
208 
209  if(masks[m]=="mask_ctrl_0"){
210  l1mudttfmasks.set_inrec_chdis_st2(-1,sec,true);
212  l1mudttfmasks.set_etsoc_chdis_st2(-1,sec,true);
214  }
215  if(masks[m]=="mask_ctrl_P1"){
218  }
219  if(masks[m]=="mask_ctrl_P2"){
222  }
223  }
224  }
225 
226  if((mask&4)>0) {
227  for(int sec=0; sec<12; sec++){
228  if(masks[m]=="mask_ctrl_N2"){
229  l1mudttfmasks.set_inrec_chdis_st3(-3,sec,true);
230  l1mudttfmasks.set_etsoc_chdis_st3(-3,sec,true);
231  }
232  if(masks[m]=="mask_ctrl_N1"){
233  l1mudttfmasks.set_inrec_chdis_st3(-2,sec,true);
234  l1mudttfmasks.set_etsoc_chdis_st3(-2,sec,true);
235  }
236 
237  if(masks[m]=="mask_ctrl_0"){
238  l1mudttfmasks.set_inrec_chdis_st3(-1,sec,true);
240  l1mudttfmasks.set_etsoc_chdis_st3(-1,sec,true);
242  }
243  if(masks[m]=="mask_ctrl_P1"){
246  }
247  if(masks[m]=="mask_ctrl_P2"){
250  }
251  }
252  }
253 
254  if((mask&8)>0) {
255  for(int sec=0; sec<12; sec++){
256  if(masks[m]=="mask_ctrl_N2"){
257  l1mudttfmasks.set_inrec_chdis_st4(-3,sec,true);
258  }
259  if(masks[m]=="mask_ctrl_N1"){
260  l1mudttfmasks.set_inrec_chdis_st4(-2,sec,true);
261  }
262 
263  if(masks[m]=="mask_ctrl_0"){
264  l1mudttfmasks.set_inrec_chdis_st4(-1,sec,true);
266  }
267  if(masks[m]=="mask_ctrl_P1"){
269  }
270  if(masks[m]=="mask_ctrl_P2"){
272  }
273  }
274  }
275  }
276  }
277  }
278  }
279 }
const std::map< std::string, std::string > & getProcRole()
Definition: TrigSystem.h:31
void set_etsoc_chdis_st1(int wh, int sc, const bool val)
void set_etsoc_chdis_st2(int wh, int sc, const bool val)
#define NULL
Definition: scimark2.h:8
L1MuDTTFMasks l1mudttfmasks
void set_inrec_chdis_st4(int wh, int sc, const bool val)
std::map< std::string, Setting > getSettings(const std::string &processor)
Definition: TrigSystem.cc:179
void set_inrec_chdis_st2(int wh, int sc, const bool val)
void set_inrec_chdis_st3(int wh, int sc, const bool val)
void set_etsoc_chdis_st3(int wh, int sc, const bool val)
constexpr uint32_t masks[]
Definition: CaloRecHit.cc:12
void set_inrec_chdis_st1(int wh, int sc, const bool val)
void L1TMuonBarrelParamsHelper::configFromPy ( std::map< std::string, int > &  allInts,
std::map< std::string, bool > &  allBools,
std::map< std::string, std::vector< std::string > >  allMasks,
unsigned int  fwVersion,
const std::string &  AssLUTpath 
)

Read Pt assignment Luts

Read Phi assignment Luts

Read Extrapolation Luts

Definition at line 17 of file L1TMuonBarrelParamsHelper.cc.

References EnergyCorrector::c, gather_cfg::cout, L1TMuonBarrelParams::LUTParams::eta_lut_, ext_lut(), l1mudttfetaplut, L1TMuonBarrelParams::l1mudttfmasks, L1TMuonBarrelParams::l1mudttfparams, l1mudttfqualplut, L1MuDTEtaPatternLut::load(), L1MuDTQualPatternLut::load(), load_ext(), load_phi(), load_pt(), L1TMuonBarrelParams::lutparams_, L1MuDTEtaPatternLut::m_lut, L1MuDTQualPatternLut::m_lut, phi_lut(), pta_lut(), pta_threshold(), L1TMuonBarrelParams::LUTParams::qp_lut_, L1MuDTTFParameters::reset(), set_BX_max(), set_BX_min(), set_DisableNewAlgo(), set_EtaTrackFinder(), L1MuDTTFMasks::set_etsoc_chdis_st1(), L1MuDTTFMasks::set_etsoc_chdis_st2(), L1MuDTTFMasks::set_etsoc_chdis_st3(), set_Extrapolation_21(), set_Extrapolation_Filter(), set_Extrapolation_nbits_Phi(), 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(), set_Open_LUTs(), set_OutOfTime_Filter(), set_OutOfTime_Filter_Window(), set_PHI_Assignment_nbits_Phi(), set_PHI_Assignment_nbits_PhiB(), set_PT_Assignment_nbits_Phi(), set_PT_Assignment_nbits_PhiB(), setAssLUTPath(), setext_lut(), setFwVersion(), setphi_lut(), setpta_lut(), and setpta_threshold().

Referenced by L1TMuonBarrelParamsESProducer::L1TMuonBarrelParamsESProducer().

18 {
19  set_PT_Assignment_nbits_Phi(allInts["PT_Assignment_nbits_Phi"]);
20  set_PT_Assignment_nbits_PhiB(allInts["PT_Assignment_nbits_PhiB"]);
21  set_PHI_Assignment_nbits_Phi(allInts["PHI_Assignment_nbits_Phi"]);
22  set_PHI_Assignment_nbits_PhiB(allInts["PHI_Assignment_nbits_PhiB"]);
23  set_Extrapolation_nbits_Phi(allInts["Extrapolation_nbits_Phi"]);
24  set_Extrapolation_nbits_PhiB(allInts["Extrapolation_nbits_PhiB"]);
25  set_BX_min(allInts["BX_min"]);
26  set_BX_max(allInts["BX_max"]);
27  set_Extrapolation_Filter(allInts["Extrapolation_Filter"]);
28  set_OutOfTime_Filter_Window(allInts["OutOfTime_Filter_Window"]);
29  set_OutOfTime_Filter(allBools["OutOfTime_Filter"]);
30  set_Open_LUTs(allBools["Open_LUTs"]);
31  set_EtaTrackFinder(allBools["EtaTrackFinder"]);
32  set_Extrapolation_21(allBools["Extrapolation_21"]);
34  set_DisableNewAlgo(allBools["DisableNewAlgo"]);
35 
36  setAssLUTPath(AssLUTpath);
38  std::vector<LUT> pta_lut(0); pta_lut.reserve(19);
39  std::vector<int> pta_threshold(10);
40  if ( load_pt(pta_lut,pta_threshold, allInts["PT_Assignment_nbits_Phi"], AssLUTpath) != 0 ) {
41  cout << "Can not open files to load pt-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
42  }
45 
47  std::vector<LUT> phi_lut(0); phi_lut.reserve(2);
48  if ( load_phi(phi_lut, allInts["PHI_Assignment_nbits_Phi"], allInts["PHI_Assignment_nbits_PhiB"], AssLUTpath) != 0 ) {
49  cout << "Can not open files to load phi-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
50  }
52 
53 
54 
55 
56  l1mudttfparams.reset(); //KK
57  l1mudttfqualplut.load(); //KK: Do these LUTs ever change and is it safe to initialize it from the release files like that?
58  l1mudttfetaplut.load(); //KK
59  // the data members of the Helper class loaded above are transient, push those to the persistent storage of the base class:
62 
63 
64  for( int wh=-3; wh<4; wh++ ) {
65  int sec = 0;
66  for(char& c : allMasks["mask_phtf_st1"].at(wh+3) ) {
67  int mask = c - '0';
69  sec++;
70  }
71  sec = 0;
72  for(char& c : allMasks["mask_phtf_st2"].at(wh+3) ) {
73  int mask = c - '0';
75  sec++;
76  }
77  sec = 0;
78  for(char& c : allMasks["mask_phtf_st3"].at(wh+3) ) {
79  int mask = c - '0';
81  sec++;
82  }
83  sec = 0;
84  for(char& c : allMasks["mask_phtf_st4"].at(wh+3) ) {
85  int mask = c - '0';
87  sec++;
88  }
89  sec = 0;
90  for(char& c : allMasks["mask_ettf_st1"].at(wh+3) ) {
91  int mask = c - '0';
93  sec++;
94  }
95  sec = 0;
96  for(char& c : allMasks["mask_ettf_st2"].at(wh+3) ) {
97  int mask = c - '0';
99  sec++;
100  }
101  sec = 0;
102  for(char& c : allMasks["mask_ettf_st3"].at(wh+3) ) {
103  int mask = c - '0';
104  l1mudttfmasks.set_etsoc_chdis_st3(wh,sec,mask);
105  //Not used in BMTF - mask
106  l1mudttfmasks.set_inrec_chdis_csc(wh,sec,true);
107  sec++;
108  }
109 
110  }
111 
112 
114  std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut(0); ext_lut.reserve(12);
115  if ( load_ext(ext_lut, allInts["PHI_Assignment_nbits_Phi"], allInts["PHI_Assignment_nbits_PhiB"]) != 0 ) {
116  cout << "Can not open files to load extrapolation look-up tables for L1TMuonBarrelTrackProducer!" << endl;
117  }
119 
120  //l1mudttfextlut.load();
121 }
L1MuDTTFParameters l1mudttfparams
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)
std::vector< LUT > phi_lut() const
void set_etsoc_chdis_st2(int wh, int sc, const bool val)
int load()
load pattern look-up table
std::vector< LUT > pta_lut() const
std::vector< int > pta_threshold() const
std::vector< LUTParams::extLUT > ext_lut() const
void setphi_lut(std::vector< LUT > philut)
int load_ext(std::vector< L1TMuonBarrelParams::LUTParams::extLUT > &, unsigned short int, unsigned short int)
L1MuDTTFMasks l1mudttfmasks
void setpta_lut(std::vector< LUT > ptalut)
void set_inrec_chdis_st4(int wh, int sc, const bool val)
int load_pt(std::vector< LUT > &, std::vector< int > &, unsigned short int, std::string)
if configDB
int load()
load look-up tables
void reset()
reset parameters to zero
void setAssLUTPath(std::string path)
L1MuDTQualPatternLut l1mudttfqualplut
friend std::ostream&amp; operator&lt;&lt;(std::ostream&amp; o, const L1TMuonBarrelParams &amp; p) { p...
void set_inrec_chdis_st2(int wh, int sc, const bool val)
void set_inrec_chdis_st3(int wh, int sc, const bool val)
void setFwVersion(unsigned fwVersion)
void set_etsoc_chdis_st3(int wh, int sc, const bool val)
void setext_lut(std::vector< LUTParams::extLUT > extlut)
tuple cout
Definition: gather_cfg.py:145
void setpta_threshold(std::vector< int > ptathresh)
void set_inrec_chdis_csc(int wh, int sc, const bool val)
void set_inrec_chdis_st1(int wh, int sc, const bool val)
etaLUT L1TMuonBarrelParamsHelper::eta_lut ( ) const
inline
std::vector<LUTParams::extLUT> L1TMuonBarrelParamsHelper::ext_lut ( ) const
inline
unsigned L1TMuonBarrelParamsHelper::fwVersion ( ) const
inline

Definition at line 102 of file L1TMuonBarrelParamsHelper.h.

References L1TMuonBarrelParams::fwVersion_.

Referenced by setFwVersion().

102 { return fwVersion_; }
int L1TMuonBarrelParamsHelper::get_BX_max ( ) const
inline
int L1TMuonBarrelParamsHelper::get_BX_min ( ) const
inline
bool L1TMuonBarrelParamsHelper::get_DisableNewAlgo ( ) const
inline
bool L1TMuonBarrelParamsHelper::get_EtaTrackFinder ( ) const
inline
bool L1TMuonBarrelParamsHelper::get_Extrapolation_21 ( ) const
inline
int L1TMuonBarrelParamsHelper::get_Extrapolation_Filter ( ) const
inline
int L1TMuonBarrelParamsHelper::get_Extrapolation_nbits_Phi ( ) const
inline
int L1TMuonBarrelParamsHelper::get_Extrapolation_nbits_PhiB ( ) const
inline
bool L1TMuonBarrelParamsHelper::get_Open_LUTs ( ) const
inline
bool L1TMuonBarrelParamsHelper::get_OutOfTime_Filter ( ) const
inline
int L1TMuonBarrelParamsHelper::get_OutOfTime_Filter_Window ( ) const
inline
int L1TMuonBarrelParamsHelper::get_PHI_Assignment_nbits_Phi ( ) const
inline
int L1TMuonBarrelParamsHelper::get_PHI_Assignment_nbits_PhiB ( ) const
inline
int L1TMuonBarrelParamsHelper::get_PT_Assignment_nbits_Phi ( ) const
inline
int L1TMuonBarrelParamsHelper::get_PT_Assignment_nbits_PhiB ( ) const
inline
int L1TMuonBarrelParamsHelper::load_ext ( std::vector< L1TMuonBarrelParams::LUTParams::extLUT > &  ext_lut,
unsigned short int  nbit_phi,
unsigned short int  nbit_phib 
)
private

Definition at line 474 of file L1TMuonBarrelParamsHelper.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().

Referenced by configFromPy().

476  {
477 
478  //max. number of Extrapolations
479  const int MAX_EXT = 12;
480 
481  // extrapolation types
482  enum Extrapolation { EX12, EX13, EX14, EX21, EX23, EX24, EX34,
483  EX15, EX16, EX25, EX26, EX56 };
484 
485  // get directory name
486  string defaultPath = "L1Trigger/L1TMuon/data/bmtf_luts/";
487  string ext_dir = "LUTs_Ext/";
488  string ext_str = "";
489 
490  // precision : in the look-up tables the following precision is used :
491  // phi ...12 bits (low, high), phib ...10 bits (address)
492  // now convert phi and phib to the required precision
493 
494  int sh_phi = 12 - nbit_phi;
495  int sh_phib = 10 - nbit_phib;
496 
497  // loop over all extrapolations
498  for ( int ext = 0; ext < MAX_EXT; ext++ ) {
499  switch (ext) {
500  case EX12 : ext_str = "ext12"; break;
501  case EX13 : ext_str = "ext13"; break;
502  case EX14 : ext_str = "ext14"; break;
503  case EX21 : ext_str = "ext21"; break;
504  case EX23 : ext_str = "ext23"; break;
505  case EX24 : ext_str = "ext24"; break;
506  case EX34 : ext_str = "ext34"; break;
507  case EX15 : ext_str = "ext15"; break;
508  case EX16 : ext_str = "ext16"; break;
509  case EX25 : ext_str = "ext25"; break;
510  case EX26 : ext_str = "ext26"; break;
511  case EX56 : ext_str = "ext56"; break;
512  }
513 
514  // assemble file name
515  edm::FileInPath lut_f = edm::FileInPath(string(defaultPath + ext_dir + ext_str + ".lut"));
516  string ext_file = lut_f.fullPath();
517 
518  // open file
519  L1TriggerLutFile file(ext_file);
520  if ( file.open() != 0 ) return -1;
521  // if ( L1MuDTTFConfig::Debug(1) ) cout << "Reading file : "
522  // << file.getName() << endl;
523 
525 
526  int number = -1;
527  int adr_old = -512 >> sh_phib;
528  int sum_low = 0;
529  int sum_high = 0;
530 
531  // read values and shift to correct precision
532  while ( file.good() ) {
533 
534  int adr = ( file.readInteger() ) >> sh_phib; // address (phib)
535  int low = ( file.readInteger() ); // low value (phi)
536  int high = ( file.readInteger() ); // high value (phi)
537 
538  number++;
539 
540  if ( adr != adr_old ) {
541 
542  tmplut.low[adr_old] = sum_low >> sh_phi;
543  tmplut.high[adr_old] = sum_high >> sh_phi;
544 
545  adr_old = adr;
546  number = 0;
547  sum_low = 0;
548  sum_high = 0;
549 
550  }
551 
552  if (number == 0) sum_low = low;
553  if (number == 0) sum_high = high;
554 
555  if ( !file.good() ) file.close();
556  }
557 
558  file.close();
559  ext_lut.push_back(tmplut);
560  }
561  return 0;
562 
563 }
std::vector< LUTParams::extLUT > ext_lut() const
const int MAX_EXT
Extrapolation
std::string fullPath() const
Definition: FileInPath.cc:184
int L1TMuonBarrelParamsHelper::load_phi ( std::vector< LUT > &  phi_lut,
unsigned short int  nbit_phi,
unsigned short int  nbit_phib,
std::string  AssLUTpath 
)
private

Definition at line 388 of file L1TMuonBarrelParamsHelper.cc.

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

Referenced by configFromPy().

392  {
393 
394 
395  // precision : in the look-up tables the following precision is used :
396  // address (phib) ...10 bits, phi ... 12 bits
397 
398  int sh_phi = 12 - nbit_phi;
399  int sh_phib = 10 - nbit_phib;
400 
401  string phi_str;
402  // loop over all phi-assignment methods
403  for ( int idx = 0; idx < 2; idx++ ) {
404  switch ( idx ) {
405  case 0 : { phi_str = "phi12"; break; }
406  case 1 : { phi_str = "phi42"; break; }
407  }
408 
409  // assemble file name
410  edm::FileInPath lut_f = edm::FileInPath(string(AssLUTpath + phi_str + ".lut"));
411  string phi_file = lut_f.fullPath();
412 
413  // open file
414  L1TriggerLutFile file(phi_file);
415  if ( file.open() != 0 ) return -1;
416 
417  LUT tmplut;
418 
419  int number = -1;
420  int adr_old = -512 >> sh_phib;
421  int sum_phi = 0;
422 
423  // read values
424  while ( file.good() ) {
425 
426  int adr = (file.readInteger()) >> sh_phib;
427  int phi = file.readInteger();
428 
429  number++;
430 
431  if ( adr != adr_old ) {
432  assert(number);
433  tmplut.insert(make_pair( adr_old, ((sum_phi/number) >> sh_phi) ));
434 
435  adr_old = adr;
436  number = 0;
437  sum_phi = 0;
438  }
439 
440  sum_phi += phi;
441 
442  if ( !file.good() ) file.close();
443 
444  }
445 
446  file.close();
447  phi_lut.push_back(tmplut);
448  }
449  return 0;
450 
451 }
std::vector< LUT > phi_lut() const
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 L1TMuonBarrelParamsHelper::load_pt ( std::vector< LUT > &  pta_lut,
std::vector< int > &  pta_threshold,
unsigned short int  nbitphi,
std::string  AssLUTpath 
)
private

if configDB

Definition at line 281 of file L1TMuonBarrelParamsHelper.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 configFromPy().

285  {
286 
287 
288 // maximal number of pt assignment methods
289 const int MAX_PTASSMETH = 19;
290 const int MAX_PTASSMETHA = 12;
291 
292 // pt assignment methods
295  PB12H, PB13H, PB14H, PB21H, PB23H, PB24H, PB34H,
296  NODEF };
297 
298  // get directory name
299  string pta_str = "";
300  // precision : in the look-up tables the following precision is used :
301  // phi ...12 bits (address) and pt ...5 bits
302  // now convert phi and phib to the required precision
303  int nbit_phi = nbitphi;
304  int sh_phi = 12 - nbit_phi;
305 
306  // loop over all pt-assignment methods
307  for ( int pam = 0; pam < MAX_PTASSMETH; pam++ ) {
308  switch ( pam ) {
309  case PT12L : { pta_str = "pta12l"; break; }
310  case PT12H : { pta_str = "pta12h"; break; }
311  case PT13L : { pta_str = "pta13l"; break; }
312  case PT13H : { pta_str = "pta13h"; break; }
313  case PT14L : { pta_str = "pta14l"; break; }
314  case PT14H : { pta_str = "pta14h"; break; }
315  case PT23L : { pta_str = "pta23l"; break; }
316  case PT23H : { pta_str = "pta23h"; break; }
317  case PT24L : { pta_str = "pta24l"; break; }
318  case PT24H : { pta_str = "pta24h"; break; }
319  case PT34L : { pta_str = "pta34l"; break; }
320  case PT34H : { pta_str = "pta34h"; break; }
321  case PB12H : { pta_str = "ptb12h_Feb2016"; break; }
322  case PB13H : { pta_str = "ptb13h_Feb2016"; break; }
323  case PB14H : { pta_str = "ptb14h_Feb2016"; break; }
324  case PB21H : { pta_str = "ptb21h_Feb2016"; break; }
325  case PB23H : { pta_str = "ptb23h_Feb2016"; break; }
326  case PB24H : { pta_str = "ptb24h_Feb2016"; break; }
327  case PB34H : { pta_str = "ptb34h_Feb2016"; break; }
328 
329  }
330 
331  // assemble file name
332  string lutpath = AssLUTpath;
333  edm::FileInPath lut_f = edm::FileInPath(string(lutpath + pta_str + ".lut"));
334  string pta_file = lut_f.fullPath();
335 
336  // open file
337  L1TriggerLutFile file(pta_file);
338  if ( file.open() != 0 ) return -1;
339 
340  // get the right shift factor
341  int shift = sh_phi;
342  int adr_old = -2048 >> shift;
343  if (pam >= MAX_PTASSMETHA) adr_old = -512 >> shift;
344 
345  LUT tmplut;
346 
347  int number = -1;
348  int sum_pt = 0;
349 
350  if ( file.good() ) {
351  int threshold = file.readInteger();
352  pta_threshold[pam/2] = threshold;
353  }
354 
355  // read values and shift to correct precision
356  while ( file.good() ) {
357 
358  int adr = (file.readInteger()) >> shift;
359  int pt = file.readInteger();
360 
361  number++;
362  //cout<<pam<<" "<<number<<" "<<MAX_PTASSMETHA<<endl;
363  if ( adr != adr_old ) {
364  assert(number);
365  tmplut.insert(make_pair( adr_old, (sum_pt/number) ));
366 
367  adr_old = adr;
368  number = 0;
369  sum_pt = 0;
370  }
371 
372  sum_pt += pt;
373 
374  if ( !file.good() ) file.close();
375 
376  }
377 
378  file.close();
379  pta_lut.push_back(tmplut);
380  }
381  return 0;
382 
383 }
assert(m_qm.get())
std::vector< LUT > pta_lut() const
std::vector< int > pta_threshold() const
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
std::vector<LUT> L1TMuonBarrelParamsHelper::phi_lut ( ) const
inline
void L1TMuonBarrelParamsHelper::print ( std::ostream &  out) const

Definition at line 3 of file L1TMuonBarrelParamsHelper.cc.

References L1TMuonBarrelParams::fwVersion_.

3  {
4 
5  out << "L1 BMTF Parameters" << std::endl;
6 
7  out << "Firmware version: " << fwVersion_ << std::endl;
8 }
std::vector<LUT> L1TMuonBarrelParamsHelper::pta_lut ( ) const
inline
std::vector<int> L1TMuonBarrelParamsHelper::pta_threshold ( ) const
inline
qpLUT L1TMuonBarrelParamsHelper::qp_lut ( ) const
inline
void L1TMuonBarrelParamsHelper::set_BX_max ( int  par1)
inline
void L1TMuonBarrelParamsHelper::set_BX_min ( int  par1)
inline
void L1TMuonBarrelParamsHelper::set_DisableNewAlgo ( bool  par1)
inline
void L1TMuonBarrelParamsHelper::set_EtaTrackFinder ( bool  par1)
inline
void L1TMuonBarrelParamsHelper::set_Extrapolation_21 ( bool  par1)
inline
void L1TMuonBarrelParamsHelper::set_Extrapolation_Filter ( int  par1)
inline
void L1TMuonBarrelParamsHelper::set_Extrapolation_nbits_Phi ( int  par1)
inline
void L1TMuonBarrelParamsHelper::set_Extrapolation_nbits_PhiB ( int  par1)
inline
void L1TMuonBarrelParamsHelper::set_Open_LUTs ( bool  par1)
inline
void L1TMuonBarrelParamsHelper::set_OutOfTime_Filter ( bool  par1)
inline
void L1TMuonBarrelParamsHelper::set_OutOfTime_Filter_Window ( int  par1)
inline
void L1TMuonBarrelParamsHelper::set_PHI_Assignment_nbits_Phi ( int  par1)
inline
void L1TMuonBarrelParamsHelper::set_PHI_Assignment_nbits_PhiB ( int  par1)
inline
void L1TMuonBarrelParamsHelper::set_PT_Assignment_nbits_Phi ( int  par1)
inline
void L1TMuonBarrelParamsHelper::set_PT_Assignment_nbits_PhiB ( int  par1)
inline
void L1TMuonBarrelParamsHelper::setAssLUTPath ( std::string  path)
inline
void L1TMuonBarrelParamsHelper::seteta_lut ( etaLUT  eta_lut)
inline
void L1TMuonBarrelParamsHelper::setext_lut ( std::vector< LUTParams::extLUT >  extlut)
inline
void L1TMuonBarrelParamsHelper::setFwVersion ( unsigned  fwVersion)
inline

Definition at line 103 of file L1TMuonBarrelParamsHelper.h.

References fwVersion(), and L1TMuonBarrelParams::fwVersion_.

Referenced by configFromPy().

void L1TMuonBarrelParamsHelper::setphi_lut ( std::vector< LUT philut)
inline
void L1TMuonBarrelParamsHelper::setpta_lut ( std::vector< LUT ptalut)
inline
void L1TMuonBarrelParamsHelper::setpta_threshold ( std::vector< int >  ptathresh)
inline
void L1TMuonBarrelParamsHelper::setqp_lut ( qpLUT  qplut)
inline

Member Data Documentation

L1MuDTEtaPatternLut L1TMuonBarrelParamsHelper::l1mudttfetaplut

Definition at line 111 of file L1TMuonBarrelParamsHelper.h.

Referenced by configFromPy().

L1MuDTQualPatternLut L1TMuonBarrelParamsHelper::l1mudttfqualplut

friend std::ostream& operator<<(std::ostream& o, const L1TMuonBarrelParams & p) { p.print(o); return o; }

Definition at line 110 of file L1TMuonBarrelParamsHelper.h.

Referenced by configFromPy().

l1t::TrigSystem L1TMuonBarrelParamsHelper::m_trgSys
private

Definition at line 114 of file L1TMuonBarrelParamsHelper.h.