BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
HltProcessor::HltCriteria Class Reference

#include <HltCriteria.h>

Public Member Functions

 HltCriteria (int)
virtual ~HltCriteria ()
bool satisfyCriteria () const
void addItem (const std::string &name, float value, const std::string &type, int id)
void setBehaviour (const std::string &behaviour)
const std::string & getBehaviour () const
const int idCriteria () const
std::vector< CriteriaItem > getItemVec ()

Detailed Description

Definition at line 10 of file HltCriteria.h.

Constructor & Destructor Documentation

◆ HltCriteria()

HltCriteria::HltCriteria ( int id)

Definition at line 11 of file HltCriteria.cxx.

11 : m_idCriteria( id ) {
12 ISvcLocator* svcLocator = Gaudi::svcLocator(); // from Bootstrap
13 StatusCode sc = svcLocator->service( "HltStoreSvc", m_HltStoreSvc );
14 if ( sc.isFailure() )
15 {
16 std::cout << "Event Filter: In HltCriteria ==> Could not access HltStoreSvc!" << std::endl;
17 exit( 1 );
18 }
19}

◆ ~HltCriteria()

virtual HltProcessor::HltCriteria::~HltCriteria ( )
inlinevirtual

Definition at line 21 of file HltCriteria.h.

21{};

Member Function Documentation

◆ addItem()

void HltCriteria::addItem ( const std::string & name,
float value,
const std::string & type,
int id )

Definition at line 81 of file HltCriteria.cxx.

82 {
83 CriteriaItem it = { name, value, type, id };
84 m_items.push_back( it );
85}

◆ getBehaviour()

const std::string & HltProcessor::HltCriteria::getBehaviour ( ) const
inline

Definition at line 28 of file HltCriteria.h.

28{ return m_behaviour; }

◆ getItemVec()

std::vector< CriteriaItem > HltProcessor::HltCriteria::getItemVec ( )
inline

Definition at line 32 of file HltCriteria.h.

32{ return m_items; }

◆ idCriteria()

const int HltProcessor::HltCriteria::idCriteria ( ) const
inline

Definition at line 30 of file HltCriteria.h.

30{ return m_idCriteria; }

◆ satisfyCriteria()

bool HltCriteria::satisfyCriteria ( ) const

Definition at line 21 of file HltCriteria.cxx.

21 {
22
23 CriteriaItemValue* p_itemValue;
24 float itemValue;
25 std::vector<CriteriaItem>::const_iterator it = m_items.begin();
26
27 bool judge = true;
28 while ( it != m_items.end() )
29 {
30 // std::cout << "HltCriteria::satisfyCriteria()"<<(int)m_HltStoreSvc<<std::endl;
31 // std::cout << it->name << "," << it->value <<std::endl;
32 bool status = m_HltStoreSvc->get( it->name, p_itemValue );
33 if ( !status ) return false;
34 // std::cout << "HltCriteria::satisfyCriteria()"<<2<<std::endl;
35 status = p_itemValue->getValue( itemValue );
36 if ( !status ) return false;
37 // std::cout << "HltCriteria::satisfyCriteria()"<<3<<std::endl;
38 // std::cout << "HltCriteria::satisfyCriteria() item[" << it->name
39 // << "] type=>" << it->type << " get value=" << itemValue << std::endl;
40
41 if ( it->type == "MIN" )
42 {
43 if ( itemValue <= it->value ) judge = false;
44 }
45 else if ( it->type == "MAX" )
46 {
47 if ( itemValue >= it->value ) judge = false;
48 }
49 else if ( it->type == "TRUE" )
50 {
51 if ( fabs( itemValue - it->value ) > 0.000001 ) judge = false;
52 }
53 else if ( it->type == "FALSE" )
54 {
55 if ( fabs( itemValue - it->value ) < 0.000001 ) judge = false;
56 }
57 else
58 {
59 std::cout << "In HltCriteria::satisfyCriteria() ==> Unvalid CriteriaItemType!"
60 << std::endl;
61 exit( 1 );
62 }
63
64 if ( it->name == "nmuc" ) {}
65 else if ( it->name == "nmdc" ) {}
66 else if ( it->name == "etot" && it->type == "MIN" ) {}
67 else if ( it->name == "etot" && it->type == "MAX" ) {}
68 else if ( it->name == "acop" && it->type == "MAX" ) {}
69 else
70 {
71 // std::cout << "In HltCriteria::satisfyCriteria() ==>Criteria bits not enough! " <<
72 // std::endl;
73 }
74 it++;
75 }
76
77 // std::cout << "HltCriteria::satisfyCriteria() return true" << std::endl;
78 return judge;
79}
bool getValue(float &value) const

◆ setBehaviour()

void HltProcessor::HltCriteria::setBehaviour ( const std::string & behaviour)
inline

Definition at line 26 of file HltCriteria.h.

26{ m_behaviour = behaviour; }

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