BOSS 7.1.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 40 of file MucFec.h.

Constructor & Destructor Documentation

◆ MucFec() [1/2]

MucFec::MucFec ( int  id)

Definition at line 18 of file MucFec.cxx.

19{
20 //cout << "MucFec:: Create FEC : " << id << endl;
21
22 if( (id < 0) || (id > STRIP_NUM-1) ) {
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.

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

◆ ~MucFec()

MucFec::~MucFec ( )
inline

Definition at line 44 of file MucFec.h.

44{ ; }

Member Function Documentation

◆ DecodeFecID()

int MucFec::DecodeFecID ( )
inline

Definition at line 60 of file MucFec.h.

60{ return m_FecID; }

Referenced by MucMappingAlg::finalize().

◆ DecodeModule()

int MucFec::DecodeModule ( )
inline

Definition at line 58 of file MucFec.h.

58{ return m_Module; }

Referenced by MucMappingAlg::finalize().

◆ DecodeSocket()

int MucFec::DecodeSocket ( )
inline

Definition at line 59 of file MucFec.h.

59{ return m_Socket; }

Referenced by MucMappingAlg::finalize().

◆ GetBin() [1/2]

string MucFec::GetBin ( unsigned int  record)

Definition at line 182 of file MucFec.cxx.

183{
184 const int SIZE = sizeof( unsigned int ) * 8;
185
186 string Bin;
187 unsigned int temp = 0;
188 for(int i=0; i<SIZE; i++) {
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.

197{
198 const int SIZE = sizeof( unsigned short ) * 8;
199
200 string Bin;
201 unsigned short temp = 0;
202 for(int i=0; i<SIZE; i++) {
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 64 of file MucFec.h.

64{ return m_ChainName; }

Referenced by MucMappingAlg::finalize().

◆ GetData()

unsigned short MucFec::GetData ( )
inline

Definition at line 51 of file MucFec.h.

51{ return m_Data; }

◆ GetDataBin()

string MucFec::GetDataBin ( )

Definition at line 220 of file MucFec.cxx.

221{
222 return MucFec::GetBin( m_Data );
223}
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 56 of file MucFec.h.

56{ return m_FirstStripID; }

Referenced by MucMappingAlg::finalize().

◆ GetGeoAddress()

unsigned short MucFec::GetGeoAddress ( )
inline

Definition at line 62 of file MucFec.h.

62{ return m_GeoAddress; }

Referenced by MucMappingAlg::finalize().

◆ GetGeoBin()

string MucFec::GetGeoBin ( )

Definition at line 215 of file MucFec.cxx.

216{
217 return MucFec::GetBin( m_GeoAddress );
218}

Referenced by MucMappingAlg::finalize().

◆ GetID()

int MucFec::GetID ( )
inline

Definition at line 47 of file MucFec.h.

47{ return m_ID; }

◆ GetLayer()

int MucFec::GetLayer ( )
inline

Definition at line 55 of file MucFec.h.

55{ return m_Layer; }

Referenced by MucMappingAlg::finalize().

◆ GetPart()

int MucFec::GetPart ( )
inline

Definition at line 53 of file MucFec.h.

53{ 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 54 of file MucFec.h.

54{ return m_Segment; }

Referenced by MucMappingAlg::finalize().

◆ GetStripOrder()

int MucFec::GetStripOrder ( )
inline

Definition at line 48 of file MucFec.h.

48{ return m_StripOrder; }

Referenced by MucMappingAlg::finalize().

◆ GetVmeAddress()

unsigned short MucFec::GetVmeAddress ( )
inline

Definition at line 50 of file MucFec.h.

50{ return m_VmeAddress; }

Referenced by MucMappingAlg::finalize().

◆ GetVmeBin()

string MucFec::GetVmeBin ( )

Definition at line 210 of file MucFec.cxx.

211{
212 return MucFec::GetBin( m_VmeAddress );
213}

Referenced by MucMappingAlg::finalize().

◆ GetVmeRecord()

unsigned int MucFec::GetVmeRecord ( )
inline

Definition at line 49 of file MucFec.h.

49{ return m_VmeRecord; }

◆ SetChainName()

void MucFec::SetChainName ( string  chainName)

◆ SetData()

void MucFec::SetData ( unsigned short  data)

Definition at line 168 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 161 of file MucFec.cxx.

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

◆ SetLocation()

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

Definition at line 152 of file MucFec.cxx.

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

◆ SetStripOrder()

void MucFec::SetStripOrder ( int  stripOrder)

Definition at line 146 of file MucFec.cxx.

147{
148 m_StripOrder = stripOrder;
149 MucFec::SetFiredStripVect();
150}

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