#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 |
Private Attributes | |
std::string | m_name |
int | m_dataGroup1_One [48] |
int | m_dataGroup1_Zero [48] |
int | m_dataGroup2_One [48] |
int | m_dataGroup2_Zero [48] |
int | m_dataGroup3 [48] |
int | m_dataGroup4 [48] |
Definition at line 8 of file TrigSAF.h.
TrigSAF::TrigSAF | ( | char * | name | ) |
int TrigSAF::getDataGroup1One | ( | int | index | ) | const [inline] |
Definition at line 19 of file TrigSAF.h.
References m_dataGroup1_One.
00019 { return m_dataGroup1_One[index]; }
int TrigSAF::getDataGroup1Zero | ( | int | index | ) | const [inline] |
Definition at line 20 of file TrigSAF.h.
References m_dataGroup1_Zero.
00020 { return m_dataGroup1_Zero[index]; }
int TrigSAF::getDataGroup2One | ( | int | index | ) | const [inline] |
Definition at line 22 of file TrigSAF.h.
References m_dataGroup2_One.
00022 { return m_dataGroup2_One[index]; }
int TrigSAF::getDataGroup2Zero | ( | int | index | ) | const [inline] |
Definition at line 23 of file TrigSAF.h.
References m_dataGroup2_Zero.
00023 { return m_dataGroup2_Zero[index]; }
int TrigSAF::getDataGroup3 | ( | int | index | ) | const [inline] |
Definition at line 25 of file TrigSAF.h.
References m_dataGroup3.
00025 { return m_dataGroup3[index]; }
int TrigSAF::getDataGroup4 | ( | int | index | ) | const [inline] |
Definition at line 26 of file TrigSAF.h.
References m_dataGroup4.
00026 { return m_dataGroup4[index]; }
const std::string& TrigSAF::getName | ( | ) | const [inline] |
void TrigSAF::initialize | ( | ) |
Definition at line 9 of file TrigSAF.cxx.
References genRecEmupikp::i, m_dataGroup1_One, m_dataGroup1_Zero, m_dataGroup2_One, m_dataGroup2_Zero, m_dataGroup3, and m_dataGroup4.
00010 { 00011 for(int i = 0; i < 48; i++) 00012 { 00013 m_dataGroup1_One[i] = 0; 00014 m_dataGroup1_Zero[i] = 0; 00015 m_dataGroup2_One[i] = 0; 00016 m_dataGroup2_Zero[i] = 0; 00017 m_dataGroup3[i] = 0; 00018 m_dataGroup4[i] = 0; 00019 } 00020 }
void TrigSAF::setSAFTrigData | ( | uint32_t | boardId, | |
uint32_t | window, | |||
uint32_t | datasize, | |||
const uint32_t * | data | |||
) |
Definition at line 22 of file TrigSAF.cxx.
References genRecEmupikp::i, ganga-rec::j, m_dataGroup1_One, m_dataGroup1_Zero, m_dataGroup2_One, m_dataGroup2_Zero, m_dataGroup3, and m_dataGroup4.
00022 { 00023 00024 if((boardId != 0xd2)&&(boardId != 0xd4)&&(boardId != 0xd6)) std::cerr << "ERROR: You set the wrong board data to TrigSAF!!!" << std::endl; 00025 00026 uint32_t jBegin = 0, jEnd = 0; 00027 if(boardId == 0xd2) { jBegin = 32; jEnd = jBegin+16; } //SAF1 00028 if(boardId == 0xd4) { jBegin = 16; jEnd = jBegin+16; } //SAF2 00029 if(boardId == 0xd6) { jBegin = 0; jEnd = jBegin+16; } //SAF3 00030 00031 for(uint32_t i = 0; i < datasize; i++) { 00032 uint32_t dataId = ((data[i] >> 16) & 0xFF); 00033 for(uint32_t j = jBegin, mask = 1; j < jEnd; j++, mask <<= 1) { 00034 if(dataId == 1) { 00035 if((data[i] & mask) != 0) { 00036 m_dataGroup1_One[j] += 1; 00037 } 00038 if(m_dataGroup1_One[j] == 0) m_dataGroup1_Zero[j] += 1; 00039 } 00040 if(dataId == 2) { 00041 if((data[i] & mask) != 0) { 00042 m_dataGroup2_One[j] += 1; 00043 } 00044 if(m_dataGroup2_One[j] == 0) m_dataGroup2_Zero[j] += 1; 00045 } 00046 if(dataId == 3) { 00047 if((data[i] & mask) != 0) { 00048 m_dataGroup3[j] = 1; 00049 } 00050 } 00051 if(dataId == 4) { 00052 if((data[i] & mask) != 0) { 00053 m_dataGroup4[j] = 1; 00054 } 00055 } 00056 } 00057 } 00058 }
int TrigSAF::m_dataGroup1_One[48] [private] |
Definition at line 31 of file TrigSAF.h.
Referenced by getDataGroup1One(), initialize(), and setSAFTrigData().
int TrigSAF::m_dataGroup1_Zero[48] [private] |
Definition at line 32 of file TrigSAF.h.
Referenced by getDataGroup1Zero(), initialize(), and setSAFTrigData().
int TrigSAF::m_dataGroup2_One[48] [private] |
Definition at line 34 of file TrigSAF.h.
Referenced by getDataGroup2One(), initialize(), and setSAFTrigData().
int TrigSAF::m_dataGroup2_Zero[48] [private] |
Definition at line 35 of file TrigSAF.h.
Referenced by getDataGroup2Zero(), initialize(), and setSAFTrigData().
int TrigSAF::m_dataGroup3[48] [private] |
Definition at line 37 of file TrigSAF.h.
Referenced by getDataGroup3(), initialize(), and setSAFTrigData().
int TrigSAF::m_dataGroup4[48] [private] |
Definition at line 38 of file TrigSAF.h.
Referenced by getDataGroup4(), initialize(), and setSAFTrigData().
std::string TrigSAF::m_name [private] |