BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Muc/MucMappingAlg/MucMappingAlg-00-00-02/MucMappingAlg/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
string GetGeoBin()
void SetChainName(string chainName)
unsigned int GetPowerpcRecord()
void SetStripOrder(int stripOrder)
MucFec(int id, int stripOrder, int part, int segment, int layer, int firstStripID, unsigned int vmeRecord, string chainName)
string GetDataBin()
vector< int > * GetFiredStripVect()
int GetFiredStripNumber()
MucFec(int id)
void SetFirstStripID(int firstStripID)
void SetData(unsigned short data)
string GetVmeBin()
string GetBin(unsigned int record)
void SetLocation(int part, int segment, int layer)
string GetBin(unsigned short record)