Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ add_subdirectory(Core)

add_subdirectory(Utils)

add_subdirectory(AnalysisSupport)
add_subdirectory(AnalysisSupport)
add_subdirectory(PhysicsSupport)

add_subdirectory(RootAnalysisHelpers)

# Build the GUI support only if we have DebugGUI
if (TARGET AliceO2::DebugGUI)
add_subdirectory(GUISupport)
add_subdirectory(GUISupport)
endif()

add_subdirectory(TestWorkflows)
add_subdirectory(TestWorkflows)
1 change: 0 additions & 1 deletion Framework/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ o2_add_library(Framework
CURL::libcurl
FairMQ::FairMQ
O2::MathUtils
ROOT::EG
ROOT::Tree
O2::CCDB
O2::FrameworkFoundation
Expand Down
9 changes: 4 additions & 5 deletions Framework/Core/include/Framework/CommonServices.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,13 @@ struct CommonServices {
};

struct CommonAnalysisServices {
static ServiceSpec databasePDGSpec();

template <typename T>
static void addAnalysisService(std::vector<ServiceSpec>& specs)
{
if constexpr (std::is_same_v<T, TDatabasePDG>) {
specs.push_back(databasePDGSpec());
}
std::vector<LoadableService> loadableServices = {};
char const* analysisServices = "O2FrameworkPhysicsSupport:PDGSupport";
loadableServices = ServiceHelpers::parseServiceSpecString(analysisServices);
ServiceHelpers::loadFromPlugin(loadableServices, specs);
}
};

Expand Down
15 changes: 0 additions & 15 deletions Framework/Core/src/CommonServices.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
#include "DecongestionService.h"
#include "ArrowSupport.h"
#include "DPLMonitoringBackend.h"
#include "TDatabasePDG.h"
#include "../../../DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h"
#include "Headers/STFHeader.h"
#include "Headers/DataHeader.h"

Expand Down Expand Up @@ -956,18 +954,5 @@ std::vector<ServiceSpec> CommonServices::defaultServices(int numThreads)
return specs;
}

o2::framework::ServiceSpec CommonAnalysisServices::databasePDGSpec()
{
return ServiceSpec{
.name = "database-pdg",
.init = [](ServiceRegistry&, DeviceState&, fair::mq::ProgOptions&) -> ServiceHandle {
auto* ptr = new TDatabasePDG();
o2::O2DatabasePDG::addALICEParticles(ptr);
return ServiceHandle{TypeIdHelpers::uniqueId<TDatabasePDG>(), ptr, ServiceKind::Serial, "database-pdg"};
},
.configure = CommonServices::noConfiguration(),
.exit = [](ServiceRegistry&, void* service) { reinterpret_cast<TDatabasePDG*>(service)->Delete(); },
.kind = ServiceKind::Serial};
}
} // namespace o2::framework
#pragma GCC diagnostic pop
14 changes: 14 additions & 0 deletions Framework/PhysicsSupport/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
# This software is distributed under the terms of the GNU General Public
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
o2_add_library(FrameworkPhysicsSupport
SOURCES src/Plugin.cxx
PRIVATE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/src
PUBLIC_LINK_LIBRARIES O2::Framework O2::SimulationDataFormat)
39 changes: 39 additions & 0 deletions Framework/PhysicsSupport/src/Plugin.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
//
#include "Framework/Plugins.h"
#include "Framework/ServiceHandle.h"
#include "Framework/ServiceSpec.h"
#include "Framework/CommonServices.h"
#include "TDatabasePDG.h"
#include "SimulationDataFormat/O2DatabasePDG.h"

using namespace o2::framework;

struct PDGSupport : o2::framework::ServicePlugin {
o2::framework::ServiceSpec* create() final
{
return new ServiceSpec{
.name = "database-pdg",
.init = [](ServiceRegistry&, DeviceState&, fair::mq::ProgOptions&) -> ServiceHandle {
auto* ptr = new TDatabasePDG();
o2::O2DatabasePDG::addALICEParticles(ptr);
return ServiceHandle{TypeIdHelpers::uniqueId<TDatabasePDG>(), ptr, ServiceKind::Serial, "database-pdg"};
},
.configure = CommonServices::noConfiguration(),
.exit = [](ServiceRegistry&, void* service) { reinterpret_cast<TDatabasePDG*>(service)->Delete(); },
.kind = ServiceKind::Serial};
}
};

DEFINE_DPL_PLUGINS_BEGIN
DEFINE_DPL_PLUGIN_INSTANCE(PDGSupport, CustomService);
DEFINE_DPL_PLUGINS_END
2 changes: 1 addition & 1 deletion cmake/O2AddWorkflow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function(o2_add_dpl_workflow baseTargetName)
add_custom_command(
TARGET ${targetExeName} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E env ASAN_OPTIONS=detect_leaks=0,detect_container_overflow=0,detect_odr_violation=0 "LD_LIBRARY_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$$LD_LIBRARY_PATH" $<TARGET_FILE:${targetExeName}> -b --dump-workflow --dump-workflow-file ${jsonFile})
add_dependencies(${targetExeName} O2::FrameworkAnalysisSupport)
add_dependencies(${targetExeName} O2::FrameworkAnalysisSupport O2::FrameworkPhysicsSupport)

install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${jsonFile}
Expand Down