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 
47  LayerMapNode(void) : hwNumber(0), logicNumber(0), bendingLayer(false), connectedToLayer(0) {}
48 
50  };
51 
53  public:
55  unsigned int refLayer;
56 
58  unsigned int logicNumber;
59 
60  RefLayerMapNode(void) : refLayer(0), logicNumber(0) {}
61 
63  };
64 
65  class RefHitNode {
66  public:
67  unsigned int iInput;
68  int iPhiMin, iPhiMax;
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,
102  };
103 
104  // General configuration parameters indexes
105  enum {
120  };
121 
124  pnodes_.resize(NUM_OMTFPARAMNODES);
125  }
127 
128  // Firmware version
129  unsigned fwVersion() const { return fwVersion_; }
131 
133  const std::vector<int> *generalParams() const { return &pnodes_[GENERAL].iparams_; }
134  void setGeneralParams(const std::vector<int> &paramsVec) {
135  pnodes_[GENERAL].type_ = "INT";
136  pnodes_[GENERAL].iparams_ = paramsVec;
137  }
138 
140  int nPdfAddrBits() const { return pnodes_[GENERAL].iparams_[GENERAL_ADDRBITS]; };
141 
142  int nPdfValBits() const { return pnodes_[GENERAL].iparams_[GENERAL_VALBITS]; };
143 
144  int nHitsPerLayer() const { return pnodes_[GENERAL].iparams_[GENERAL_HITSPERLAYER]; };
145 
146  int nPhiBits() const { return pnodes_[GENERAL].iparams_[GENERAL_PHIBITS]; };
147 
148  int nPhiBins() const { return pnodes_[GENERAL].iparams_[GENERAL_PHIBINS]; };
149 
150  int nRefHits() const { return pnodes_[GENERAL].iparams_[GENERAL_NREFHITS]; };
151 
152  int nTestRefHits() const { return pnodes_[GENERAL].iparams_[GENERAL_NTESTREFHITS]; };
153 
154  int nProcessors() const { return pnodes_[GENERAL].iparams_[GENERAL_NPROCESSORS]; };
155 
156  int nLogicRegions() const { return pnodes_[GENERAL].iparams_[GENERAL_NLOGIC_REGIONS]; };
157 
158  int nInputs() const { return pnodes_[GENERAL].iparams_[GENERAL_NINPUTS]; };
159 
160  int nLayers() const { return pnodes_[GENERAL].iparams_[GENERAL_NLAYERS]; };
161 
162  int nRefLayers() const { return pnodes_[GENERAL].iparams_[GENERAL_NREFLAYERS]; };
163 
164  int nGoldenPatterns() const { return pnodes_[GENERAL].iparams_[GENERAL_NGOLDENPATTERNS]; };
165 
167  void setLayerMap(const std::vector<LayerMapNode> &aVector) { layerMap_ = aVector; }
168 
169  void setRefLayerMap(const std::vector<RefLayerMapNode> &aVector) { refLayerMap_ = aVector; }
170 
171  void setRefHitMap(const std::vector<RefHitNode> &aVector) { refHitMap_ = aVector; };
172 
173  void setGlobalPhiStartMap(const std::vector<int> &aVector) { globalPhiStart_ = aVector; };
174 
175  void setLayerInputMap(const std::vector<LayerInputNode> &aVector) { layerInputMap_ = aVector; };
176 
177  void setConnectedSectorsStart(const std::vector<int> &aVector) {
178  pnodes_[SECTORS_START].type_ = "INT";
179  pnodes_[SECTORS_START].iparams_ = aVector;
180  };
181 
182  void setConnectedSectorsEnd(const std::vector<int> &aVector) {
183  pnodes_[SECTORS_END].type_ = "INT";
184  pnodes_[SECTORS_END].iparams_ = aVector;
185  };
186 
187  const std::vector<LayerMapNode> *layerMap() const { return &layerMap_; };
188 
189  const std::vector<RefLayerMapNode> *refLayerMap() const { return &refLayerMap_; };
190 
191  const std::vector<RefHitNode> *refHitMap() const { return &refHitMap_; };
192 
193  const std::vector<int> *globalPhiStartMap() const { return &globalPhiStart_; };
194 
195  const std::vector<LayerInputNode> *layerInputMap() const { return &layerInputMap_; };
196 
197  const std::vector<int> *connectedSectorsStart() const { return &pnodes_[SECTORS_START].iparams_; };
198 
199  const std::vector<int> *connectedSectorsEnd() const { return &pnodes_[SECTORS_END].iparams_; };
200 
202  const l1t::LUT *chargeLUT() const { return &pnodes_[CHARGE].LUT_; }
203  const l1t::LUT *etaLUT() const { return &pnodes_[ETA].LUT_; }
204  const l1t::LUT *ptLUT() const { return &pnodes_[PT].LUT_; }
205  const l1t::LUT *pdfLUT() const { return &pnodes_[PDF].LUT_; }
206  const l1t::LUT *meanDistPhiLUT() const { return &pnodes_[MEANDISTPHI].LUT_; }
207 
208  void setChargeLUT(const l1t::LUT &lut) {
209  pnodes_[CHARGE].type_ = "LUT";
210  pnodes_[CHARGE].LUT_ = lut;
211  }
212  void setEtaLUT(const l1t::LUT &lut) {
213  pnodes_[ETA].type_ = "LUT";
214  pnodes_[ETA].LUT_ = lut;
215  }
216  void setPtLUT(const l1t::LUT &lut) {
217  pnodes_[PT].type_ = "LUT";
218  pnodes_[PT].LUT_ = lut;
219  }
220  void setPdfLUT(const l1t::LUT &lut) {
221  pnodes_[PDF].type_ = "LUT";
222  pnodes_[PDF].LUT_ = lut;
223  }
224  void setMeanDistPhiLUT(const l1t::LUT &lut) {
225  pnodes_[MEANDISTPHI].type_ = "LUT";
226  pnodes_[MEANDISTPHI].LUT_ = lut;
227  }
228 
229 private:
231  unsigned fwVersion_;
232 
234  std::vector<Node> pnodes_;
235 
237  std::vector<LayerMapNode> layerMap_;
238 
241  std::vector<RefLayerMapNode> refLayerMap_;
242 
246  std::vector<RefHitNode> refHitMap_;
247 
250  std::vector<int> globalPhiStart_;
251 
255  std::vector<LayerInputNode> layerInputMap_;
256 
258 };
259 #endif
std::vector< RefHitNode > refHitMap_
const std::vector< LayerMapNode > * layerMap() const
void setMeanDistPhiLUT(const l1t::LUT &lut)
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)
const std::vector< int > * connectedSectorsEnd() const
unsigned fwVersion() const
void setRefLayerMap(const std::vector< RefLayerMapNode > &aVector)
void setChargeLUT(const l1t::LUT &lut)
unsigned int logicNumber
logic numer of the layer
unsigned fwVersion_
Version of firmware configuration.
const l1t::LUT * chargeLUT() const
Golden Patterns definitions.
const std::vector< LayerInputNode > * layerInputMap() const
const std::vector< int > * generalParams() const
General definitions.
void setPtLUT(const l1t::LUT &lut)
void setGeneralParams(const std::vector< int > &paramsVec)
std::vector< unsigned > uparams_
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_
const l1t::LUT * etaLUT() const
const l1t::LUT * pdfLUT() const
int nPdfAddrBits() const
Access to specific general settings.
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)
const std::vector< int > * globalPhiStartMap() const
void setLayerInputMap(const std::vector< LayerInputNode > &aVector)
#define COND_SERIALIZABLE
Definition: Serializable.h:38
std::vector< int > globalPhiStart_
void setRefHitMap(const std::vector< RefHitNode > &aVector)
const l1t::LUT * ptLUT() const
unsigned int logicNumber
Corresponding logical layer number.
void setFwVersion(unsigned fwVersion)
const std::vector< RefLayerMapNode > * refLayerMap() const
std::vector< RefLayerMapNode > refLayerMap_
const l1t::LUT * meanDistPhiLUT() const
void setPdfLUT(const l1t::LUT &lut)
const std::vector< int > * connectedSectorsStart() const
const std::vector< RefHitNode > * refHitMap() const