CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/L1TriggerConfig/DTTPGConfig/interface/DTConfigTSPhi.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00012 //
00013 //--------------------------------------------------
00014 #ifndef DT_CONFIG_TSPHI_H
00015 #define DT_CONFIG_TSPHI_H
00016 
00017 //---------------
00018 // C++ Headers --
00019 //---------------
00020 
00021 //----------------------
00022 // Base Class Headers --
00023 //----------------------
00024 
00025 //------------------------------------
00026 // Collaborating Class Declarations --
00027 //------------------------------------
00028 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00029 #include "L1TriggerConfig/DTTPGConfig/interface/BitArray.h"
00030 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfig.h"
00031 #include "boost/cstdint.hpp"
00032 
00033 //              ---------------------
00034 //              -- Class Interface --
00035 //              ---------------------
00036 
00037 class DTConfigTSPhi : public DTConfig {
00038 
00039   public:
00040   
00042   static const int NTSSTSM = 7;
00043   
00045   static const int NTSMD = 2;
00046   
00048   static const int NTSSTSMD = 3;
00049 
00051   DTConfigTSPhi(const edm:: ParameterSet& ps);
00052 
00054   DTConfigTSPhi() {};
00055 
00057   DTConfigTSPhi(bool debug, unsigned short int tss_buffer[7][31], int ntss, unsigned short int tsm_buffer[9]);
00058 
00060   ~DTConfigTSPhi();
00061 
00063   inline bool debug() const { return m_debug; }
00064 
00066   inline int  TssMasking(int i) const { return (int)m_tssmsk[i]; }
00067  
00069   inline bool  TssHtrigEna(int i) const { return m_tsshte[i]; }
00070 
00072   inline bool  TssHtrigEnaCarry() const { return m_tsshte[2]; }
00073   
00075   inline bool  TssInOutEna(int i) const { return m_tssnoe[i]; }
00076   
00078   inline bool  TssInOutEnaCarry() const { return m_tssnoe[2]; }
00079   
00081   inline bool  TssCorrEna(int i) const { return m_tsscce[i]; }
00082   
00084   inline bool  TssCorrEnaCarry() const { return m_tsscce[2]; }
00085   
00087   inline int  TsmMasking(int i) const { return (int)m_tsmmsk[i]; }
00088   
00090   inline bool  TsmHtrigEna(int i) const { return m_tsmhte[i]; }
00091   
00093   inline bool  TsmHtrigEnaCarry() const { return m_tsmhte[2]; }
00094   
00096   inline bool  TsmInOutEna(int i) const { return m_tsmnoe[i]; }
00097   
00099   inline bool  TsmInOutEnaCarry() const { return m_tsmnoe[2]; }
00100   
00102   inline bool  TsmCorrEna(int i) const { return m_tsmcce[i]; }
00103     
00105   inline bool  TsmCorrEnaCarry() const { return m_tsmcce[2]; }
00106     
00108   inline int  TssGhost1Flag() const { return (int)m_tssgs1; }
00109   
00111   inline int  TssGhost2Flag() const { return (int)m_tssgs2; }
00112 
00114   inline int  TsmGhost1Flag() const { return (int)m_tsmgs1; }
00115   
00117   inline int  TsmGhost2Flag() const { return (int)m_tsmgs2; }
00118   
00120   inline bool  TssGhost1Corr() const { return m_tsscgs1; }
00121   
00123   inline bool  TssGhost2Corr() const { return m_tsscgs2; }
00124 
00126   inline bool  TsmGhost1Corr() const { return m_tsmcgs1; }
00127   
00129   inline bool  TsmGhost2Corr() const { return m_tsmcgs2; }
00130 
00132   inline int  TsmGetCarryFlag() const { return (int)m_tsmhsp; }
00133 
00135   inline bool usedTraco(int i) const { return (bool) m_tstren.element(i-1); }
00136 
00138   inline BitArray<8> TsmStatus() const { return m_tsmword; };
00139 
00140   // DBSM-doubleTSM
00142   int TSSinTSMD(int stat, int sect);
00143 
00144   // Set Methods
00146   inline void setDebug(bool debug) { m_debug=debug; }
00147 
00149   void  setTssMasking(unsigned short int tssmsk, int i) { m_tssmsk[i-1] = tssmsk; }
00150  
00152   inline void  setTssHtrigEna(bool tsshte, int i) { m_tsshte[i-1] = tsshte; }
00153 
00155   inline void  setTssHtrigEnaCarry(bool tsshte) { m_tsshte[2] = tsshte; }
00156   
00158   inline void  setTssInOutEna(bool tssnoe, int i) { m_tssnoe[i-1] = tssnoe; }
00159   
00161   inline void  setTssInOutEnaCarry(bool tssnoe) { m_tssnoe[2] = tssnoe; }
00162   
00164   inline void  setTssCorrEna(bool tsscce, int i) { m_tsscce[i-1] = tsscce; }
00165   
00167   inline void  setTssCorrEnaCarry(bool tsscce) { m_tsscce[2] = tsscce; }
00168   
00170   void setTsmMasking(unsigned short int tsmmsk, int i) { m_tsmmsk[i-1] = tsmmsk; }
00171   
00173   inline void setTsmHtrigEna(bool tsmhte, int i) { m_tsmhte[i-1] = tsmhte; }
00174   
00176   inline void setTsmHtrigEnaCarry(bool tsmhte) { m_tsmhte[2] = tsmhte; }
00177   
00179   inline void setTsmInOutEna(bool tsmnoe, int i) { m_tsmnoe[i-1] = tsmnoe; }
00180   
00182   inline void setTsmInOutEnaCarry(bool tsmnoe) { m_tsmnoe[2] = tsmnoe; }
00183   
00185   inline void setTsmCorrEna(bool tsmcce, int i) { m_tsmcce[i-1] = tsmcce; }
00186     
00188   inline void setTsmCorrEnaCarry(bool tsmcce) { m_tsmcce[2] = tsmcce; }
00189     
00191   inline void setTssGhost1Flag(unsigned short tssgs1) { m_tssgs1 = tssgs1; }
00192   
00194   inline void setTssGhost2Flag(unsigned short tssgs2) { m_tssgs2 = tssgs2; }
00195 
00197   inline void setTsmGhost1Flag(unsigned short tsmgs1) { m_tsmgs1 = tsmgs1; }
00198   
00200   inline void setTsmGhost2Flag(unsigned short tsmgs2) { m_tsmgs2 = tsmgs2; }
00201   
00203   inline void setTssGhost1Corr(bool tsscgs1) { m_tsscgs1 = tsscgs1; }
00204   
00206   inline void setTssGhost2Corr(bool tsscgs2) { m_tsscgs2 = tsscgs2; }
00207 
00209   inline void setTsmGhost1Corr(bool tsmcgs1) { m_tsmcgs1 = tsmcgs1; }
00210   
00212   inline void setTsmGhost2Corr(bool tsmcgs2) { m_tsmcgs2 = tsmcgs2; }
00213 
00215   inline void setTsmCarryFlag(unsigned short tsmhsp) { m_tsmhsp = tsmhsp; }
00216 
00218   inline void setUsedTraco(int i, int val) { m_tstren.set(i,val); }
00219 
00221   inline void setTsmStatus(int i, int val) { m_tsmword.set(i,val); };
00222 
00224   int nValidTSS();
00225 
00227   int nValidTSM();
00228 
00230   void print() const ;
00231 
00232   private:
00233 
00235   bool checkMask(unsigned short);
00236 
00238   void setDefaults(const edm:: ParameterSet& ps);
00239 
00240   bool m_debug;
00241 
00242   // TSS Parameters
00243   unsigned short int m_tssmsk[2];  // [0]=1st [1]=2nd
00244   bool m_tsshte[3]; // [0]=1st [1]=2nd [2]=carry
00245   bool m_tssnoe[3]; // [0]=1st [1]=2nd [2]=carry
00246   bool m_tsscce[3]; // [0]=1st [1]=2nd [2]=carry
00247   unsigned short int m_tssgs1;
00248   unsigned short int m_tssgs2;
00249   bool m_tsscgs1;
00250   bool m_tsscgs2;
00251 
00252   //TSM Parameters
00253   unsigned short int m_tsmmsk[2];  // [0]=1st [1]=2nd
00254   bool m_tsmhte[3]; // [0]=1st [1]=2nd [2]=carry
00255   bool m_tsmnoe[3]; // [0]=1st [1]=2nd [2]=carry
00256   bool m_tsmcce[3]; // [0]=1st [1]=2nd [2]=carry
00257   unsigned short int m_tsmgs1; 
00258   unsigned short int m_tsmgs2;
00259   bool m_tsmcgs1;
00260   bool m_tsmcgs2;
00261   unsigned short int m_tsmhsp;
00262 
00263   
00264   BitArray<24> m_tstren;     // Enabled TRACOs
00265   BitArray<8> m_tsmword; // TSM backup mode word
00266   unsigned short int m_ntsstsmd;        // nb tss to one of the tsmd (only if back-up mode)
00267 
00268   short int m_ntss;
00269   short int m_ntsm;
00270 
00271 };
00272 
00273 #endif