#include <HltCriteria.h>
Public Member Functions | |
void | addItem (const std::string &name, float value, const std::string &type, int id) |
void | addItem (const std::string &name, float value, const std::string &type, int id) |
const std::string & | getBehaviour () const |
const std::string & | getBehaviour () const |
std::vector< CriteriaItem > | getItemVec () |
std::vector< CriteriaItem > | getItemVec () |
HltCriteria (int) | |
HltCriteria (int) | |
const int | idCriteria () const |
const int | idCriteria () const |
bool | satisfyCriteria () const |
bool | satisfyCriteria () const |
void | setBehaviour (const std::string &behaviour) |
void | setBehaviour (const std::string &behaviour) |
virtual | ~HltCriteria () |
virtual | ~HltCriteria () |
Private Attributes | |
std::string | m_behaviour |
HltStoreSvc * | m_HltStoreSvc |
HltStoreSvc * | m_HltStoreSvc |
int | m_idCriteria |
std::vector< CriteriaItem > | m_items |
std::vector< CriteriaItem > | m_items |
|
00012 :m_idCriteria(id) 00013 { 00014 ISvcLocator* svcLocator = Gaudi::svcLocator(); // from Bootstrap 00015 StatusCode sc = svcLocator->service("HltStoreSvc", m_HltStoreSvc); 00016 if (sc.isFailure()) { 00017 std::cout<<"Event Filter: In HltCriteria ==> Could not access HltStoreSvc!"<<std::endl; 00018 exit(1); 00019 } 00020 }
|
|
00021 {};
|
|
|
|
00021 {};
|
|
|
|
00079 { 00080 CriteriaItem it = {name, value, type,id}; 00081 m_items.push_back(it); 00082 }
|
|
00030 {
00031 return m_behaviour;
00032 }
|
|
00030 {
00031 return m_behaviour;
00032 }
|
|
00038 {
00039 return m_items;
00040 }
|
|
00038 {
00039 return m_items;
00040 }
|
|
00034 {
00035 return m_idCriteria;
00036 }
|
|
00034 {
00035 return m_idCriteria;
00036 }
|
|
|
|
00022 { 00023 00024 CriteriaItemValue* p_itemValue; 00025 float itemValue; 00026 std::vector<CriteriaItem>::const_iterator it = m_items.begin(); 00027 00028 bool judge=true; 00029 while (it != m_items.end()) { 00030 //std::cout << "HltCriteria::satisfyCriteria()"<<(int)m_HltStoreSvc<<std::endl; 00031 //std::cout << it->name << "," << it->value <<std::endl; 00032 bool status = m_HltStoreSvc->get(it->name, p_itemValue); 00033 if (!status) return false; 00034 //std::cout << "HltCriteria::satisfyCriteria()"<<2<<std::endl; 00035 status = p_itemValue->getValue(itemValue); 00036 if (!status) return false; 00037 //std::cout << "HltCriteria::satisfyCriteria()"<<3<<std::endl; 00038 //std::cout << "HltCriteria::satisfyCriteria() item[" << it->name 00039 // << "] type=>" << it->type << " get value=" << itemValue << std::endl; 00040 00041 if (it->type == "MIN") { 00042 if (itemValue <= it->value) judge= false; 00043 } else if (it->type == "MAX") { 00044 if (itemValue >= it->value) judge= false; 00045 } else if (it->type == "TRUE") { 00046 if (fabs(itemValue - it->value) > 0.000001) judge= false; 00047 } else if (it->type == "FALSE") { 00048 if (fabs(itemValue - it->value) < 0.000001) judge= false; 00049 } else { 00050 std::cout << "In HltCriteria::satisfyCriteria() ==> Unvalid CriteriaItemType!" << std::endl; 00051 exit(1); 00052 } 00053 00054 if(it->name =="nmuc"){ 00055 00056 } 00057 else if(it->name =="nmdc"){ 00058 00059 } 00060 else if(it->name=="etot"&&it->type=="MIN"){ 00061 00062 } 00063 else if(it->name=="etot"&&it->type=="MAX"){ 00064 00065 } 00066 else if(it->name=="acop"&&it->type=="MAX"){ 00067 00068 } 00069 else{ 00070 //std::cout << "In HltCriteria::satisfyCriteria() ==>Criteria bits not enough! " << std::endl; 00071 } 00072 it++; 00073 } 00074 00075 //std::cout << "HltCriteria::satisfyCriteria() return true" << std::endl; 00076 return judge; 00077 }
|
|
00026 { 00027 m_behaviour = behaviour; 00028 }
|
|
00026 { 00027 m_behaviour = behaviour; 00028 }
|
|
|
|
|
|
|
|
|
|
|
|
|