BOSS 7.0.9
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 DEFAULT_STRIP_ORDER = -1; // Default strip id defined order
20 // Order of strip connected to data bit
21 // 1: low data bit corresponding to low strip ID
22 // -1: low data bit corresponding to high strip ID
23static const int STRIP_NUM = 16; // Number of strip channel in one fec
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
42 public:
43 MucFec( int id );
44 MucFec( int id, int stripOrder, int part, int segment, int layer, int firstStripID, unsigned int vmeRecord, string chainName);
45 ~MucFec( ) { ; }
46
47 //-------------------------- Get methods --------------------------------
48 int GetID() { return m_ID; }
49 int GetStripOrder() { return m_StripOrder; }
50 unsigned int GetVmeRecord() { return m_VmeRecord; }
51 unsigned short GetVmeAddress() { return m_VmeAddress; }
52 unsigned short GetData() { return m_Data; }
53
54 int GetPart() { return m_Part; }
55 int GetSegment() { return m_Segment; }
56 int GetLayer() { return m_Layer; }
57 unsigned short GetGeoAddress() { return m_GeoAddress; }
58 int GetFirstStripID() { return m_FirstStripID; }
59 string GetChainName() { return m_ChainName; }
61 vector< int >* GetFiredStripVect();
62 unsigned int GetPowerpcRecord();
63 int DecodeModule() { return m_Module; }
64 int DecodeSocket() { return m_Socket; }
65 int DecodeFecID() { return m_FecID; }
66 string GetBin( unsigned int record );
67 string GetBin( unsigned short record );
68 string GetVmeBin();
69 string GetGeoBin();
70 string GetDataBin();
71
72 //-------------------------- Set methods --------------------------------
73 void SetStripOrder( int stripOrder );
74 void SetLocation( int part, int segment, int layer );
75 void SetFirstStripID( int firstStripID );
76 void SetChainName( string chainName );
77 void SetData( unsigned short data );
78
79 private:
80 int m_ID; // Id in chain, 0~STRIPNUM-1
81 int m_StripOrder; // Order of strip connected to data bit
82 unsigned int m_VmeRecord; // 32 bits record data of VME format: VME address + data
83 // high 16 bits are the VME address, the low 16 bits are signals
84 // address contains module, socket, FEC id
85 unsigned int m_PowerpcRecord; // 32 bits record data of PowerPC format: GEO address + data
86 // high 16 bits are the FEC address, the low 16 bits are signals
87 // address contains part, segment, layer, and first strip id
88 // signals contain 16 strips status
89 unsigned short m_VmeAddress; // High 16 bit of VME record for VME address
90 unsigned short m_GeoAddress; // High 16 bit of PowerPC record for GEO address
91 unsigned short m_Data; // Low 16 bit of record for data
92
93 int m_Module; // Module number decoded from VME address
94 int m_Socket; // Socket number decoded from VME address
95 int m_FecID; // FEC id decode from VME address, matching m_ID or (STRIPNUM-1) - m_ID
96 string m_ChainName; // Chain name FEC belongs to
97 int m_Part; // Located part
98 int m_Segment; // located segment
99 int m_Layer; // located layer
100 int m_FirstStripID; // First strip id
101 int m_FiredStripNumber; // Number of fired strips
102 vector< int > m_FiredStripVect; // Vector of fired strip ids
103
104 void Initialize();
105 void DecodeData();
106 void DecodeVmeAddress();
107 void SetFiredStripNumber();
108 void SetFiredStripVect();
109 void EncodePowerpcRecord();
110
111};
112
113#endif
114
TTree * data
Definition: MucFec.h:40
string GetGeoBin()
Definition: MucFec.cxx:232
string GetChainName()
Definition: MucFec.h:59
~MucFec()
Definition: MucFec.h:45
int GetID()
Definition: MucFec.h:48
void SetChainName(string chainName)
int GetFirstStripID()
Definition: MucFec.h:58
unsigned int GetPowerpcRecord()
Definition: MucFec.cxx:193
void SetStripOrder(int stripOrder)
Definition: MucFec.cxx:156
int DecodeModule()
Definition: MucFec.h:63
int GetSegment()
Definition: MucFec.h:55
unsigned int GetVmeRecord()
Definition: MucFec.h:50
int GetPart()
Definition: MucFec.h:54
string GetDataBin()
Definition: MucFec.cxx:237
int DecodeSocket()
Definition: MucFec.h:64
vector< int > * GetFiredStripVect()
Definition: MucFec.cxx:195
int DecodeFecID()
Definition: MucFec.h:65
int GetFiredStripNumber()
Definition: MucFec.cxx:191
int GetLayer()
Definition: MucFec.h:56
void SetFirstStripID(int firstStripID)
Definition: MucFec.cxx:172
unsigned short GetData()
Definition: MucFec.h:52
void SetData(unsigned short data)
Definition: MucFec.cxx:179
string GetVmeBin()
Definition: MucFec.cxx:227
string GetBin(unsigned int record)
Definition: MucFec.cxx:197
void SetLocation(int part, int segment, int layer)
Definition: MucFec.cxx:163
unsigned short GetGeoAddress()
Definition: MucFec.h:57
int GetStripOrder()
Definition: MucFec.h:49
unsigned short GetVmeAddress()
Definition: MucFec.h:51