Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:18

0001 #ifndef L1Trigger_RPCPattern_h
0002 #define L1Trigger_RPCPattern_h
0003 //-----------------------------------------------------------------------------
0004 /** \class RPCPattern
0005  *
0006  * Definition of single pattern of muon track, i.e. strips range for every plane,
0007  * muon sign and ptCode, etc.
0008  * \author Karol Bunkowski (Warsaw)
0009  */
0010 #include "CondFormats/Serialization/interface/Serializable.h"
0011 
0012 #include <vector>
0013 #include <string>
0014 //-----------------------------------------------------------------------------
0015 
0016 class RPCPattern {
0017 public:
0018   //needed types
0019   /** \class RPCLogicalStrip
0020    * Logical Strip for pattern definition. It may be OR of few Logic m_Strips of LogCone
0021    * The strips range is m_StripFrom - (m_StripTo-1)
0022    * If the pattern is not defined for given plane, the valu of m_StripFrom is m_NOT_CONECTED.
0023   */
0024   class RPCLogicalStrip {
0025     friend class RPCPattern;
0026 
0027   private:
0028     ///First strip in range.
0029     unsigned char m_StripFrom;
0030     ///Next-to-last strip in range.
0031     unsigned char m_StripTo;
0032 
0033     COND_SERIALIZABLE;
0034   };
0035 
0036   typedef std::vector<RPCPattern> RPCPatVec;
0037 
0038   struct TQuality {
0039     unsigned char m_FiredPlanes;
0040     char m_QualityTabNumber;
0041     char m_QualityValue;
0042     char m_logsector;
0043     char m_logsegment;
0044     signed char m_tower;
0045 
0046     COND_SERIALIZABLE;
0047   };
0048 
0049   typedef std::vector<TQuality> TQualityVec;
0050 
0051   // use namespace?
0052   // Moved/duplicated from RPCConst
0053   //    enum TPatternType {PAT_TYPE_T, PAT_TYPE_E};
0054   typedef char TPatternType;
0055   static const TPatternType PAT_TYPE_T = 0;
0056   static const TPatternType PAT_TYPE_E = 1;
0057   static const int m_LOGPLANES_COUNT = 6;
0058   static const int m_FIRST_PLANE = 0;
0059   static const int m_LAST_PLANE = 5;
0060   static const int m_NOT_CONECTED = 99;
0061 
0062   ///Default Constructor. Empty pattern, no muon, all planes m_NOT_CONECTED
0063   RPCPattern();
0064   RPCPattern(int tower, int sector, int segment);
0065 
0066   void setStripFrom(int logPlane, int stripFrom);
0067 
0068   void setStripTo(int logPlane, int stripTo);
0069 
0070   ///First strip in range.
0071   int getStripFrom(int logPlane) const;
0072 
0073   ///Next-to-last strip in range.
0074   int getStripTo(int logPlane) const;
0075 
0076   int getTower() const;
0077   int getLogSector() const;
0078   int getLogSegment() const;
0079 
0080   int getCode() const;
0081 
0082   int getSign() const;
0083 
0084   int getNumber() const;
0085 
0086   TPatternType getPatternType() const;
0087 
0088   int getRefGroup() const;
0089 
0090   int getQualityTabNumber() const;
0091 
0092   void setCoords(int tower, int sector, int segment);
0093 
0094   void setCode(int a);
0095 
0096   void setSign(int a);
0097 
0098   void setNumber(int a);
0099 
0100   void setPatternType(TPatternType patternType);
0101 
0102   void setRefGroup(int refGroup);
0103 
0104   void setQualityTabNumber(int qualityTabNumber);
0105 
0106 private:
0107   ///LogicalStrip for every LogPlane.
0108   RPCLogicalStrip m_Strips[m_LOGPLANES_COUNT];
0109 
0110   // coordinates
0111   char m_Tower;
0112   char m_LogSector;
0113   char m_LogSegment;
0114 
0115   ///Muon's sign.
0116   char m_Sign;
0117 
0118   ///Muons ptCode.
0119   char m_Code;
0120 
0121   /** The m_PAC algorith that should be used for given Pattern.
0122     * PAT_TYPE_T - Basic (clasic), PAT_TYPE_E - "impoved" (economic).
0123     * @see "Pattern Comparator Trigger Algorithm  implementation in FPGA" */
0124   TPatternType m_PatternType;
0125 
0126   ///If pattern is of type PAT_TYPE_E, denotes the index of group to which this pattern belongs.
0127   char m_RefGroup;
0128 
0129   /** The index of quality table that should be used for given pattern.
0130    * The quality table is defined at the beginig of each patterns file */
0131   char m_QualityTabNumber;
0132 
0133   ///m_Number of pattern in m_PAC's patterns set.
0134   short m_Number;
0135 
0136   COND_SERIALIZABLE;
0137 };
0138 
0139 #endif