Skip to content
Snippets Groups Projects
Commit fb53c386 authored by Rafal Bielski's avatar Rafal Bielski :wave: Committed by Tomasz Bold
Browse files

Make TrigByteStreamCnvSvc inherit from ByteStreamCnvSvc instead of ByteStreamCnvSvcBase

This way there can be only one instance of the service and it provides all functionality
needed by the offline code, while still implementing the HLT-specific output handling.
parent 2c550823
No related branches found
No related tags found
1 merge request!20406Write BS with trigger EDM
...@@ -53,7 +53,7 @@ namespace { ...@@ -53,7 +53,7 @@ namespace {
// Standard constructor // Standard constructor
// ============================================================================= // =============================================================================
TrigByteStreamCnvSvc::TrigByteStreamCnvSvc(const std::string& name, ISvcLocator* svcLoc) TrigByteStreamCnvSvc::TrigByteStreamCnvSvc(const std::string& name, ISvcLocator* svcLoc)
: ByteStreamCnvSvcBase(name, svcLoc), : ByteStreamCnvSvc(name, svcLoc),
m_evtStore("StoreGateSvc", name), m_evtStore("StoreGateSvc", name),
m_robDataProviderSvc("ROBDataProviderSvc", name) {} m_robDataProviderSvc("ROBDataProviderSvc", name) {}
...@@ -67,6 +67,7 @@ TrigByteStreamCnvSvc::~TrigByteStreamCnvSvc() {} ...@@ -67,6 +67,7 @@ TrigByteStreamCnvSvc::~TrigByteStreamCnvSvc() {}
// ============================================================================= // =============================================================================
StatusCode TrigByteStreamCnvSvc::initialize() { StatusCode TrigByteStreamCnvSvc::initialize() {
ATH_MSG_VERBOSE("start of " << __FUNCTION__); ATH_MSG_VERBOSE("start of " << __FUNCTION__);
ATH_CHECK(ByteStreamCnvSvc::initialize());
ATH_CHECK(m_evtStore.retrieve()); ATH_CHECK(m_evtStore.retrieve());
ATH_CHECK(m_robDataProviderSvc.retrieve()); ATH_CHECK(m_robDataProviderSvc.retrieve());
ATH_MSG_VERBOSE("end of " << __FUNCTION__); ATH_MSG_VERBOSE("end of " << __FUNCTION__);
...@@ -83,6 +84,7 @@ StatusCode TrigByteStreamCnvSvc::finalize() { ...@@ -83,6 +84,7 @@ StatusCode TrigByteStreamCnvSvc::finalize() {
if (m_evtStore.release().isFailure()) if (m_evtStore.release().isFailure())
ATH_MSG_WARNING("Failed to release service " << m_evtStore.typeAndName()); ATH_MSG_WARNING("Failed to release service " << m_evtStore.typeAndName());
ATH_MSG_VERBOSE("end of " << __FUNCTION__); ATH_MSG_VERBOSE("end of " << __FUNCTION__);
ATH_CHECK(ByteStreamCnvSvc::finalize());
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -134,7 +136,7 @@ StatusCode TrigByteStreamCnvSvc::connectOutput(const std::string& outputFile, co ...@@ -134,7 +136,7 @@ StatusCode TrigByteStreamCnvSvc::connectOutput(const std::string& outputFile, co
StatusCode TrigByteStreamCnvSvc::commitOutput(const std::string& /*outputFile*/, bool /*do_commit*/) { StatusCode TrigByteStreamCnvSvc::commitOutput(const std::string& /*outputFile*/, bool /*do_commit*/) {
ATH_MSG_VERBOSE("start of " << __FUNCTION__); ATH_MSG_VERBOSE("start of " << __FUNCTION__);
printRawEvent(); if (msgLvl(MSG::DEBUG)) printRawEvent();
// Serialise the output FullEventFragment // Serialise the output FullEventFragment
std::unique_ptr<uint32_t[]> rawEventPtr; std::unique_ptr<uint32_t[]> rawEventPtr;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef TRIGBYTESTREAMCNVSVC_H #ifndef TRIGBYTESTREAMCNVSVC_H
#define TRIGBYTESTREAMCNVSVC_H #define TRIGBYTESTREAMCNVSVC_H
#include "ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h" #include "ByteStreamCnvSvc/ByteStreamCnvSvc.h"
// Forward declarations // Forward declarations
class StoreGateSvc; class StoreGateSvc;
...@@ -13,8 +13,14 @@ class IROBDataProviderSvc; ...@@ -13,8 +13,14 @@ class IROBDataProviderSvc;
/** @class TrigByteStreamCnvSvc /** @class TrigByteStreamCnvSvc
* @brief A ByteStreamCnvSvc implementation for online use * @brief A ByteStreamCnvSvc implementation for online use
*
* It overrides the connectOutput and commitOutput methods of the base class. In this implementation, they create
* the specific online HLT output and send it out directly to the TDAQ infrastructure without using an output service.
*
* It needs to inherit from ByteStreamCnvSvc rather than ByteStreamCnvSvcBase, because some elements of the athena
* framework (particularly converters) rely on the properties or functionality of the offline ByteStreamCnvSvc.
**/ **/
class TrigByteStreamCnvSvc : public ByteStreamCnvSvcBase { class TrigByteStreamCnvSvc : public ByteStreamCnvSvc {
public: public:
/// Standard constructor /// Standard constructor
TrigByteStreamCnvSvc(const std::string& name, ISvcLocator* svcLoc); TrigByteStreamCnvSvc(const std::string& name, ISvcLocator* svcLoc);
......
...@@ -84,28 +84,20 @@ def setupCommonServices(): ...@@ -84,28 +84,20 @@ def setupCommonServices():
theApp.CreateSvc += [ svcMgr.DetDescrCnvSvc.getFullName() ] theApp.CreateSvc += [ svcMgr.DetDescrCnvSvc.getFullName() ]
svcMgr.EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ] svcMgr.EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ]
# ByteStreamCnvSvc configuration # Online services for ByteStream input/output
from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamCnvSvc from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamCnvSvc, TrigByteStreamInputSvc, TrigEventSelectorByteStream
svcMgr += ByteStreamCnvSvc("ByteStreamCnvSvc") svcMgr += TrigByteStreamCnvSvc("ByteStreamCnvSvc") # this name is hard-coded in some converters
svcMgr.EventPersistencySvc.CnvServices += [ "ByteStreamCnvSvc" ] svcMgr.EventPersistencySvc.CnvServices += [ "ByteStreamCnvSvc" ]
from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamInputSvc
svcMgr += TrigByteStreamInputSvc("ByteStreamInputSvc") svcMgr += TrigByteStreamInputSvc("ByteStreamInputSvc")
svcMgr += TrigEventSelectorByteStream("EventSelector", ByteStreamInputSvc = svcMgr.ByteStreamInputSvc)
from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigEventSelectorByteStream
svcMgr += TrigEventSelectorByteStream("EventSelector",
ByteStreamInputSvc = svcMgr.ByteStreamInputSvc)
theApp.EvtSel = "EventSelector" theApp.EvtSel = "EventSelector"
from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamCnvSvc
svcMgr += TrigByteStreamCnvSvc("ByteStreamCnvSvc")
# make the HltEventLoopMgr service available # make the HltEventLoopMgr service available
svcMgr.HltEventLoopMgr = theApp.service( "HltEventLoopMgr" ) # already instantiated svcMgr.HltEventLoopMgr = theApp.service( "HltEventLoopMgr" ) # already instantiated
svcMgr.HltEventLoopMgr.WhiteboardSvc = "EventDataSvc" svcMgr.HltEventLoopMgr.WhiteboardSvc = "EventDataSvc"
svcMgr.HltEventLoopMgr.SchedulerSvc = AlgScheduler.getScheduler().getName() svcMgr.HltEventLoopMgr.SchedulerSvc = AlgScheduler.getScheduler().getName()
svcMgr.HltEventLoopMgr.EvtSel = svcMgr.EventSelector svcMgr.HltEventLoopMgr.EvtSel = svcMgr.EventSelector
svcMgr.HltEventLoopMgr.OutputCnvSvc = svcMgr.TrigByteStreamCnvSvc svcMgr.HltEventLoopMgr.OutputCnvSvc = svcMgr.ByteStreamCnvSvc
from TrigOutputHandling.TrigOutputHandlingConfig import HLTResultMTMakerCfg from TrigOutputHandling.TrigOutputHandlingConfig import HLTResultMTMakerCfg
svcMgr.HltEventLoopMgr.ResultMaker = HLTResultMTMakerCfg() svcMgr.HltEventLoopMgr.ResultMaker = HLTResultMTMakerCfg()
......
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