BOSS 7.1.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.

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

◆ ~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 79 of file HltCriteria.cxx.

79 {
80 CriteriaItem it = {name, value, type,id};
81 m_items.push_back(it);
82}

◆ getBehaviour()

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

Definition at line 30 of file HltCriteria.h.

30 {
31 return m_behaviour;
32 }

◆ getItemVec()

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

Definition at line 38 of file HltCriteria.h.

38 {
39 return m_items;
40 }

◆ idCriteria()

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

Definition at line 34 of file HltCriteria.h.

34 {
35 return m_idCriteria;
36 }

◆ satisfyCriteria()

bool HltCriteria::satisfyCriteria ( ) const

Definition at line 22 of file HltCriteria.cxx.

22 {
23
24 CriteriaItemValue* p_itemValue;
25 float itemValue;
26 std::vector<CriteriaItem>::const_iterator it = m_items.begin();
27
28 bool judge=true;
29 while (it != m_items.end()) {
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 if (itemValue <= it->value) judge= false;
43 } else if (it->type == "MAX") {
44 if (itemValue >= it->value) judge= false;
45 } else if (it->type == "TRUE") {
46 if (fabs(itemValue - it->value) > 0.000001) judge= false;
47 } else if (it->type == "FALSE") {
48 if (fabs(itemValue - it->value) < 0.000001) judge= false;
49 } else {
50 std::cout << "In HltCriteria::satisfyCriteria() ==> Unvalid CriteriaItemType!" << std::endl;
51 exit(1);
52 }
53
54 if(it->name =="nmuc"){
55
56 }
57 else if(it->name =="nmdc"){
58
59 }
60 else if(it->name=="etot"&&it->type=="MIN"){
61
62 }
63 else if(it->name=="etot"&&it->type=="MAX"){
64
65 }
66 else if(it->name=="acop"&&it->type=="MAX"){
67
68 }
69 else{
70 //std::cout << "In HltCriteria::satisfyCriteria() ==>Criteria bits not enough! " << std::endl;
71 }
72 it++;
73 }
74
75 //std::cout << "HltCriteria::satisfyCriteria() return true" << std::endl;
76 return judge;
77}
bool getValue(float &value) const
bool get(const std::string &name, T &value)
Definition: HltStoreSvc.h:76

◆ setBehaviour()

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

Definition at line 26 of file HltCriteria.h.

26 {
27 m_behaviour = behaviour;
28 }

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