HltProcessor::HltCriteria Class Reference

#include <HltCriteria.h>

List of all members.

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::stringgetBehaviour () const
const int idCriteria () const
std::vector< CriteriaItemgetItemVec ()

Private Attributes

std::string m_behaviour
std::vector< CriteriaItemm_items
int m_idCriteria
HltStoreSvcm_HltStoreSvc

Classes

struct  CriteriaItem


Detailed Description

Definition at line 10 of file HltCriteria.h.


Constructor & Destructor Documentation

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]

Definition at line 21 of file HltCriteria.h.

00021 {};


Member Function Documentation

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().

00079                                                                                           {
00080   CriteriaItem it = {name, value, type,id};
00081   m_items.push_back(it);
00082 }

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   }


Member Data Documentation

std::string HltProcessor::HltCriteria::m_behaviour [private]

Definition at line 43 of file HltCriteria.h.

Referenced by getBehaviour(), and setBehaviour().

HltStoreSvc* HltProcessor::HltCriteria::m_HltStoreSvc [private]

Definition at line 48 of file HltCriteria.h.

Referenced by HltCriteria(), and satisfyCriteria().

int HltProcessor::HltCriteria::m_idCriteria [private]

Definition at line 46 of file HltCriteria.h.

Referenced by idCriteria().

std::vector<CriteriaItem> HltProcessor::HltCriteria::m_items [private]

Definition at line 45 of file HltCriteria.h.

Referenced by addItem(), getItemVec(), and satisfyCriteria().


Generated on Tue Nov 29 23:36:34 2016 for BOSS_7.0.2 by  doxygen 1.4.7