Commit 5af6fbb2 authored by Tim Martin's avatar Tim Martin
Browse files

Pick EDM updates from triggerJsonPayload branch

parent 9ff16cac
......@@ -27,7 +27,7 @@ atlas_add_xaod_smart_pointer_dicts(
"xAOD::JetRoIContainer_v2" "xAOD::EmTauRoIContainer_v1"
"xAOD::EmTauRoIContainer_v2" "xAOD::TriggerMenuContainer_v1"
"xAOD::TrigCompositeContainer_v1" "xAOD::BunchConfContainer_v1"
"xAOD::TrigPassBitsContainer_v1"
"xAOD::TrigPassBitsContainer_v1" "xAOD::TriggerMenuJsonContainer_v1"
OBJECTS "xAOD::EnergySumRoI_v1" "xAOD::EnergySumRoI_v2"
"xAOD::TrigDecision_v1" "xAOD::TrigNavigation_v1"
"xAOD::RoiDescriptorStore_v1" )
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// Local include(s):
#include "xAODTrigger/versions/TriggerMenuJsonAuxContainer_v1.h"
namespace xAOD {
TriggerMenuJsonAuxContainer_v1::TriggerMenuJsonAuxContainer_v1()
: AuxContainerBase() {
AUX_VARIABLE( key );
AUX_VARIABLE( name );
AUX_VARIABLE( payload );
}
} // namespace xAOD
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// System include(s):
#include <iostream>
// EDM include(s):
#include "xAODCore/AuxStoreAccessorMacros.h"
// Local include(s):
#include "xAODTrigger/versions/TriggerMenuJson_v1.h"
namespace xAOD {
TriggerMenuJson_v1::TriggerMenuJson_v1()
: SG::AuxElement() {
}
/////////////////////////////////////////////////////////////////////////////
//
// Implementation of the configuration identifier accessor functions
//
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( TriggerMenuJson_v1, uint32_t, key,
setKey )
AUXSTORE_OBJECT_SETTER_AND_GETTER( TriggerMenuJson_v1, std::string, name,
setName )
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
// Implementation of the payload accessor functions
//
AUXSTORE_OBJECT_SETTER_AND_GETTER( TriggerMenuJson_v1, std::string,
payload, setPayload )
//
/////////////////////////////////////////////////////////////////////////////
} // namespace xAOD
......@@ -4,3 +4,6 @@
#include "xAODTrigger/TriggerMenuAuxContainer.h"
#include "xAODTrigger/TriggerMenuContainer.h"
#include "xAODTrigger/TriggerMenuJsonAuxContainer.h"
#include "xAODTrigger/TriggerMenuJsonContainer.h"
\ No newline at end of file
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// $Id: ContainerProxies.cxx 755776 2016-06-17 13:45:30Z krasznaa $
......@@ -9,6 +9,7 @@
// Local include(s):
#include "xAODTrigger/versions/TriggerMenuContainer_v1.h"
#include "xAODTrigger/versions/TriggerMenuJsonContainer_v1.h"
#include "xAODTrigger/versions/EmTauRoIContainer_v1.h"
#include "xAODTrigger/versions/EmTauRoIContainer_v2.h"
......@@ -22,6 +23,7 @@
// Set up the collection proxies:
ADD_NS_DV_PROXY( xAOD, TriggerMenuContainer_v1 );
ADD_NS_DV_PROXY( xAOD, TriggerMenuJsonContainer_v1 );
ADD_NS_DV_PROXY( xAOD, EmTauRoIContainer_v1 );
ADD_NS_DV_PROXY( xAOD, EmTauRoIContainer_v2 );
......
......@@ -14,6 +14,8 @@
#include "xAODTrigger/JetEtRoIAuxInfo.h"
#include "xAODTrigger/JetRoIContainer.h"
#include "xAODTrigger/JetRoIAuxContainer.h"
#include "xAODTrigger/TriggerMenuJsonContainer.h"
#include "xAODTrigger/TriggerMenuJsonAuxContainer.h"
#include "xAODTrigger/MuonRoIContainer.h"
#include "xAODTrigger/MuonRoIAuxContainer.h"
#include "xAODTrigger/TrigCompositeContainer.h"
......
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRIGGER_TRIGGERMENUJSON_H
#define XAODTRIGGER_TRIGGERMENUJSON_H
// Local include(s):
#include "xAODTrigger/versions/TriggerMenuJson_v1.h"
namespace xAOD {
/// Define the latest version of the trigger menu JSON class
typedef TriggerMenuJson_v1 TriggerMenuJson;
}
#endif // XAODTRIGGER_TRIGGERMENUJSON_H
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TriggerMenuAuxContainer.h 631149 2014-11-26 12:26:18Z krasznaa $
#ifndef XAODTRIGGER_TRIGGERMENUJSONAUXCONTAINER_H
#define XAODTRIGGER_TRIGGERMENUJSONAUXCONTAINER_H
// Local include(s):
#include "xAODTrigger/versions/TriggerMenuJsonAuxContainer_v1.h"
namespace xAOD {
/// Define the latest version of the trigger menu auxiliary container class
typedef TriggerMenuJsonAuxContainer_v1 TriggerMenuJsonAuxContainer;
}
// Set up a CLID for the container:
#include "xAODCore/CLASS_DEF.h"
CLASS_DEF( xAOD::TriggerMenuJsonAuxContainer, 373045213, 1 )
#endif // XAODTRIGGER_TRIGGERMENUJSONAUXCONTAINER_H
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRIGGER_TRIGGERMENUJSONCONTAINER_H
#define XAODTRIGGER_TRIGGERMENUJSONCONTAINER_H
// Local include(s):
#include "xAODTrigger/versions/TriggerMenuJsonContainer_v1.h"
#include "xAODTrigger/TriggerMenuJson.h"
namespace xAOD {
typedef TriggerMenuJsonContainer_v1 TriggerMenuJsonContainer;
}
// Set up a CLID for the container:
#include "xAODCore/CLASS_DEF.h"
CLASS_DEF( xAOD::TriggerMenuJsonContainer, 1221262614, 1 )
#ifndef XAOD_STANDALONE
#include "AthenaKernel/MetaCont.h"
CLASS_DEF( MetaCont<xAOD::TriggerMenuJsonContainer> , 1760135678 , 1 )
#include "xAODCore/BaseInfo.h"
SG_BASE( MetaCont<xAOD::TriggerMenuJsonContainer>, MetaContBase );
#endif // not XAOD_STANDALONE
#endif // XAODTRIGGER_TRIGGERMENUJSONCONTAINER_H
......@@ -126,6 +126,18 @@
id="B8614CC5-8696-4170-8CCC-496DA7671246" />
<typedef name="xAOD::TriggerMenuAuxContainer" />
<!-- xAOD::TriggerMenuJson interface type(s). -->
<class name="xAOD::TriggerMenuJson_v1" />
<class name="xAOD::TriggerMenuJsonContainer_v1"
id="EB93A327-042C-706C-9690-A3F419DCCFEB" />
<typedef name="xAOD::TriggerMenuJson" />
<typedef name="xAOD::TriggerMenuJsonContainer" />
<!-- xAOD::TriggerMenuJson auxiliary type(s). -->
<class name="xAOD::TriggerMenuJsonAuxContainer_v1"
id="27A79C63-7809-7F7F-DB5A-998EF07CD154" />
<typedef name="xAOD::TriggerMenuJsonAuxContainer" />
<!-- xAOD::TrigDecision interface type(s). -->
<class name="xAOD::TrigDecision_v1"
id="092BCB2D-9630-4689-BE86-7B93466420DA" />
......
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TriggerMenuAuxContainer_v1.h 636406 2014-12-17 05:19:48Z lheinric $
#ifndef XAODTRIGGER_VERSIONS_MENUJSONAUXCONTAINER_v1_H
#define XAODTRIGGER_VERSIONS_MENUJSONAUXCONTAINER_v1_H
// System include(s):
extern "C" {
# include <stdint.h>
}
#include <vector>
#include <string>
// EDM include(s):
#include "xAODCore/AuxContainerBase.h"
//class xAODTriggerMenuAuxContainerCnv;
namespace xAOD {
/// Auxiliary store object for TriggerMenuJsonContainer_v1
///
/// Holder for a JSON file.
///
class TriggerMenuJsonAuxContainer_v1 : public AuxContainerBase {
public:
/// Default constructor
TriggerMenuJsonAuxContainer_v1();
private:
//friend class ::xAODTriggerMenuAuxContainerCnv;
/// @name Configuration identifier variables
/// @{
std::vector< uint32_t > key;
std::vector< std::string > name;
/// @}
/// @name Stored JSON data
/// @{
std::vector< std::string > payload;
/// @}
}; // class TriggerMenuJsonAuxContainer_v1
} // namespace xAOD
#include "xAODCore/BaseInfo.h"
SG_BASE( xAOD::TriggerMenuJsonAuxContainer_v1, xAOD::AuxContainerBase );
#endif // XAODTRIGGER_VERSIONS_MENUJSONAUXCONTAINER_v1_H
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRIGGER_VERSIONS_MENUJSONCONTAINER_v1_H
#define XAODTRIGGER_VERSIONS_MENUJSONCONTAINER_v1_H
// EDM include(s):
#include "AthContainers/DataVector.h"
// Local include(s):
#include "xAODTrigger/versions/TriggerMenuJson_v1.h"
namespace xAOD {
/// Define the menu container as a simple DataVector
typedef DataVector< TriggerMenuJson_v1 > TriggerMenuJsonContainer_v1;
}
#endif // XAODTRIGGER_VERSIONS_MENUJSONCONTAINER_v1_H
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRIGGER_VERSIONS_MENUJSON_v1_H
#define XAODTRIGGER_VERSIONS_MENUJSON_v1_H
// System include(s):
extern "C" {
# include <stdint.h>
}
#include <vector>
#include <string>
// EDM include(s):
#include "AthContainers/AuxElement.h"
namespace xAOD {
/// Raw JSON data for a given type of menu file.
///
/// Associated to the menu file's configuration key.
///
class TriggerMenuJson_v1 : public SG::AuxElement {
public:
/// Default constructor
TriggerMenuJson_v1();
/// @name Configuration identifier variables
/// @{
/// Get the key of this configuration
uint32_t key() const;
/// Set the key of this configuration
void setKey( uint32_t value );
/// Get the name of this configuration
const std::string& name() const;
/// Set the name key of this configuration
void setName( const std::string& name );
/// @}
/// @name Payload configuration access
/// @{
/// Get the JSON payload
const std::string& payload() const;
/// Set the JSON payload
void setPayload( const std::string& payload );
/// @}
}; // class TriggerMenuJson_v1
} // namespace xAOD
#endif // XAODTRIGGER_VERSIONS_MENUJSON_v1_H
......@@ -15,6 +15,13 @@
#include "xAODTrigger/versions/TriggerMenuContainer_v1.h"
#include "xAODTrigger/versions/TriggerMenuAuxContainer_v1.h"
#include "xAODTrigger/TriggerMenuJson.h"
#include "xAODTrigger/TriggerMenuJsonContainer.h"
#include "xAODTrigger/TriggerMenuJsonAuxContainer.h"
#include "xAODTrigger/versions/TriggerMenuJson_v1.h"
#include "xAODTrigger/versions/TriggerMenuJsonContainer_v1.h"
#include "xAODTrigger/versions/TriggerMenuJsonAuxContainer_v1.h"
#include "xAODTrigger/MuonRoI.h"
#include "xAODTrigger/MuonRoIContainer.h"
#include "xAODTrigger/MuonRoIAuxContainer.h"
......@@ -105,6 +112,7 @@ namespace {
struct GCCXML_DUMMY_INSTANTIATION_XAODTRIGGER {
// Local type(s).
XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, TriggerMenuContainer_v1 );
XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, TriggerMenuJsonContainer_v1 );
XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, BunchConfContainer_v1 );
XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, MuonRoIContainer_v1 );
......
......@@ -13,6 +13,7 @@ atlas_add_poolcnv_library( xAODTriggerAthenaPoolPoolCnv
xAODTrigger/EnergySumRoI.h xAODTrigger/EnergySumRoIAuxInfo.h
xAODTrigger/TrigCompositeContainer.h xAODTrigger/TrigCompositeAuxContainer.h
xAODTrigger/TriggerMenuContainer.h xAODTrigger/TriggerMenuAuxContainer.h
xAODTrigger/TriggerMenuJsonContainer.h xAODTrigger/TriggerMenuJsonAuxContainer.h
xAODTrigger/TrigConfKeys.h
xAODTrigger/TrigDecision.h xAODTrigger/TrigDecisionAuxInfo.h
xAODTrigger/TrigNavigation.h xAODTrigger/TrigNavigationAuxInfo.h
......@@ -27,6 +28,7 @@ atlas_add_poolcnv_library( xAODTriggerAthenaPoolPoolCnv
xAOD::EnergySumRoI xAOD::EnergySumRoIAuxInfo
xAOD::TrigCompositeContainer xAOD::TrigCompositeAuxContainer
xAOD::TriggerMenuContainer xAOD::TriggerMenuAuxContainer
xAOD::TriggerMenuJsonContainer xAOD::TriggerMenuJsonAuxContainer
xAOD::TrigConfKeys
xAOD::TrigDecision xAOD::TrigDecisionAuxInfo
xAOD::TrigNavigation xAOD::TrigNavigationAuxInfo
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// Local include(s):
#include "xAODTriggerMenuJsonAuxContainerCnv.h"
xAODTriggerMenuJsonAuxContainerCnv::
xAODTriggerMenuJsonAuxContainerCnv( ISvcLocator* svcLoc )
: xAODTriggerMenuJsonAuxContainerCnvBase( svcLoc ) {
}
xAOD::TriggerMenuJsonAuxContainer*
xAODTriggerMenuJsonAuxContainerCnv::createTransientWithKey (const std::string& key) {
std::unique_ptr<xAOD::TriggerMenuJsonAuxContainer_v1> obj
{ xAODTriggerMenuJsonAuxContainerCnvBase::createTransientWithKey (key) };
return obj.release();
}
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODTRIGGERATHENAPOOL_XAODTRIGGERMENUJSONAUXCONTAINERCNV_H
#define XAODTRIGGERATHENAPOOL_XAODTRIGGERMENUJSONAUXCONTAINERCNV_H
// Gaudi/Athena include(s):
#include "AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.h"
// EDM include(s):
#include "xAODTrigger/TriggerMenuJsonAuxContainer.h"
/// Base class for the converter
typedef T_AthenaPoolAuxContainerCnv< xAOD::TriggerMenuJsonAuxContainer >
xAODTriggerMenuJsonAuxContainerCnvBase;
/**
* @short POOL converter for the xAOD::TriggerMenuJsonAuxContainer class
*/
class xAODTriggerMenuJsonAuxContainerCnv :
public xAODTriggerMenuJsonAuxContainerCnvBase {
// Declare the factory as our friend:
friend class CnvFactory< xAODTriggerMenuJsonAuxContainerCnv >;
protected:
/// Converter constructor
public:
xAODTriggerMenuJsonAuxContainerCnv( ISvcLocator* svcLoc );
protected:
/// Function reading in the object from the input file
virtual xAOD::TriggerMenuJsonAuxContainer*
createTransientWithKey( const std::string& key ) override;
}; // class xAODTriggerMenuJsonAuxContainerCnv
#endif // XAODTRIGGERATHENAPOOL_XAODTRIGGERMENUJSONAUXCONTAINERCNV_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// $Id: TriggerMenuMetaDataTool.cxx 683395 2015-07-16 11:11:56Z krasznaa $
......@@ -16,23 +16,46 @@ namespace xAODMaker {
: asg::AsgMetadataTool( name ),
m_menu(), m_menuAux(), m_beginFileIncidentSeen( false ) {
declareProperty( "InputKey", m_inputKey = "TriggerMenu" );
declareProperty( "OutputKey", m_outputKey = "TriggerMenu" );
#ifndef XAOD_STANDALONE
declareInterface< ::IMetaDataTool >( this );
#endif // XAOD_STANDALONE
declareProperty("InputKey", m_inputKey = "TriggerMenu");
declareProperty("OutputKey", m_outputKey = "TriggerMenu");
declareProperty("InputKeyJSON_HLT", m_inputKeyJSON_HLT = "TriggerMenuJson_HLT");
declareProperty("OutputKeyJSON_HLT", m_outputKeyJSON_HLT = "TriggerMenuJson_HLT");
declareProperty("InputKeyJSON_L1", m_inputKeyJSON_L1 = "TriggerMenuJson_L1");
declareProperty("OutputKeyJSON_L1", m_outputKeyJSON_L1 = "TriggerMenuJson_L1");
declareProperty("InputKeyJSON_HLTPS", m_inputKeyJSON_HLTPS = "TriggerMenuJson_HLTPS");
declareProperty("OutputKeyJSON_HLTPS", m_outputKeyJSON_HLTPS = "TriggerMenuJson_HLTPS");
declareProperty("InputKeyJSON_L1PS", m_inputKeyJSON_L1PS = "TriggerMenuJson_L1PS");
declareProperty("OutputKeyJSON_L1PS", m_outputKeyJSON_L1PS = "TriggerMenuJson_L1PS");
}
StatusCode TriggerMenuMetaDataTool::initialize() {
// Greet the user:
ATH_MSG_DEBUG( "Initialising TriggerMenuMetaDataTool" );
ATH_MSG_DEBUG( " InputKey = " << m_inputKey );
ATH_MSG_DEBUG( " OutputKey = " << m_outputKey );
// Reset the internal variable(s):
m_menu.reset(); m_menuAux.reset();
m_menu.reset();
m_menuAux.reset();
m_menuJSON_hlt.reset();
m_menuJSON_hltAux.reset();
m_menuJSON_l1.reset();
m_menuJSON_l1Aux.reset();
m_menuJSON_hltps.reset();
m_menuJSON_hltpsAux.reset();
m_menuJSON_l1ps.reset();
m_menuJSON_l1psAux.reset();
// m_menuJSON_bg.reset(); // TODO
// m_menuJSON_bgAux.reset();
m_beginFileIncidentSeen = false;
// Return gracefully:
......@@ -44,10 +67,14 @@ namespace xAODMaker {
return StatusCode::SUCCESS;
}
StatusCode TriggerMenuMetaDataTool::beginInputFile() {
// Whatever happens, we've seen the first BeginInputFile incident now.
m_beginFileIncidentSeen = true;
ATH_CHECK( checkxAODTriggerMenu() );
ATH_CHECK( checkxAODTriggerMenuJson() );
return StatusCode::SUCCESS;
}
StatusCode TriggerMenuMetaDataTool::checkxAODTriggerMenu() {
// If the input file doesn't have any trigger configuration metadata,
// then finish right away:
if( ! inputMetaStore()->contains< xAOD::TriggerMenuContainer >(
......@@ -97,6 +124,55 @@ namespace xAODMaker {
return StatusCode::SUCCESS;
}
StatusCode TriggerMenuMetaDataTool::checkxAODTriggerMenuJson() {
ATH_CHECK( checkCopyJSON(m_inputKeyJSON_HLT, m_menuJSON_hlt, m_menuJSON_hltAux) );
ATH_CHECK( checkCopyJSON(m_inputKeyJSON_L1, m_menuJSON_l1, m_menuJSON_l1Aux) );
ATH_CHECK( checkCopyJSON(m_inputKeyJSON_HLTPS, m_menuJSON_hltps, m_menuJSON_hltpsAux) );
ATH_CHECK( checkCopyJSON(m_inputKeyJSON_L1PS, m_menuJSON_l1ps, m_menuJSON_l1psAux) );
// ATH_CHECK( checkCopyJSON(m_inputKeyJSON_BG, m_menuJSON_bg, m_menuJSON_bgAux) );
return StatusCode::SUCCESS;
}
StatusCode TriggerMenuMetaDataTool::checkCopyJSON(const std::string& inputMetaSGKey,
std::unique_ptr< xAOD::TriggerMenuJsonContainer >& outContainer,
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer >& outAuxContainer) {
const xAOD::TriggerMenuJsonContainer* input = 0;
if (inputMetaStore()->retrieve( input, inputMetaSGKey ).isSuccess() ) {
// Create an output container if it doesn't exist yet:
if( ( ! outContainer.get() ) && ( ! outAuxContainer.get() ) ) {
ATH_MSG_DEBUG( "Creating output container" );
outContainer.reset( new xAOD::TriggerMenuJsonContainer() );
outAuxContainer.reset( new xAOD::TriggerMenuJsonAuxContainer() );
outContainer->setStore( outAuxContainer.get() );
}
// Loop over the configurations of the input file:
for( const xAOD::TriggerMenuJson* menuJson : *input ) {
// Check if this configuration is already in the output container:
bool exists = false;
for( const xAOD::TriggerMenuJson* existing : *outContainer ) {
if (existing->key() == menuJson->key()) {
exists = true;
break;
}
}
if( exists ) {
continue;
}
// If it's a new configuration, put it into the output container:
ATH_MSG_VERBOSE( "Copying " << inputMetaSGKey << " configuration with Key: " << menuJson->key() );
xAOD::TriggerMenuJson* out = new xAOD::TriggerMenuJson();
outContainer->push_back( out );
*out = *menuJson;
}
}
return StatusCode::SUCCESS;
}
StatusCode TriggerMenuMetaDataTool::beginEvent() {
// In case the BeginInputFile incident was missed in standalone mode, make
......@@ -111,7 +187,12 @@ namespace xAODMaker {
}
StatusCode TriggerMenuMetaDataTool::metaDataStop() {
ATH_CHECK( endxAODTriggerMenu() );
ATH_CHECK( endxAODTriggerMenuJson() );
return StatusCode::SUCCESS;
}
StatusCode TriggerMenuMetaDataTool::endxAODTriggerMenu() {
// The output may already have trigger configuration metadata in it.
// For instance from TrigConf::xAODMenuWriter. In this case let that
// object take precedence.
......@@ -135,4 +216,36 @@ namespace xAODMaker {
return StatusCode::SUCCESS;
}
StatusCode TriggerMenuMetaDataTool::endxAODTriggerMenuJson() {