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

Merge branch 'cbk/dualuse' into 'master'

Make EventBookkeeperTools properly dual use

Closes ATEAM-602

See merge request !37561
parents f2e4810a e8cf4e1f
No related branches found
No related tags found
No related merge requests found
......@@ -6,18 +6,32 @@
atlas_subdir( EventBookkeeperTools )
if( XAOD_STANDALONE )
set( athena_libs )
set( xaod_access_lib xAODRootAccess )
# ... for AthAnalysisBase (Athena calls this POOLRootAccess)
else()
set( athena_libs AthenaKernel GaudiKernel )
set( xaod_access_lib POOLRootAccessLib )
endif()
# Component(s) in the package:
atlas_add_component( EventBookkeeperTools
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AsgTools AthenaBaseComps AthenaKernel GaudiKernel
SGTools StoreGateLib EventBookkeeperMetaData EventInfo xAODCutFlow xAODEventInfo )
atlas_add_library( EventBookkeeperToolsLib
EventBookkeeperTools/*.h Root/*.cxx
PUBLIC_HEADERS EventBookkeeperTools
LINK_LIBRARIES ${athena_libs} AsgDataHandlesLib AsgMessagingLib AsgTools xAODCutFlow xAODEventInfo )
atlas_add_dictionary( EventBookkeeperToolsDict
EventBookkeeperTools/EventBookkeeperToolsDict.h
EventBookkeeperTools/selection.xml
LINK_LIBRARIES EventBookkeeperToolsLib )
if( NOT XAOD_STANDALONE )
atlas_add_component( EventBookkeeperTools
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps AthenaKernel GaudiKernel EventBookkeeperToolsLib
SGTools StoreGateLib EventBookkeeperMetaData EventInfo )
endif()
atlas_add_executable( dump-cbk
util/dump-cbk.cxx
......@@ -28,17 +42,23 @@ atlas_install_python_modules( python/*.py )
atlas_install_joboptions( share/*.py )
# Tests
atlas_add_test( BookkeeperDumperTool
SCRIPT test/test_BookkeeperDumperTool.py
atlas_add_test( DumpCbkTest
SCRIPT dump-cbk $ASG_TEST_FILE_MC
PROPERTIES TIMEOUT 300
POST_EXEC_SCRIPT nopost.sh )
atlas_add_test( CutflowSvcDummyAlg
SCRIPT athena EventBookkeeperTools/TestCutFlowSvcDummyAlg.py
PROPERTIES TIMEOUT 300
POST_EXEC_SCRIPT nopost.sh )
if ( NOT GENERATIONBASE )
atlas_add_test( CutflowSvcOutput
if( NOT XAOD_STANDALONE )
atlas_add_test( BookkeeperDumperTool
SCRIPT test/test_BookkeeperDumperTool.py
PROPERTIES TIMEOUT 300
POST_EXEC_SCRIPT nopost.sh )
atlas_add_test( CutFlowSvcDummyAlg
SCRIPT athena EventBookkeeperTools/TestCutFlowSvcDummyAlg.py
PROPERTIES TIMEOUT 300
POST_EXEC_SCRIPT nopost.sh )
atlas_add_test( CutFlowSvcOutput
SCRIPT athena EventBookkeeperTools/TestCutFlowSvcOutput.py
PROPERTIES TIMEOUT 300
POST_EXEC_SCRIPT nopost.sh )
......
......@@ -17,13 +17,20 @@
*/
#include <AsgTools/AsgMetadataTool.h>
#include <AsgTools/PropertyWrapper.h>
#ifndef XAOD_STANDALONE
#include <AthenaKernel/IMetaDataTool.h>
#endif
class BookkeeperDumperTool : public asg::AsgMetadataTool,
public virtual IMetaDataTool
class BookkeeperDumperTool : public asg::AsgMetadataTool
#ifndef XAOD_STANDALONE
, public virtual IMetaDataTool
#endif
{
#ifndef XAOD_STANDALONE
/// Declare the correct constructor for Athena
ASG_TOOL_CLASS( BookkeeperDumperTool, IMetaDataTool )
#endif
public:
BookkeeperDumperTool(const std::string &name = "BookkeeperDumperTool");
......@@ -31,11 +38,14 @@ public:
virtual StatusCode initialize() final;
virtual StatusCode beginInputFile() final;
virtual StatusCode beginInputFile(const SG::SourceID &) final { return StatusCode::SUCCESS; }
virtual StatusCode endInputFile() final { return StatusCode::SUCCESS; }
virtual StatusCode endInputFile(const SG::SourceID &) final { return StatusCode::SUCCESS; }
virtual StatusCode metaDataStop() final { return StatusCode::SUCCESS; }
#ifndef XAOD_STANDALONE
virtual StatusCode beginInputFile(const SG::SourceID &) final { return StatusCode::SUCCESS; }
virtual StatusCode endInputFile(const SG::SourceID &) final { return StatusCode::SUCCESS; }
#endif
Gaudi::Property<bool> m_standaloneMode{this, "StandaloneMode", false, "Dump on initialize when running standalone"};
};
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef EVENT_BOOKKEEPER_TOOLS__EVENT_BOOKKEEPER_TOOLS_DICT_H
#define EVENT_BOOKKEEPER_TOOLS__EVENT_BOOKKEEPER_TOOLS_DICT_H
#include <EventBookkeeperTools/BookkeeperDumperTool.h>
#endif
<lcgdict>
<class name="BookkeeperDumperTool" />
</lcgdict>
......@@ -7,10 +7,9 @@
* @brief Implementation of class BookkeeperDumperTool
*/
#include "BookkeeperDumperTool.h"
#include <xAODCutFlow/CutBookkeeperContainer.h>
#include <EventBookkeeperTools/BookkeeperDumperTool.h>
BookkeeperDumperTool::BookkeeperDumperTool(const std::string &name)
......
#include "../BookkeeperDumperTool.h"
#include <EventBookkeeperTools/BookkeeperDumperTool.h>
#include "../BookkeeperTool.h"
#include "../CppFilterTester.h"
#include "../CutFlowSvc.h"
......
......@@ -13,9 +13,8 @@
// ASG
#include <AsgMessaging/MessageCheck.h>
#include <AsgTools/ToolHandle.h>
#include <AsgTools/AnaToolHandle.h>
#include <AsgTools/AsgMetadataTool.h>
#include <AthAnalysisBaseComps/AthAnalysisHelper.h>
ANA_MSG_HEADER(CutFlow)
ANA_MSG_SOURCE(CutFlow, "Dump")
......@@ -65,8 +64,8 @@ int main(int argc, char **argv)
event.getEntries();
// Retrieve the tool
ToolHandle<asg::AsgMetadataTool> tool("BookkeeperDumperTool/BookkeeperDumperTool");
ANA_CHECK(AAH::setProperty(tool, "StandaloneMode", true));
asg::AnaToolHandle<asg::AsgMetadataTool> tool("BookkeeperDumperTool/BookkeeperDumperTool");
ANA_CHECK(tool.setProperty("StandaloneMode", true));
ANA_CHECK(tool.retrieve());
// Trigger finalization of all services and tools created by the Gaudi Application
......
......@@ -38,6 +38,7 @@
+ DetectorDescription/GeoPrimitives
+ DetectorDescription/IRegionSelector
+ DetectorDescription/RoiDescriptor
+ Event/EventBookkeeperTools
+ Event/EventPrimitives
+ Event/FourMomUtils
- Event/xAOD/.*AthenaPool
......
......@@ -130,7 +130,9 @@
+ Event/xAOD/xAODCoreAthenaPool
+ Event/xAOD/xAODCoreCnv
+ Event/xAOD/xAODCutFlow
+ Event/xAOD/xAODCutFlowAthenaPool
+ Event/xAOD/xAODEventFormat
+ Event/xAOD/xAODEventFormatCnv
+ Event/xAOD/xAODEventInfo
+ Event/xAOD/xAODEventInfoAthenaPool
+ Event/xAOD/xAODEventInfoCnv
......
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