00001 /******************************************************************** 00002 NAME: StepDecision.cxx 00003 ********************************************************************/ 00004 // INCLUDE HEADER FILES: 00005 #include "HltSteering/StepDecision.h" 00006 // INCLUDE GAUDI HEADER FILES: 00007 #include "GaudiKernel/MsgStream.h" 00008 #include "GaudiKernel/Property.h" 00009 #include "GaudiKernel/ISvcLocator.h" 00010 #include "GaudiKernel/StatusCode.h" 00011 00012 #include <string> 00013 #include <vector> 00014 #include <algorithm> 00015 // END OF HEADER FILES INCLUDE 00016 using HltProcessor::Signature; 00017 00019 // CONSTRUCTOR: 00020 StepDecision::StepDecision(const std::string& name, ISvcLocator* pSvcLocator): 00021 Algorithm(name, pSvcLocator) { 00022 m_isEnabled = false; 00023 } 00024 00025 // DESTRUCTOR: 00026 StepDecision::~StepDecision() { } 00027 00029 // INITIALIZE METHOD: 00030 StatusCode StepDecision::initDecision(Signature* signature) { 00031 00032 MsgStream log( messageService(), name() ); 00033 00034 StatusCode sc = service( "HltStoreSvc", m_HltStoreSvc); 00035 if( sc.isFailure() ) { 00036 log << MSG::FATAL << name() << ": Unable to locate Service HltStoreSvc" << endreq; 00037 return sc; 00038 } 00039 00040 std::string sigID = signature->label(); 00041 m_SigMap[sigID] = signature; 00042 log << MSG::INFO << name() << " Find Signature with ID: " << sigID << endreq; 00043 00044 return StatusCode::SUCCESS; 00045 } 00046 00048 // MY EXECUTE METHOD: 00049 int StepDecision::execDecision(const std::string& sigID) { 00050 00051 MsgStream log( messageService(), name() ); 00052 //log << MSG::DEBUG << "Starting Execution StepDecision" << endreq; 00053 00054 Signature* sig = m_SigMap[sigID]; 00055 int decision = sig->isCriteriaMatched(); 00056 00057 m_continue =sig->midresult(); 00058 m_behaviour = sig->result(); 00059 //cout << "----"<< m_behaviour<< " "<<m_continue<<endl; 00060 return decision; 00061 }