BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
TrigCondition Class Reference

#include <TrigCondition.h>

Public Member Functions

 TrigCondition (char *name, uint32_t window, const uint32_t *data)
 
virtual ~TrigCondition ()
 
const std::string & getName () const
 
const std::vector< uint32_t > & getCondList () const
 
uint32_t getNumOne (int index) const
 
uint32_t getNumZero (int index) const
 
void print () const
 

Detailed Description

Definition at line 8 of file TrigCondition.h.

Constructor & Destructor Documentation

◆ TrigCondition()

TrigCondition::TrigCondition ( char *  name,
uint32_t  window,
const uint32_t *  data 
)

Definition at line 55 of file TrigCondition.cxx.

55 :
56 m_name(name)
57{
58 for (uint32_t group = 0; group < 2; group++) {
59 uint32_t iBegin = group * 24;
60 uint32_t iEnd = (group + 1) * 24;
61 uint32_t jBegin = group * window;
62 uint32_t jEnd = (group + 1) * window;
63 for (uint32_t i = iBegin, mask = 1; i < iEnd; i++, mask <<= 1) {
64 uint32_t num_One = 0, num_Zero = 0;
65 for (uint32_t j = jBegin; j < jEnd; j++) {
66 if ((data[j] & mask) != 0) {
67 num_One++;
68 }
69 else {
70 if (num_One == 0) num_Zero++;
71 }
72 }
73 m_num_One[i] = num_One;
74 m_num_Zero[i] = num_Zero;
75 }
76 }
77
78 for (uint32_t i = 0; i < 48; i++) {
79 if (m_num_One[i] != 0) m_condList.push_back(i);
80 }
81}
TTree * data

◆ ~TrigCondition()

virtual TrigCondition::~TrigCondition ( )
inlinevirtual

Definition at line 11 of file TrigCondition.h.

11{}

Member Function Documentation

◆ getCondList()

const std::vector< uint32_t > & TrigCondition::getCondList ( ) const
inline

Definition at line 14 of file TrigCondition.h.

14{ return m_condList; }

◆ getName()

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

Definition at line 13 of file TrigCondition.h.

13{ return m_name; }

◆ getNumOne()

uint32_t TrigCondition::getNumOne ( int  index) const
inline

Definition at line 15 of file TrigCondition.h.

15{ return m_num_One[index]; }

◆ getNumZero()

uint32_t TrigCondition::getNumZero ( int  index) const
inline

Definition at line 16 of file TrigCondition.h.

16{ return m_num_Zero[index]; }

◆ print()

void TrigCondition::print ( ) const

Definition at line 83 of file TrigCondition.cxx.

83 {
84 int size = m_condList.size();
85 std::cout << "TrigCondition-" << m_name << " contains the following conditions:" << std::endl;
86 for (int i = 0; i < size; i++) {
87 std::cout << '\t' << s_CONDITIONS[m_condList[i]] << std::endl;
88 }
89}

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