BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MucFec Class Reference

#include <MucFec.h>

Public Member Functions

 MucFec (int id)
 MucFec (int id, int stripOrder, int part, int segment, int layer, int firstStripID, unsigned int vmeRecord, string chainName)
 ~MucFec ()
int GetID ()
int GetStripOrder ()
unsigned int GetVmeRecord ()
unsigned short GetVmeAddress ()
unsigned short GetData ()
int GetPart ()
int GetSegment ()
int GetLayer ()
int GetFirstStripID ()
int GetFiredStripNumber ()
int DecodeModule ()
int DecodeSocket ()
int DecodeFecID ()
unsigned int GetPowerpcRecord ()
unsigned short GetGeoAddress ()
vector< int > * GetFiredStripVect ()
string GetChainName ()
string GetBin (unsigned int record)
string GetBin (unsigned short record)
string GetVmeBin ()
string GetGeoBin ()
string GetDataBin ()
void SetStripOrder (int stripOrder)
void SetLocation (int part, int segment, int layer)
void SetFirstStripID (int firstStripID)
void SetChainName (string chainName)
void SetData (unsigned short data)

Detailed Description

Definition at line 41 of file MucFec.h.

Constructor & Destructor Documentation

◆ MucFec() [1/2]

MucFec::MucFec ( int id)

Definition at line 18 of file MucFec.cxx.

18 {
19 // cout << "MucFec:: Create FEC : " << id << endl;
20
21 if ( ( id < 0 ) || ( id > STRIP_NUM - 1 ) )
22 {
23 cout << "Initialize failure, check id!" << endl;
24 m_ID = 0;
25 }
26 else m_ID = id;
27
28 m_Part = 0;
29 m_Segment = 0;
30 m_Layer = 0;
31 m_FirstStripID = 0;
32 m_StripOrder = DEFAULT_STRIP_ORDER;
33 m_ChainName = "NoName";
34 m_VmeRecord = 0;
35
36 MucFec::Initialize();
37}

◆ MucFec() [2/2]

MucFec::MucFec ( int id,
int stripOrder,
int part,
int segment,
int layer,
int firstStripID,
unsigned int vmeRecord,
string chainName )

Definition at line 39 of file MucFec.cxx.

40 {
41 // cout << "MucFec:: Create FEC : " << endl;
42 // cout << "ID: " << id << "\tPart: " << part << "\tSegment: " << segment << "\tLayer: " <<
43 // layer
44 // << "\tfirstStripID: " << firstStripID << "\tvmeRecord: " << vmeRecord<<endl;
45
46 // Check parameters
47 if ( ( id < 0 ) || ( id > STRIP_NUM - 1 ) )
48 {
49 m_ID = 0;
50 cout << "MucFec::Check id:\t" << id << "!" << endl;
51 }
52 else if ( ( stripOrder != 1 ) && ( stripOrder != -1 ) )
53 {
54 m_StripOrder = 0;
55 cout << "MucFec::Check stripOrder:\t" << stripOrder << "!" << endl;
56 }
57 else if ( ( part < 0 ) || ( part > PART_MAX - 1 ) )
58 {
59 m_Part = 0;
60 cout << "MucFec::Check part:\t" << part << "!" << endl;
61 }
62 else if ( ( segment < 0 ) ||
63 ( segment > ( ( part == BRID ) ? ( B_SEG_NUM - 1 ) : ( E_SEG_NUM - 1 ) ) ) )
64 {
65 m_Segment = 0;
66 cout << "MucFec::Check segment:\t" << segment << "!" << endl;
67 }
68 else if ( ( layer < 0 ) ||
69 ( layer > ( ( part == BRID ) ? ( B_LAY_NUM - 1 ) : ( E_LAY_NUM - 1 ) ) ) )
70 {
71 m_Layer = 0;
72 cout << "MucFec::Check layer:\t" << layer << "!" << endl;
73 }
74 else if ( sizeof( vmeRecord ) < 4 )
75 {
76 m_VmeRecord = 0;
77 cout << "MucFec::Check record:\t" << vmeRecord << "!" << endl;
78 }
79 else
80 {
81 m_ID = id;
82 m_StripOrder = stripOrder;
83 m_Part = part;
84 m_Segment = segment;
85 m_Layer = layer;
86 m_FirstStripID = firstStripID;
87 m_ChainName = chainName;
88 m_VmeRecord = vmeRecord;
89 }
90
91 MucFec::Initialize();
92}

◆ ~MucFec()

MucFec::~MucFec ( )
inline

Definition at line 46 of file MucFec.h.

46{ ; }

Member Function Documentation

◆ DecodeFecID()

int MucFec::DecodeFecID ( )
inline

Definition at line 62 of file MucFec.h.

62{ return m_FecID; }

Referenced by MucMappingAlg::finalize().

◆ DecodeModule()

int MucFec::DecodeModule ( )
inline

Definition at line 60 of file MucFec.h.

60{ return m_Module; }

Referenced by MucMappingAlg::finalize().

◆ DecodeSocket()

int MucFec::DecodeSocket ( )
inline

Definition at line 61 of file MucFec.h.

61{ return m_Socket; }

Referenced by MucMappingAlg::finalize().

◆ GetBin() [1/2]

string MucFec::GetBin ( unsigned int record)

Definition at line 182 of file MucFec.cxx.

182 {
183 const int SIZE = sizeof( unsigned int ) * 8;
184
185 string Bin;
186 unsigned int temp = 0;
187 for ( int i = 0; i < SIZE; i++ )
188 {
189 temp = record >> SIZE - i - 1;
190 Bin += ( temp & 1 ) ? "1" : "0";
191 }
192
193 return Bin;
194}

Referenced by GetDataBin(), GetGeoBin(), and GetVmeBin().

◆ GetBin() [2/2]

string MucFec::GetBin ( unsigned short record)

Definition at line 196 of file MucFec.cxx.

196 {
197 const int SIZE = sizeof( unsigned short ) * 8;
198
199 string Bin;
200 unsigned short temp = 0;
201 for ( int i = 0; i < SIZE; i++ )
202 {
203 temp = record >> SIZE - i - 1;
204 Bin += ( temp & 1 ) ? "1" : "0";
205 }
206
207 return Bin;
208}

◆ GetChainName()

string MucFec::GetChainName ( )
inline

Definition at line 66 of file MucFec.h.

66{ return m_ChainName; }

Referenced by MucMappingAlg::finalize().

◆ GetData()

unsigned short MucFec::GetData ( )
inline

Definition at line 53 of file MucFec.h.

53{ return m_Data; }

◆ GetDataBin()

string MucFec::GetDataBin ( )

Definition at line 214 of file MucFec.cxx.

214{ return MucFec::GetBin( m_Data ); }
string GetBin(unsigned int record)
Definition MucFec.cxx:182

Referenced by MucMappingAlg::finalize().

◆ GetFiredStripNumber()

int MucFec::GetFiredStripNumber ( )

Definition at line 178 of file MucFec.cxx.

178{ return m_FiredStripNumber; }

◆ GetFiredStripVect()

vector< int > * MucFec::GetFiredStripVect ( )

Definition at line 180 of file MucFec.cxx.

180{ return &m_FiredStripVect; }

◆ GetFirstStripID()

int MucFec::GetFirstStripID ( )
inline

Definition at line 58 of file MucFec.h.

58{ return m_FirstStripID; }

Referenced by MucMappingAlg::finalize().

◆ GetGeoAddress()

unsigned short MucFec::GetGeoAddress ( )
inline

Definition at line 64 of file MucFec.h.

64{ return m_GeoAddress; }

Referenced by MucMappingAlg::finalize().

◆ GetGeoBin()

string MucFec::GetGeoBin ( )

Definition at line 212 of file MucFec.cxx.

212{ return MucFec::GetBin( m_GeoAddress ); }

Referenced by MucMappingAlg::finalize().

◆ GetID()

int MucFec::GetID ( )
inline

Definition at line 49 of file MucFec.h.

49{ return m_ID; }

◆ GetLayer()

int MucFec::GetLayer ( )
inline

Definition at line 57 of file MucFec.h.

57{ return m_Layer; }

Referenced by MucMappingAlg::finalize().

◆ GetPart()

int MucFec::GetPart ( )
inline

Definition at line 55 of file MucFec.h.

55{ return m_Part; }

Referenced by MucMappingAlg::finalize().

◆ GetPowerpcRecord()

unsigned int MucFec::GetPowerpcRecord ( )

Definition at line 179 of file MucFec.cxx.

179{ return m_PowerpcRecord; }

◆ GetSegment()

int MucFec::GetSegment ( )
inline

Definition at line 56 of file MucFec.h.

56{ return m_Segment; }

Referenced by MucMappingAlg::finalize().

◆ GetStripOrder()

int MucFec::GetStripOrder ( )
inline

Definition at line 50 of file MucFec.h.

50{ return m_StripOrder; }

Referenced by MucMappingAlg::finalize().

◆ GetVmeAddress()

unsigned short MucFec::GetVmeAddress ( )
inline

Definition at line 52 of file MucFec.h.

52{ return m_VmeAddress; }

Referenced by MucMappingAlg::finalize().

◆ GetVmeBin()

string MucFec::GetVmeBin ( )

Definition at line 210 of file MucFec.cxx.

210{ return MucFec::GetBin( m_VmeAddress ); }

Referenced by MucMappingAlg::finalize().

◆ GetVmeRecord()

unsigned int MucFec::GetVmeRecord ( )
inline

Definition at line 51 of file MucFec.h.

51{ return m_VmeRecord; }

◆ SetChainName()

void MucFec::SetChainName ( string chainName)

◆ SetData()

void MucFec::SetData ( unsigned short data)

Definition at line 169 of file MucFec.cxx.

169 {
170 m_Data = data;
171 m_VmeRecord = ( m_VmeRecord | m_Data );
172 MucFec ::EncodePowerpcRecord();
173 MucFec ::SetFiredStripNumber();
174 MucFec ::SetFiredStripVect();
175}
TTree * data

◆ SetFirstStripID()

void MucFec::SetFirstStripID ( int firstStripID)

Definition at line 163 of file MucFec.cxx.

163 {
164 m_FirstStripID = firstStripID;
165 MucFec ::EncodePowerpcRecord();
166 MucFec ::SetFiredStripVect();
167}

◆ SetLocation()

void MucFec::SetLocation ( int part,
int segment,
int layer )

Definition at line 155 of file MucFec.cxx.

155 {
156 m_Part = part;
157 m_Segment = segment;
158 m_Layer = layer;
159
160 MucFec::Initialize();
161}

◆ SetStripOrder()

void MucFec::SetStripOrder ( int stripOrder)

Definition at line 150 of file MucFec.cxx.

150 {
151 m_StripOrder = stripOrder;
152 MucFec::SetFiredStripVect();
153}

The documentation for this class was generated from the following files: