BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
TrigSAF Class Reference

#include <TrigSAF.h>

Public Member Functions

 TrigSAF (char *name)
 
virtual ~TrigSAF ()
 
void setSAFTrigData (uint32_t boardId, uint32_t window, uint32_t datasize, const uint32_t *data)
 
void initialize ()
 
const std::string & getName () const
 
int getDataGroup1One (int index) const
 
int getDataGroup1Zero (int index) const
 
int getDataGroup2One (int index) const
 
int getDataGroup2Zero (int index) const
 
int getDataGroup3 (int index) const
 
int getDataGroup4 (int index) const
 

Detailed Description

Definition at line 8 of file TrigSAF.h.

Constructor & Destructor Documentation

◆ TrigSAF()

TrigSAF::TrigSAF ( char *  name)

Definition at line 4 of file TrigSAF.cxx.

5{
6 m_name = name;
7}

◆ ~TrigSAF()

virtual TrigSAF::~TrigSAF ( )
inlinevirtual

Definition at line 11 of file TrigSAF.h.

11{}

Member Function Documentation

◆ getDataGroup1One()

int TrigSAF::getDataGroup1One ( int  index) const
inline

Definition at line 19 of file TrigSAF.h.

19{ return m_dataGroup1_One[index]; }

◆ getDataGroup1Zero()

int TrigSAF::getDataGroup1Zero ( int  index) const
inline

Definition at line 20 of file TrigSAF.h.

20{ return m_dataGroup1_Zero[index]; }

◆ getDataGroup2One()

int TrigSAF::getDataGroup2One ( int  index) const
inline

Definition at line 22 of file TrigSAF.h.

22{ return m_dataGroup2_One[index]; }

◆ getDataGroup2Zero()

int TrigSAF::getDataGroup2Zero ( int  index) const
inline

Definition at line 23 of file TrigSAF.h.

23{ return m_dataGroup2_Zero[index]; }

◆ getDataGroup3()

int TrigSAF::getDataGroup3 ( int  index) const
inline

Definition at line 25 of file TrigSAF.h.

25{ return m_dataGroup3[index]; }

◆ getDataGroup4()

int TrigSAF::getDataGroup4 ( int  index) const
inline

Definition at line 26 of file TrigSAF.h.

26{ return m_dataGroup4[index]; }

◆ getName()

const std::string & TrigSAF::getName ( ) const
inline

Definition at line 17 of file TrigSAF.h.

17{ return m_name; }

◆ initialize()

void TrigSAF::initialize ( )

Definition at line 9 of file TrigSAF.cxx.

10{
11 for(int i = 0; i < 48; i++)
12 {
13 m_dataGroup1_One[i] = 0;
14 m_dataGroup1_Zero[i] = 0;
15 m_dataGroup2_One[i] = 0;
16 m_dataGroup2_Zero[i] = 0;
17 m_dataGroup3[i] = 0;
18 m_dataGroup4[i] = 0;
19 }
20}

◆ setSAFTrigData()

void TrigSAF::setSAFTrigData ( uint32_t  boardId,
uint32_t  window,
uint32_t  datasize,
const uint32_t *  data 
)

Definition at line 22 of file TrigSAF.cxx.

22 {
23
24 if((boardId != 0xd2)&&(boardId != 0xd4)&&(boardId != 0xd6)) std::cerr << "ERROR: You set the wrong board data to TrigSAF!!!" << std::endl;
25
26 uint32_t jBegin = 0, jEnd = 0;
27 if(boardId == 0xd2) { jBegin = 32; jEnd = jBegin+16; } //SAF1
28 if(boardId == 0xd4) { jBegin = 16; jEnd = jBegin+16; } //SAF2
29 if(boardId == 0xd6) { jBegin = 0; jEnd = jBegin+16; } //SAF3
30
31 for(uint32_t i = 0; i < datasize; i++) {
32 uint32_t dataId = ((data[i] >> 16) & 0xFF);
33 for(uint32_t j = jBegin, mask = 1; j < jEnd; j++, mask <<= 1) {
34 if(dataId == 1) {
35 if((data[i] & mask) != 0) {
36 m_dataGroup1_One[j] += 1;
37 }
38 if(m_dataGroup1_One[j] == 0) m_dataGroup1_Zero[j] += 1;
39 }
40 if(dataId == 2) {
41 if((data[i] & mask) != 0) {
42 m_dataGroup2_One[j] += 1;
43 }
44 if(m_dataGroup2_One[j] == 0) m_dataGroup2_Zero[j] += 1;
45 }
46 if(dataId == 3) {
47 if((data[i] & mask) != 0) {
48 m_dataGroup3[j] = 1;
49 }
50 }
51 if(dataId == 4) {
52 if((data[i] & mask) != 0) {
53 m_dataGroup4[j] = 1;
54 }
55 }
56 }
57 }
58}
TTree * data

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