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

Delete TrigExMTHelloWorldLvl1 package

This package is obsolete and hasn't been used since Run-1. For similar
features, see the TrigExPartialEB package.
parent 92804993
No related branches found
No related tags found
No related merge requests found
################################################################################
# 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 )
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