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