Commit a7a3d91f authored by Marco Clemencic's avatar Marco Clemencic
Browse files

moved services from GaudiSvc to GaudiMonitor (removed DatalistenerSvc)

Removed DataListenerSvc from GaudiMonitor
Moved from GaudiSvc to GaudiMonitor
- AlgContextSvc
- ExceptionSvc
- HistorySvc
- IssueLogger

IN PROGRESS - issue GAUDI-1: Split GaudiSvc in smaller libraries 
https://sftjira.cern.ch/browse/GAUDI-1

From: Marco Clemencic <marco.clemencic@cern.ch>


git-svn-id: svn+ssh://svn.cern.ch/reps/gaudi/Gaudi/branches/GAUDI/GAUDI_newpack@6724 53ecefc3-a64d-0410-9bdf-b8581fa3287e
parent 93aba2a4
......@@ -19,8 +19,6 @@ include_dirs $(GAUDIEXAMPLESROOT)/src/Lib
library GaudiExamplesLib -no_static Lib/*.cpp
macro datalistener_use "DataListener/*.cpp" WIN32 " "
library GaudiExamples -import=Reflex -no_static \
AbortEvent/*.cpp \
AlgSequencer/*.cpp \
......@@ -36,7 +34,6 @@ library GaudiExamples -import=Reflex -no_static \
PartProp/*.cpp \
Properties/*.cpp \
ExtendedProperties/*.cpp \
$(datalistener_use) \
POOLIO/*.cpp \
ColorMsg/ColorMsgAlg.cpp \
History/History.cpp \
......
Package GaudiExamples
Package manager : Marco Clemencic
! 2011-12-02 - Marco Clemencic
- Removed DataListenerSvc test.
! 2011-12-01 - Chris Jones
- Fixed bug #85377: GaudiTuple tuple does not undestand ulonglong
Add some addition Tuple checks, for various data types.
......
JobOptionsSvc INFO
//GP:================================================================================
//GP: include "../options/DataListener.opts" (0,0)
ApplicationMgr.TopAlg = [ "DataListenerAlg" ] ; //GP: (1,1)
ApplicationMgr.ExtSvc += [ "DataListenerSvc" ] ; //GP: (1,1)
MessageSvc.OutputLevel = 1; //GP: (1,1)
ApplicationMgr.EvtMax = 10; //GP: (1,1)
ApplicationMgr.EvtSel = "NONE"; //GP: (1,1)
EventSelector.PrintFreq = 1; //GP: (1,1)
DataListenerSvc.MonALISAMonitoring = 1; //GP: (1,1)
DataListenerSvc.XMLMonitoring = 1; //GP: (1,1)
DataListenerSvc.FileMonitoring = 1; //GP: (1,1)
DataListenerSvc.EventFrequency = 2; //GP: (1,1)
DataListenerSvc.MLEventFrequency = 2; //GP: (1,1)
DataListenerSvc.MLClusterName = "DataListenerSvcTesting"; //GP: (1,1)
DataListenerSvc.MLjobID = 1; //GP: (1,1)
//GP: end "../options/DataListener.opts" (30,1)
//GP:================================================================================
JobOptionsSvc INFO Job options successfully read in from ../options/DataListener.opts
ApplicationMgr DEBUG Getting my own properties
ApplicationMgr SUCCESS
====================================================================================================================================
Welcome to ApplicationMgr $Revision: 1.19 $
running on pclhcb55.cern.ch on Fri Jun 6 14:43:08 2008
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
ServiceManager DEBUG Initializing service DataListenerSvc
DataListenerSvc DEBUG Service base class initialized successfully
IncidentSvc DEBUG Service base class initialized successfully
DataListenerSvc VERBOSE ServiceLocatorHelper::createService: found service IncidentSvc
IncidentSvc DEBUG Adding [EndEvent] listener 'DataListenerSvc' with priority 0
[TIME: Fri Jun 6 14:43:09 2008] [INFO] Initializing destination addresses & ports:
[TIME: Fri Jun 6 14:43:09 2008] [INFO] Sending HTTP GET request to:
Hostname: ganga.web.cern.ch , Port: 80 , Filename: /ganga/monalisa.conf
[TIME: Fri Jun 6 14:43:09 2008] [INFO] Received response from ganga.web.cern.ch, response size is 1724 bytes
[TIME: Fri Jun 6 14:43:09 2008] [WARNING] [ setLogLevel() ] Invalid level value: QUIET
[TIME: Fri Jun 6 14:43:09 2008] [INFO] Adding destination host: 137.138.5.25 - port 38884
[TIME: Fri Jun 6 14:43:09 2008] [INFO] Disabling job monitoring...
[TIME: Fri Jun 6 14:43:09 2008] [INFO] Disabling system monitoring...
[TIME: Fri Jun 6 14:43:09 2008] [INFO] Setting general information monitoring to false
DataListenerSvc INFO Data sent to MonALISA every 2 events
DataListenerSvc DEBUG MonALISA ApMon configuration file destination not specified, will be read from: DataListenerSvc
DataListenerSvc INFO Frequency XML logs are written at: 2
DataListenerSvc INFO Data will be published to a MonALISA server
DataListenerSvc INFO Data will be written to XML log files
DataListenerSvc INFO Data will be updated in a Text log file
ServiceManager DEBUG Initializing service AppMgrRunable
AppMgrRunable DEBUG Service base class initialized successfully
ServiceManager DEBUG Initializing service EventLoopMgr
EventLoopMgr DEBUG Service base class initialized successfully
IncidentSvc DEBUG Adding [AbortEvent] listener '<unknown>' with priority 0
EventLoopMgr DEBUG Creating Top Algorithm DataListenerAlg with name DataListenerAlg
DataListenerAlg DEBUG Releasing service 'JobOptionsSvc'
DataListenerAlg DEBUG Property update for OutputLevel : new value = 1
DataListenerAlg DEBUG Initialize base class GaudiCommon<Algorithm>
DataListenerAlg DEBUG List of ALL properties of DataListenerAlg/DataListenerAlg #properties = 29
DataListenerAlg DEBUG Property ['Name': Value] = 'RegisterForContextService':True
DataListenerAlg DEBUG Property ['Name': Value] = 'ContextService':AlgContextSvc
DataListenerAlg DEBUG Property ['Name': Value] = 'UseEfficiencyRowFormat':True
DataListenerAlg DEBUG Property ['Name': Value] = 'EfficiencyRowFormat': |*%|-48.48s|%|50t||%|10d| |%|11.5g| |(%|#9.6g| +- %|-#9.6g|)%%| ------- | ------- |
DataListenerAlg DEBUG Property ['Name': Value] = 'RegularRowFormat': | %|-48.48s|%|50t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |
DataListenerAlg DEBUG Property ['Name': Value] = 'StatTableHeader': | Counter | # | sum | mean/eff^* | rms/err^* | min | max |
DataListenerAlg DEBUG Property ['Name': Value] = 'GlobalTimeOffset':0
DataListenerAlg DEBUG Property ['Name': Value] = 'RootOnTES':
DataListenerAlg DEBUG Property ['Name': Value] = 'RootInTES':
DataListenerAlg DEBUG Property ['Name': Value] = 'Context':
DataListenerAlg DEBUG Property ['Name': Value] = 'TypePrint':True
DataListenerAlg DEBUG Property ['Name': Value] = 'StatPrint':True
DataListenerAlg DEBUG Property ['Name': Value] = 'PropertiesPrint':False
DataListenerAlg DEBUG Property ['Name': Value] = 'ErrorsPrint':True
DataListenerAlg DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc
DataListenerAlg DEBUG Property ['Name': Value] = 'AuditStop':False
DataListenerAlg DEBUG Property ['Name': Value] = 'AuditStart':False
DataListenerAlg DEBUG Property ['Name': Value] = 'AuditEndRun':False
DataListenerAlg DEBUG Property ['Name': Value] = 'AuditBeginRun':False
DataListenerAlg DEBUG Property ['Name': Value] = 'AuditFinalize':False
DataListenerAlg DEBUG Property ['Name': Value] = 'AuditExecute':False
DataListenerAlg DEBUG Property ['Name': Value] = 'AuditRestart':False
DataListenerAlg DEBUG Property ['Name': Value] = 'AuditReinitialize':False
DataListenerAlg DEBUG Property ['Name': Value] = 'AuditInitialize':False
DataListenerAlg DEBUG Property ['Name': Value] = 'AuditAlgorithms':False
DataListenerAlg DEBUG Property ['Name': Value] = 'ErrorCount':0
DataListenerAlg DEBUG Property ['Name': Value] = 'ErrorMax':1
DataListenerAlg DEBUG Property ['Name': Value] = 'Enable':True
DataListenerAlg DEBUG Property ['Name': Value] = 'OutputLevel':1
DataListenerAlg VERBOSE ServiceLocatorHelper::createService: found service DataListenerSvc
DataListenerAlg DEBUG ==> Initialize
EventDataSvc DEBUG Service base class initialized successfully
EventDataSvc VERBOSE ServiceLocatorHelper::createService: found service IncidentSvc
EventPersistenc... DEBUG Service base class initialized successfully
EventLoopMgr WARNING Unable to locate service "EventSelector"
EventLoopMgr WARNING No events will be processed from external input.
HistogramDataSvc DEBUG Service base class initialized successfully
HistogramDataSvc VERBOSE ServiceLocatorHelper::createService: found service IncidentSvc
HistogramPersis... DEBUG 'CnvServices':[ 'RootHistSvc' ]
HistogramPersis... DEBUG Service base class initialized successfully
HistogramPersis...WARNING Histograms saving not required.
HistogramDataSvc VERBOSE ServiceLocatorHelper::createService: found service HistogramPersistencySvc
ApplicationMgr INFO Application Manager Initialized successfully
ServiceManager DEBUG Starting service DataListenerSvc
ServiceManager DEBUG Starting service AppMgrRunable
ServiceManager DEBUG Starting service IncidentSvc
ServiceManager DEBUG Starting service EventPersistencySvc
ServiceManager DEBUG Starting service EventDataSvc
ServiceManager DEBUG Starting service HistogramPersistencySvc
ServiceManager DEBUG Starting service HistogramDataSvc
ServiceManager DEBUG Starting service EventLoopMgr
ApplicationMgr INFO Application Manager Started successfully
AlgContextSvc DEBUG Service base class initialized successfully
AlgContextSvc VERBOSE ServiceLocatorHelper::createService: found service IncidentSvc
IncidentSvc DEBUG Adding [BeginEvent] listener 'AlgContextSvc' with priority 0
IncidentSvc DEBUG Adding [EndEvent] listener 'AlgContextSvc' with priority 0
DataListenerAlg DEBUG ==> Execution counter:
IncidentSvc VERBOSE Calling 'DataListenerSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
DataListenerAlg DEBUG ==> Execution counter:
IncidentSvc VERBOSE Calling 'DataListenerSvc' for incident [EndEvent]
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Arithmetic number:5
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Exponential number:1.0406
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Fibonacci number:1
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Geometric number:4
DataListenerSvc INFO XML written to file: 0x7fb170
DataListenerSvc DEBUG XML written: Arithmetic number , 5
DataListenerSvc DEBUG XML written: Exponential number , 1.0406
DataListenerSvc DEBUG XML written: Fibonacci number , 1
DataListenerSvc DEBUG XML written: Geometric number , 4
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
DataListenerAlg DEBUG ==> Execution counter:
IncidentSvc VERBOSE Calling 'DataListenerSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
DataListenerAlg DEBUG ==> Execution counter:
IncidentSvc VERBOSE Calling 'DataListenerSvc' for incident [EndEvent]
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Arithmetic number:9
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Exponential number:1.17258
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Fibonacci number:1
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Geometric number:16
DataListenerSvc INFO XML written to file: 0x7fb170
DataListenerSvc DEBUG XML written: Arithmetic number , 9
DataListenerSvc DEBUG XML written: Exponential number , 1.17258
DataListenerSvc DEBUG XML written: Fibonacci number , 1
DataListenerSvc DEBUG XML written: Geometric number , 16
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
DataListenerAlg DEBUG ==> Execution counter:
IncidentSvc VERBOSE Calling 'DataListenerSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
DataListenerAlg DEBUG ==> Execution counter:
IncidentSvc VERBOSE Calling 'DataListenerSvc' for incident [EndEvent]
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Arithmetic number:13
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Exponential number:1.89046
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Fibonacci number:1
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Geometric number:64
DataListenerSvc INFO XML written to file: 0x7fb170
DataListenerSvc DEBUG XML written: Arithmetic number , 13
DataListenerSvc DEBUG XML written: Exponential number , 1.89046
DataListenerSvc DEBUG XML written: Fibonacci number , 1
DataListenerSvc DEBUG XML written: Geometric number , 64
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
DataListenerAlg DEBUG ==> Execution counter:
IncidentSvc VERBOSE Calling 'DataListenerSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
DataListenerAlg DEBUG ==> Execution counter:
IncidentSvc VERBOSE Calling 'DataListenerSvc' for incident [EndEvent]
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Arithmetic number:17
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Exponential number:12.7724
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Fibonacci number:1
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Geometric number:256
DataListenerSvc INFO XML written to file: 0x7fb170
DataListenerSvc DEBUG XML written: Arithmetic number , 17
DataListenerSvc DEBUG XML written: Exponential number , 12.7724
DataListenerSvc DEBUG XML written: Fibonacci number , 1
DataListenerSvc DEBUG XML written: Geometric number , 256
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
DataListenerAlg DEBUG ==> Execution counter:
IncidentSvc VERBOSE Calling 'DataListenerSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [BeginEvent]
DataListenerAlg DEBUG ==> Execution counter:
ServiceManager DEBUG Stopping service EventLoopMgr
IncidentSvc VERBOSE Calling 'DataListenerSvc' for incident [EndEvent]
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Arithmetic number:21
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Exponential number:26612.6
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Fibonacci number:1
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc DEBUG ApMon instantiated
DataListenerSvc INFO Sent parameters to MonALISA sever:DataListenerSvcTesting->jobID: 1->Geometric number:1024
DataListenerSvc INFO XML written to file: 0x7fb170
DataListenerSvc DEBUG XML written: Arithmetic number , 21
DataListenerSvc DEBUG XML written: Exponential number , 26612.6
DataListenerSvc DEBUG XML written: Fibonacci number , 1
DataListenerSvc DEBUG XML written: Geometric number , 1024
IncidentSvc VERBOSE Calling 'AlgContextSvc' for incident [EndEvent]
ServiceManager DEBUG Stopping service AlgContextSvc
ServiceManager DEBUG Stopping service HistogramDataSvc
ServiceManager DEBUG Stopping service HistogramPersistencySvc
ServiceManager DEBUG Stopping service EventDataSvc
ServiceManager DEBUG Stopping service EventPersistencySvc
ServiceManager DEBUG Stopping service IncidentSvc
ServiceManager DEBUG Stopping service AppMgrRunable
ServiceManager DEBUG Stopping service DataListenerSvc
ApplicationMgr INFO Application Manager Stopped successfully
ServiceManager DEBUG Finalizing service EventLoopMgr
DataListenerAlg DEBUG ==> Finalize
DataListenerAlg DEBUG Finalize base class GaudiAlgorithm
DataListenerAlg DEBUG Tools to release :
DataListenerAlg DEBUG Services to release : AlgContextSvc
DataListenerAlg DEBUG Releasing service 'AlgContextSvc'
IncidentSvc DEBUG Removing [AbortEvent] listener '<unknown>'
EventLoopMgr INFO Histograms converted successfully according to request.
ServiceManager DEBUG Finalizing service AlgContextSvc
IncidentSvc DEBUG Removing [BeginEvent] listener 'AlgContextSvc'
IncidentSvc DEBUG Removing [EndEvent] listener 'AlgContextSvc'
ServiceManager DEBUG Finalizing service HistogramDataSvc
ServiceManager DEBUG Finalizing service HistogramPersistencySvc
ServiceManager DEBUG Finalizing service EventDataSvc
ServiceManager DEBUG Finalizing service EventPersistencySvc
ServiceManager DEBUG Finalizing service IncidentSvc
ServiceManager DEBUG Finalizing service AppMgrRunable
ServiceManager DEBUG Finalizing service DataListenerSvc
DataListenerSvc DEBUG ApMon deleted
DataListenerSvc INFO finalized successfully
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
ApplicationMgr.TopAlg = { "DataListenerAlg" };
ApplicationMgr.ExtSvc += { "DataListenerSvc" };
MessageSvc.OutputLevel = 1;
ApplicationMgr.EvtMax = 10 ;
ApplicationMgr.EvtSel = "NONE" ;
EventSelector.PrintFreq = 1;
// Turn on/off monitoring services
DataListenerSvc.MonALISAMonitoring = 1;
DataListenerSvc.XMLMonitoring = 1;
DataListenerSvc.FileMonitoring = 1;
// Specify monitor service frequency
DataListenerSvc.EventFrequency = 2;
DataListenerSvc.MLEventFrequency = 2;
// MonALISA publishing options
DataListenerSvc.MLClusterName = "DataListenerSvcTesting";
// Path to MonALISA configuration file
//DataListenerSvc.MonaLisaMonitoring = "./destinations.conf";
DataListenerSvc.MLjobID = 1;
// $Id: DataListenerAlg.cpp,v 1.1 2006/09/04 08:22:30 hmd Exp $
// Include files
// from Gaudi
#include "GaudiKernel/DeclareFactoryEntries.h"
// local
#include "DataListenerAlg.h"
#include <cmath>
//-----------------------------------------------------------------------------
// Implementation file for class : DataListenerAlg
//
// 2006-08-28 : Ben King
//-----------------------------------------------------------------------------
// Declaration of the Algorithm Factory
DECLARE_ALGORITHM_FACTORY( DataListenerAlg )
//=============================================================================
// Standard constructor, initializes variables
//=============================================================================
DataListenerAlg::DataListenerAlg( const std::string& name,
ISvcLocator* pSvcLocator)
: GaudiAlgorithm ( name , pSvcLocator )
, m_fibo(1)
, m_geo(1)
, m_arith(1)
, m_expo(1.01)
{
}
//=============================================================================
// Destructor
//=============================================================================
DataListenerAlg::~DataListenerAlg() {}
//=============================================================================
// Initialization
//=============================================================================
StatusCode DataListenerAlg::initialize() {
StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first
if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm
try {
sc = service("DataListenerSvc", m_DataListenerSvc, true);
m_DataListenerSvc->declareInfo("Fibonacci number", m_fibo, "Fibonacci series", this);
m_DataListenerSvc->declareInfo("Exponential number", m_expo, "Exponential series", this);
m_DataListenerSvc->declareInfo("Arithmetic number", m_arith, "Arithmetic series", this);
m_DataListenerSvc->declareInfo("Geometric number", m_geo, "Geometric series", this);
} catch (std::runtime_error &e){
info() << "WARNING loading DataListenerSvc:\t" << e.what() << endmsg;
}
debug() << "==> Initialize" << endmsg;
return StatusCode::SUCCESS;
}
//=============================================================================
// Main execution
//=============================================================================
StatusCode DataListenerAlg::execute() {
debug() << "==> Execution counter:\t" << endmsg;
// StatusCode sc = Arith(m_arith, 2, 1);
// sc = Expo(m_expo, 1);
// sc = Fibonacci(m_fibo, 1, 1);
// sc = Geo(m_geo, 2, 1);
// m_counter++;
StatusCode sc = Arith( 2, 1);
sc = Expo( 1);
sc = Fibonacci( 1, 1);
sc = Geo( 2, 1);
m_counter++;
return sc;
}
// StatusCode DataListenerAlg::Arith(int& startPoint, int difference, unsigned int numSteps)
// {
// startPoint += difference*numSteps;
// setFilterPassed(true); // Mandatory. Set to true if event is accepted.
// return StatusCode::SUCCESS;
// }
StatusCode DataListenerAlg::Arith(int difference, unsigned int numSteps)
{
m_arith += difference*numSteps;
return StatusCode::SUCCESS;
}
// StatusCode DataListenerAlg::Expo(double& startPoint, unsigned int numSteps)
// {
// for(unsigned int i=0; i<numSteps; i++){
// startPoint = startPoint*startPoint;
// }
// setFilterPassed(true); // Mandatory. Set to true if event is accepted.
// return StatusCode::SUCCESS;
// }
StatusCode DataListenerAlg::Expo(unsigned int numSteps)
{
for(unsigned int i=0; i<numSteps; i++){
m_expo = m_expo*m_expo;
}
return StatusCode::SUCCESS;
}
// StatusCode DataListenerAlg::Fibonacci(int& startPoint1, int startPoint2, unsigned int numSteps)
// {
// int temp1;
// for (unsigned int i = 0; i < numSteps; i++){
// temp1 = startPoint1 + startPoint2;
// startPoint1 = startPoint2;
// startPoint2 = temp1;
// }
// setFilterPassed(true); // Mandatory. Set to true if event is accepted.
// return StatusCode::SUCCESS;
// }
StatusCode DataListenerAlg::Fibonacci(int startPoint2, unsigned int numSteps)
{
int temp1;
for (unsigned int i = 0; i < numSteps; i++){
temp1 = m_fibo + startPoint2;
m_fibo = startPoint2;
startPoint2 = temp1;
}
return StatusCode::SUCCESS;
}
// StatusCode DataListenerAlg::Geo(int& startPoint, int ratio, unsigned int numSteps)
// {
// for (unsigned int i = 0; i< numSteps; i++){
// startPoint = startPoint*ratio;
// }
// setFilterPassed(true); // Mandatory. Set to true if event is accepted.
// return StatusCode::SUCCESS;
// }
StatusCode DataListenerAlg::Geo(int ratio, unsigned int numSteps)
{
for (unsigned int i = 0; i< numSteps; i++){
m_geo = m_geo*ratio;
}
return StatusCode::SUCCESS;
}
//=============================================================================
// Finalize
//=============================================================================
StatusCode DataListenerAlg::finalize() {
debug() << "==> Finalize" << endmsg;
return GaudiAlgorithm::finalize(); // must be called after all other actions
}
//=============================================================================
// $Id: DataListenerAlg.h,v 1.1 2006/09/04 08:22:30 hmd Exp $
#ifndef DATALISTENER_DATALISTENER_H
#define DATALISTENER_DATALISTENER_H 1
// Include files
// from Gaudi
#include "GaudiAlg/GaudiAlgorithm.h"
//#include "GaudiSvc/v14r6/src/DataListenerSvc/DataListenerSvc.h"
/** @class DataListenerAlg DataListenerAlg.h DataListener/DataListenerAlg.h
*
*
* @author Ben King
* @date 2006-08-28
*/
class DataListenerAlg : public GaudiAlgorithm {
public:
/// Standard constructor
DataListenerAlg( const std::string& name, ISvcLocator* pSvcLocator );
virtual ~DataListenerAlg( ); ///< Destructor
virtual StatusCode initialize(); ///< Algorithm initialization
virtual StatusCode execute (); ///< Algorithm execution
virtual StatusCode finalize (); ///< Algorithm finalization
protected:
private:
int m_fibo;
int m_geo;
int m_arith;
double m_expo;
int m_counter;
IMonitorSvc *m_DataListenerSvc;
// StatusCode Fibonacci(int& startPoint1, int startPoint2, unsigned int numSteps);
// StatusCode Arith(int& startPoint, int difference, unsigned int numSteps);
// StatusCode Geo(int& startPoint, int ratio, unsigned int numSteps);
// StatusCode Expo(double& startPoint, unsigned int numSteps);
StatusCode Fibonacci(int startPoint2, unsigned int numSteps);
StatusCode Arith( int difference, unsigned int numSteps);
StatusCode Geo( int ratio, unsigned int numSteps);
StatusCode Expo( unsigned int numSteps);
};
#endif // DATALISTENER_DATALISTENER_H
<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="args"><set><text>$GAUDIEXAMPLESROOT/options/DataListener.opts</text></set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="reference"><text>../../home/DataListener.ref</text></argument>
<argument name="unsupported_platforms"><set><text>win32</text><text>.*</text></set></argument>
</extension>