CMS 3D CMS Logo

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