Skip to content
Snippets Groups Projects
Commit 0b67eced authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Delete obsolete scripts to create Gaudi components

Delete obsolete scripts to create Gaudi components. All these scripts
are CMT-based and not maintained. For analysis-based releases see the
up-to-date scripts in PyUtils/python/scripts.


Former-commit-id: 2c36013f
parent 71d17ceb
No related merge requests found
Showing
with 0 additions and 771 deletions
################################################################################
# Package: AlgorithmToolSetup
################################################################################
# Declare the package name:
atlas_subdir( AlgorithmToolSetup )
# Install files from the package:
atlas_install_runtime( src/*.templ src/*.txt share/AlgorithmToolSetup.sh )
atlas_install_scripts( share/*.sh )
This tool is meant to do the repetitive part in setting up a new Tool or a new Algorithm. It is also set up in a way to encourage clean
programming, following the conventions for software development in Atlas. Just start the shell script corresponding
to your shell (.sh or .csh), it will inquire everything it needs to know interactively. Make sure that your environment is set up properly,
the utility is working in the directory specified by $TestArea. The utility directory is for the time being assumed to be directly under the
$TestArea directory. Please make sure that the utility directory is located correctly. Once the tool is in CVS, the directory will
automatically be located correctly, when it is checked out.
What the utility does:
- If the package directory for the new algorithm specified by the user
does not yet exist, the package directory will be set up, including subdirectories.
Otherwise, the files for the new algorithm or tool will be inserted in the already existing directory.
- It creates all files necessary for the new algorithm/tool to be compiled (Although, of course, the code won't do
much at this stage.) For a new tool, named (by the user) 'NewTool', part of the package 'NewPackage' in the directory
'$TestArea/NewPath' the following files are created :
../NewPath/NewPackage:
ChangeLog
../NewPath/NewPackage/cmt:
requirements
../NewPath/NewPackage/doc:
mainpage.h
../NewPath/NewPackage/NewPackage:
INewTool.h (interface only for Tools, will not be created for algorithms)
NewTool.h
../NewPath/NewPackage/share:
../NewPath/NewPackage/src:
NewTool.cxx
../NewPath/NewPackage/src/components:
NewPackage_entries.cxx
NewPackage_load.cxx
If the new algorithm/tool is inserted into an already existing package, the ChangeLog, the requirements and the mainpage file
as well as the files in the components directory are not created. A standard entry is added to the ChangeLog.
However, the files in the components directory have to be edited by hand, when an algorithm/tool is added to an existing
package in order to make it compile.
Tools created by the utility are always derived from an Interface. The interface is always placed in the same directory
as the Tool's header file.
Martin Siebel <Martin.Siebel@CERN.ch>, May 2006
\ No newline at end of file
#!/usr/local/bin/bash
#
# Basic Utility to create standard athena algorithms or tools
# M.Siebel, 05.2006 <Martin.Siebel@CERN.ch>
#
binDir=`dirname $0`
srcDir=`dirname $binDir`
#
# inquiry section
#
echo
echo
cat $srcDir/introAlgorithmToolSetup.txt
echo
echo " o-----------------------o"
echo " | Do you want to set up |"
echo " | |"
echo " | (1) a Tool |"
echo " | (2) an Algorithm |"
echo " o-----------------------o"
echo
isTool=" "
while [ "${isTool}" != "1" -a "${isTool}" != "2" ]
do
read isTool
if [ "$isTool" != "1" -a "$isTool" != "2" ]
then
echo " Please enter only '1' or '2' "
fi
done
algName=""
while [ "$algName" == "" ]
do
if [ $isTool = 1 ]
then
echo
echo " o-----------------------------o"
echo " | Please enter the TOOL NAME: |"
echo " o-----------------------------o"
echo
else
echo
echo " o----------------------------------o"
echo " | Please enter the ALGORITHM NAME: |"
echo " o----------------------------------o"
echo
fi
read algName
done
packageName=""
while [ "$packageName" == "" ]
do
echo
echo " o---------------------------------------------------o"
echo " | Please enter the PACKAGE NAME (e.g. RecExCommon): |"
echo " o---------------------------------------------------o"
echo
read packageName
done
packageDir=""
while [ "$packageDir" == "" ]
do
echo
echo " o--------------------------------------------------o"
echo " | Please enter the PACKAGE PATH beyond '/offline/' |"
echo " | and without the new package's directory |"
echo " | (e.g. Reconstruction/RecExample ): |"
echo " o--------------------------------------------------o"
echo
read packageDir
done
thisDir=`pwd`
targetDir=$thisDir/$packageDir/$packageName
if [ -d $targetDir ]
then
echo
echo " The Package $packageDir/$packageName does already exist. Do you want to insert $algName into it? (y/n)"
echo
answer=" "
while [ "$answer" != "y" -a "$answer" != "n" ]
do
read answer
if [ $answer = "y" ]
then
if [ -e ${targetDir}/${packageName}/${algName}.h ]
then
echo
echo " The file $targetDir/$packageName/$algName.h already exists. --> Cancel setup"
echo " Have a nice day ..."
exit 1
else
isInsert=1
fi
elif [ "$answer" = "n" ]
then
echo
echo " Have a nice day ... bye!"
exit 1
else
echo " Please answer only with 'y' or 'n' "
fi
done
else
echo
echo " The Package $packageDir/$packageName does not exist. Do you want to create it? (y/n)"
echo
answer=" "
while [ "$answer" != "y" -a "$answer" != "n" ]
do
read answer
if [ "$answer" = "y" ]
then
isInsert=0
elif [ "$answer" = "n" ]
then
echo
echo " Have a nice day ... bye!"
exit 1
else
echo " Please answer only with 'y' or 'n' "
fi
done
fi
answer="n"
nameSpace=""
while [ "$nameSpace" == "" -a "$answer" != "yes" ]
do
echo
echo " o--------------------------------------------------o"
echo " | Please enter the NAMESPACE (e.g. Trk,InDet,...): |"
echo " o--------------------------------------------------o"
echo
read nameSpace
if [ "$nameSpace" == "" ]
then
echo
echo " *###################################################*"
echo " # #"
echo " # W A R N I N G ! #"
echo " # #"
echo " # You did not specify a namespace for your code #"
echo " # The use of namespaces is #"
echo " # ** REQUIRED ** #"
echo " # by ATLAS C++ Coding Standards. #"
echo " # (see coding standards document, par. 2.4/NC4) #"
echo " # #"
echo " # If you are positively sure you want to #"
echo " # proceed without a namespace type yes, #"
echo " # type anything else to return and choose #"
echo " # a namespace. #"
echo " # #"
echo " *###################################################*"
echo
read answer
fi
done
authorName=""
while [ "$authorName" == "" ]
do
echo
echo " o----------------------------o"
echo " | Please enter YOUR NAME: |"
echo " | (not as mail address, that |"
echo " | will be the next question)|"
echo " o----------------------------o"
echo
read authorName
done
authorMail=""
while [ "$authorMail" == "" ]
do
echo
echo " o-----------------------------------o"
echo " | Please enter YOUR E-MAIL ADDRESS: |"
echo " o-----------------------------------o"
echo
read authorMail
done
#
# create directories
#
if [ $isInsert -eq 0 ]
then
echo " Setting up directory"
mkdir -p $targetDir
mkdir -p $targetDir/$packageName
mkdir -p $targetDir/src
mkdir -p $targetDir/src/components
mkdir -p $targetDir/cmt
mkdir -p $targetDir/doc
fi
#
# copy files
#
echo " Setting up basic files"
if [ $isTool -eq 1 ]
then
type="tool"
cp $srcDir/interface_tool.templ $targetDir/$packageName/I${algName}.h
else
type="alg"
fi
cp $srcDir/source_$type.templ $targetDir/src/$algName.cxx
cp $srcDir/header_$type.templ $targetDir/src/$algName.h
if [ $isInsert -eq 0 ]
then
cp $srcDir/requirements.templ $targetDir/cmt/requirements
cp $srcDir/version.templ $targetDir/cmt/version.cmt
cp $srcDir/mainpage.templ $targetDir/doc/mainpage.h
cp $srcDir/entries_$type.templ $targetDir/src/components/${packageName}_entries.cxx
cp $srcDir/load.templ $targetDir/src/components/${packageName}_load.cxx
cp $srcDir/ChangeLog.templ $targetDir/ChangeLog
else
# Add to ChangeLog
mv $targetDir/ChangeLog $targetDir/ChangeLog.tmp
cp $srcDir/ChangeLog.templ $targetDir/ChangeLog
cat $targetDir/ChangeLog.tmp >> $targetDir/ChangeLog
rm -f $targetDir/ChangeLog.tmp
fi
#
# replace keys
#
cppKey=`echo "${nameSpace}${algName}" | tr "[:lower:]" "[:upper:]"`
today=`date +%F`
fileList="$targetDir/src/$algName.cxx $targetDir/src/$algName.h $targetDir/ChangeLog"
if [ $isInsert -eq 0 ]
then
fileList="$fileList $targetDir/cmt/requirements $targetDir/cmt/version.cmt $targetDir/doc/mainpage.h $targetDir/src/components/${packageName}_entries.cxx $targetDir/src/components/${packageName}_load.cxx"
fi
if [ $isTool -eq 1 ]
then
fileList="$fileList $targetDir/$packageName/I${algName}.h"
fi
echo " Editing files: " $fileList
for file in $fileList
do
cat $file |sed s/@algName@/$algName/g > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed s/@packageName@/$packageName/g > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed s/@authorName@/"$authorName"/g > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed s/@CppKey@/$cppKey/g > ${file}.tmp ; mv -f ${file}.tmp $file
if [ "$nameSpace" != "" ]
then
cat $file |sed s/@nameSpace@/$nameSpace/g > ${file}.tmp ; mv -f ${file}.tmp $file
else
cat $file |sed s/@nameSpace@::/" "/g > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed 's#namespace @nameSpace@#// No NameSpace selected#g' > ${file}.tmp ; mv -f ${file}.tmp $file
fi
cat $file |sed s/@authorMail@/"$authorMail"/g > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed s/@date@/$today/g > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed s/@algName@/$algName/g > ${file}.tmp ; mv -f ${file}.tmp $file
done
if [ "$nameSpace" == "" ]
then
if [ $isTool -eq 1 ]
then
file="$targetDir/$packageName/$algName.h"
echo "making adjustments not to use a namespace in $file"
cat $file |sed '52d' > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed '16d' > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed '16,50s/^ //g' > ${file}.tmp ; mv -f ${file}.tmp $file
file="$targetDir/$packageName/I$algName.h"
echo "making adjustments not to use a namespace in $file"
cat $file |sed '29d' > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed '11d' > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed '11,27s/^ //g' > ${file}.tmp ; mv -f ${file}.tmp $file
file="$targetDir/src/components/${packageName}_entries.cxx"
echo "making adjustments not to use a namespace in $file"
cat $file |sed '4c DECLARE_TOOL_FACTORY( @algName@ )' > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed '8c DECLARE_TOOL( @algName@ )' > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed s/@algName@/$algName/g > ${file}.tmp ; mv -f ${file}.tmp $file
else
file="$targetDir/$packageName/$algName.h"
echo "making adjustments not to use a namespace in $file"
cat $file |sed '59d' > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed '18d' > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed '18,57s/^ //g' > ${file}.tmp ; mv -f ${file}.tmp $file
file="$targetDir/src/components/${packageName}_entries.cxx"
echo "making adjustments not to use a namespace in $file"
cat $file |sed '4c DECLARE_ALGORITHM_FACTORY( @algName@ )' > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed '7c DECLARE_ALGORITHM( @algName@ )' > ${file}.tmp ; mv -f ${file}.tmp $file
cat $file |sed s/@algName@/$algName/g > ${file}.tmp ; mv -f ${file}.tmp $file
fi
fi
#
# Printout Goodbye
#
if [ $isInsert -eq 1 ]
then
cat $srcDir/exitAlgorithmToolSetup_insert.txt
else
cat $srcDir/exitAlgorithmToolSetup.txt
fi
This tool is meant to do the repetitive part in setting up a new Tool or a new Algorithm. It is also set up in a way to encourage clean
programming, following the conventions for software development in Atlas. Just start the shell script corresponding
to your shell (.sh or .csh), it will inquire everything it needs to know interactively. Make sure that your environment is set up properly,
the utility is working in the directory specified by $TestArea. The utility directory is for the time being assumed to be directly under the
$TestArea directory. Please make sure that the utility directory is located correctly. Once the tool is in CVS, the directory will
automatically be located correctly, when it is checked out.
What the utility does:
- If the package directory for the new algorithm specified by the user
does not yet exist, the package directory will be set up, including subdirectories.
Otherwise, the files for the new algorithm or tool will be inserted in the already existing directory.
- It creates all files necessary for the new algorithm/tool to be compiled (Although, of course, the code won't do
much at this stage.) For a new tool, named (by the user) 'NewTool', part of the package 'NewPackage' in the directory
'$TestArea/NewPath' the following files are created :
../NewPath/NewPackage:
ChangeLog
../NewPath/NewPackage/cmt:
requirements
../NewPath/NewPackage/doc:
mainpage.h
../NewPath/NewPackage/NewPackage:
INewTool.h (interface only for Tools, will not be created for algorithms)
NewTool.h
../NewPath/NewPackage/share:
../NewPath/NewPackage/src:
NewTool.cxx
../NewPath/NewPackage/src/components:
NewPackage_entries.cxx
NewPackage_load.cxx
If the new algorithm/tool is inserted into an already existing package, the ChangeLog, the requirements and the mainpage file
as well as the files in the components directory are not created. A standard entry is added to the ChangeLog.
However, the files in the components directory have to be edited by hand, when an algorithm/tool is added to an existing
package in order to make it compile.
Tools created by the utility are always derived from an Interface. The interface is always placed in the same directory
as the Tool's header file.
Martin Siebel <Martin.Siebel@CERN.ch>, May 2006
\ No newline at end of file
@date@ @authorName@ <@authorMail@>
Setup of @algName@ (empty) using SetupUtility
#include "GaudiKernel/DeclareFactoryEntries.h"
#include "../@algName@.h"
DECLARE_NAMESPACE_ALGORITHM_FACTORY( @nameSpace@ , @algName@ )
DECLARE_FACTORY_ENTRIES( @packageName@ ) {
DECLARE_NAMESPACE_ALGORITHM( @nameSpace@ , @algName@ )
}
#include "GaudiKernel/DeclareFactoryEntries.h"
#include "../@algName@.h"
DECLARE_NAMESPACE_TOOL_FACTORY( @nameSpace@, @algName@ )
DECLARE_FACTORY_ENTRIES( @packageName@ )
{
DECLARE_NAMESPACE_TOOL( @nameSpace@, @algName@ )
}
o--------------------------------------------------------o
| The empty files for the Algorithm/Tool are now set up |
| and ready to compile. Remember to type 'cmt config' |
| before 'make' |
| |
| Please do not forget to remove the standard comments |
| from the header file and the doc/mainpage.h file and |
| to replace them with meaningful comments. |
| (Don't forget, your name is already there ... ;-) ) |
| |
o--------------------------------------------------------o
o--------------------------------------------------------o
| The empty files for the Algorithm/Tool are now set up. |
| You still have to add your new Algorithm or Tool to |
| the files in src/components. |
| After that they are ready to compile. |
| |
| Please do not forget to remove the standard comments |
| from the header file and the doc/mainpage.h file and |
| to replace them with meaningful comments. |
| (Don't forget, your name is already there ... ;-) ) |
| |
o--------------------------------------------------------o
///////////////////////////////////////////////////////////////////
// @algName@.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef @CppKey@_H
#define @CppKey@_H
// Gaudi includes
#include "AthenaBaseComps/AthAlgorithm.h"
#include <string>
class AtlasDetectorID;
class Identifier;
namespace @nameSpace@
{
/** @class @algName@
This is for the Doxygen-Documentation.
Please delete these lines and fill in information about
the Algorithm!
Please precede every member function declaration with a
short Doxygen comment stating the purpose of this function.
@author @authorName@ <@authorMail@>
*/
class @algName@ : public AthAlgorithm
{
public:
/** Standard Athena-Algorithm Constructor */
@algName@(const std::string& name, ISvcLocator* pSvcLocator);
/** Default Destructor */
~@algName@();
/** standard Athena-Algorithm method */
StatusCode initialize();
/** standard Athena-Algorithm method */
StatusCode execute();
/** standard Athena-Algorithm method */
StatusCode finalize();
private:
/** member variables for algorithm properties: */
// int/double/bool m_propertyName;
};
} // end of namespace
#endif
///////////////////////////////////////////////////////////////////
// @algName@.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef @CppKey@_H
#define @CppKey@_H
#include "AthenaBaseComps/AthAlgTool.h"
#include "@packageName@/I@algName@.h"
class AtlasDetectorID;
class Identifier;
namespace @nameSpace@
{
/** @class @algName@
This is for the Doxygen-Documentation.
Please delete these lines and fill in information about
the Algorithm!
Please precede every member function declaration with a
short Doxygen comment stating the purpose of this function.
@author @authorName@ <@authorMail@>
*/
class @algName@ : virtual public I@algName@, public AthAlgTool
{
public:
@algName@(const std::string&,const std::string&,const IInterface*);
/** default destructor */
virtual ~@algName@ ();
/** standard Athena-Algorithm method */
virtual StatusCode initialize();
/** standard Athena-Algorithm method */
virtual StatusCode finalize ();
private:
/** member variables for algorithm properties: */
// int/double/bool m_propertyName;
};
} // end of namespace
#endif
///////////////////////////////////////////////////////////////////
// I@algName@.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef I@CppKey@_H
#define I@CppKey@_H
#include "GaudiKernel/IAlgTool.h"
namespace @nameSpace@
{
static const InterfaceID IID_I@algName@("@nameSpace@::I@algName@", 1, 0);
class I@algName@ : virtual public IAlgTool {
public:
static const InterfaceID& interfaceID( ) ;
// enter declaration of your interface-defining member functions here
};
inline const InterfaceID& @nameSpace@::I@algName@::interfaceID()
{
return IID_I@algName@;
}
} // end of namespace
#endif
o--------------------------------------------------------o
| |
| This tool sets up the basic files needed to write new |
| algorithms or tools within the Athena framework. |
| |
| It requires the name of the algorithm/tool to be |
| created, the name of the package, where it is to be |
| located and the path to the package. |
| |
| If the targeted package already exists, the new |
| algorithm/tool will be added to the package |
| |
| This tool sets up the cmt/requirements file, the |
| header and the source file, the components files and |
| the doc/mainpage file. |
| |
| |
| Martin Siebel, 05/2006 |
| <Martin.Siebel@CERN.ch> |
o--------------------------------------------------------o
#include "GaudiKernel/LoadFactoryEntries.h"
LOAD_FACTORY_ENTRIES( @packageName@ )
/**
@page PackageName_page PackageName (package)
>> Please enter an overview of the created package here: What does it contain?
@author @authorName@ <@authorMail@>
@section @packageName@Intro Introduction
>> Please enter a brief description of the package here.
@section @packageName@Req Requirements
@include requirements
*/
package @packageName@
author @authorName@ <@authorMail@>
public
use AtlasPolicy AtlasPolicy-*
use AthenaBaseComps AthenaBaseComps-* Control
apply_pattern component_library
library @packageName@ *.cxx components/*.cxx
private
#macro cppdebugflags '$(cppdebugflags_s)'
#macro_remove componentshr_linkopts "-Wl,-s"
///////////////////////////////////////////////////////////////////
// @algName@.cxx, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#include "@algName@.h"
//================ Constructor =================================================
@nameSpace@::@algName@::@algName@(const std::string& name, ISvcLocator* pSvcLocator)
:
AthAlgorithm(name,pSvcLocator)
{
// template for property decalration
//declareProperty("PropertyName", m_propertyName);
}
//================ Destructor =================================================
@nameSpace@::@algName@::~@algName@()
{}
//================ Initialisation =================================================
StatusCode @nameSpace@::@algName@::initialize()
{
// Code entered here will be executed once at program start.
ATH_MSG_INFO (" initialize()");
// retrieve something from StoreGate (it's an AthAlg member!)
// StatusCode sc = evtStore()->retrieve("MyCollection",m_collection);
// if (sc.isFailure()) ATH_MSG_ERROR ("Could not retrieve ...!");
ATH_MSG_INFO ("initialize() successful in " << name());
return StatusCode::SUCCESS;
}
//================ Finalisation =================================================
StatusCode @nameSpace@::@algName@::finalize()
{
// Code entered here will be executed once at the end of the program run.
return StatusCode::SUCCESS;
}
//================ Execution ====================================================
StatusCode @nameSpace@::@algName@::execute()
{
// Code entered here will be executed once per event
return StatusCode::SUCCESS;
}
//============================================================================================
///////////////////////////////////////////////////////////////////
// @algName@.cxx, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#include "@algName@.h"
//================ Constructor =================================================
@nameSpace@::@algName@::@algName@(const std::string& t,
const std::string& n,
const IInterface* p )
:
AthAlgTool(t,n,p)
{
declareInterface<I@algName@>(this);
// template for property decalration
//declareProperty("PropertyName", m_propertyName);
}
//================ Destructor =================================================
@nameSpace@::@algName@::~@algName@()
{}
//================ Initialisation =================================================
StatusCode @nameSpace@::@algName@::initialize()
{
StatusCode sc = AlgTool::initialize();
if (sc.isFailure()) return sc;
ATH_MSG_INFO ("initialize() successful in " << name());
return StatusCode::SUCCESS;
}
//================ Finalisation =================================================
StatusCode @nameSpace@::@algName@::finalize()
{
StatusCode sc = AlgTool::finalize();
return sc;
}
//============================================================================================
@packageName@-00-00-00
#!/usr/bin/env sh
# Author: Amir Farbin (afarbin@cern.ch)
#
# Wishlist: write a cleaner version in python!
pkgName=$1
rel=$2
#base=/afs/cern.ch/atlas/software/dist
base=$SITEROOT/atlas/software/dist
if [ $# -eq 0 ] ; then
echo
echo Checkout an ATLAS Athena package from CVS repository.
echo
echo Usage:
echo " addpkg <PackageName> [ <Release>/<Tag> ]"
echo
echo "<PackageName>: the full name of the package."
echo " (ex: Reconstruction/RecExample/RecExCommon)"
echo
echo "<Release>: the Athena release version. This is an optional parameter."
echo " If no release or tag is specified, addpkg will attempt to checkout "
echo " version corresponding to your present release version."
echo
echo "<Tag>: may be supplied instead of <Release>. (ex: RecExCommon-00-03-42)"
exit 1;
fi
if [ "X$rel" = "X" ] ; then
rel=`cmt show macro_value ATLAS_RELEASE`
echo Using release $rel.
fi
if [ -e $base/$rel ] ; then
pkgPath=$base/$rel/$pkgName
tag=`ls $pkgPath`
cmt co -r $tag $pkgName
else
cmt co -r $rel $pkgName
fi
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