BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
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, <ygxie@mail.ihep.ac.cn> |
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 <string>
14#include <vector>
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),
24const int FIRST_STRIP_ID[7] = { 0, 16, 32, 48, 64, 80, 96 }; // 1st stripid list of chain
25const int FIRST_STRID_SQC_EC[4] = { 48, 32, 16, 0 }; // 1st stripid list of chain in Endcap
26const int FIRST_STRID_SQC_BETOP[4] = { 64, 96, 80,
27 48 }; // 1st stripid list of chain in Barrel east Seg2
28const int FIRST_STRID_SQC_BEA[3] = { 48, 64,
29 80 }; // 1st stripid list of chain in Barrel east Seg0,1,5
30const int FIRST_STRID_SQC_BEB[3] = { 80, 64, 48 }; // 1st stripid list of chain in Barrel east
31 // Seg3,4,6,7
32const int FIRST_STRID_SQC_BWA[3] = { 32, 16, 0 }; // 1st stripid list of chain in Barrel west
33 // Seg0,1,2,5 of even layers,Seg3,4,6,7 of
34 // odd layers,
35const int FIRST_STRID_SQC_BWB[3] = { 0, 16, 32 }; // 1st stripid list of chain in Barrel west
36 // Seg0,1,2,5 of odd layers,Seg3,4,6,7 of
37 // even layers,
38const int STRORDER_ECA[E_LAY_NUM] = {
39 -1, 1, -1, 1, -1, 1, -1, 1 }; // Order sequence A for Endcap
40 // East Seg0 and Seg2, West Seg1 and Seg3;
41const int STRORDER_ECB[E_LAY_NUM] = {
42 1, -1, 1, -1, 1, -1, 1, -1 }; // Order sequence B for Endcap
43 // East Seg1 and Seg3, West Seg0 and Seg2;
44const int STRORDER_BETOP[4] = { 1, -1, 1, -1 }; // Strip order of FECs in Barrel east Seg2
45const int STRORDER_BEA[3] = { -1, -1, 1 }; // Strip order of FECs in Barrel east Seg0,1,5,
46 // and west Seg3,4,6,7 for even layers
47const int STRORDER_BEB[3] = { 1, -1, -1 }; // Strip order of FECs in Barrel east Seg3,4,6,7,
48 // and west Seg0,1,2,5 for even layers
49const int STRORDER_BWO[3] = { -1, -1,
50 -1 }; // Strip order of FECs in Barrel west for odd layers
51
52class MucChain {
53
54public:
55 MucChain( int id, string name, int module, int socket, int fecOrder );
56 ~MucChain();
57 //--------------------------- Get methods ----------------------------------
58 int GetID() { return m_ID; }
59 int GetPart() { return m_Part; }
60 int GetSegment() { return m_Segment; }
61 int GetFecTotal() { return m_FecTotal; }
62 int GetFecOrder() { return m_FecOrder; }
63 string GetName() { return m_Name; }
64 vector<MucFec> GetFecVect() { return m_FecVect; }
65
66 MucFec* GetFec( int fecId ) { return &m_FecVect[fecId]; }
67 int GetFecLayerID( int fecID ) { return m_FecLayerID[fecID]; }
68 int GetFirstStripID( int fecID ) { return m_FirstStripID[fecID]; }
69
70 //---------------------------- Set methods ----------------------------------
71 void ReMap( string name, int module, int socket );
72 void SetFecOrder( int fecOrder );
73 void SetStripOrder( int stripOrder ); // All FECs, 0 as default order: -1
74 void SetStripOrder( int fecID, int stripOrder ); // One FEC
75 void ArrayInvert( int* array, int number );
76
77private:
78 int m_ID; // Chain id
79 string m_Name; // Name of chain based on hardware
80 int m_Module; // Module id connected by chain
81 int m_Socket; // Socket id connected by chain
82 int m_FecOrder; // FEC id defined order,
83 int m_Part; // Part chain belongs to
84 int m_Segment; // Segment chain belongs to
85 int m_FecLayerID[FEC_NUM]; // Array of the layer id for each FEC in chain
86 int m_FecTotal; // Total FECs in chain, 0 ~ FEC_NUM
87 int m_FecPerLayer; // Number of FECs in each layer
88 int m_FirstStripID[FEC_NUM]; // Array of the first strip id for each FEC in chain
89 int m_StripOrder[FEC_NUM]; // Strip order corresponding to data bit
90 vector<MucFec> m_FecVect; // Vector of the FECs in chain
91
92 void Mapping();
93 void InitPart();
94 void InitSegment();
95 void InitFecTotal();
96 void InitFecPerLayer();
97 void InitFecLayerID();
98 void InitFirstStripID();
99 void InitStripOrder();
100 unsigned int EncodeVmeRecord( int module, int socket, int fecId, unsigned short data );
101 void InitFecVect();
102};
103
104#endif
TTree * data
const int STRORDER_ECA[E_LAY_NUM]
Definition MucChain.h:38
const int STRORDER_ECB[E_LAY_NUM]
Definition MucChain.h:41
const int FIRST_STRID_SQC_BEA[3]
Definition MucChain.h:28
const int FIRST_STRID_SQC_BEB[3]
Definition MucChain.h:30
const int FIRST_STRID_SQC_BWA[3]
Definition MucChain.h:32
const int FIRST_STRID_SQC_BWB[3]
Definition MucChain.h:35
const int STRORDER_BETOP[4]
Definition MucChain.h:44
const int STRORDER_BWO[3]
Definition MucChain.h:49
const int FIRST_STRID_SQC_EC[4]
Definition MucChain.h:25
const int FIRST_STRID_SQC_BETOP[4]
Definition MucChain.h:26
const int STRORDER_BEB[3]
Definition MucChain.h:47
const int STRORDER_BEA[3]
Definition MucChain.h:45
const int FIRST_STRIP_ID[7]
Definition MucChain.h:24
void ArrayInvert(int *array, int number)
Definition MucChain.cxx:70
int GetSegment()
Definition MucChain.h:60
vector< MucFec > GetFecVect()
Definition MucChain.h:64
void SetFecOrder(int fecOrder)
Definition MucChain.cxx:49
int GetFecOrder()
Definition MucChain.h:62
void SetStripOrder(int stripOrder)
Definition MucChain.cxx:55
void ReMap(string name, int module, int socket)
Definition MucChain.cxx:41
int GetFirstStripID(int fecID)
Definition MucChain.h:68
int GetFecTotal()
Definition MucChain.h:61
int GetFecLayerID(int fecID)
Definition MucChain.h:67
MucFec * GetFec(int fecId)
Definition MucChain.h:66
int GetPart()
Definition MucChain.h:59
string GetName()
Definition MucChain.h:63
int GetID()
Definition MucChain.h:58
MucChain(int id, string name, int module, int socket, int fecOrder)
Definition MucChain.cxx:17