Skip to content
Snippets Groups Projects
Commit 2483776e authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'hlt_helloworld_cleanup' into 'master'

Delete obsolete HLT HelloWorld packages

See merge request atlas/athena!16635
parents 442b60f4 f7d57492
No related branches found
No related tags found
No related merge requests found
Showing
with 4 additions and 479 deletions
......@@ -138,8 +138,9 @@ if False:
# Private Application Configuration options, replace with
# your configuration.
#--------------------------------------------------------------
from TrigExMTHelloWorld.TrigExMTHelloWorldConf import MTHelloWorld
HelloWorld = MTHelloWorld("HelloWorld")
from AthExHelloWorld.AthExHelloWorldConf import HelloAlg
HelloWorld = HelloAlg("HelloWorld")
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
......
################################################################################
# Package: TrigExMTHelloWorld
################################################################################
# Declare the package name:
atlas_subdir( TrigExMTHelloWorld )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthenaBaseComps
PRIVATE
GaudiKernel )
# Component(s) in the package:
atlas_add_component( TrigExMTHelloWorld
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps GaudiKernel )
# Install files from the package:
atlas_install_headers( TrigExMTHelloWorld )
atlas_install_joboptions( share/*.py )
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#include "AthenaBaseComps/AthAlgorithm.h"
/////////////////////////////////////////////////////////////////////////////
class MTHelloWorld : public AthAlgorithm {
public:
MTHelloWorld (const std::string& name, ISvcLocator* pSvcLocator);
virtual StatusCode initialize();
virtual StatusCode execute();
virtual StatusCode finalize();
virtual StatusCode start();
virtual StatusCode stop();
private:
IntegerProperty m_myInt;
BooleanProperty m_myBool;
DoubleProperty m_myDouble;
StringArrayProperty m_myStringVec;
};
#**************************************************************
#
# MTHelloWorld example
#
#==============================================================
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.Constants import *
#--------------------------------------------------------------
# Private Application Configuration options
#--------------------------------------------------------------
from TrigExMTHelloWorld.TrigExMTHelloWorldConf import MTHelloWorld
HelloWorld = MTHelloWorld("HelloWorld")
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += HelloWorld
#--------------------------------------------------------------
# Algorithms Private Options
#--------------------------------------------------------------
# For the genuine HelloWorld algorithm
HelloWorld.MyInt = 42
HelloWorld.MyBool = TRUE
HelloWorld.MyDouble = 3.14159
HelloWorld.MyStringVec = [ "Welcome", "to", "Athena", "Framework", "Tutorial" ]
# For a special HelloWorld algorithm
#HelloWorld__1 = Algorithm( "HelloWorld__1" )
#HelloWorld__1.MyInt = 21
#HelloWorld__1.MyBool = FALSE
#HelloWorld__1.MyDouble = 6.28
#HelloWorld__1.MyStringVec = [ "Welcome", "to", "Thread", "1" ]
#==============================================================
#
# End of MTHelloWorld example
#
#**************************************************************
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigExMTHelloWorld/MTHelloWorld.h"
MTHelloWorld::MTHelloWorld(const std::string& name, ISvcLocator* pSvcLocator) :
AthAlgorithm(name, pSvcLocator),
m_myInt(0), m_myBool(0), m_myDouble(0)
{
// Part 2: Declare the properties
declareProperty("MyInt", m_myInt);
declareProperty("MyBool", m_myBool);
declareProperty("MyDouble", m_myDouble);
declareProperty("MyStringVec",m_myStringVec);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
StatusCode MTHelloWorld::initialize()
{
ATH_MSG_INFO("initialize()");
SmartIF<IService> tmp_msgSvc(msgSvc());
if(tmp_msgSvc.isValid()) {
ATH_MSG_INFO(" Algorithm = " << name() << " is connected to Message Service = " << tmp_msgSvc->name());
}
// Part 2: Print out the property values
ATH_MSG_INFO(" MyInt = " << m_myInt);
ATH_MSG_INFO(" MyBool = " << m_myBool);
ATH_MSG_INFO(" MyDouble = " << m_myDouble);
for (unsigned int i=0; i<m_myStringVec.value().size(); i++) {
ATH_MSG_INFO(" MyStringVec[" << i << "] = " << (m_myStringVec.value())[i]);
}
return StatusCode::SUCCESS;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
StatusCode MTHelloWorld::execute()
{
ATH_MSG_INFO("execute()");
// Part 1: Print out the different levels of messages
ATH_MSG_DEBUG( "A DEBUG message");
ATH_MSG_INFO( "An INFO message");
ATH_MSG_WARNING( "A WARNING message");
ATH_MSG_ERROR( "An ERROR message");
ATH_MSG_FATAL( "A FATAL error message");
return StatusCode::SUCCESS;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
StatusCode MTHelloWorld::finalize()
{
ATH_MSG_INFO( "finalize()");
return StatusCode::SUCCESS;
}
StatusCode MTHelloWorld::start()
{
ATH_MSG_INFO( "start()");
return StatusCode::SUCCESS;
}
StatusCode MTHelloWorld::stop()
{
ATH_MSG_INFO( "stop()");
return StatusCode::SUCCESS;
}
#include "TrigExMTHelloWorld/MTHelloWorld.h"
DECLARE_COMPONENT( MTHelloWorld )
################################################################################
# Package: TrigExMTHelloWorldLvl1
################################################################################
# Declare the package name:
atlas_subdir( TrigExMTHelloWorldLvl1 )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthenaBaseComps
PRIVATE
Control/StoreGate
Event/ByteStreamCnvSvcBase
Event/ByteStreamData
GaudiKernel
Trigger/TrigT1/TrigT1Result )
# Component(s) in the package:
atlas_add_component( TrigExMTHelloWorldLvl1
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps StoreGateLib SGtests ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel TrigT1Result )
# Install files from the package:
atlas_install_headers( TrigExMTHelloWorldLvl1 )
atlas_install_joboptions( share/*.py )
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "AthenaBaseComps/AthAlgorithm.h"
#include <stdint.h>
#include <vector>
#include <string>
/////////////////////////////////////////////////////////////////////////////
class IROBDataProviderSvc;
class MTHelloWorldLvl1:public AthAlgorithm {
public:
MTHelloWorldLvl1(const std::string& name, ISvcLocator* pSvcLocator);
StatusCode initialize();
StatusCode execute();
StatusCode finalize();
private:
IROBDataProviderSvc* m_pIROBDataProviderSvc;
BooleanProperty m_retrieveLvl1;
BooleanProperty m_retrieveROBs;
IntegerArrayProperty m_listRobIds;
std::vector<uint32_t> m_robIds;
};
To run the example:
-------------------
run the application with
./athenaMT --file <ByteStreamFile> [jobOptions-file]
The ByteStreamFile can be in gzip compressed format (ending .gz) or
in uncompressed format.
./athenaMT --help
provides a help with all possible options.
Alternative way to run the example (= use the default settings)
-----------------------------------
1) make in your run directory a soft link to jobOptions.txt
ln -s MTHelloWorldLvl1Options.txt jobOptions.txt
and
2) make a soft link to the gzip compressed ByteStream data file
ln -s <ByteStream-data-file>.gz Raw.re.gz
3) run application with
./athenaMT
#**************************************************************
#
# MTHelloWorldLvl1 example
#
#==============================================================
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.Constants import *
from AthenaCommon import CfgMgr
#--------------------------------------------------------------
# disable sending of Level 2 result
#--------------------------------------------------------------
if not hasattr( svcMgr, "ByteStreamAddressProviderSvc" ):
from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ByteStreamAddressProviderSvc
svcMgr += ByteStreamAddressProviderSvc()
svcMgr.ByteStreamAddressProviderSvc.OutputLevel = OUTPUTLEVEL
svcMgr.ByteStreamAddressProviderSvc.TypeNames += [
"ROIB::RoIBResult/RoIBResult"
]
#--------------------------------------------------------------
# Private Application Configuration options
#--------------------------------------------------------------
HelloWorld = CfgMgr.MTHelloWorldLvl1("HelloWorld")
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += HelloWorld
#--------------------------------------------------------------
# need to run LVL1 configuration for LVL1 conversion in HLTSSW
#--------------------------------------------------------------
svcMgr += CfgMgr.LVL1CTP__L1Config("L1Config")
svcMgr += CfgMgr.LVL1CTP__CTPHardware("CTPHardware")
L1Config = svcMgr.L1Config
CTPHardware = svcMgr.CTPHardware
if not ('TrigT1ConfigVersion' in dir()):
TrigT1ConfigVersion="CSC-02"
if 'DetDescrVersion' in dir():
print DetDescrVersion
# what follows is a poor-man's database (hopefully soon to be replaced by a real one)
if DetDescrVersion.startswith("Rome"):
TrigT1ConfigVersion="DC2"
elif DetDescrVersion.startswith("DC2"):
TrigT1ConfigVersion="DC2"
elif DetDescrVersion.startswith("ATLAS-DC3"):
TrigT1ConfigVersion="DC2"
L1Config.triggerMenuFileLocation = "LVL1triggermenu"+TrigT1ConfigVersion+".xml"
L1Config.thresholdListFileLocation = "LVL1triggerthresholds"+TrigT1ConfigVersion+".xml"
L1Config.muctpiConfigLocation = "trigger.muctpi.xml"
CTPHardware.hardwareXMLFile = "hardware.xml"
CTPHardware.printoutLUT = "no"
#--------------------------------------------------------------
# Algorithms Private Options
#--------------------------------------------------------------
#
#--- retrieve the Level-1 result
#
HelloWorld.RetrieveLvl1 = TRUE
#
#--- retrieve the ROBs over the network
#
HelloWorld.RetrieveROBs = TRUE
#--- empty list of ROBs
HelloWorld.RobId = [ ]
#--- Give a list of ROBs contained in your input file
# ------------------
#HelloWorld.RobId = [
# 0x42002a,
# 0x42002b,
# 0x42002e,
# 0x42002f,
# 0x420060,
# 0x420064
# ]
ROBDataProviderSvc.OutputLevel = OUTPUTLEVEL
#==============================================================
#
# End of MTHelloWorldLvl1 example
#
#**************************************************************
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigExMTHelloWorldLvl1/MTHelloWorldLvl1.h"
#include "TrigT1Result/RoIBResult.h"
#include "StoreGate/DataHandle.h"
#include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h"
#include "ByteStreamData/RawEvent.h"
// static const AlgFactory<MTHelloWorldLvl1> Factory;
// const IAlgFactory& MTHelloWorldLvl1Factory = Factory;
/////////////////////////////////////////////////////////////////////////////
MTHelloWorldLvl1::MTHelloWorldLvl1(const std::string& name, ISvcLocator* pSvcLocator) :
AthAlgorithm(name, pSvcLocator),
m_pIROBDataProviderSvc(0),
m_retrieveLvl1(false),
m_retrieveROBs(false)
{
// Declare the properties
declareProperty("RetrieveLvl1", m_retrieveLvl1);
declareProperty("RetrieveROBs", m_retrieveROBs);
declareProperty("RobId", m_listRobIds);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
StatusCode MTHelloWorldLvl1::initialize() {
// Part 1: Get the messaging service, print where you are
ATH_MSG_INFO("initialize()");
SmartIF<IService> tmp_msgSvc(msgSvc());
if(tmp_msgSvc.isValid()) {
ATH_MSG_INFO(" Algorithm = " << name() << " is connected to Message Service = " << tmp_msgSvc->name());
}
// Print out the property values
ATH_MSG_INFO(" RetrieveLvl1 = " << m_retrieveLvl1);
ATH_MSG_INFO(" RetrieveROBs = " << m_retrieveROBs);
if (m_retrieveROBs) {
ATH_MSG_INFO(" Number of ROBs to access = " << m_listRobIds.value().size());
ATH_MSG_INFO(" List of ROBs: ");
std::vector<int>::const_iterator it = m_listRobIds.value().begin();
while (it != m_listRobIds.value().end())
{
m_robIds.push_back(*it);
ATH_MSG_DEBUG(" 0x" << MSG::hex << *it);
++it;
}
}
// Part 4: Locate the ROBDataProviderSvc
StatusCode sc = service("ROBDataProviderSvc", m_pIROBDataProviderSvc);
if (!sc.isSuccess()) {
ATH_MSG_ERROR("Could not find ROBDataProviderSvc");
return sc;
} else {
IService* svc = dynamic_cast<IService*>(m_pIROBDataProviderSvc);
if(svc != 0 ) {
ATH_MSG_INFO(" Algorithm = " << name() << " is connected to ROBDataProviderSvc Service = "
<< svc->name());
}
}
return StatusCode::SUCCESS;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
StatusCode MTHelloWorldLvl1::execute() {
// Get the messaging service, print where you are
MsgStream log(msgSvc(), name());
ATH_MSG_INFO("execute()");
ATH_MSG_DEBUG(" StoreGate structure: Begin execute " << name() << "\n"
<< evtStore()->dump());
// Get the Lvl1 Id
const DataHandle<ROIB::RoIBResult> dobj;
if (m_retrieveLvl1) {
StatusCode sc = evtStore()->retrieve(dobj,"RoIBResult") ;
if ( sc.isFailure() ) {
ATH_MSG_ERROR("Could not find Lvl1Result");
return sc;
} else {
ATH_MSG_INFO(" ---> Lvl1Result ID " << dobj->cTPResult().header().L1ID());
}
}
// Get the ROBs
if (m_retrieveROBs) {
// preload ROBs in memory
m_pIROBDataProviderSvc->addROBData(m_robIds);
// retrieve ROBs
std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFragments;
m_pIROBDataProviderSvc->getROBData(m_robIds, robFragments) ;
ATH_MSG_INFO(" ---> number of ROBs retrieved " << robFragments.size());
std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>::const_iterator it = robFragments.begin();
ATH_MSG_INFO(" ---> List of ROBs found: ");
while (it != robFragments.end())
{
ATH_MSG_INFO(" ---> ROB ID = 0x" << MSG::hex << (*it)->rod_source_id() << MSG::dec
<< " Level-1 ID = " << (*it)->rod_lvl1_id());
++it;
}
}
ATH_MSG_DEBUG(" StoreGate structure: End execute " << name() << "\n"
<< evtStore()->dump());
return StatusCode::SUCCESS;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
StatusCode MTHelloWorldLvl1::finalize() {
// Part 1: Get the messaging service, print where you are
MsgStream log(msgSvc(), name());
ATH_MSG_INFO("finalize()");
return StatusCode::SUCCESS;
}
#include "TrigExMTHelloWorldLvl1/MTHelloWorldLvl1.h"
DECLARE_COMPONENT( MTHelloWorldLvl1 )
......@@ -56,7 +56,7 @@ option['l2pu-worker'] = 1
# ================================
# Defines the L2 HLT Implementation to use. It has to be either a python dictionary (like the default argument), a dictionary that configures an HLTImplementation, or a string, that determines the path to the jobOptions to use. This parameter can also be set to dal.HLTImplementation object that will be used blindly to configure the L2 system at your partition.
# option['l2-hlt'] = {'jobOptionsPath': 'TrigExMTHelloWorld/MTHelloWorldOptions.py'}
# option['l2-hlt'] = {'jobOptionsPath': 'AthExHelloWorld/HelloWorldOptions.py'}
# Defines the EF HLT Implementation to use. It has to be either a python dictionary (like the default argument), a dictionary that configures an HLTImplementation, or a string, that determines the path to the jobOptions to use. This parameter can also be set to dal.HLTImplementation object that will be used blindly to configure the EF system at your partition.
#option['ef-hlt'] = option['l2-hlt']
......
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