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