Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
Showing
with 885 additions and 0 deletions
///////////////////////// -*- 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"
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/ToolHandle.h"
#include <string>
/////////////////////////////////////////////////////////////////////////////
class ToolUsingTool : virtual public IVirtualTool, virtual public AthAlgTool {
public:
ToolUsingTool( 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;
ToolHandle< IVirtualTool > m_pubTool;
ToolHandle< IVirtualTool > m_privTool;
ToolHandleArray< IVirtualTool > m_toolArray;
};
#endif // !ATHEXJOBOPTIONS_TOOLUSINGTOOL_H
// dear emacs, this is -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHEXJOBOPTIONS_TOPALGORITHM_H
#define ATHEXJOBOPTIONS_TOPALGORITHM_H 1
#include "AthenaBaseComps/AthAlgorithm.h"
#include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/ServiceHandle.h"
#include "AthExJobOptions/KeyMixin.h"
class StoreGateSvc;
class IVirtualTool;
class IVirtualSvc;
#include <string>
#include <vector>
/////////////////////////////////////////////////////////////////////////////
class TopAlgorithm : public AthAlgorithm, private KeyMixin {
public:
TopAlgorithm( 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:
double m_rndmFactor;
typedef ToolHandle<IVirtualTool> IVirtualTool_t;
typedef ToolHandleArray<IVirtualTool> IVirtualTools_t;
IVirtualTool_t m_tool;
IVirtualTool_t m_publicTool;
IVirtualTools_t m_listOfPrivateTools;
IVirtualTools_t m_listOfPublicTools;
typedef ServiceHandle<IVirtualSvc> IVirtualSvc_t;
IVirtualSvc_t m_svc;
// testing bug #31571
// https://savannah.cern.ch/bugs/?31571
IVirtualTool_t m_emptyPrivateTool;
IVirtualTool_t m_emptyPublicTool;
};
#endif // !ATHEXJOBOPTIONS_TOPALGORITHM_H
package AthExJobOptions
author Wim Lavrijsen <WLavrijsen@lbl.gov>
use AtlasPolicy AtlasPolicy-*
use GaudiInterface GaudiInterface-* External
use AthenaKernel AthenaKernel-* Control
use AthenaBaseComps AthenaBaseComps-* Control
use CLIDSvc CLIDSvc-* Control
library AthExJobOptions *.cxx -s=components *.cxx
apply_pattern component_library
apply_pattern declare_joboptions \
files="*.py"
apply_pattern declare_python_modules \
files="*.py"
private
use EventInfo EventInfo-* Event
use StoreGate StoreGate-* Control
apply_pattern install_runtime
use TestTools TestTools-* AtlasTest -no_auto_imports
apply_pattern athenarun_test name="JobOptionsBasic" \
pre_script="../cmt/setup.sh" \
options="AthExJobOptions/AthExJobOptions_BasicJobOptions.py" \
post_script="${TESTTOOLSROOT}/share/post.sh JobOptionsBasic"
apply_pattern athenarun_test name="JobOptionsCustomTool" \
pre_script="../cmt/setup.sh" \
options="AthExJobOptions/AthExJobOptions_CustomToolJobOptions.py" \
post_script="${TESTTOOLSROOT}/share/post.sh JobOptionsCustomTool"
apply_pattern athenarun_test name="JobOptionsCustomTopAlg" \
pre_script="../cmt/setup.sh" \
options="AthExJobOptions/AthExJobOptions_CustomTopAlgorithmJobOptions.py" \
post_script="${TESTTOOLSROOT}/share/post.sh JobOptionsCustomTopAlg"
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
@mainpage AthExJobOptions Package
@author Wim Lavrijsen <WLavrijsen@lbl.gov>
@author Martin Woudstra <Martin.Woudstra@cern.ch>
@section AthExJobOptionsIntro Introduction
This package contains examples of configurable-style job options, and shows
how to write self-contained Gaudi component configurations by deriving your
own python classes from the generated configurables.
For this purpose, it uses a few "Hello World!"-style Algorithms and AlgTools;
the real meat, however, is in the custom python files.
@section AthExJobOptionsOverview Class Overview
Of main interest are the python classes; the other classes are merely there in
order to have something to play with.
The python classes are:
- CustomTopAlgorithm : shows how to implement a customization of a top algorithm by using a class derived from the generated configurable. The result is a well-contained representation of the corresponding Gaudi component.
The following Algorithm classes are available:
- NoopAlgorithm : a do-nothing Algorithm, which only has the base-class Algorithm properties.
- TopAlgorithm : an algorithm that makes use of a tool, set by configuration, to perform a task.
- SubAlgorithm : an algorithm that presumes to be controlled by another algorithm.
The following AlgTool classes, all implementing the @c IVirtualTool interface, are available:
- ConcreteTool : a tool that performs a task.
- TemplatedTool : a tool that is templated in C++ and performs a task.
- ToolUsingTool : a tool that makes use of a tool, set by configuration, to perform a task.
As well as the following helpers:
- KeyMixin : a mixin class providing in/out key properties for use with @c StoreGate
- SomeData : a custom data class, instances of which can be put in, and read from, @c StoreGate
@ref used_AthExJobOptions
@ref requirements_AthExJobOptions
*/
/**
@page used_AthExJobOptions Used Packages
@htmlinclude used_packages.html
*/
/**
@page requirements_AthExJobOptions Requirements
@include requirements
*/
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# File: AthExJobOptions/CustomToolUsingTool.py
# Author: Wim Lavrijsen (WLavrijsen@lbl.gov)
__version__ = '1.0.0'
__author__ = 'Wim Lavrijsen (WLavrijsen@lbl.gov)'
__all__ = [ 'CustomToolUsingTool' ]
# Get our base class (was generated by genConf; note that the package name is
# not necessary if both classes reside in the same directory)
from AthExJobOptionsConf import ToolUsingTool
# Customized class, enable through derivation
class CustomToolUsingTool( ToolUsingTool ):
__slots__ = [] # enforce no new properties
def __init__( self, name = 'CustomToolUsingTool' ): # sets default name
super( CustomToolUsingTool, self ).__init__( name ) # have to call base init
# setDefaults is enforced to be a class method; because it is a class method,
# the defaults can be savely queried by other tools, without touching any part
# of the configuration as would happen otherwise
def setDefaults( cls, handle ):
# these values will override the C++ (i.e. developer) default values, not
# any python (i.e. user) values
handle.Factor = 42. # best, is considered default
if not hasattr( handle, 'TheToolTool' ):
from AthExJobOptionsConf import ConcreteTool
handle.TheToolTool = ConcreteTool( 'ToolTool' )
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# File: AthExJobOptions/CustomToolUsingTool2.py
# Author: Wim Lavrijsen (WLavrijsen@lbl.gov)
__version__ = '1.0.0'
__author__ = 'Wim Lavrijsen (WLavrijsen@lbl.gov)'
__all__ = [ 'CustomToolUsingTool2' ]
# Customized class, enable through pseudo-metaclass
class CustomToolUsingTool2( object ):
def __new__( cls, name = 'CustomToolUsingTool2' ):
# first, look for already fully customized instance
from AthExJobOptionsConf import ToolUsingTool
try:
return ToolUsingTool.configurables[ name ]
except KeyError:
pass
# else, request a new instance, and add customization
from AthExJobOptionsConf import ConcreteTool
tool = ToolUsingTool( name )
tool.Factor = 42.
tool.TheToolTool = ConcreteTool( 'ToolTool' )
# all done
return tool
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
## @file CustomTopAlgorithm.py
# File: AthExJobOptions/CustomTopAlgorithm.py
# Author: Wim Lavrijsen (WLavrijsen@lbl.gov)
__version__ = '1.0.0'
__author__ = 'Wim Lavrijsen (WLavrijsen@lbl.gov)'
__all__ = [ 'CustomTopAlgorithm' ]
# Get our base class (was generated by genConf; note that the package name is
# not necessary if both classes reside in the same directory)
from AthExJobOptionsConf import TopAlgorithm
## @class CustomTopAlgorithm
# @brief Customizer class for TopAlgorithm, enabled through derivation
# bla bla bla
class CustomTopAlgorithm( TopAlgorithm ):
__slots__ = [] # enforce no new properties
def __init__( self, name = 'CustomTopAlgorithm' ): # sets default name
super( CustomTopAlgorithm, self ).__init__( name ) # have to call base init
self.RndmFactor = 101. # allowed, NOT considered default
# setDefaults is enforced to be a class method; because it is a class method,
# the defaults can be savely queried by other tools, without touching any part
# of the configuration as would happen otherwise
def setDefaults( cls, handle ):
# these values will override the C++ (i.e. developer) default values, not
# any python (i.e. user) values
handle.RndmFactor = 42. # best, is considered default
# make sure one tool is always selected
if not hasattr( handle, 'TheTool' ):
from AthExJobOptionsConf import ConcreteTool
handle.TheTool = ConcreteTool()
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# File: AthExJobOptions/__init__.py
# Author: Wim Lavrijsen (WLavrijsen@lbl.gov)
__version__ = '1.0.0'
__author__ = 'Wim Lavrijsen (WLavrijsen@lbl.gov)'
__all__ = [ 'CustomTopAlgorithm' ]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment