Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:07

0001 /*
0002  * ProcConfigurationBase.h
0003  *
0004  *  Created on: Jan 30, 2019
0005  *      Author: Karol Bunkowski kbunkow@cern.ch
0006  */
0007 
0008 #ifndef L1T_OmtfP1_PROCCONFIGURATIONBASE_H_
0009 #define L1T_OmtfP1_PROCCONFIGURATIONBASE_H_
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 
0012 class ProcConfigurationBase {
0013 public:
0014   ProcConfigurationBase();
0015   virtual ~ProcConfigurationBase();
0016 
0017   /**configuration from the edm::ParameterSet
0018    * the parameters are set (i.e. overwritten) only if their exist in the edmParameterSet
0019    */
0020   virtual void configureFromEdmParameterSet(const edm::ParameterSet& edmParameterSet);
0021 
0022   virtual unsigned int nPhiBins() const = 0;
0023 
0024   virtual unsigned int nProcessors() const = 0;
0025 
0026   virtual double hwPtToGev(int hwPt) const = 0;
0027 
0028   virtual double hwUPtToGev(int hwPt) const = 0;
0029 
0030   ///uGMT pt scale conversion: [0GeV, 0.5GeV) = 1 [0.5GeV, 1 Gev) = 2
0031   virtual int ptGevToHw(double ptGev) const = 0;
0032 
0033   //processor internal phi scale
0034   virtual int getProcScalePhi(double phiRad, double procPhiZeroRad = 0) const = 0;
0035 
0036   virtual int etaToHwEta(double eta) const = 0;
0037 
0038   //returns address for the  pdf LUTs
0039   virtual unsigned int ptHwToPtBin(int ptHw) const { return 0; }
0040 
0041   virtual unsigned int ptGeVToPtBin(float ptGeV) const { return 0; }
0042 
0043   //returns address for the  pdf LUTs
0044   virtual unsigned int etaHwToEtaBin(int etaHw) const { return 0; }
0045 
0046   virtual int foldPhi(int phi) const;
0047 
0048   virtual unsigned int nLayers() const = 0;
0049 
0050   virtual bool isBendingLayer(unsigned int iLayer) const = 0;
0051 
0052   virtual unsigned int getBxToProcess() const { return 1; }
0053 
0054   virtual int cscLctCentralBx() const { return cscLctCentralBx_; }
0055 
0056   virtual void setCscLctCentralBx(int lctCentralBx) { this->cscLctCentralBx_ = lctCentralBx; }
0057 
0058   virtual bool getRpcDropAllClustersIfMoreThanMax() const { return rpcDropAllClustersIfMoreThanMax; }
0059 
0060   virtual void setRpcDropAllClustersIfMoreThanMax(bool rpcDropAllClustersIfMoreThanMax = true) {
0061     this->rpcDropAllClustersIfMoreThanMax = rpcDropAllClustersIfMoreThanMax;
0062   }
0063 
0064   virtual unsigned int getRpcMaxClusterCnt() const { return rpcMaxClusterCnt; }
0065 
0066   virtual void setRpcMaxClusterCnt(unsigned int rpcMaxClusterCnt = 2) { this->rpcMaxClusterCnt = rpcMaxClusterCnt; }
0067 
0068   virtual unsigned int getRpcMaxClusterSize() const { return rpcMaxClusterSize; }
0069 
0070   virtual void setRpcMaxClusterSize(unsigned int rpcMaxClusterSize = 4) { this->rpcMaxClusterSize = rpcMaxClusterSize; }
0071 
0072   virtual int getMinDtPhiQuality() const { return minDtPhiQuality; }
0073 
0074   virtual void setMinDtPhiQuality(int minDtPhiQuality = 2) { this->minDtPhiQuality = minDtPhiQuality; }
0075 
0076   virtual int getMinDtPhiBQuality() const { return minDtPhiBQuality; }
0077 
0078   virtual void setMinDtPhiBQuality(int minDtPhiBQuality = 2) { this->minDtPhiBQuality = minDtPhiBQuality; }
0079 
0080   virtual bool getFixCscGeometryOffset() const { return fixCscGeometryOffset; }
0081 
0082   virtual bool setFixCscGeometryOffset(bool fixCscGeometryOffset) {
0083     return this->fixCscGeometryOffset = fixCscGeometryOffset;
0084   }
0085 
0086   enum class StubEtaEncoding {
0087     //in the firmware the eta is encoded as fired bits in the 9bit word, this is DT phase-1 encoding.
0088     //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()
0089     //this is the OMTF run2 option
0090     bits = 0,
0091     //the phase1 eta scale is used, but all hw values are valid, i.e. the DT-phase one binnig is NOT used
0092     valueP1Scale = 1,
0093   };
0094 
0095   StubEtaEncoding getStubEtaEncoding() const { return stubEtaEncoding; }
0096 
0097   void setStubEtaEncoding(StubEtaEncoding stubEtaEncoding) { this->stubEtaEncoding = stubEtaEncoding; }
0098 
0099   //[unit/rad] for DT segment phiB, as it is at the level of the algorithm
0100   //in the link data it can be different, and it is converted in the DtDigiToStubsConverterOmtf::addDTphiDigi
0101   double dtPhiBUnitsRad() const { return dtPhiBUnitsRad_; }
0102 
0103 private:
0104   int cscLctCentralBx_ = 8;  //CSCConstants::LCT_CENTRAL_BX;
0105 
0106   //parameters of the RpcClusterization
0107   unsigned int rpcMaxClusterSize = 3;
0108   unsigned int rpcMaxClusterCnt = 2;
0109 
0110   bool rpcDropAllClustersIfMoreThanMax = false;
0111   // if true no  cluster is return if there is more clusters then maxClusterCnt (counted regardless of the size)
0112 
0113   int minDtPhiQuality = 2;
0114 
0115   int minDtPhiBQuality = 2;  //used on the top of the minDtPhiQuality
0116 
0117   double dtPhiBUnitsRad_ = 512;  //[unit/rad] for DT segment phiB, it is at the level of the algorithm, not inputs
0118 
0119   bool fixCscGeometryOffset = false;
0120 
0121   StubEtaEncoding stubEtaEncoding = StubEtaEncoding::bits;
0122 };
0123 
0124 #endif /* L1T_OmtfP1_PROCCONFIGURATIONBASE_H_ */