CMS 3D CMS Logo

ProcConfigurationBase.h
Go to the documentation of this file.
1 /*
2  * ProcConfigurationBase.h
3  *
4  * Created on: Jan 30, 2019
5  * Author: Karol Bunkowski kbunkow@cern.ch
6  */
7 
8 #ifndef L1T_OmtfP1_PROCCONFIGURATIONBASE_H_
9 #define L1T_OmtfP1_PROCCONFIGURATIONBASE_H_
11 
13 public:
15  virtual ~ProcConfigurationBase();
16 
20  virtual void configureFromEdmParameterSet(const edm::ParameterSet& edmParameterSet);
21 
22  virtual unsigned int nPhiBins() const = 0;
23 
24  virtual unsigned int nProcessors() const = 0;
25 
26  virtual double hwPtToGev(int hwPt) const = 0;
27 
28  virtual double hwUPtToGev(int hwPt) const = 0;
29 
31  virtual int ptGevToHw(double ptGev) const = 0;
32 
33  //processor internal phi scale
34  virtual int getProcScalePhi(double phiRad, double procPhiZeroRad = 0) const = 0;
35 
36  virtual int etaToHwEta(double eta) const = 0;
37 
38  //returns address for the pdf LUTs
39  virtual unsigned int ptHwToPtBin(int ptHw) const { return 0; }
40 
41  virtual unsigned int ptGeVToPtBin(float ptGeV) const { return 0; }
42 
43  //returns address for the pdf LUTs
44  virtual unsigned int etaHwToEtaBin(int etaHw) const { return 0; }
45 
46  virtual int foldPhi(int phi) const;
47 
48  virtual unsigned int nLayers() const = 0;
49 
50  virtual bool isBendingLayer(unsigned int iLayer) const = 0;
51 
52  virtual unsigned int getBxToProcess() const { return 1; }
53 
54  virtual int cscLctCentralBx() const { return cscLctCentralBx_; }
55 
56  virtual void setCscLctCentralBx(int lctCentralBx) { this->cscLctCentralBx_ = lctCentralBx; }
57 
59 
62  }
63 
64  virtual unsigned int getRpcMaxClusterCnt() const { return rpcMaxClusterCnt; }
65 
66  virtual void setRpcMaxClusterCnt(unsigned int rpcMaxClusterCnt = 2) { this->rpcMaxClusterCnt = rpcMaxClusterCnt; }
67 
68  virtual unsigned int getRpcMaxClusterSize() const { return rpcMaxClusterSize; }
69 
70  virtual void setRpcMaxClusterSize(unsigned int rpcMaxClusterSize = 4) { this->rpcMaxClusterSize = rpcMaxClusterSize; }
71 
72  virtual int getMinDtPhiQuality() const { return minDtPhiQuality; }
73 
75 
76  virtual int getMinDtPhiBQuality() const { return minDtPhiBQuality; }
77 
79 
80  virtual bool getFixCscGeometryOffset() const { return fixCscGeometryOffset; }
81 
83  return this->fixCscGeometryOffset = fixCscGeometryOffset;
84  }
85 
86  enum class StubEtaEncoding {
87  //in the firmware the eta is encoded as fired bits in the 9bit word, this is DT phase-1 encoding.
88  //In the emulator in most of the places eta value is used, but with the DT-like binning, i.e. only certain values are valid, see OMTFConfiguration::eta2Bits()
89  //this is the OMTF run2 option
90  bits = 0,
91  //the phase1 eta scale is used, but all hw values are valid, i.e. the DT-phase one binnig is NOT used
92  valueP1Scale = 1,
93  };
94 
96 
98 
99  //[unit/rad] for DT segment phiB, as it is at the level of the algorithm
100  //in the link data it can be different, and it is converted in the DtDigiToStubsConverterOmtf::addDTphiDigi
101  double dtPhiBUnitsRad() const { return dtPhiBUnitsRad_; }
102 
103 private:
104  int cscLctCentralBx_ = 8; //CSCConstants::LCT_CENTRAL_BX;
105 
106  //parameters of the RpcClusterization
107  unsigned int rpcMaxClusterSize = 3;
108  unsigned int rpcMaxClusterCnt = 2;
109 
111  // if true no cluster is return if there is more clusters then maxClusterCnt (counted regardless of the size)
112 
114 
115  int minDtPhiBQuality = 2; //used on the top of the minDtPhiQuality
116 
117  double dtPhiBUnitsRad_ = 512; //[unit/rad] for DT segment phiB, it is at the level of the algorithm, not inputs
118 
119  bool fixCscGeometryOffset = false;
120 
122 };
123 
124 #endif /* L1T_OmtfP1_PROCCONFIGURATIONBASE_H_ */
virtual bool setFixCscGeometryOffset(bool fixCscGeometryOffset)
StubEtaEncoding getStubEtaEncoding() const
virtual void setMinDtPhiBQuality(int minDtPhiBQuality=2)
virtual int getMinDtPhiBQuality() const
virtual void setRpcMaxClusterSize(unsigned int rpcMaxClusterSize=4)
virtual unsigned int getRpcMaxClusterSize() const
virtual void configureFromEdmParameterSet(const edm::ParameterSet &edmParameterSet)
virtual int etaToHwEta(double eta) const =0
virtual bool getFixCscGeometryOffset() const
virtual int ptGevToHw(double ptGev) const =0
uGMT pt scale conversion: [0GeV, 0.5GeV) = 1 [0.5GeV, 1 Gev) = 2
void setStubEtaEncoding(StubEtaEncoding stubEtaEncoding)
virtual unsigned int nPhiBins() const =0
virtual unsigned int getRpcMaxClusterCnt() const
virtual unsigned int nProcessors() const =0
virtual unsigned int ptHwToPtBin(int ptHw) const
virtual unsigned int etaHwToEtaBin(int etaHw) const
virtual void setMinDtPhiQuality(int minDtPhiQuality=2)
virtual void setCscLctCentralBx(int lctCentralBx)
virtual bool isBendingLayer(unsigned int iLayer) const =0
virtual int cscLctCentralBx() const
virtual unsigned int nLayers() const =0
virtual int foldPhi(int phi) const
virtual unsigned int ptGeVToPtBin(float ptGeV) const
virtual void setRpcMaxClusterCnt(unsigned int rpcMaxClusterCnt=2)
virtual int getProcScalePhi(double phiRad, double procPhiZeroRad=0) const =0
virtual int getMinDtPhiQuality() const
virtual unsigned int getBxToProcess() const
virtual void setRpcDropAllClustersIfMoreThanMax(bool rpcDropAllClustersIfMoreThanMax=true)
virtual bool getRpcDropAllClustersIfMoreThanMax() const
virtual double hwUPtToGev(int hwPt) const =0
virtual double hwPtToGev(int hwPt) const =0