CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Muc/MucMappingAlg/MucMappingAlg-00-00-02/MucMappingAlg/MucChain.h
Go to the documentation of this file.
1//------------------------------------------------------------------------------|
2// [File ]: MucChain.h |
3// [Brief ]: Header file of class MucChain for electronics mapping |
4// [Author]: Xie Yuguang, <[email protected]> |
5// [Date ]: Jun 7, 2006 |
6// [Log ]: See ChangLog |
7//------------------------------------------------------------------------------|
8
9#ifndef MUC_CHAIN_H
10#define MUC_CHAIN_H
11
12#include<iostream>
13#include<vector>
14#include<string>
15
16using namespace std;
17
18#include "MucFec.h"
19#include "MucGeoConst.h"
20
21static const int FEC_NUM = 16; // Maximun of FECs in a chain
22static const int DEFAULT_FEC_ORDER = 1; // Default FEC id defined order
23 // 1: from chain tail(the detector end),
24
25const int FIRST_STRIP_ID[7] = {0, 16, 32, 48, 64, 80, 96}; // 1st stripid list of chain
26const int FIRST_STRID_SQC_EC[4] = {48, 32, 16, 0}; // 1st stripid list of chain in Endcap
27const int FIRST_STRID_SQC_BETOP[4]= {64, 96, 80, 48}; // 1st stripid list of chain in Barrel east Seg2
28const int FIRST_STRID_SQC_BEA[3] = {48, 64, 80} ; // 1st stripid list of chain in Barrel east Seg0,1,5
29const int FIRST_STRID_SQC_BEB[3] = {80, 64, 48} ; // 1st stripid list of chain in Barrel east Seg3,4,6,7
30const int FIRST_STRID_SQC_BWA[3] = {32, 16, 0} ; // 1st stripid list of chain in Barrel west
31 // Seg0,1,2,5 of even layers,Seg3,4,6,7 of odd layers,
32const int FIRST_STRID_SQC_BWB[3] = {0, 16, 32} ; // 1st stripid list of chain in Barrel west
33 // Seg0,1,2,5 of odd layers,Seg3,4,6,7 of even layers,
34const int STRORDER_ECA[E_LAY_NUM] = {-1, 1, -1, 1, -1, 1, -1, 1}; // Order sequence A for Endcap
35 // East Seg0 and Seg2, West Seg1 and Seg3;
36const int STRORDER_ECB[E_LAY_NUM] = {1, -1, 1, -1, 1, -1, 1, -1}; // Order sequence B for Endcap
37 // East Seg1 and Seg3, West Seg0 and Seg2;
38const int STRORDER_BETOP[4] = {1, -1, 1, -1} ; // Strip order of FECs in Barrel east Seg2
39const int STRORDER_BEA[3] = {-1, -1, 1} ; // Strip order of FECs in Barrel east Seg0,1,5,
40 // and west Seg3,4,6,7 for even layers
41const int STRORDER_BEB[3] = {1, -1, -1} ; // Strip order of FECs in Barrel east Seg3,4,6,7,
42 // and west Seg0,1,2,5 for even layers
43const int STRORDER_BWO[3] = {-1, -1, -1} ; // Strip order of FECs in Barrel west for odd layers
44
45class MucChain {
46
47 public:
48 MucChain( int id, string name, int module, int socket, int fecOrder);
50 //--------------------------- Get methods ----------------------------------
51 int GetID() { return m_ID; }
52 int GetPart() { return m_Part; }
53 int GetSegment() { return m_Segment; }
54 int GetFecTotal() { return m_FecTotal;}
55 int GetFecOrder() { return m_FecOrder;}
56 string GetName() { return m_Name; }
57 vector< MucFec> GetFecVect() { return m_FecVect; }
58
59 MucFec* GetFec( int fecId ) { return &m_FecVect[fecId]; }
60 int GetFecLayerID( int fecID ) { return m_FecLayerID[fecID]; }
61 int GetFirstStripID( int fecID ) { return m_FirstStripID[fecID]; }
62
63 //---------------------------- Set methods ----------------------------------
64 void ReMap( string name, int module, int socket );
65 void SetFecOrder( int fecOrder );
66 void SetStripOrder( int stripOrder ); // All FECs, 0 as default order: -1
67 void SetStripOrder( int fecID, int stripOrder ); // One FEC
68 void ArrayInvert( int* array, int number );
69
70 private:
71 int m_ID; // Chain id
72 string m_Name; // Name of chain based on hardware
73 int m_Module; // Module id connected by chain
74 int m_Socket; // Socket id connected by chain
75 int m_FecOrder; // FEC id defined order,
76 int m_Part; // Part chain belongs to
77 int m_Segment; // Segment chain belongs to
78 int m_FecLayerID[FEC_NUM]; // Array of the layer id for each FEC in chain
79 int m_FecTotal; // Total FECs in chain, 0 ~ FEC_NUM
80 int m_FecPerLayer; // Number of FECs in each layer
81 int m_FirstStripID[FEC_NUM]; // Array of the first strip id for each FEC in chain
82 int m_StripOrder[FEC_NUM]; // Strip order corresponding to data bit
83 vector< MucFec> m_FecVect; // Vector of the FECs in chain
84
85 void Mapping();
86 void InitPart();
87 void InitSegment();
88 void InitFecTotal();
89 void InitFecPerLayer();
90 void InitFecLayerID();
91 void InitFirstStripID();
92 void InitStripOrder();
93 unsigned int EncodeVmeRecord( int module, int socket, int fecId, unsigned short data);
94 void InitFecVect();
95};
96
97#endif
TTree * data
void SetStripOrder(int fecID, int stripOrder)
void ArrayInvert(int *array, int number)
void SetFecOrder(int fecOrder)
void SetStripOrder(int stripOrder)
void ReMap(string name, int module, int socket)
MucChain(int id, string name, int module, int socket, int fecOrder)