Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:37:09

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTConfigTraco
0004  *
0005  *   Configurable parameters and constants 
0006  *   for Level-1 Muon DT Trigger - Traco chip
0007  *
0008  *
0009  *   \author S. Vanini
0010  *
0011  */
0012 //
0013 //--------------------------------------------------
0014 #ifndef DT_CONFIG_TRACO_H
0015 #define DT_CONFIG_TRACO_H
0016 
0017 //---------------
0018 // C++ Headers --
0019 //---------------
0020 
0021 //----------------------
0022 // Base Class Headers --
0023 //----------------------
0024 
0025 //------------------------------------
0026 // Collaborating Class Declarations --
0027 //------------------------------------
0028 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0029 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfig.h"
0030 #include "L1TriggerConfig/DTTPGConfig/interface/BitArray.h"
0031 #include <cstdint>
0032 
0033 //              ---------------------
0034 //              -- Class Interface --
0035 //              ---------------------
0036 
0037 class DTConfigTraco : public DTConfig {
0038 public:
0039   //! Costants: esolution for psi and DeltaPsiR (phi_B)
0040   static const int RESOLPSI = 512;
0041   //! Costant: resulution for psiR (phi)
0042   static const int RESOLPSIR = 4096;
0043   //! Costant: maximum number of TRACO output candidates to TS
0044   static const int NMAXCAND;
0045 
0046   //! Constructor
0047   DTConfigTraco(const edm::ParameterSet& ps);
0048 
0049   //! Constructor
0050   DTConfigTraco() {}
0051 
0052   //! Constructor from string
0053   DTConfigTraco(int debug, unsigned short int* buffer);
0054 
0055   //! Destructor
0056   ~DTConfigTraco() override;
0057 
0058   //! Set default parameters
0059   void setDefaults(const edm::ParameterSet& ps);
0060 
0061   //! Debug flag
0062   inline int debug() const { return m_debug; }
0063 
0064   //! KRAD traco parameter
0065   inline int KRAD() const { return m_krad; }
0066 
0067   //! BTIC traco parameter: must be equal to Btis ST parameter
0068   inline int BTIC() const { return m_btic; }
0069 
0070   //! DD traco parameter: this is fixed
0071   inline int DD() const { return m_dd; }
0072 
0073   //! Recycling of TRACO cand. in inner/outer SL : REUSEI/REUSEO
0074   inline int TcReuse(int i) const {
0075     if (i == 0)
0076       return m_reusei;
0077     else
0078       return m_reuseo;
0079   }
0080 
0081   //! Single HTRIG enabling on first/second tracks F(S)HTMSK
0082   inline int singleHflag(int i) const {
0083     if (i == 0)
0084       return m_fhtmsk;
0085     else
0086       return m_shtmsk;
0087   }
0088 
0089   //! Single LTRIG enabling on first/second tracks: F(S)LTMSK
0090   inline int singleLflag(int i) const {
0091     if (i == 0)
0092       return m_fltmsk;
0093     else
0094       return m_sltmsk;
0095   }
0096 
0097   //! Preference to inner on first/second tracks: F(S)SLMSK
0098   inline int prefInner(int i) const {
0099     if (i == 0)
0100       return m_fslmsk;
0101     else
0102       return m_sslmsk;
0103   }
0104 
0105   //! Preference to HTRIG on first/second tracks: F(S)HTPRF
0106   inline int prefHtrig(int i) const {
0107     if (i == 0)
0108       return m_fhtprf;
0109     else
0110       return m_shtprf;
0111   }
0112 
0113   //! Ascend. order for K sorting first/second tracks: F(S)HISM
0114   inline int sortKascend(int i) const {
0115     if (i == 0)
0116       return m_fhism;
0117     else
0118       return m_shism;
0119   }
0120 
0121   //! K tollerance for correlation in TRACO: F(S)PRGCOMP
0122   inline int TcKToll(int i) const {
0123     if (i == 0)
0124       return m_fprgcomp;
0125     else
0126       return m_sprgcomp;
0127   }
0128 
0129   //! Suppr. of LTRIG in 4 BX before HTRIG: LTS
0130   inline int TcBxLts() const { return m_lts; }
0131 
0132   //! Single LTRIG accept enabling on first/second tracks LTF
0133   inline int singleLenab(int i) const { return m_ltf; }
0134 
0135   //! Connected bti in traco: bti mask
0136   inline int usedBti(int bti) const { return m_trgenb.element(bti - 1); }
0137 
0138   //! IBTIOFF traco parameter
0139   inline int IBTIOFF() const { return m_ibtioff; }
0140 
0141   //! Bending angle cut for all stations and triggers : KPRGCOM
0142   inline int BendingAngleCut() const { return m_kprgcom; }
0143 
0144   //! Flag for Low validation parameter
0145   inline int LVALIDIFH() const { return m_lvalidifh; }
0146 
0147   //! Set single parameter functions
0148   //! Set debug flag
0149   inline void setDebug(int debug) { m_debug = debug; }
0150 
0151   //! Set KRAD traco parameter
0152   inline void setKRAD(int KRAD) { m_krad = KRAD; }
0153 
0154   //! Set BTIC traco parameter: must be equal to Btis ST parameter
0155   inline void setBTIC(int BTIC) { m_btic = BTIC; }
0156 
0157   //! Set DD traco parameter: this is fixed
0158   inline void setDD(int DD) { m_dd = DD; }
0159 
0160   //! Set Recycling of TRACO cand. in inner/outer SL : REUSEI/REUSEO
0161   inline void setTcReuse(int i, int TcReuse) {
0162     if (i == 0)
0163       m_reusei = TcReuse;
0164     else
0165       m_reuseo = TcReuse;
0166   }
0167 
0168   //! Set Single HTRIG enabling on first/second tracks F(S)HTMSK
0169   inline void setSingleHflag(int i, int singleHflag) {
0170     if (i == 0)
0171       m_fhtmsk = singleHflag;
0172     else
0173       m_shtmsk = singleHflag;
0174   }
0175 
0176   //! Set Single LTRIG enabling on first/second tracks: F(S)LTMSK
0177   inline void setSingleLflag(int i, int singleLflag) {
0178     if (i == 0)
0179       m_fltmsk = singleLflag;
0180     else
0181       m_sltmsk = singleLflag;
0182   }
0183 
0184   //! Set Preference to inner on first/second tracks: F(S)SLMSK
0185   inline void setPrefInner(int i, int prefInner) {
0186     if (i == 0)
0187       m_fslmsk = prefInner;
0188     else
0189       m_sslmsk = prefInner;
0190   }
0191 
0192   //! Set Preference to HTRIG on first/second tracks: F(S)HTPRF
0193   inline void setPrefHtrig(int i, int prefHtrig) {
0194     if (i == 0)
0195       m_fhtprf = prefHtrig;
0196     else
0197       m_shtprf = prefHtrig;
0198   }
0199 
0200   //! Set Ascend. order for K sorting first/second tracks: F(S)HISM
0201   inline void setSortKascend(int i, int sortKascend) {
0202     if (i == 0)
0203       m_fhism = sortKascend;
0204     else
0205       m_shism = sortKascend;
0206   }
0207 
0208   //! Set K tollerance for correlation in TRACO: F(S)PRGCOMP
0209   inline void setTcKToll(int i, int TcKToll) {
0210     if (i == 0)
0211       m_fprgcomp = TcKToll;
0212     else
0213       m_sprgcomp = TcKToll;
0214   }
0215 
0216   //! Set Suppr. of LTRIG in 4 BX before HTRIG: LTS
0217   inline void setTcBxLts(int TcBxLts) { m_lts = TcBxLts; }
0218 
0219   //! Set Single LTRIG accept enabling on first/second tracks LTF
0220   inline void setSingleLenab(int i, int singleLenab) { m_ltf = singleLenab; }
0221 
0222   //! Set Connected bti in traco: bti mask
0223   inline void setUsedBti(int bti, int mask) { m_trgenb.set(bti - 1, mask); }
0224 
0225   //! Set IBTIOFF traco parameter
0226   inline void setIBTIOFF(int IBTIOFF) { m_ibtioff = IBTIOFF; }
0227 
0228   //! Set Bending angle cut for all stations and triggers : KPRGCOM
0229   inline void setBendingAngleCut(int BendingAngleCut) { m_kprgcom = BendingAngleCut; }
0230 
0231   //! Set Flag for Low validation parameter
0232   inline void setLVALIDIFH(int LVALIDIFH) { m_lvalidifh = LVALIDIFH; }
0233 
0234   //! Print the setup
0235   void print() const;
0236 
0237 private:
0238   int8_t m_debug;
0239   int8_t m_krad;
0240   int8_t m_btic;
0241   int8_t m_dd;
0242   int8_t m_reusei;
0243   int8_t m_reuseo;
0244   int8_t m_fhtmsk;
0245   int8_t m_shtmsk;
0246   int8_t m_fltmsk;
0247   int8_t m_sltmsk;
0248   int8_t m_fslmsk;
0249   int8_t m_sslmsk;
0250   int8_t m_fhtprf;
0251   int8_t m_shtprf;
0252   int8_t m_fhism;
0253   int8_t m_shism;
0254   int8_t m_fprgcomp;
0255   int8_t m_sprgcomp;
0256   int8_t m_lts;
0257   int8_t m_ltf;
0258   BitArray<16> m_trgenb;
0259   int8_t m_ibtioff;
0260   int16_t m_kprgcom;
0261   int8_t m_lvalidifh;
0262 };
0263 
0264 #endif