diff --git a/Event/EventBookkeeperTools/CMakeLists.txt b/Event/EventBookkeeperTools/CMakeLists.txt index 0f7d1f44b870a5f51829f6b0da422c1e8eed5ceb..9b676cd1644e052c0b13a8754e35df21a0ec57fc 100644 --- a/Event/EventBookkeeperTools/CMakeLists.txt +++ b/Event/EventBookkeeperTools/CMakeLists.txt @@ -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 ) diff --git a/Event/EventBookkeeperTools/src/BookkeeperDumperTool.h b/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperDumperTool.h old mode 100755 new mode 100644 similarity index 81% rename from Event/EventBookkeeperTools/src/BookkeeperDumperTool.h rename to Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperDumperTool.h index 604d1fcc9d55d901bdc0bfdd4361f82db414070f..c9339ba270e547999d7782010869724cd60572af --- a/Event/EventBookkeeperTools/src/BookkeeperDumperTool.h +++ b/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperDumperTool.h @@ -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"}; }; diff --git a/Event/EventBookkeeperTools/EventBookkeeperTools/EventBookkeeperToolsDict.h b/Event/EventBookkeeperTools/EventBookkeeperTools/EventBookkeeperToolsDict.h new file mode 100644 index 0000000000000000000000000000000000000000..ae7dcecd55de0e66355689d60cce765d917f6254 --- /dev/null +++ b/Event/EventBookkeeperTools/EventBookkeeperTools/EventBookkeeperToolsDict.h @@ -0,0 +1,10 @@ +/* + 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 diff --git a/Event/EventBookkeeperTools/EventBookkeeperTools/selection.xml b/Event/EventBookkeeperTools/EventBookkeeperTools/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..8f65a891c98c793857288edc55c931aaa18e61d0 --- /dev/null +++ b/Event/EventBookkeeperTools/EventBookkeeperTools/selection.xml @@ -0,0 +1,3 @@ +<lcgdict> + <class name="BookkeeperDumperTool" /> +</lcgdict> diff --git a/Event/EventBookkeeperTools/src/BookkeeperDumperTool.cxx b/Event/EventBookkeeperTools/Root/BookkeeperDumperTool.cxx old mode 100755 new mode 100644 similarity index 98% rename from Event/EventBookkeeperTools/src/BookkeeperDumperTool.cxx rename to Event/EventBookkeeperTools/Root/BookkeeperDumperTool.cxx index ae07d44a89e9c337febbe94062eaec7cb9643d42..e3c7770d6ee0ab477253dcc28ff507ab68da16bd --- a/Event/EventBookkeeperTools/src/BookkeeperDumperTool.cxx +++ b/Event/EventBookkeeperTools/Root/BookkeeperDumperTool.cxx @@ -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) diff --git a/Event/EventBookkeeperTools/src/components/EventBookkeeperTools_entries.cxx b/Event/EventBookkeeperTools/src/components/EventBookkeeperTools_entries.cxx index 8629f6a0c37b77e4265a7f4b2ff1e54a3568c1a1..e9a0d0ab0532302d693ebab4dbd69eeda6e513ac 100644 --- a/Event/EventBookkeeperTools/src/components/EventBookkeeperTools_entries.cxx +++ b/Event/EventBookkeeperTools/src/components/EventBookkeeperTools_entries.cxx @@ -1,4 +1,5 @@ -#include "../BookkeeperDumperTool.h" +#include <EventBookkeeperTools/BookkeeperDumperTool.h> + #include "../BookkeeperTool.h" #include "../CppFilterTester.h" #include "../CutFlowSvc.h" diff --git a/Event/EventBookkeeperTools/util/dump-cbk.cxx b/Event/EventBookkeeperTools/util/dump-cbk.cxx index 45036386ec4c962616af7dd0140b1764ada323f5..cb72ff2fbece5ae630faddd95d884a724fa2ae18 100644 --- a/Event/EventBookkeeperTools/util/dump-cbk.cxx +++ b/Event/EventBookkeeperTools/util/dump-cbk.cxx @@ -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 diff --git a/Projects/AnalysisBase/package_filters.txt b/Projects/AnalysisBase/package_filters.txt index 274072529144919e58a7912e9b1cea9cfc2db2e6..d8cfcbe0b953d355b8aca092a621d06b7d2943fc 100644 --- a/Projects/AnalysisBase/package_filters.txt +++ b/Projects/AnalysisBase/package_filters.txt @@ -38,6 +38,7 @@ + DetectorDescription/GeoPrimitives + DetectorDescription/IRegionSelector + DetectorDescription/RoiDescriptor ++ Event/EventBookkeeperTools + Event/EventPrimitives + Event/FourMomUtils - Event/xAOD/.*AthenaPool diff --git a/Projects/AthGeneration/package_filters.txt b/Projects/AthGeneration/package_filters.txt index e4d2888809449379721955c197cf721c96140f36..2648099c10e95c718c6a001e9b4c5e75619ff84b 100644 --- a/Projects/AthGeneration/package_filters.txt +++ b/Projects/AthGeneration/package_filters.txt @@ -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