#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 () |
Private Attributes | |
std::string | m_behaviour |
std::vector< CriteriaItem > | m_items |
int | m_idCriteria |
HltStoreSvc * | m_HltStoreSvc |
Classes | |
struct | CriteriaItem |
Definition at line 10 of file HltCriteria.h.
HltCriteria::HltCriteria | ( | int | ) |
Definition at line 11 of file HltCriteria.cxx.
References m_HltStoreSvc.
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 }
virtual HltProcessor::HltCriteria::~HltCriteria | ( | ) | [inline, virtual] |
void HltCriteria::addItem | ( | const std::string & | name, | |
float | value, | |||
const std::string & | type, | |||
int | id | |||
) |
Definition at line 79 of file HltCriteria.cxx.
References m_items.
Referenced by HltProcessor::MyFrame::buildSignatureList().
const std::string& HltProcessor::HltCriteria::getBehaviour | ( | ) | const [inline] |
Definition at line 30 of file HltCriteria.h.
References m_behaviour.
00030 { 00031 return m_behaviour; 00032 }
std::vector<CriteriaItem> HltProcessor::HltCriteria::getItemVec | ( | ) | [inline] |
Definition at line 38 of file HltCriteria.h.
References m_items.
00038 { 00039 return m_items; 00040 }
const int HltProcessor::HltCriteria::idCriteria | ( | ) | const [inline] |
Definition at line 34 of file HltCriteria.h.
References m_idCriteria.
00034 { 00035 return m_idCriteria; 00036 }
bool HltCriteria::satisfyCriteria | ( | ) | const |
Definition at line 22 of file HltCriteria.cxx.
References HltStoreSvc::get(), CriteriaItemValue::getValue(), m_HltStoreSvc, and m_items.
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 }
void HltProcessor::HltCriteria::setBehaviour | ( | const std::string & | behaviour | ) | [inline] |
Definition at line 26 of file HltCriteria.h.
References m_behaviour.
00026 { 00027 m_behaviour = behaviour; 00028 }
int HltProcessor::HltCriteria::m_idCriteria [private] |
std::vector<CriteriaItem> HltProcessor::HltCriteria::m_items [private] |
Definition at line 45 of file HltCriteria.h.
Referenced by addItem(), getItemVec(), and satisfyCriteria().