Skip to content
Snippets Groups Projects
Commit e74f7908 authored by Tomasz Bold's avatar Tomasz Bold
Browse files

added configuration of dynamic variables Aux to be stored

parent ed558238
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
#include <cstring>
#include <boost/algorithm/string.hpp>
#include "GaudiKernel/IToolSvc.h"
#include "GaudiKernel/System.h"
#include "AthenaKernel/StorableConversions.h"
......@@ -25,15 +26,15 @@ StatusCode TriggerEDMSerialiserTool::initialize() {
ATH_CHECK( m_serializerSvc.retrieve() );
ATH_CHECK( m_clidSvc.retrieve() );
for ( std::string typeAndKey: m_collectionsToSerialize ) {
const std::string type = typeAndKey.substr( 0, typeAndKey.find('#') );
for ( std::string typeKeyAux: m_collectionsToSerialize ) {
const std::string type = typeKeyAux.substr( 0, typeKeyAux.find('#') );
if ( type.find('_') == std::string::npos ) {
ATH_MSG_ERROR( "Unversioned object to be recorded " << typeAndKey );
ATH_MSG_ERROR( "Unversioned object to be recorded " << typeKeyAux );
return StatusCode::FAILURE;
}
const std::string transientType = typeAndKey.substr( 0, typeAndKey.find('_') );
const std::string transientType = typeKeyAux.substr( 0, typeKeyAux.find('_') );
const std::string key = typeAndKey.substr( typeAndKey.find('#')+1 );
const std::string key = typeKeyAux.substr( typeKeyAux.find('#')+1, typeKeyAux.find('.') );
CLID clid;
if ( m_clidSvc->getIDOfTypeName(transientType, clid).isFailure() ) {
ATH_MSG_ERROR( "Can not find CLID for " << transientType << " that is needed to stream " << key );
......@@ -47,7 +48,21 @@ StatusCode TriggerEDMSerialiserTool::initialize() {
}
ATH_MSG_DEBUG( "Type " << type << " key " << key << " serializable" );
m_toSerialize.push_back( Address{ type, clid, classDesc, key } );
xAOD::AuxSelection sel;
if ( typeKeyAux.find('.') != std::string::npos ) {
ATH_MSG_DEBUG( "with aux content: " );
std::string allVars = typeKeyAux.substr( typeKeyAux.find('.')+1 );
std::set<std::string> variableNames;
boost::split( variableNames, allVars, [](const char c){ return c == '.'; } );
for ( auto el: variableNames )
ATH_MSG_DEBUG( " " << el );
sel.selectAux( variableNames );
}
m_toSerialize.push_back( Address{ type, clid, classDesc, key, sel } );
}
return StatusCode::SUCCESS;
}
......@@ -121,6 +136,9 @@ StatusCode TriggerEDMSerialiserTool::fill( HLT::HLTResultMT& resultToFill ) cons
fragment[0] = fragment.size();
ATH_MSG_DEBUG("Fragment size " << fragment.size() );
payload.insert( payload.end(), fragment.begin(), fragment.end() );
if ( mem ) delete [] static_cast<const char*>( mem );
ATH_MSG_DEBUG( "Payload size after inserting " << address.type << "#" << address.key << " " << payload.size()*sizeof(uint32_t) << " bytes" );
......
......@@ -4,18 +4,15 @@
#ifndef TRIGOUTPUTHANDLING_TriggerEDMSerialiserTool_H
#define TRIGOUTPUTHANDLING_TriggerEDMSerialiserTool_H
// STL includes
#include <string>
// FrameWork includes
#include <string>
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ServiceHandle.h"
// OutputHandling includes
#include "TrigOutputHandling/HLTResultMTMakerTool.h"
#include "xAODCore/AuxSelection.h"
#include "AthenaKernel/IClassIDSvc.h"
#include "AthenaKernel/IAthenaSerializeSvc.h"
#include "AthenaKernel/IDictLoaderSvc.h"
#include "TrigOutputHandling/HLTResultMTMakerTool.h"
/**
* @class TriggerEDMSerialiserTool is tool responsible for creation of HLT Result filled with streamed EDM collections
......@@ -36,7 +33,7 @@ class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool>
virtual StatusCode initialize() override;
private:
Gaudi::Property<std::vector<std::string>> m_collectionsToSerialize { this, "CollectionsToSerialize", {}, "TYPE#SG key of collections to be streamed (like in StreamAOD), the type has to be an exact type i.e. with _vN not the alias type" };
Gaudi::Property<std::vector<std::string>> m_collectionsToSerialize { this, "CollectionsToSerialize", {}, "TYPE#SG.aux1.aux2..etc key of collections to be streamed (like in StreamAOD), the type has to be an exact type i.e. with _vN not the alias type" };
Gaudi::Property<int> m_moduleID { this, "ModuleID", 0, "The HLT result fragment to which the output should be added"};
......@@ -46,7 +43,8 @@ class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool>
std::string type;
CLID clid;
RootType rt;
std::string key;
std::string key;
xAOD::AuxSelection sel;
};
std::vector< Address > m_toSerialize; // postprocessed configuration info
......
......@@ -349,7 +349,7 @@ print summMaker
serialiser = TriggerEDMSerialiserTool(OutputLevel=VERBOSE)
serialiser.CollectionsToSerialize = [ "xAOD::TrigCompositeContainer_v1#EgammaCaloDecisions_remap",
"xAOD::TrigCompositeAuxContainer_v1#EgammaCaloDecisionsAux.",
"xAOD::TrigCompositeAuxContainer_v1#EgammaCaloDecisionsAux.name.seed",
"xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex_remap",
"xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux." ]
......
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