/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Muc/MucMappingAlg/MucMappingAlg-00-00-02/MucMappingAlg/MucFec.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------|
00002 //      [File  ]:                       MucFec.h                                |
00003 //      [Brief ]:       Header file of class MucFec for electronics mapping     |
00004 //      [Author]:       Xie Yuguang, <ygxie@mail.ihep.ac.cn>                    |
00005 //      [Date  ]:       Jun 7, 2006                                             |
00006 //      [Log   ]:       See ChangLog                                            |
00007 //------------------------------------------------------------------------------|
00008 
00009 #ifndef MUC_FEC_H
00010 #define MUC_FEC_H
00011 
00012 #include<iostream>
00013 #include<string>
00014 #include<vector>
00015 
00016 using namespace std;
00017 
00018 static const int        LENGTH                          = 16;           // Size of record section
00019 static const int        DEFAULT_STRIP_ORDER   = -1;             // Default strip id defined order
00020                                                 // Order of strip connected to data bit 
00021                                                                                           //    1: low data bit corresponding to low strip ID 
00022                                                                                           // -1: low data bit corresponding to high strip ID
00023 static const int  STRIP_NUM       = 16;  // Number of strip channel in one fec   
00024 
00025 //  present DAQ format
00026 //   ModuleID   ErrorFlag Slot  FEC
00027 //  |= = = = =|= = = = = |= = |= = = =|16bit FEC data|
00028 
00029 //  Old DAQ format
00030 //   ErrorFlag  ModuleID  Slot  FEC
00031 //  |= = = = =|= = = = = |= = |= = = =|16bit FEC data|    
00032 
00033 static const int  MODULE_BIT  = 6;   // ">>" bit number for module, old DAQ format
00034 //static const int  MODULE_BIT      = 11;  // ">>" bit number for module, present DAQ format, but used in MucBuilder not here
00035 static const int  SOCKET_BIT  = 4;   // ">>" bit number for socket
00036 static const int  PART_BIT    = 14;  // ">>" bit number for part
00037 static const int  SEG_BIT     = 11;  // ">>" bit number for segment
00038 static const int  LAY_BIT     = 7;   // ">>" bit number for layer
00039 
00040 class MucFec {
00041 
00042   public:
00043           MucFec( int id );
00044     MucFec( int id, int stripOrder, int part, int segment, int layer, int firstStripID, unsigned int vmeRecord, string chainName);
00045     ~MucFec( ) { ; }
00046 
00047                 //-------------------------- Get methods --------------------------------
00048     int             GetID()           { return m_ID;                  }
00049                 int                 GetStripOrder()     { return m_StripOrder;  }
00050     unsigned   int      GetVmeRecord()  { return m_VmeRecord;   } 
00051     unsigned short      GetVmeAddress() { return m_VmeAddress;  }
00052     unsigned short      GetData()           { return m_Data;          }
00053 
00054     int GetPart()                 { return m_Part;              }
00055     int GetSegment()    { return m_Segment; }
00056     int GetLayer()              { return m_Layer;       }
00057     unsigned short  GetGeoAddress()     { return m_GeoAddress;  }
00058                 int         GetFirstStripID() { return m_FirstStripID;  }
00059           string        GetChainName()    { return m_ChainName;         }
00060                 int         GetFiredStripNumber();
00061                 vector< int >*  GetFiredStripVect();    
00062     unsigned int          GetPowerpcRecord();   
00063           int   DecodeModule()  { return m_Module;              }
00064                 int DecodeSocket()      { return m_Socket;              }
00065                 int     DecodeFecID()           { return m_FecID;                 }     
00066                 string  GetBin( unsigned int record );  
00067                 string  GetBin( unsigned short record );
00068                 string  GetVmeBin();
00069                 string  GetGeoBin();
00070                 string  GetDataBin();
00071 
00072                 //-------------------------- Set methods --------------------------------
00073     void  SetStripOrder( int stripOrder );
00074                 void    SetLocation( int part, int segment, int layer );
00075                 void    SetFirstStripID( int firstStripID );
00076                 void  SetChainName( string chainName );
00077                 void    SetData( unsigned short data );
00078 
00079         private:
00080     int m_ID;                       // Id in chain, 0~STRIPNUM-1
00081     int m_StripOrder;   // Order of strip connected to data bit 
00082     unsigned int        m_VmeRecord;    // 32 bits record data of VME format: VME address + data 
00083                                             //  high 16 bits are the VME address, the low 16 bits are signals
00084                                             //  address contains module, socket, FEC id
00085     unsigned int  m_PowerpcRecord;      // 32 bits record data of PowerPC format: GEO address + data
00086                                             //  high 16 bits are the FEC address, the low 16 bits are signals
00087                                             //  address contains part, segment, layer, and first strip id
00088                                             //  signals contain 16 strips status
00089     unsigned short      m_VmeAddress;   // High 16 bit of VME record for VME address    
00090     unsigned short  m_GeoAddress;       // High 16 bit of PowerPC record for GEO address
00091     unsigned short      m_Data;                   // Low  16 bit of record for data
00092                 
00093                 int     m_Module;               // Module number decoded from VME address
00094                 int     m_Socket;               // Socket number decoded from VME address
00095                 int     m_FecID;                // FEC id decode from VME address, matching m_ID or (STRIPNUM-1) - m_ID 
00096           string        m_ChainName;    // Chain name FEC belongs to
00097     int   m_Part;                       // Located part
00098     int   m_Segment;    // located segment
00099     int   m_Layer;              // located layer
00100                 int     m_FirstStripID;           // First strip id 
00101                 int             m_FiredStripNumber;     // Number of fired strips
00102           vector< int >   m_FiredStripVect;     // Vector of fired strip ids
00103 
00104                 void    Initialize();           
00105                 void    DecodeData();
00106                 void    DecodeVmeAddress();
00107                 void    SetFiredStripNumber();  
00108                 void    SetFiredStripVect();
00109                 void    EncodePowerpcRecord();
00110                 
00111 };
00112 
00113 #endif
00114 

Generated on Tue Nov 29 23:12:57 2016 for BOSS_7.0.2 by  doxygen 1.4.7