CMS 3D CMS Logo

L1MuGMTConfig.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTConfig
4 //
5 // Description: Configuration parameters for L1GlobalMuonTrigger
6 //
7 //
8 //
9 // Author :
10 // N. Neumeister CERN EP
11 //
12 // Migrated to CMSSW:
13 // I. Mikulec
14 //
15 //--------------------------------------------------
16 
17 //-----------------------
18 // This Class's Header --
19 //-----------------------
20 
22 
23 //---------------
24 // C++ Headers --
25 //---------------
26 
27 #include <iostream>
28 #include <fstream>
29 #include <string>
30 
31 //-------------------------------
32 // Collaborating Class Headers --
33 //-------------------------------
34 
61 
65 
67 
69 
70 // --------------------------------
71 // class L1MuGMTConfig
72 //---------------------------------
73 using namespace std;
74 
75 //----------------
76 // Constructors --
77 //----------------
78 
80  m_DTInputTag = ps.getParameter<edm::InputTag>("DTCandidates");
81  m_CSCInputTag = ps.getParameter<edm::InputTag>("CSCCandidates");
82  m_RPCbInputTag = ps.getParameter<edm::InputTag>("RPCbCandidates");
83  m_RPCfInputTag = ps.getParameter<edm::InputTag>("RPCfCandidates");
84  m_MipIsoInputTag = ps.getParameter<edm::InputTag>("MipIsoData");
85 
86  m_debug = true;
87  m_dbgLevel = ps.getUntrackedParameter<int>("Debug", 0);
88 
89  // set min and max bunch crossing
90  m_BxMin = ps.getParameter<int>("BX_min");
91  m_BxMax = ps.getParameter<int>("BX_max");
92 
93  // set min and max bunch crossing for the readout
94  m_BxMinRo = ps.getParameter<int>("BX_min_readout");
95  m_BxMaxRo = ps.getParameter<int>("BX_max_readout");
96 }
97 
98 //--------------
99 // Destructor --
100 //--------------
102 
103 //--------------
104 // Operations --
105 //--------------
106 
108  // set weights for eta and phi
109  m_EtaWeight_barrel = m_GMTParams->getEtaWeight_barrel();
110  m_PhiWeight_barrel = m_GMTParams->getPhiWeight_barrel();
111  m_EtaPhiThreshold_barrel = m_GMTParams->getEtaPhiThreshold_barrel();
112 
113  m_EtaWeight_endcap = m_GMTParams->getEtaWeight_endcap();
114  m_PhiWeight_endcap = m_GMTParams->getPhiWeight_endcap();
115  m_EtaPhiThreshold_endcap = m_GMTParams->getEtaPhiThreshold_endcap();
116 
117  m_EtaWeight_COU = m_GMTParams->getEtaWeight_COU();
118  m_PhiWeight_COU = m_GMTParams->getPhiWeight_COU();
119  m_EtaPhiThreshold_COU = m_GMTParams->getEtaPhiThreshold_COU();
120 
121  m_CaloTrigger = m_GMTParams->getCaloTrigger();
122  m_IsolationCellSizeEta = m_GMTParams->getIsolationCellSizeEta();
123  m_IsolationCellSizePhi = m_GMTParams->getIsolationCellSizePhi();
124 
125  m_DoOvlRpcAnd = m_GMTParams->getDoOvlRpcAnd();
126 
127  m_PropagatePhi = m_GMTParams->getPropagatePhi();
128 
129  m_VersionSortRankEtaQLUT = m_GMTParams->getVersionSortRankEtaQLUT();
130  m_VersionLUTs = m_GMTParams->getVersionLUTs();
131 
132  if (Debug(1)) {
133  stringstream stdss;
134  stdss << endl
135  << "*******************************************" << endl
136  << "**** L1 Global Muon Trigger settings : ****" << endl
137  << "*******************************************" << endl
138  << endl
139 
140  << "L1 Global Muon Trigger : DTCandidates : " << m_DTInputTag << endl
141  << "L1 Global Muon Trigger : CSCCandidates : " << m_CSCInputTag << endl
142  << "L1 Global Muon Trigger : RPCbCandidates : " << m_RPCbInputTag << endl
143  << "L1 Global Muon Trigger : RPCfCandidates : " << m_RPCfInputTag << endl
144  << "L1 Global Muon Trigger : debug level : " << m_dbgLevel << endl
145  << "L1 Global Muon Trigger : minimal bunch-crossing : " << m_BxMin << endl
146  << "L1 Global Muon Trigger : maximal bunch-crossing : " << m_BxMax << endl
147  << "L1 Global Muon Trigger : barrel eta weight : " << m_EtaWeight_barrel << endl
148  << "L1 Global Muon Trigger : barrel phi weight : " << m_PhiWeight_barrel << endl
149  << "L1 Global Muon Trigger : barrel eta-phi threshold : " << m_EtaPhiThreshold_barrel << endl
150  << "L1 Global Muon Trigger : endcap eta weight : " << m_EtaWeight_endcap << endl
151  << "L1 Global Muon Trigger : endcap phi weight : " << m_PhiWeight_endcap << endl
152  << "L1 Global Muon Trigger : endcap eta-phi threshold : " << m_EtaPhiThreshold_endcap << endl
153  << "L1 Global Muon Trigger : cancel out unit eta weight : " << m_EtaWeight_COU << endl
154  << "L1 Global Muon Trigger : cancel out unit phi weight : " << m_PhiWeight_COU << endl
155  << "L1 Global Muon Trigger : cancel out unit eta-phi threshold : " << m_EtaPhiThreshold_COU << endl
156  << "L1 Global Muon Trigger : calorimeter trigger : " << m_CaloTrigger << endl
157  << "L1 Global Muon Trigger : muon isolation cell size (eta) : " << m_IsolationCellSizeEta << endl
158  << "L1 Global Muon Trigger : muon isolation cell size (phi) : " << m_IsolationCellSizePhi << endl
159  << "L1 Global Muon Trigger : require confirmation by RPC in overlap region : " << m_DoOvlRpcAnd << endl
160  << "L1 Global Muon Trigger : propagate phi to vertex : " << m_PropagatePhi << endl
161  << "L1 Global Muon Trigger : version of low quality assignment LUT : " << m_VersionSortRankEtaQLUT << endl
162  << "L1 Global Muon Trigger : general LUTs version : " << m_VersionLUTs << endl;
163  edm::LogVerbatim("GMT_Config_info") << stdss.str();
164  }
165 }
166 
168  // create Registers
169  m_RegCDLConfig = new L1MuGMTRegCDLConfig();
170  m_RegMMConfigPhi = new L1MuGMTRegMMConfigPhi();
171  m_RegMMConfigEta = new L1MuGMTRegMMConfigEta();
172  m_RegMMConfigPt = new L1MuGMTRegMMConfigPt();
173  m_RegMMConfigCharge = new L1MuGMTRegMMConfigCharge();
174  m_RegMMConfigMIP = new L1MuGMTRegMMConfigMIP();
175  m_RegMMConfigISO = new L1MuGMTRegMMConfigISO();
176  m_RegMMConfigSRK = new L1MuGMTRegMMConfigSRK();
177  m_RegSortRankOffset = new L1MuGMTRegSortRankOffset();
178 
179  // create LUTs
180  m_EtaLUT = new L1MuGMTEtaLUT();
181  m_LFCOUDeltaEtaLUT = new L1MuGMTLFCOUDeltaEtaLUT();
182  m_LFDeltaEtaLUT = new L1MuGMTLFDeltaEtaLUT();
183  m_LFDisableHotLUT = new L1MuGMTLFDisableHotLUT();
184  m_LFEtaConvLUT = new L1MuGMTLFEtaConvLUT();
185  m_LFMatchQualLUT = new L1MuGMTLFMatchQualLUT();
186  m_LFMergeRankCombineLUT = new L1MuGMTLFMergeRankCombineLUT();
187  m_LFMergeRankEtaPhiLUT = new L1MuGMTLFMergeRankEtaPhiLUT();
188  m_LFMergeRankEtaQLUT = new L1MuGMTLFMergeRankEtaQLUT();
189  m_LFMergeRankPtQLUT = new L1MuGMTLFMergeRankPtQLUT();
190  m_LFOvlEtaConvLUT = new L1MuGMTLFOvlEtaConvLUT();
191  m_LFPhiProEtaConvLUT = new L1MuGMTLFPhiProEtaConvLUT();
192  m_LFPhiProLUT = new L1MuGMTLFPhiProLUT();
193  m_LFPtMixLUT = new L1MuGMTLFPtMixLUT();
194  m_LFSortRankCombineLUT = new L1MuGMTLFSortRankCombineLUT();
195  m_LFSortRankEtaPhiLUT = new L1MuGMTLFSortRankEtaPhiLUT();
196  m_LFSortRankEtaQLUT = new L1MuGMTLFSortRankEtaQLUT();
197  m_LFSortRankPtQLUT = new L1MuGMTLFSortRankPtQLUT();
198  m_MIAUEtaConvLUT = new L1MuGMTMIAUEtaConvLUT();
199  m_MIAUEtaProLUT = new L1MuGMTMIAUEtaProLUT();
200  m_MIAUPhiPro1LUT = new L1MuGMTMIAUPhiPro1LUT();
201  m_MIAUPhiPro2LUT = new L1MuGMTMIAUPhiPro2LUT();
202  m_PhiLUT = new L1MuGMTPhiLUT();
203 }
204 
206  // delete Registers
207  delete m_RegCDLConfig;
208  delete m_RegMMConfigPhi;
209  delete m_RegMMConfigEta;
210  delete m_RegMMConfigPt;
211  delete m_RegMMConfigCharge;
212  delete m_RegMMConfigMIP;
213  delete m_RegMMConfigISO;
214  delete m_RegMMConfigSRK;
215  delete m_RegSortRankOffset;
216 
217  // delete LUTs
218  delete m_EtaLUT;
219  delete m_LFCOUDeltaEtaLUT;
220  delete m_LFDeltaEtaLUT;
221  delete m_LFDisableHotLUT;
222  delete m_LFEtaConvLUT;
223  delete m_LFMatchQualLUT;
224  delete m_LFMergeRankCombineLUT;
225  delete m_LFMergeRankEtaPhiLUT;
226  delete m_LFMergeRankEtaQLUT;
227  delete m_LFMergeRankPtQLUT;
228  delete m_LFOvlEtaConvLUT;
229  delete m_LFPhiProEtaConvLUT;
230  delete m_LFPhiProLUT;
231  delete m_LFPtMixLUT;
232  delete m_LFSortRankCombineLUT;
233  delete m_LFSortRankEtaPhiLUT;
234  delete m_LFSortRankEtaQLUT;
235  delete m_LFSortRankPtQLUT;
236  delete m_MIAUEtaConvLUT;
237  delete m_MIAUEtaProLUT;
238  delete m_MIAUPhiPro1LUT;
239  delete m_MIAUPhiPro2LUT;
240  delete m_PhiLUT;
241 }
242 
244  std::vector<L1MuGMTLUT*> theLUTs;
245 
246  theLUTs.push_back(m_LFSortRankEtaQLUT);
247  theLUTs.push_back(m_LFSortRankPtQLUT);
248  theLUTs.push_back(m_LFSortRankEtaPhiLUT);
249  theLUTs.push_back(m_LFSortRankCombineLUT);
250 
251  theLUTs.push_back(m_LFDisableHotLUT);
252 
253  theLUTs.push_back(m_LFMergeRankEtaQLUT);
254  theLUTs.push_back(m_LFMergeRankPtQLUT);
255  theLUTs.push_back(m_LFMergeRankEtaPhiLUT);
256  theLUTs.push_back(m_LFMergeRankCombineLUT);
257 
258  theLUTs.push_back(m_LFDeltaEtaLUT);
259  theLUTs.push_back(m_LFMatchQualLUT);
260  theLUTs.push_back(m_LFOvlEtaConvLUT);
261  theLUTs.push_back(m_LFCOUDeltaEtaLUT);
262 
263  theLUTs.push_back(m_LFEtaConvLUT);
264 
265  theLUTs.push_back(m_LFPtMixLUT);
266  theLUTs.push_back(m_LFPhiProLUT);
267  theLUTs.push_back(m_LFPhiProEtaConvLUT);
268 
269  theLUTs.push_back(m_MIAUEtaConvLUT);
270  theLUTs.push_back(m_MIAUPhiPro1LUT);
271  theLUTs.push_back(m_MIAUPhiPro2LUT);
272  theLUTs.push_back(m_MIAUEtaProLUT);
273 
274  std::vector<L1MuGMTLUT*>::iterator it = theLUTs.begin();
275  for (; it != theLUTs.end(); it++) {
276  edm::LogVerbatim("GMT_LUTGen_info") << "**** Generating " << (*it)->Name() << " LUT ****" << endl
277  << "saving" << endl;
278  std::string fn = dir + "/" + (*it)->Name() + ".lut";
279  (*it)->Save(fn.c_str());
280  }
281 
282  edm::LogVerbatim("GMT_LUTGen_info") << "Successfully created all GMT look-up tables in directory './" << dir << "'"
283  << endl
284  << endl;
285 }
286 
288  std::vector<L1MuGMTReg*> theRegs;
289 
290  theRegs.push_back(m_RegCDLConfig);
291  theRegs.push_back(m_RegMMConfigPhi);
292  theRegs.push_back(m_RegMMConfigEta);
293  theRegs.push_back(m_RegMMConfigPt);
294  theRegs.push_back(m_RegMMConfigCharge);
295  theRegs.push_back(m_RegMMConfigSRK);
296  theRegs.push_back(m_RegMMConfigMIP);
297  theRegs.push_back(m_RegMMConfigISO);
298  theRegs.push_back(m_RegSortRankOffset);
299 
300  ofstream of((dir + "/LogicFPGARegs.cfg").c_str());
301 
302  std::vector<L1MuGMTReg*>::iterator it = theRegs.begin();
303  for (; it != theRegs.end(); it++) {
304  for (unsigned int i = 0; i < (*it)->getNumberOfInstances(); i++)
305  of << (*it)->getName() << "[" << i << "] = " << (*it)->getValue(i) << endl;
306  }
307 }
308 
309 // static data members
310 
317 bool L1MuGMTConfig::m_debug = false;
318 int L1MuGMTConfig::m_BxMin = -4;
319 int L1MuGMTConfig::m_BxMax = 4;
320 int L1MuGMTConfig::m_BxMinRo = -2;
328 float L1MuGMTConfig::m_EtaWeight_COU = 0.316;
331 bool L1MuGMTConfig::m_CaloTrigger = true;
334 bool L1MuGMTConfig::m_DoOvlRpcAnd = false;
335 
336 bool L1MuGMTConfig::m_PropagatePhi = false;
338 unsigned L1MuGMTConfig::m_VersionLUTs = 0;
339 
349 
373 
379 
static L1MuGMTLFSortRankEtaPhiLUT * m_LFSortRankEtaPhiLUT
static edm::InputTag m_CSCInputTag
static L1MuGMTLFDeltaEtaLUT * m_LFDeltaEtaLUT
static float m_EtaPhiThreshold_COU
Log< level::Info, true > LogVerbatim
static L1MuGMTRegMMConfigCharge * m_RegMMConfigCharge
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
static L1MuGMTMIAUPhiPro2LUT * m_MIAUPhiPro2LUT
static edm::InputTag m_RPCbInputTag
static int m_BxMax
static bool m_DoOvlRpcAnd
static int m_IsolationCellSizePhi
GMT Merge Method Config Register Phi.
Definition: L1MuGMTReg.h:148
static L1MuGMTLFSortRankCombineLUT * m_LFSortRankCombineLUT
static const L1MuTriggerScales * m_TriggerScales
void dumpRegs(std::string dir)
static L1MuGMTEtaLUT * m_EtaLUT
static bool m_CaloTrigger
static int m_dbgLevel
static float m_PhiWeight_barrel
static L1MuGMTPhiLUT * m_PhiLUT
static int m_IsolationCellSizeEta
static L1MuGMTLFMergeRankEtaQLUT * m_LFMergeRankEtaQLUT
static L1MuGMTLFMatchQualLUT * m_LFMatchQualLUT
static L1MuGMTRegMMConfigISO * m_RegMMConfigISO
GMT Merge Method Config Register Charge.
Definition: L1MuGMTReg.h:178
static L1MuGMTMIAUEtaConvLUT * m_MIAUEtaConvLUT
T getUntrackedParameter(std::string const &, T const &) const
GMT Merge Method Config Register ISO.
Definition: L1MuGMTReg.h:241
virtual ~L1MuGMTConfig()
destructor
static L1MuGMTLFDisableHotLUT * m_LFDisableHotLUT
static const L1MuTriggerPtScale * m_TriggerPtScale
static L1MuGMTRegMMConfigPhi * m_RegMMConfigPhi
static float m_EtaWeight_endcap
static const L1MuGMTChannelMask * m_GMTChanMask
static unsigned m_VersionSortRankEtaQLUT
static float m_PhiWeight_COU
static L1MuGMTLFMergeRankPtQLUT * m_LFMergeRankPtQLUT
static L1MuGMTLFMergeRankCombineLUT * m_LFMergeRankCombineLUT
static L1MuGMTRegSortRankOffset * m_RegSortRankOffset
static int m_BxMinRo
GMT Register that implements Rank offset for merged cands.
Definition: L1MuGMTReg.h:286
static L1MuGMTLFSortRankEtaQLUT * m_LFSortRankEtaQLUT
static unsigned m_VersionLUTs
static L1MuGMTRegMMConfigEta * m_RegMMConfigEta
GMT Register that implements Configuration of Cancel Decisison Logic.
Definition: L1MuGMTReg.h:312
void dumpLUTs(std::string dir)
static edm::InputTag m_MipIsoInputTag
static float m_EtaPhiThreshold_endcap
static L1MuGMTMIAUEtaProLUT * m_MIAUEtaProLUT
static float m_PhiWeight_endcap
static edm::InputTag m_RPCfInputTag
static L1MuGMTLFMergeRankEtaPhiLUT * m_LFMergeRankEtaPhiLUT
static float m_EtaWeight_barrel
GMT Register that implements additional Halo Overwrites Matched bit.
Definition: L1MuGMTReg.h:253
static const L1MuGMTScales * m_GMTScales
GMT Merge Method Config Register Eta.
Definition: L1MuGMTReg.h:158
L1MuGMTConfig(const edm::ParameterSet &ps)
constructor
static float m_EtaWeight_COU
static L1MuGMTRegMMConfigPt * m_RegMMConfigPt
static L1MuGMTLFPhiProLUT * m_LFPhiProLUT
static bool m_PropagatePhi
static const L1MuGMTParameters * m_GMTParams
static L1MuGMTRegMMConfigMIP * m_RegMMConfigMIP
static L1MuGMTLFEtaConvLUT * m_LFEtaConvLUT
static L1MuGMTLFSortRankPtQLUT * m_LFSortRankPtQLUT
void clearLUTsRegs()
GMT Merge Method Config Register Pt.
Definition: L1MuGMTReg.h:168
static L1MuGMTMIAUPhiPro1LUT * m_MIAUPhiPro1LUT
static L1MuGMTLFOvlEtaConvLUT * m_LFOvlEtaConvLUT
static float m_EtaPhiThreshold_barrel
static int m_BxMin
static const L1CaloGeometry * m_caloGeom
GMT Merge Method Config Register MIP.
Definition: L1MuGMTReg.h:230
static int m_BxMaxRo
static L1MuGMTLFCOUDeltaEtaLUT * m_LFCOUDeltaEtaLUT
void createLUTsRegs()
static L1MuGMTLFPtMixLUT * m_LFPtMixLUT
static L1MuGMTLFPhiProEtaConvLUT * m_LFPhiProEtaConvLUT
static L1MuGMTRegCDLConfig * m_RegCDLConfig
const bool Debug
static edm::InputTag m_DTInputTag
static L1MuGMTRegMMConfigSRK * m_RegMMConfigSRK
static bool m_debug