CMS 3D CMS Logo

L1TMuonOverlapParams.h
Go to the documentation of this file.
1 #ifndef L1TMTFOverlapParams_h
2 #define L1TMTFOverlapParams_h
3 
4 #include <memory>
5 #include <iostream>
6 #include <vector>
7 #include <cmath>
8 
11 
15 public:
16  class Node {
17  public:
19  unsigned version_;
21  std::vector<double> dparams_;
22  std::vector<unsigned> uparams_;
23  std::vector<int> iparams_;
24  std::vector<std::string> sparams_;
25  Node() {
26  type_ = "unspecified";
27  version_ = 0;
28  }
30  };
31 
32  class LayerMapNode {
33  public:
35  unsigned int hwNumber;
36 
38  unsigned int logicNumber;
39 
42 
45  unsigned int connectedToLayer;
46 
48 
50  };
51 
53  public:
55  unsigned int refLayer;
56 
58  unsigned int logicNumber;
59 
61 
63  };
64 
65  class RefHitNode {
66  public:
67  unsigned int iInput;
69  unsigned int iRefHit;
70  unsigned int iRefLayer;
71  unsigned int iRegion;
72 
73  RefHitNode(void) : iInput(0), iPhiMin(0), iPhiMax(0), iRefHit(0), iRefLayer(0), iRegion(0) {}
74 
76  };
77 
79  public:
80  unsigned int iFirstInput;
81  unsigned int iLayer;
82  unsigned int nInputs;
83 
84  LayerInputNode(void) : iFirstInput(0), iLayer(0), nInputs(0) {}
85 
87  };
88 
89  enum { Version = 1 };
90 
91  // DO NOT ADD ENTRIES ANYWHERE BUT DIRECTLY BEFORE "NUM_OMTFPARAMNODES"
92  enum {
93  CHARGE = 0,
94  ETA = 1,
95  PT = 2,
96  PDF = 3,
98  GENERAL = 5,
103  };
104 
105  // General configuration parameters indexes
106  enum {
121  };
122 
125  pnodes_.resize(NUM_OMTFPARAMNODES);
126  }
128 
129  // Firmware version
130  unsigned fwVersion() const { return fwVersion_; }
132 
134  const std::vector<int> *generalParams() const { return &pnodes_[GENERAL].iparams_; }
135  void setGeneralParams(const std::vector<int> &paramsVec) {
136  pnodes_[GENERAL].type_ = "INT";
137  pnodes_[GENERAL].iparams_ = paramsVec;
138  }
139 
141  int nPdfAddrBits() const { return pnodes_[GENERAL].iparams_[GENERAL_ADDRBITS]; };
142 
143  int nPdfValBits() const { return pnodes_[GENERAL].iparams_[GENERAL_VALBITS]; };
144 
145  int nHitsPerLayer() const { return pnodes_[GENERAL].iparams_[GENERAL_HITSPERLAYER]; };
146 
147  int nPhiBits() const { return pnodes_[GENERAL].iparams_[GENERAL_PHIBITS]; };
148 
149  int nPhiBins() const { return pnodes_[GENERAL].iparams_[GENERAL_PHIBINS]; };
150 
151  int nRefHits() const { return pnodes_[GENERAL].iparams_[GENERAL_NREFHITS]; };
152 
153  int nTestRefHits() const { return pnodes_[GENERAL].iparams_[GENERAL_NTESTREFHITS]; };
154 
155  int nProcessors() const { return pnodes_[GENERAL].iparams_[GENERAL_NPROCESSORS]; };
156 
157  int nLogicRegions() const { return pnodes_[GENERAL].iparams_[GENERAL_NLOGIC_REGIONS]; };
158 
159  int nInputs() const { return pnodes_[GENERAL].iparams_[GENERAL_NINPUTS]; };
160 
161  int nLayers() const { return pnodes_[GENERAL].iparams_[GENERAL_NLAYERS]; };
162 
163  int nRefLayers() const { return pnodes_[GENERAL].iparams_[GENERAL_NREFLAYERS]; };
164 
165  int nGoldenPatterns() const { return pnodes_[GENERAL].iparams_[GENERAL_NGOLDENPATTERNS]; };
166 
168  void setLayerMap(const std::vector<LayerMapNode> &aVector) { layerMap_ = aVector; }
169 
170  void setRefLayerMap(const std::vector<RefLayerMapNode> &aVector) { refLayerMap_ = aVector; }
171 
172  void setRefHitMap(const std::vector<RefHitNode> &aVector) { refHitMap_ = aVector; };
173 
174  void setGlobalPhiStartMap(const std::vector<int> &aVector) { globalPhiStart_ = aVector; };
175 
176  void setLayerInputMap(const std::vector<LayerInputNode> &aVector) { layerInputMap_ = aVector; };
177 
178  void setConnectedSectorsStart(const std::vector<int> &aVector) {
179  pnodes_[SECTORS_START].type_ = "INT";
180  pnodes_[SECTORS_START].iparams_ = aVector;
181  };
182 
183  void setConnectedSectorsEnd(const std::vector<int> &aVector) {
184  pnodes_[SECTORS_END].type_ = "INT";
185  pnodes_[SECTORS_END].iparams_ = aVector;
186  };
187 
188  const std::vector<LayerMapNode> *layerMap() const { return &layerMap_; };
189 
190  const std::vector<RefLayerMapNode> *refLayerMap() const { return &refLayerMap_; };
191 
192  const std::vector<RefHitNode> *refHitMap() const { return &refHitMap_; };
193 
194  const std::vector<int> *globalPhiStartMap() const { return &globalPhiStart_; };
195 
196  const std::vector<LayerInputNode> *layerInputMap() const { return &layerInputMap_; };
197 
198  const std::vector<int> *connectedSectorsStart() const { return &pnodes_[SECTORS_START].iparams_; };
199 
200  const std::vector<int> *connectedSectorsEnd() const { return &pnodes_[SECTORS_END].iparams_; };
201 
203  const l1t::LUT *chargeLUT() const { return &pnodes_[CHARGE].LUT_; }
204  const l1t::LUT *etaLUT() const { return &pnodes_[ETA].LUT_; }
205  const l1t::LUT *ptLUT() const { return &pnodes_[PT].LUT_; }
206  const l1t::LUT *pdfLUT() const { return &pnodes_[PDF].LUT_; }
207  const l1t::LUT *meanDistPhiLUT() const { return &pnodes_[MEANDISTPHI].LUT_; }
208 
213  const l1t::LUT *distPhiShiftLUT() const {
214  if (pnodes_.size() >= (DIST_PHI_SHIFT + 1))
215  return &pnodes_[DIST_PHI_SHIFT].LUT_;
216  else
217  return nullptr;
218  }
219 
220  void setChargeLUT(const l1t::LUT &lut) {
221  pnodes_[CHARGE].type_ = "LUT";
222  pnodes_[CHARGE].LUT_ = lut;
223  }
224  void setEtaLUT(const l1t::LUT &lut) {
225  pnodes_[ETA].type_ = "LUT";
226  pnodes_[ETA].LUT_ = lut;
227  }
228  void setPtLUT(const l1t::LUT &lut) {
229  pnodes_[PT].type_ = "LUT";
230  pnodes_[PT].LUT_ = lut;
231  }
232  void setPdfLUT(const l1t::LUT &lut) {
233  pnodes_[PDF].type_ = "LUT";
234  pnodes_[PDF].LUT_ = lut;
235  }
236  void setMeanDistPhiLUT(const l1t::LUT &lut) {
237  pnodes_[MEANDISTPHI].type_ = "LUT";
238  pnodes_[MEANDISTPHI].LUT_ = lut;
239  }
240  void setDistPhiShiftLUT(const l1t::LUT &lut) {
241  pnodes_[DIST_PHI_SHIFT].type_ = "LUT";
242  pnodes_[DIST_PHI_SHIFT].LUT_ = lut;
243  }
244 
245 private:
247  unsigned fwVersion_;
248 
250  std::vector<Node> pnodes_;
251 
253  std::vector<LayerMapNode> layerMap_;
254 
257  std::vector<RefLayerMapNode> refLayerMap_;
258 
262  std::vector<RefHitNode> refHitMap_;
263 
266  std::vector<int> globalPhiStart_;
267 
271  std::vector<LayerInputNode> layerInputMap_;
272 
274 };
275 #endif
std::vector< RefHitNode > refHitMap_
const std::vector< int > * generalParams() const
General definitions.
void setMeanDistPhiLUT(const l1t::LUT &lut)
const l1t::LUT * chargeLUT() const
Golden Patterns definitions.
void setLayerMap(const std::vector< LayerMapNode > &aVector)
Connections definitions.
void setConnectedSectorsEnd(const std::vector< int > &aVector)
unsigned int hwNumber
short layer number used within OMTF emulator
void setEtaLUT(const l1t::LUT &lut)
void setRefLayerMap(const std::vector< RefLayerMapNode > &aVector)
void setChargeLUT(const l1t::LUT &lut)
unsigned int logicNumber
logic numer of the layer
const std::vector< LayerMapNode > * layerMap() const
const l1t::LUT * distPhiShiftLUT() const
unsigned fwVersion_
Version of firmware configuration.
const std::vector< LayerInputNode > * layerInputMap() const
int nPdfAddrBits() const
Access to specific general settings.
void setPtLUT(const l1t::LUT &lut)
void setGeneralParams(const std::vector< int > &paramsVec)
std::vector< unsigned > uparams_
const l1t::LUT * pdfLUT() const
unsigned fwVersion() const
std::vector< LayerInputNode > layerInputMap_
std::vector< Node > pnodes_
vector of LUT like parameters
bool bendingLayer
Is this a bending layers?
std::vector< double > dparams_
void setConnectedSectorsStart(const std::vector< int > &aVector)
std::vector< std::string > sparams_
Definition: LUT.h:29
std::vector< LayerMapNode > layerMap_
Vector of structs representing definitions of measurement layers.
unsigned int refLayer
Reference layer number.
void setGlobalPhiStartMap(const std::vector< int > &aVector)
void setLayerInputMap(const std::vector< LayerInputNode > &aVector)
#define COND_SERIALIZABLE
Definition: Serializable.h:39
std::vector< int > globalPhiStart_
void setRefHitMap(const std::vector< RefHitNode > &aVector)
const std::vector< int > * connectedSectorsEnd() const
unsigned int logicNumber
Corresponding logical layer number.
const l1t::LUT * meanDistPhiLUT() const
const std::vector< RefLayerMapNode > * refLayerMap() const
void setFwVersion(unsigned fwVersion)
const std::vector< int > * connectedSectorsStart() const
const l1t::LUT * ptLUT() const
const std::vector< RefHitNode > * refHitMap() const
const std::vector< int > * globalPhiStartMap() const
std::vector< RefLayerMapNode > refLayerMap_
void setDistPhiShiftLUT(const l1t::LUT &lut)
const l1t::LUT * etaLUT() const
void setPdfLUT(const l1t::LUT &lut)