CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions
L1TMuonBarrelParamsHelper Class Reference

#include <L1TMuonBarrelParamsHelper.h>

Inheritance diagram for L1TMuonBarrelParamsHelper:
L1TMuonBarrelParams

Public Member Functions

std::string AssLUTPath () const
 
void configFromDB (l1t::TriggerSystem &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

L1MuBMTEtaPatternLut l1mudttfetaplut
 
L1MuBMTQualPatternLut 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...
 

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 30 of file L1TMuonBarrelParamsHelper.h.

Constructor & Destructor Documentation

◆ L1TMuonBarrelParamsHelper() [1/2]

L1TMuonBarrelParamsHelper::L1TMuonBarrelParamsHelper ( )
inline

Definition at line 32 of file L1TMuonBarrelParamsHelper.h.

◆ L1TMuonBarrelParamsHelper() [2/2]

L1TMuonBarrelParamsHelper::L1TMuonBarrelParamsHelper ( const L1TMuonBarrelParams barrelParams)

Definition at line 9 of file L1TMuonBarrelParamsHelper.cc.

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

◆ ~L1TMuonBarrelParamsHelper()

L1TMuonBarrelParamsHelper::~L1TMuonBarrelParamsHelper ( )
inline

Definition at line 35 of file L1TMuonBarrelParamsHelper.h.

35 {};

Member Function Documentation

◆ AssLUTPath()

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

Definition at line 44 of file L1TMuonBarrelParamsHelper.h.

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

Referenced by L1TMuonBarrelParamsViewer::analyze().

44 { return !pnodes_[CONFIG].sparams_.empty() ? pnodes_[CONFIG].sparams_[0] : ""; }
std::vector< Node > pnodes_

◆ configFromDB()

void L1TMuonBarrelParamsHelper::configFromDB ( l1t::TriggerSystem trgSys)

Converts the last bit to int

All bits must be the same

if register path

for masks

for it tRow

for it procRole

Definition at line 124 of file L1TMuonBarrelParamsHelper.cc.

References DMR_cfg::cerr, spr::find(), l1t::TriggerSystem::getParameters(), l1t::TriggerSystem::getProcToRoleAssignment(), L1TMuonBarrelParams::l1mudttfmasks, visualization-live-secondInstance_cfg::m, gpuClustering::pixelStatus::mask, Skims_PA_cff::paths, L1MuDTTFMasks::reset(), fileinputsource_cfi::sec, set_DisableNewAlgo(), 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.getProcToRoleAssignment();
126 
127  //Cleaning the default masking from the prototype
129 
130  for (auto it_proc = procRole.begin(); it_proc != procRole.end(); it_proc++) {
131  std::string procId = it_proc->first;
132 
133  std::map<std::string, l1t::Parameter> settings = trgSys.getParameters(procId.c_str());
134 
135  std::vector<std::string> paths = settings["regTable"].getTableColumn<std::string>("register_path");
136  std::vector<unsigned int> vals = settings["regTable"].getTableColumn<unsigned int>("register_value");
137  for (unsigned int row = 0; row < paths.size(); row++) {
138  if (paths[row].find("open_lut") != std::string::npos) {
139  //std::cout << "Value is: " << vals[row] << std::endl;
140  set_Open_LUTs(vals[row]);
141  }
142  if (paths[row].find("sel_21") != std::string::npos) {
143  //std::cout << "Value is: " << vals[row] << std::endl;
144  set_Extrapolation_21(vals[row]);
145  }
146 
147  if (paths[row].find("dis_newalgo") != std::string::npos) {
148  //std::cout << "Value is: " << vals[row] << std::endl;
149  //int fwv = (vals[row]==1) ? 1 : 2;
150  //setFwVersion(fwv);
151  bool disnewalgo = (vals[row] == 1);
152  set_DisableNewAlgo(disnewalgo);
153  }
154 
155  string masks[5] = {"mask_ctrl_N2", "mask_ctrl_N1", "mask_ctrl_0", "mask_ctrl_P1", "mask_ctrl_P2"};
156 
157  for (int m = 0; m < 5; m++) {
158  if (paths[row].find(masks[m]) != std::string::npos) {
160  int mask = 0x1 & vals[row];
161  int mask_all = vals[row];
163  if (!(mask_all == 0x111111 || mask_all == 0x222222 || mask_all == 0x333333 || mask_all == 0x444444 ||
164  mask_all == 0x555555 || mask_all == 0x666666 || mask_all == 0x777777))
165  cerr << "BMTF: Cannot re-emulate properly. Individual link masking cannot be handled." << endl;
166 
167  if ((mask & 1) > 0) {
168  for (int sec = 0; sec < 12; sec++) {
169  if (masks[m] == "mask_ctrl_N2") {
171  //l1mudttfmasks.set_etsoc_chdis_st1(-3,sec,true);
172  }
173  if (masks[m] == "mask_ctrl_N1") {
175  //l1mudttfmasks.set_etsoc_chdis_st1(-2,sec,true);
176  }
177 
178  if (masks[m] == "mask_ctrl_0") {
181  //l1mudttfmasks.set_etsoc_chdis_st1(-1,sec,true);
182  //l1mudttfmasks.set_etsoc_chdis_st1(1,sec,true);
183  }
184  if (masks[m] == "mask_ctrl_P1") {
186  //l1mudttfmasks.set_etsoc_chdis_st1(2,sec,true);
187  }
188  if (masks[m] == "mask_ctrl_P2") {
190  //l1mudttfmasks.set_etsoc_chdis_st1(3,sec,true);
191  }
192  }
193  }
194 
195  if ((mask & 2) > 0) {
196  for (int sec = 0; sec < 12; sec++) {
197  if (masks[m] == "mask_ctrl_N2") {
199  //l1mudttfmasks.set_etsoc_chdis_st2(-3,sec,true);
200  }
201  if (masks[m] == "mask_ctrl_N1") {
203  //l1mudttfmasks.set_etsoc_chdis_st2(-2,sec,true);
204  }
205 
206  if (masks[m] == "mask_ctrl_0") {
209  //l1mudttfmasks.set_etsoc_chdis_st2(-1,sec,true);
210  //l1mudttfmasks.set_etsoc_chdis_st2(1,sec,true);
211  }
212  if (masks[m] == "mask_ctrl_P1") {
214  //l1mudttfmasks.set_etsoc_chdis_st2(2,sec,true);
215  }
216  if (masks[m] == "mask_ctrl_P2") {
218  //l1mudttfmasks.set_etsoc_chdis_st2(3,sec,true);
219  }
220  }
221  }
222 
223  if ((mask & 4) > 0) {
224  for (int sec = 0; sec < 12; sec++) {
225  if (masks[m] == "mask_ctrl_N2") {
227  //l1mudttfmasks.set_etsoc_chdis_st3(-3,sec,true);
228  }
229  if (masks[m] == "mask_ctrl_N1") {
231  //l1mudttfmasks.set_etsoc_chdis_st3(-2,sec,true);
232  }
233 
234  if (masks[m] == "mask_ctrl_0") {
237  //l1mudttfmasks.set_etsoc_chdis_st3(-1,sec,true);
238  //l1mudttfmasks.set_etsoc_chdis_st3(1,sec,true);
239  }
240  if (masks[m] == "mask_ctrl_P1") {
242  //l1mudttfmasks.set_etsoc_chdis_st3(2,sec,true);
243  }
244  if (masks[m] == "mask_ctrl_P2") {
246  //l1mudttfmasks.set_etsoc_chdis_st3(3,sec,true);
247  }
248  }
249  }
250 
251  if ((mask & 8) > 0) {
252  for (int sec = 0; sec < 12; sec++) {
253  if (masks[m] == "mask_ctrl_N2") {
255  }
256  if (masks[m] == "mask_ctrl_N1") {
258  }
259 
260  if (masks[m] == "mask_ctrl_0") {
263  }
264  if (masks[m] == "mask_ctrl_P1") {
266  }
267  if (masks[m] == "mask_ctrl_P2") {
269  }
270  }
271  }
272  }
273  }
274  }
275  }
276 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
constexpr uint32_t mask
Definition: gpuClustering.h:26
const std::map< std::string, std::string > & getProcToRoleAssignment(void) const noexcept
Definition: TriggerSystem.h:60
L1MuDTTFMasks l1mudttfmasks
const std::map< std::string, Parameter > & getParameters(const char *processor) const
void set_inrec_chdis_st4(int wh, int sc, const bool val)
void reset()
reset parameters to zero
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_inrec_chdis_st1(int wh, int sc, const bool val)

◆ configFromPy()

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 HltBtagPostValidation_cff::c, gather_cfg::cout, L1TMuonBarrelParams::LUTParams::eta_lut_, ext_lut(), fwVersion(), l1mudttfetaplut, L1TMuonBarrelParams::l1mudttfmasks, L1TMuonBarrelParams::l1mudttfparams, l1mudttfqualplut, L1MuBMTEtaPatternLut::load(), L1MuBMTQualPatternLut::load(), load_ext(), load_phi(), load_pt(), L1TMuonBarrelParams::lutparams_, L1MuBMTEtaPatternLut::m_lut, L1MuBMTQualPatternLut::m_lut, gpuClustering::pixelStatus::mask, phi_lut(), pta_lut(), pta_threshold(), L1TMuonBarrelParams::LUTParams::qp_lut_, L1MuDTTFParameters::reset(), fileinputsource_cfi::sec, 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().

21  {
22  set_PT_Assignment_nbits_Phi(allInts["PT_Assignment_nbits_Phi"]);
23  set_PT_Assignment_nbits_PhiB(allInts["PT_Assignment_nbits_PhiB"]);
24  set_PHI_Assignment_nbits_Phi(allInts["PHI_Assignment_nbits_Phi"]);
25  set_PHI_Assignment_nbits_PhiB(allInts["PHI_Assignment_nbits_PhiB"]);
26  set_Extrapolation_nbits_Phi(allInts["Extrapolation_nbits_Phi"]);
27  set_Extrapolation_nbits_PhiB(allInts["Extrapolation_nbits_PhiB"]);
28  set_BX_min(allInts["BX_min"]);
29  set_BX_max(allInts["BX_max"]);
30  set_Extrapolation_Filter(allInts["Extrapolation_Filter"]);
31  set_OutOfTime_Filter_Window(allInts["OutOfTime_Filter_Window"]);
32  set_OutOfTime_Filter(allBools["OutOfTime_Filter"]);
33  set_Open_LUTs(allBools["Open_LUTs"]);
34  set_EtaTrackFinder(allBools["EtaTrackFinder"]);
35  set_Extrapolation_21(allBools["Extrapolation_21"]);
37  set_DisableNewAlgo(allBools["DisableNewAlgo"]);
38 
39  setAssLUTPath(AssLUTpath);
41  std::vector<LUT> pta_lut(0);
42  pta_lut.reserve(19);
43  std::vector<int> pta_threshold(10);
44  if (load_pt(pta_lut, pta_threshold, allInts["PT_Assignment_nbits_Phi"], AssLUTpath) != 0) {
45  cout << "Can not open files to load pt-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
46  }
49 
51  std::vector<LUT> phi_lut(0);
52  phi_lut.reserve(2);
53  if (load_phi(phi_lut, allInts["PHI_Assignment_nbits_Phi"], allInts["PHI_Assignment_nbits_PhiB"], AssLUTpath) != 0) {
54  cout << "Can not open files to load phi-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
55  }
57 
58  l1mudttfparams.reset(); //KK
60  .load(); //KK: Do these LUTs ever change and is it safe to initialize it from the release files like that?
61  l1mudttfetaplut.load(); //KK
62  // the data members of the Helper class loaded above are transient, push those to the persistent storage of the base class:
65 
66  for (int wh = -3; wh < 4; wh++) {
67  int sec = 0;
68  for (char& c : allMasks["mask_phtf_st1"].at(wh + 3)) {
69  int mask = c - '0';
71  sec++;
72  }
73  sec = 0;
74  for (char& c : allMasks["mask_phtf_st2"].at(wh + 3)) {
75  int mask = c - '0';
77  sec++;
78  }
79  sec = 0;
80  for (char& c : allMasks["mask_phtf_st3"].at(wh + 3)) {
81  int mask = c - '0';
83  sec++;
84  }
85  sec = 0;
86  for (char& c : allMasks["mask_phtf_st4"].at(wh + 3)) {
87  int mask = c - '0';
89  sec++;
90  }
91  sec = 0;
92  for (char& c : allMasks["mask_ettf_st1"].at(wh + 3)) {
93  int mask = c - '0';
95  sec++;
96  }
97  sec = 0;
98  for (char& c : allMasks["mask_ettf_st2"].at(wh + 3)) {
99  int mask = c - '0';
101  sec++;
102  }
103  sec = 0;
104  for (char& c : allMasks["mask_ettf_st3"].at(wh + 3)) {
105  int mask = c - '0';
107  //Not used in BMTF - mask
109  sec++;
110  }
111  }
112 
114  std::vector<L1TMuonBarrelParams::LUTParams::extLUT> ext_lut(0);
115  ext_lut.reserve(12);
116  if (load_ext(ext_lut, allInts["PHI_Assignment_nbits_Phi"], allInts["PHI_Assignment_nbits_PhiB"]) != 0) {
117  cout << "Can not open files to load extrapolation look-up tables for L1TMuonBarrelTrackProducer!" << endl;
118  }
120 
121  //l1mudttfextlut.load();
122 }
L1MuBMTQualPatternLut l1mudttfqualplut
friend std::ostream& operator<<(std::ostream& o, const L1TMuonBarrelParams & p) { p...
L1MuDTTFParameters l1mudttfparams
void set_etsoc_chdis_st1(int wh, int sc, const bool val)
int load()
load look-up tables
int load_phi(std::vector< LUT > &, unsigned short int, unsigned short int, std::string)
std::vector< LUT > phi_lut() const
int load()
load pattern look-up table
void set_etsoc_chdis_st2(int wh, int sc, const bool val)
constexpr uint32_t mask
Definition: gpuClustering.h:26
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
void reset()
reset parameters to zero
void setAssLUTPath(std::string path)
std::vector< int > pta_threshold() const
void set_inrec_chdis_st2(int wh, int sc, const bool val)
std::vector< LUT > pta_lut() const
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)
std::vector< LUTParams::extLUT > ext_lut() const
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)

◆ eta_lut()

etaLUT L1TMuonBarrelParamsHelper::eta_lut ( ) const
inline

◆ ext_lut()

std::vector<LUTParams::extLUT> L1TMuonBarrelParamsHelper::ext_lut ( ) const
inline

◆ fwVersion()

unsigned L1TMuonBarrelParamsHelper::fwVersion ( ) const
inline

◆ get_BX_max()

int L1TMuonBarrelParamsHelper::get_BX_max ( ) const
inline

◆ get_BX_min()

int L1TMuonBarrelParamsHelper::get_BX_min ( ) const
inline

◆ get_DisableNewAlgo()

bool L1TMuonBarrelParamsHelper::get_DisableNewAlgo ( ) const
inline

◆ get_EtaTrackFinder()

bool L1TMuonBarrelParamsHelper::get_EtaTrackFinder ( ) const
inline

◆ get_Extrapolation_21()

bool L1TMuonBarrelParamsHelper::get_Extrapolation_21 ( ) const
inline

◆ get_Extrapolation_Filter()

int L1TMuonBarrelParamsHelper::get_Extrapolation_Filter ( ) const
inline

◆ get_Extrapolation_nbits_Phi()

int L1TMuonBarrelParamsHelper::get_Extrapolation_nbits_Phi ( ) const
inline

◆ get_Extrapolation_nbits_PhiB()

int L1TMuonBarrelParamsHelper::get_Extrapolation_nbits_PhiB ( ) const
inline

◆ get_Open_LUTs()

bool L1TMuonBarrelParamsHelper::get_Open_LUTs ( ) const
inline

◆ get_OutOfTime_Filter()

bool L1TMuonBarrelParamsHelper::get_OutOfTime_Filter ( ) const
inline

◆ get_OutOfTime_Filter_Window()

int L1TMuonBarrelParamsHelper::get_OutOfTime_Filter_Window ( ) const
inline

◆ get_PHI_Assignment_nbits_Phi()

int L1TMuonBarrelParamsHelper::get_PHI_Assignment_nbits_Phi ( ) const
inline

◆ get_PHI_Assignment_nbits_PhiB()

int L1TMuonBarrelParamsHelper::get_PHI_Assignment_nbits_PhiB ( ) const
inline

◆ get_PT_Assignment_nbits_Phi()

int L1TMuonBarrelParamsHelper::get_PT_Assignment_nbits_Phi ( ) const
inline

◆ get_PT_Assignment_nbits_PhiB()

int L1TMuonBarrelParamsHelper::get_PT_Assignment_nbits_PhiB ( ) const
inline

◆ load_ext()

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 538 of file L1TMuonBarrelParamsHelper.cc.

References EX12, EX13, EX14, EX15, EX16, EX21, EX23, EX24, EX25, EX26, EX34, EX56, ext_lut(), geometryDiff::file, edm::FileInPath::fullPath(), LaserClient_cfi::high, L1TMuonBarrelParams::LUTParams::extLUT::high, LaserClient_cfi::low, L1TMuonBarrelParams::LUTParams::extLUT::low, MAX_EXT, and contentValuesFiles::number.

Referenced by configFromPy().

540  {
541  //max. number of Extrapolations
542  const int MAX_EXT = 12;
543 
544  // extrapolation types
546 
547  // get directory name
548  string defaultPath = "L1Trigger/L1TMuon/data/bmtf_luts/";
549  string ext_dir = "LUTs_Ext/";
550  string ext_str = "";
551 
552  // precision : in the look-up tables the following precision is used :
553  // phi ...12 bits (low, high), phib ...10 bits (address)
554  // now convert phi and phib to the required precision
555 
556  int sh_phi = 12 - nbit_phi;
557  int sh_phib = 10 - nbit_phib;
558 
559  // loop over all extrapolations
560  for (int ext = 0; ext < MAX_EXT; ext++) {
561  switch (ext) {
562  case EX12:
563  ext_str = "ext12";
564  break;
565  case EX13:
566  ext_str = "ext13";
567  break;
568  case EX14:
569  ext_str = "ext14";
570  break;
571  case EX21:
572  ext_str = "ext21";
573  break;
574  case EX23:
575  ext_str = "ext23";
576  break;
577  case EX24:
578  ext_str = "ext24";
579  break;
580  case EX34:
581  ext_str = "ext34";
582  break;
583  case EX15:
584  ext_str = "ext15";
585  break;
586  case EX16:
587  ext_str = "ext16";
588  break;
589  case EX25:
590  ext_str = "ext25";
591  break;
592  case EX26:
593  ext_str = "ext26";
594  break;
595  case EX56:
596  ext_str = "ext56";
597  break;
598  }
599 
600  // assemble file name
601  edm::FileInPath lut_f = edm::FileInPath(string(defaultPath + ext_dir + ext_str + ".lut"));
602  string ext_file = lut_f.fullPath();
603 
604  // open file
605  L1TriggerLutFile file(ext_file);
606  if (file.open() != 0)
607  return -1;
608  // if ( L1MuDTTFConfig::Debug(1) ) cout << "Reading file : "
609  // << file.getName() << endl;
610 
612 
613  int number = -1;
614  int adr_old = -512 >> sh_phib;
615  int sum_low = 0;
616  int sum_high = 0;
617 
618  // read values and shift to correct precision
619  while (file.good()) {
620  int adr = (file.readInteger()) >> sh_phib; // address (phib)
621  int low = (file.readInteger()); // low value (phi)
622  int high = (file.readInteger()); // high value (phi)
623 
624  number++;
625 
626  if (adr != adr_old) {
627  tmplut.low[adr_old] = sum_low >> sh_phi;
628  tmplut.high[adr_old] = sum_high >> sh_phi;
629 
630  adr_old = adr;
631  number = 0;
632  sum_low = 0;
633  sum_high = 0;
634  }
635 
636  if (number == 0)
637  sum_low = low;
638  if (number == 0)
639  sum_high = high;
640 
641  if (!file.good())
642  file.close();
643  }
644 
645  file.close();
646  ext_lut.push_back(tmplut);
647  }
648  return 0;
649 }
std::string fullPath() const
Definition: FileInPath.cc:161
const int MAX_EXT
Extrapolation
Definition: memstream.h:15
std::vector< LUTParams::extLUT > ext_lut() const

◆ load_phi()

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 453 of file L1TMuonBarrelParamsHelper.cc.

References cms::cuda::assert(), geometryDiff::file, edm::FileInPath::fullPath(), heavyIonCSV_trainingSettings::idx, contentValuesFiles::number, phi, and phi_lut().

Referenced by configFromPy().

456  {
457  // precision : in the look-up tables the following precision is used :
458  // address (phib) ...10 bits, phi ... 12 bits
459 
460  int sh_phi = 12 - nbit_phi;
461  int sh_phib = 10 - nbit_phib;
462 
463  string phi_str;
464  // loop over all phi-assignment methods
465  for (int idx = 0; idx < 2; idx++) {
466  switch (idx) {
467  case 0: {
468  phi_str = "phi12";
469  break;
470  }
471  case 1: {
472  phi_str = "phi42";
473  break;
474  }
475  }
476 
477  // assemble file name
478  edm::FileInPath lut_f = edm::FileInPath(string(AssLUTpath + phi_str + ".lut"));
479  string phi_file = lut_f.fullPath();
480 
481  // open file
482  L1TriggerLutFile file(phi_file);
483  if (file.open() != 0)
484  return -1;
485 
486  LUT tmplut;
487 
488  int number = -1;
489  int adr_old = -512 >> sh_phib;
490  int sum_phi = 0;
491 
492  // read values
493  while (file.good()) {
494  int adr = (file.readInteger()) >> sh_phib;
495  int phi = file.readInteger();
496 
497  number++;
498 
499  if (adr != adr_old) {
500  assert(number);
501  tmplut.insert(make_pair(adr_old, ((sum_phi / number) >> sh_phi)));
502 
503  adr_old = adr;
504  number = 0;
505  sum_phi = 0;
506  }
507 
508  sum_phi += phi;
509 
510  if (!file.good())
511  file.close();
512  }
513 
514  file.close();
515  phi_lut.push_back(tmplut);
516  }
517  return 0;
518 }
std::string fullPath() const
Definition: FileInPath.cc:161
std::vector< LUT > phi_lut() const
assert(be >=bs)
std::vector< unsigned short int > LUT
Definition: DTTracoLUTs.h:31

◆ load_pt()

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 278 of file L1TMuonBarrelParamsHelper.cc.

References cms::cuda::assert(), geometryDiff::file, edm::FileInPath::fullPath(), MAX_PTASSMETH, NODEF, contentValuesFiles::number, DiDispStaMuonMonitor_cfi::pt, PT12H, PT12L, PT13H, PT13L, PT14H, PT14L, PT23H, PT23L, PT24H, PT24L, PT34H, PT34L, pta_lut(), pta_threshold(), edm::shift, and remoteMonitoring_LASER_era2018_cfg::threshold.

Referenced by configFromPy().

281  {
282  // maximal number of pt assignment methods
283  const int MAX_PTASSMETH = 19;
284  const int MAX_PTASSMETHA = 12;
285 
286  // pt assignment methods
287  enum PtAssMethod {
288  PT12L,
289  PT12H,
290  PT13L,
291  PT13H,
292  PT14L,
293  PT14H,
294  PT23L,
295  PT23H,
296  PT24L,
297  PT24H,
298  PT34L,
299  PT34H,
300  PB12H,
301  PB13H,
302  PB14H,
303  PB21H,
304  PB23H,
305  PB24H,
306  PB34H,
307  NODEF
308  };
309 
310  // get directory name
311  string pta_str = "";
312  // precision : in the look-up tables the following precision is used :
313  // phi ...12 bits (address) and pt ...5 bits
314  // now convert phi and phib to the required precision
315  int nbit_phi = nbitphi;
316  int sh_phi = 12 - nbit_phi;
317 
318  // loop over all pt-assignment methods
319  for (int pam = 0; pam < MAX_PTASSMETH; pam++) {
320  switch (pam) {
321  case PT12L: {
322  pta_str = "pta12l";
323  break;
324  }
325  case PT12H: {
326  pta_str = "pta12h";
327  break;
328  }
329  case PT13L: {
330  pta_str = "pta13l";
331  break;
332  }
333  case PT13H: {
334  pta_str = "pta13h";
335  break;
336  }
337  case PT14L: {
338  pta_str = "pta14l";
339  break;
340  }
341  case PT14H: {
342  pta_str = "pta14h";
343  break;
344  }
345  case PT23L: {
346  pta_str = "pta23l";
347  break;
348  }
349  case PT23H: {
350  pta_str = "pta23h";
351  break;
352  }
353  case PT24L: {
354  pta_str = "pta24l";
355  break;
356  }
357  case PT24H: {
358  pta_str = "pta24h";
359  break;
360  }
361  case PT34L: {
362  pta_str = "pta34l";
363  break;
364  }
365  case PT34H: {
366  pta_str = "pta34h";
367  break;
368  }
369  case PB12H: {
370  pta_str = "ptb12h_Feb2016";
371  break;
372  }
373  case PB13H: {
374  pta_str = "ptb13h_Feb2016";
375  break;
376  }
377  case PB14H: {
378  pta_str = "ptb14h_Feb2016";
379  break;
380  }
381  case PB21H: {
382  pta_str = "ptb21h_Feb2016";
383  break;
384  }
385  case PB23H: {
386  pta_str = "ptb23h_Feb2016";
387  break;
388  }
389  case PB24H: {
390  pta_str = "ptb24h_Feb2016";
391  break;
392  }
393  case PB34H: {
394  pta_str = "ptb34h_Feb2016";
395  break;
396  }
397  }
398 
399  // assemble file name
400  const string& lutpath = AssLUTpath;
401  edm::FileInPath lut_f = edm::FileInPath(string(lutpath + pta_str + ".lut"));
402  string pta_file = lut_f.fullPath();
403 
404  // open file
405  L1TriggerLutFile file(pta_file);
406  if (file.open() != 0)
407  return -1;
408 
409  // get the right shift factor
410  int shift = sh_phi;
411  int adr_old = -2048 >> shift;
412  if (pam >= MAX_PTASSMETHA)
413  adr_old = -512 >> shift;
414 
415  LUT tmplut;
416 
417  int number = -1;
418  int sum_pt = 0;
419 
420  if (file.good()) {
421  int threshold = file.readInteger();
422  pta_threshold[pam / 2] = threshold;
423  }
424 
425  // read values and shift to correct precision
426  while (file.good()) {
427  int adr = (file.readInteger()) >> shift;
428  int pt = file.readInteger();
429 
430  number++;
431  //cout<<pam<<" "<<number<<" "<<MAX_PTASSMETHA<<endl;
432  if (adr != adr_old) {
433  assert(number);
434  tmplut.insert(make_pair(adr_old, (sum_pt / number)));
435 
436  adr_old = adr;
437  number = 0;
438  sum_pt = 0;
439  }
440 
441  sum_pt += pt;
442 
443  if (!file.good())
444  file.close();
445  }
446 
447  file.close();
448  pta_lut.push_back(tmplut);
449  }
450  return 0;
451 }
std::string fullPath() const
Definition: FileInPath.cc:161
assert(be >=bs)
std::vector< int > pta_threshold() const
std::vector< LUT > pta_lut() const
static unsigned int const shift
std::vector< unsigned short int > LUT
Definition: DTTracoLUTs.h:31
const int MAX_PTASSMETH
PtAssMethod

◆ phi_lut()

std::vector<LUT> L1TMuonBarrelParamsHelper::phi_lut ( ) const
inline

◆ print()

void L1TMuonBarrelParamsHelper::print ( std::ostream &  out) const

Definition at line 3 of file L1TMuonBarrelParamsHelper.cc.

References L1TMuonBarrelParams::fwVersion_, and MillePedeFileConverter_cfg::out.

3  {
4  out << "L1 BMTF Parameters" << std::endl;
5 
6  out << "Firmware version: " << fwVersion_ << std::endl;
7 }

◆ pta_lut()

std::vector<LUT> L1TMuonBarrelParamsHelper::pta_lut ( ) const
inline

◆ pta_threshold()

std::vector<int> L1TMuonBarrelParamsHelper::pta_threshold ( ) const
inline

◆ qp_lut()

qpLUT L1TMuonBarrelParamsHelper::qp_lut ( ) const
inline

◆ set_BX_max()

void L1TMuonBarrelParamsHelper::set_BX_max ( int  par1)
inline

◆ set_BX_min()

void L1TMuonBarrelParamsHelper::set_BX_min ( int  par1)
inline

◆ set_DisableNewAlgo()

void L1TMuonBarrelParamsHelper::set_DisableNewAlgo ( bool  par1)
inline

◆ set_EtaTrackFinder()

void L1TMuonBarrelParamsHelper::set_EtaTrackFinder ( bool  par1)
inline

◆ set_Extrapolation_21()

void L1TMuonBarrelParamsHelper::set_Extrapolation_21 ( bool  par1)
inline

◆ set_Extrapolation_Filter()

void L1TMuonBarrelParamsHelper::set_Extrapolation_Filter ( int  par1)
inline

◆ set_Extrapolation_nbits_Phi()

void L1TMuonBarrelParamsHelper::set_Extrapolation_nbits_Phi ( int  par1)
inline

◆ set_Extrapolation_nbits_PhiB()

void L1TMuonBarrelParamsHelper::set_Extrapolation_nbits_PhiB ( int  par1)
inline

◆ set_Open_LUTs()

void L1TMuonBarrelParamsHelper::set_Open_LUTs ( bool  par1)
inline

◆ set_OutOfTime_Filter()

void L1TMuonBarrelParamsHelper::set_OutOfTime_Filter ( bool  par1)
inline

◆ set_OutOfTime_Filter_Window()

void L1TMuonBarrelParamsHelper::set_OutOfTime_Filter_Window ( int  par1)
inline

◆ set_PHI_Assignment_nbits_Phi()

void L1TMuonBarrelParamsHelper::set_PHI_Assignment_nbits_Phi ( int  par1)
inline

◆ set_PHI_Assignment_nbits_PhiB()

void L1TMuonBarrelParamsHelper::set_PHI_Assignment_nbits_PhiB ( int  par1)
inline

◆ set_PT_Assignment_nbits_Phi()

void L1TMuonBarrelParamsHelper::set_PT_Assignment_nbits_Phi ( int  par1)
inline

◆ set_PT_Assignment_nbits_PhiB()

void L1TMuonBarrelParamsHelper::set_PT_Assignment_nbits_PhiB ( int  par1)
inline

◆ setAssLUTPath()

void L1TMuonBarrelParamsHelper::setAssLUTPath ( std::string  path)
inline

◆ seteta_lut()

void L1TMuonBarrelParamsHelper::seteta_lut ( etaLUT  eta_lut)
inline

◆ setext_lut()

void L1TMuonBarrelParamsHelper::setext_lut ( std::vector< LUTParams::extLUT >  extlut)
inline

◆ setFwVersion()

void L1TMuonBarrelParamsHelper::setFwVersion ( unsigned  fwVersion)
inline

◆ setphi_lut()

void L1TMuonBarrelParamsHelper::setphi_lut ( std::vector< LUT philut)
inline

◆ setpta_lut()

void L1TMuonBarrelParamsHelper::setpta_lut ( std::vector< LUT ptalut)
inline

◆ setpta_threshold()

void L1TMuonBarrelParamsHelper::setpta_threshold ( std::vector< int >  ptathresh)
inline

◆ setqp_lut()

void L1TMuonBarrelParamsHelper::setqp_lut ( qpLUT  qplut)
inline

Member Data Documentation

◆ l1mudttfetaplut

L1MuBMTEtaPatternLut L1TMuonBarrelParamsHelper::l1mudttfetaplut

Definition at line 107 of file L1TMuonBarrelParamsHelper.h.

Referenced by configFromPy().

◆ l1mudttfqualplut

L1MuBMTQualPatternLut L1TMuonBarrelParamsHelper::l1mudttfqualplut

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

Definition at line 106 of file L1TMuonBarrelParamsHelper.h.

Referenced by configFromPy().