Commit d5e96ef2 authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

cvs2svn commit to create tag 'AthExJobOptions-00-04-01'. (AthExJobOptions-00-04-01)

parent ad553849
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// AnotherConcreteSvc.h
// Header file for class AnotherConcreteSvc
// Author: S.Binet<binet@cern.ch>
///////////////////////////////////////////////////////////////////
#ifndef ATHEXJOBOPTIONS_ANOTHERCONCRETESVC_H
#define ATHEXJOBOPTIONS_ANOTHERCONCRETESVC_H 1
// STL includes
#include <string>
// FrameWork includes
#include "AthenaBaseComps/AthService.h"
// AthExJobOptions includes
#include "AthExJobOptions/IVirtualSvc.h"
// Forward declaration
template <class TYPE> class SvcFactory;
class AnotherConcreteSvc : virtual public IVirtualSvc,
public AthService
{
protected:
friend class SvcFactory<AnotherConcreteSvc>;
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
// Copy constructor:
/// Constructor with parameters:
AnotherConcreteSvc( const std::string& name, ISvcLocator* pSvcLocator );
/// Destructor:
virtual ~AnotherConcreteSvc();
/// Gaudi Service Implementation
//@{
StatusCode initialize();
StatusCode finalize();
virtual StatusCode queryInterface( const InterfaceID& riid,
void** ppvInterface );
//@}
///////////////////////////////////////////////////////////////////
// Const methods:
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// Non-const methods:
///////////////////////////////////////////////////////////////////
static const InterfaceID& interfaceID();
/** The very important message of the day
*/
StatusCode qotd( std::string& quote );
///////////////////////////////////////////////////////////////////
// Private methods:
///////////////////////////////////////////////////////////////////
private:
/// Default constructor:
AnotherConcreteSvc();
///////////////////////////////////////////////////////////////////
// Private data:
///////////////////////////////////////////////////////////////////
private:
/// The quote of the day
StringProperty m_qotd;
};
/// I/O operators
//////////////////////
///////////////////////////////////////////////////////////////////
/// Inline methods:
///////////////////////////////////////////////////////////////////
inline const InterfaceID& AnotherConcreteSvc::interfaceID()
{
return IVirtualSvc::interfaceID();
}
#endif //> ATHEXJOBOPTIONS_ANOTHERCONCRETESVC_H
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// ConcreteSvc.h
// Header file for class ConcreteSvc
// Author: S.Binet<binet@cern.ch>
///////////////////////////////////////////////////////////////////
#ifndef ATHEXJOBOPTIONS_CONCRETESVC_H
#define ATHEXJOBOPTIONS_CONCRETESVC_H 1
// STL includes
#include <string>
// FrameWork includes
#include "AthenaBaseComps/AthService.h"
// AthExJobOptions includes
#include "AthExJobOptions/IVirtualSvc.h"
// Forward declaration
template <class TYPE> class SvcFactory;
class ConcreteSvc : virtual public IVirtualSvc,
public AthService
{
protected:
friend class SvcFactory<ConcreteSvc>;
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
// Copy constructor:
/// Constructor with parameters:
ConcreteSvc( const std::string& name, ISvcLocator* pSvcLocator );
/// Destructor:
virtual ~ConcreteSvc();
/// Gaudi Service Implementation
//@{
StatusCode initialize();
StatusCode finalize();
virtual StatusCode queryInterface( const InterfaceID& riid,
void** ppvInterface );
//@}
///////////////////////////////////////////////////////////////////
// Const methods:
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// Non-const methods:
///////////////////////////////////////////////////////////////////
static const InterfaceID& interfaceID();
/** The very important message of the day
*/
StatusCode qotd( std::string& quote );
///////////////////////////////////////////////////////////////////
// Private methods:
///////////////////////////////////////////////////////////////////
private:
/// Default constructor:
ConcreteSvc();
///////////////////////////////////////////////////////////////////
// Private data:
///////////////////////////////////////////////////////////////////
private:
/// The quote of the day
StringProperty m_qotd;
};
/// I/O operators
//////////////////////
///////////////////////////////////////////////////////////////////
/// Inline methods:
///////////////////////////////////////////////////////////////////
inline const InterfaceID& ConcreteSvc::interfaceID()
{
return IVirtualSvc::interfaceID();
}
#endif //> ATHEXJOBOPTIONS_CONCRETESVC_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_CONCRETETOOL_H
#define ATHEXJOBOPTIONS_CONCRETETOOL_H 1
#include "AthExJobOptions/IVirtualTool.h"
#include "AthenaBaseComps/AthAlgTool.h"
#include <string>
/////////////////////////////////////////////////////////////////////////////
class ConcreteTool : virtual public IVirtualTool, virtual public AthAlgTool {
public:
ConcreteTool( const std::string&, const std::string&, const IInterface* );
// to allow access to the IVirtualTool interface
StatusCode queryInterface( const InterfaceID& riid, void** ppvIf );
// setup/teardown functions, similar like those for Algorithm/Service
StatusCode initialize();
StatusCode finalize();
// the magic method this tool provides
StatusCode performTask( double& result );
public:
// to resolve possible conflicts with IProperty::interfaceID()
static const InterfaceID& interfaceID() { return IVirtualTool::interfaceID(); }
private:
double m_factor;
};
#endif // !ATHEXJOBOPTIONS_CONCRETETOOL_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_EVTLOOPPRESELECTTOOL_H
#define ATHEXJOBOPTIONS_EVTLOOPPRESELECTTOOL_H 1
#include "AthenaKernel/IAthenaEvtLoopPreSelectTool.h"
#include "AthenaBaseComps/AthAlgTool.h"
#include <string>
/////////////////////////////////////////////////////////////////////////////
class ExampleEvtLoopPreSelectTool : public AthAlgTool, virtual public IAthenaEvtLoopPreSelectTool {
public:
ExampleEvtLoopPreSelectTool( const std::string&, const std::string&, const IInterface* );
// to allow access to the IAthenaEvtLoopPreSelectTool interface
StatusCode queryInterface( const InterfaceID& riid, void** ppvIf );
// setup/teardown functions
StatusCode initialize();
StatusCode finalize();
// the method that decides if an event should be passed to the EventSelector
bool passEvent(const EventInfo* pEvent);
public:
// to resolve possible conflicts with IProperty::interfaceID()
static const InterfaceID& interfaceID() { return IAthenaEvtLoopPreSelectTool::interfaceID(); }
private:
int m_prescale;
};
#endif // !ATHEXJOBOPTIONS_CONCRETETOOL_H
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// IVirtualSvc.h
// Header file for class IVirtualSvc
// Author: S.Binet<binet@cern.ch>
///////////////////////////////////////////////////////////////////
#ifndef ATHEXJOBOPTIONS_IVIRTUALSVC_H
#define ATHEXJOBOPTIONS_IVIRTUALSVC_H
/** @class IVirtualSvc
* This is the interface to a test service
*/
// STL includes
// FrameWork includes
#include "GaudiKernel/IService.h"
// forward declaration
class IVirtualSvc : virtual public IService
{
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
/** Destructor:
*/
virtual ~IVirtualSvc();
///////////////////////////////////////////////////////////////////
// Const methods:
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// Non-const methods:
///////////////////////////////////////////////////////////////////
/// Delivers important informations
virtual StatusCode qotd( std::string& quote ) = 0;
/// identifier for the framework
static const InterfaceID& interfaceID();
};
// I/O operators
//////////////////////
///////////////////////////////////////////////////////////////////
// Inline methods:
///////////////////////////////////////////////////////////////////
inline const InterfaceID& IVirtualSvc::interfaceID()
{
static const InterfaceID IID_IVirtualSvc("IVirtualSvc", 1, 0);
return IID_IVirtualSvc;
}
#endif //> ATHEXJOBOPTIONS_IVIRTUALSVC_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_IVIRTUALTOOL_H
#define ATHEXJOBOPTIONS_IVIRTUALTOOL_H
#include "GaudiKernel/IAlgTool.h"
/////////////////////////////////////////////////////////////////////////////
class IVirtualTool : virtual public IAlgTool {
public:
static const InterfaceID& interfaceID();
public:
virtual StatusCode performTask( double& result ) = 0;
};
#endif // !ATHEXJOBOPTIONS_IVIRTUALTOOL_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_KEYMIXIN_H
#define ATHEXJOBOPTIONS_KEYMIXIN_H 1
class AthAlgorithm;
#include <string>
/////////////////////////////////////////////////////////////////////////////
class KeyMixin {
public:
KeyMixin( AthAlgorithm* );
protected:
std::string getInputKey() const { return m_inputKey; }
std::string getOutputKey() const { return m_outputKey; }
private:
std::string m_inputKey;
std::string m_outputKey;
};
#endif // !ATHEXJOBOPTIONS_KEYMIXIN_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_NOOPALGORITHM_H
#define ATHEXJOBOPTIONS_NOOPALGORITHM_H 1
#include "AthenaBaseComps/AthAlgorithm.h"
/////////////////////////////////////////////////////////////////////////////
class NoopAlgorithm : public AthAlgorithm {
public:
NoopAlgorithm( const std::string& name, ISvcLocator* svcloc );
StatusCode initialize(); // called once, at start of job
StatusCode reinitialize(); // can be called anytime after init
StatusCode execute(); // called every event
StatusCode finalize(); // called once, at end of job
private:
// services to hold on to
};
#endif // !ATHEXJOBOPTIONS_NOOPALGORITHM_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_SOMEDATA_H
#define ATHEXJOBOPTIONS_SOMEDATA_H 1
#include "CLIDSvc/CLASS_DEF.h"
/////////////////////////////////////////////////////////////////////////////
class SomeData {
public:
SomeData( double value ) : m_value( value ) {}
double getValue() { return m_value; }
void setValue( double value ) { m_value = value; }
private:
double m_value;
};
// CLASS_DEF macro's can be obtained for your class by running the clid script
// with your class name, like so (in an ATLAS environment):
//
// $ clid -m SomeData
//
CLASS_DEF( SomeData, 86850056, 1 )
#endif // !ATHEXJOBOPTIONS_SOMEDATA_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_SUBALGORITHM_H
#define ATHEXJOBOPTIONS_SUBALGORITHM_H 1
#include "AthenaBaseComps/AthAlgorithm.h"
#include <string>
#include <vector>
/////////////////////////////////////////////////////////////////////////////
class SubAlgorithm : public AthAlgorithm {
public:
SubAlgorithm( const std::string& name, ISvcLocator* svcloc );
StatusCode initialize(); // called once, at start of job
StatusCode reinitialize(); // can be called anytime after init
StatusCode beginRun(); // called at begin of every run
StatusCode execute(); // called every event
StatusCode endRun(); // called at end of every run
StatusCode finalize(); // called once, at end of job
private:
// add toolhandle ...
std::vector< std::string > m_selections;
};
#endif // !ATHEXJOBOPTIONS_SUBALGORITHM_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_TEMPLATEDTOOL_H
#define ATHEXJOBOPTIONS_TEMPLATEDTOOL_H 1
#include "AthExJobOptions/IVirtualTool.h"
#include "AthenaBaseComps/AthAlgTool.h"
#include <string>
/////////////////////////////////////////////////////////////////////////////
namespace ToolSpace {
template< class T >
class TemplatedTool : virtual public IVirtualTool, virtual public AthAlgTool {
public:
TemplatedTool( const std::string&, const std::string&, const IInterface* );
// to allow access to the IVirtualTool interface
StatusCode queryInterface( const InterfaceID& riid, void** ppvIf );
// setup/teardown functions, similar like those for Algorithm/Service
StatusCode initialize();
StatusCode finalize();
// the magic method this tool provides
virtual StatusCode performTask( double& result );
public:
// to resolve possible conflicts with IProperty::interfaceID()
static const InterfaceID& interfaceID() { return IVirtualTool::interfaceID(); }
private:
double m_factor;
};
}
#endif // !ATHEXJOBOPTIONS_TOOLUSINGTOOL_H
// dear emacs, this is -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_TESTSVCHANDLEARRAYALG_H
#define ATHEXJOBOPTIONS_TESTSVCHANDLEARRAYALG_H 1
#include "AthenaBaseComps/AthAlgorithm.h"
#include "GaudiKernel/ServiceHandle.h"
class IVirtualSvc;
#include <string>
#include <vector>
/////////////////////////////////////////////////////////////////////////////
class TestSvcHandleArrayAlg : public AthAlgorithm {
public:
TestSvcHandleArrayAlg( const std::string& name, ISvcLocator* svcloc );
StatusCode initialize(); // called once, at start of job
StatusCode reinitialize(); // can be called anytime after init
StatusCode beginRun(); // called at begin of every run
StatusCode execute(); // called every event
StatusCode endRun(); // called at end of every run
StatusCode finalize(); // called once, at end of job
private:
typedef ServiceHandleArray<IVirtualSvc> IVirtualSvcs_t;
IVirtualSvcs_t m_listOfSvcs;
};
#endif // !ATHEXJOBOPTIONS_TESTSVCHANDLEARRAYALG_H
// -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_TOOLUSINGTOOL_H
#define ATHEXJOBOPTIONS_TOOLUSINGTOOL_H 1
#include "AthExJobOptions/IVirtualTool.h"