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

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------|
00002 //      [File  ]:                       MucChain.h                              |
00003 //      [Brief ]:       Header file of class MucChain 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_CHAIN_H
00010 #define MUC_CHAIN_H
00011 
00012 #include<iostream>
00013 #include<vector>
00014 #include<string>
00015 
00016 using namespace std;
00017 
00018 #include "MucFec.h"
00019 #include "MucGeoConst.h"
00020 
00021 static const int  FEC_NUM     = 16;     // Maximun of FECs in a chain
00022 static const int  DEFAULT_FEC_ORDER     = 1;    // Default FEC id defined order
00023                                                 // 1: from chain tail(the detector end), 
00024 
00025 const int FIRST_STRIP_ID[7]                 = {0, 16, 32, 48, 64, 80, 96};  // 1st stripid list of chain 
00026 const int FIRST_STRID_SQC_EC[4]         = {48, 32, 16, 0};  // 1st stripid list of chain in Endcap
00027 const int FIRST_STRID_SQC_BETOP[4]= {64, 96, 80, 48}; // 1st stripid list of chain in Barrel east Seg2
00028 const int FIRST_STRID_SQC_BEA[3]        = {48, 64, 80} ;    // 1st stripid list of chain in Barrel east Seg0,1,5
00029 const int FIRST_STRID_SQC_BEB[3]        = {80, 64, 48} ;    // 1st stripid list of chain in Barrel east Seg3,4,6,7
00030 const int FIRST_STRID_SQC_BWA[3]        = {32, 16, 0}  ;    // 1st stripid list of chain in Barrel west 
00031                                                                                                 // Seg0,1,2,5 of even layers,Seg3,4,6,7 of odd layers, 
00032 const int FIRST_STRID_SQC_BWB[3]        = {0, 16, 32}  ;    // 1st stripid list of chain in Barrel west 
00033                                                                                                 // Seg0,1,2,5 of odd layers,Seg3,4,6,7 of even layers,
00034 const int STRORDER_ECA[E_LAY_NUM] = {-1, 1, -1, 1, -1, 1, -1, 1};       // Order sequence A for Endcap
00035                                                                                                                         // East Seg0 and Seg2, West Seg1 and Seg3;
00036 const int STRORDER_ECB[E_LAY_NUM] = {1, -1, 1, -1, 1, -1, 1, -1};       // Order sequence B for Endcap
00037                                                                                                                         // East Seg1 and Seg3, West Seg0 and Seg2;
00038 const int STRORDER_BETOP[4]     = {1, -1, 1, -1} ;  // Strip order of FECs in Barrel east Seg2
00039 const int STRORDER_BEA[3]       = {-1, -1, 1} ;       // Strip order of FECs in Barrel east Seg0,1,5, 
00040                                                                                     // and west Seg3,4,6,7 for even layers
00041 const int STRORDER_BEB[3]       = {1, -1, -1} ;       // Strip order of FECs in Barrel east Seg3,4,6,7, 
00042                                                                                     // and west Seg0,1,2,5 for even layers
00043 const int STRORDER_BWO[3]       = {-1, -1, -1} ;      // Strip order of FECs in Barrel west for odd layers
00044 
00045 class MucChain {
00046 
00047   public:
00048           MucChain( int id, string name, int module, int socket, int fecOrder);
00049                 ~MucChain( );
00050                 //--------------------------- Get methods ----------------------------------
00051                 int GetID()           { return m_ID;              }
00052                 int GetPart()     { return m_Part;        }
00053                 int     GetSegment()    { return m_Segment; }
00054                 int     GetFecTotal() { return m_FecTotal;}
00055                 int GetFecOrder() { return m_FecOrder;}
00056                 string  GetName() { return m_Name;        }
00057           vector< MucFec> GetFecVect()  { return m_FecVect;     }
00058 
00059                 MucFec* GetFec( int fecId )                 { return &m_FecVect[fecId];           }
00060                 int     GetFecLayerID( int fecID )        { return m_FecLayerID[fecID];   }
00061                 int     GetFirstStripID( int fecID )    { return m_FirstStripID[fecID]; }
00062                 
00063                 //---------------------------- Set methods ----------------------------------
00064                 void    ReMap( string name, int module, int socket );
00065                 void    SetFecOrder( int fecOrder );
00066                 void    SetStripOrder( int stripOrder );                        // All FECs, 0 as default order: -1
00067                 void    SetStripOrder( int fecID, int stripOrder );     // One FEC
00068                 void    ArrayInvert( int* array, int number );
00069 
00070   private:
00071                 int m_ID;                                             // Chain id
00072                 string  m_Name;                                 // Name of chain based on hardware
00073                 int     m_Module;                                   // Module id connected by chain
00074                 int m_Socket;                               // Socket id connected by chain
00075                 int     m_FecOrder;                               // FEC id defined order, 
00076                 int m_Part;                                         // Part chain belongs to 
00077                 int m_Segment;                            // Segment chain belongs to 
00078                 int m_FecLayerID[FEC_NUM];      // Array of the layer id for each FEC in chain 
00079                 int m_FecTotal;                           // Total FECs in chain, 0 ~ FEC_NUM 
00080                 int     m_FecPerLayer;                  // Number of FECs in each layer
00081                 int m_FirstStripID[FEC_NUM];    // Array of the first strip id for each FEC in chain
00082                 int     m_StripOrder[FEC_NUM];          // Strip order corresponding to data bit
00083           vector< MucFec> m_FecVect;            // Vector of the FECs in chain
00084         
00085                 void    Mapping();
00086                 void    InitPart();
00087                 void    InitSegment();
00088                 void    InitFecTotal();
00089                 void    InitFecPerLayer();
00090                 void    InitFecLayerID();
00091                 void    InitFirstStripID();
00092                 void    InitStripOrder();
00093           unsigned int  EncodeVmeRecord( int module, int socket, int fecId, unsigned short data);
00094                 void    InitFecVect();
00095 };
00096 
00097 #endif

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