BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
MucFec.h
Go to the documentation of this file.
1//------------------------------------------------------------------------------|
2// [File ]: MucFec.h |
3// [Brief ]: Header file of class MucFec for electronics mapping |
4// [Author]: Xie Yuguang, <[email protected]> |
5// [Date ]: Jun 7, 2006 |
6// [Log ]: See ChangLog |
7//------------------------------------------------------------------------------|
8
9#ifndef MUC_FEC_H
10#define MUC_FEC_H
11
12#include<iostream>
13#include<string>
14#include<vector>
15
16using namespace std;
17
18static const int LENGTH = 16; // Size of record section
19static const int STRIP_NUM = 16; // Number of strip channel in one fec
20static const int DEFAULT_STRIP_ORDER = -1; // Default strip id defined order
21 // Order of strip connected to data bit
22 // 1: low data bit corresponding to low strip ID
23 // -1: low data bit corresponding to high strip ID
24
25// present DAQ format
26// ModuleID ErrorFlag Slot FEC
27// |= = = = =|= = = = = |= = |= = = =|16bit FEC data|
28
29// Old DAQ format
30// ErrorFlag ModuleID Slot FEC
31// |= = = = =|= = = = = |= = |= = = =|16bit FEC data|
32
33static const int MODULE_BIT = 6; // ">>" bit number for module, old DAQ format
34//static const int MODULE_BIT = 11; // ">>" bit number for module, present DAQ format, but used in MucBuilder not here
35static const int SOCKET_BIT = 4; // ">>" bit number for socket
36static const int PART_BIT = 14; // ">>" bit number for part
37static const int SEG_BIT = 11; // ">>" bit number for segment
38static const int LAY_BIT = 7; // ">>" bit number for layer
39
40class MucFec {
41 public:
42 MucFec( int id );
43 MucFec( int id, int stripOrder, int part, int segment, int layer, int firstStripID, unsigned int vmeRecord, string chainName);
44 ~MucFec( ) { ; }
45
46 //-------------------------- Get methods --------------------------------
47 int GetID() { return m_ID; }
48 int GetStripOrder() { return m_StripOrder; }
49 unsigned int GetVmeRecord() { return m_VmeRecord; }
50 unsigned short GetVmeAddress() { return m_VmeAddress; }
51 unsigned short GetData() { return m_Data; }
52
53 int GetPart() { return m_Part; }
54 int GetSegment() { return m_Segment; }
55 int GetLayer() { return m_Layer; }
56 int GetFirstStripID() { return m_FirstStripID; }
58 int DecodeModule() { return m_Module; }
59 int DecodeSocket() { return m_Socket; }
60 int DecodeFecID() { return m_FecID; }
61 unsigned int GetPowerpcRecord();
62 unsigned short GetGeoAddress() { return m_GeoAddress; }
63 vector< int >* GetFiredStripVect();
64 string GetChainName() { return m_ChainName; }
65 string GetBin( unsigned int record );
66 string GetBin( unsigned short record );
67 string GetVmeBin();
68 string GetGeoBin();
69 string GetDataBin();
70
71 //-------------------------- Set methods --------------------------------
72 void SetStripOrder( int stripOrder );
73 void SetLocation( int part, int segment, int layer );
74 void SetFirstStripID( int firstStripID );
75 void SetChainName( string chainName );
76 void SetData( unsigned short data );
77
78 private:
79 int m_ID; // Id in chain, 0~STRIPNUM-1
80 int m_StripOrder; // Order of strip connected to data bit
81 unsigned int m_VmeRecord; // 32 bits record data of VME format: VME address + data
82 // high 16 bits are the VME address, the low 16 bits are signals
83 // address contains module, socket, FEC id
84 unsigned int m_PowerpcRecord; // 32 bits record data of PowerPC format: GEO address + data
85 // high 16 bits are the FEC address, the low 16 bits are signals
86 // address contains part, segment, layer, and first strip id
87 // signals contain 16 strips status
88 unsigned short m_VmeAddress; // High 16 bit of VME record for VME address
89 unsigned short m_GeoAddress; // High 16 bit of PowerPC record for GEO address
90 unsigned short m_Data; // Low 16 bit of record for data
91
92 int m_Module; // Module number decoded from VME address
93 int m_Socket; // Socket number decoded from VME address
94 int m_FecID; // FEC id decode from VME address, matching m_ID or (STRIPNUM-1) - m_ID
95 string m_ChainName; // Chain name FEC belongs to
96 int m_Part; // Located part
97 int m_Segment; // located segment
98 int m_Layer; // located layer
99 int m_FirstStripID; // First strip id
100 int m_FiredStripNumber; // Number of fired strips
101 vector< int > m_FiredStripVect; // Vector of fired strip ids
102
103 void Initialize();
104 void DecodeData();
105 void DecodeVmeAddress();
106 void SetFiredStripNumber();
107 void SetFiredStripVect();
108 void EncodePowerpcRecord();
109
110};
111
112#endif
113
TTree * data
string GetGeoBin()
Definition MucFec.cxx:215
string GetChainName()
Definition MucFec.h:64
~MucFec()
Definition MucFec.h:44
int GetID()
Definition MucFec.h:47
void SetChainName(string chainName)
int GetFirstStripID()
Definition MucFec.h:56
unsigned int GetPowerpcRecord()
Definition MucFec.cxx:179
void SetStripOrder(int stripOrder)
Definition MucFec.cxx:146
int DecodeModule()
Definition MucFec.h:58
int GetSegment()
Definition MucFec.h:54
unsigned int GetVmeRecord()
Definition MucFec.h:49
int GetPart()
Definition MucFec.h:53
string GetDataBin()
Definition MucFec.cxx:220
int DecodeSocket()
Definition MucFec.h:59
vector< int > * GetFiredStripVect()
Definition MucFec.cxx:180
int DecodeFecID()
Definition MucFec.h:60
int GetFiredStripNumber()
Definition MucFec.cxx:178
int GetLayer()
Definition MucFec.h:55
MucFec(int id)
Definition MucFec.cxx:18
void SetFirstStripID(int firstStripID)
Definition MucFec.cxx:161
unsigned short GetData()
Definition MucFec.h:51
void SetData(unsigned short data)
Definition MucFec.cxx:168
string GetVmeBin()
Definition MucFec.cxx:210
string GetBin(unsigned int record)
Definition MucFec.cxx:182
void SetLocation(int part, int segment, int layer)
Definition MucFec.cxx:152
unsigned short GetGeoAddress()
Definition MucFec.h:62
int GetStripOrder()
Definition MucFec.h:48
unsigned short GetVmeAddress()
Definition MucFec.h:50