From 32c1c7d397d5204e994bc8ff0ae941be094db912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Wed, 2 Jul 2025 11:52:30 +0200 Subject: [PATCH 1/4] Add TOF Response parameters as a service --- Common/Core/CMakeLists.txt | 2 + Common/Core/PID/PIDTOFService.cxx | 293 ++++++++++++++++++++++++++++++ Common/Core/PID/PIDTOFService.h | 205 +++++++++++++++++++++ Common/DataModel/CMakeLists.txt | 1 + 4 files changed, 501 insertions(+) create mode 100644 Common/Core/PID/PIDTOFService.cxx create mode 100644 Common/Core/PID/PIDTOFService.h diff --git a/Common/Core/CMakeLists.txt b/Common/Core/CMakeLists.txt index a5a771a2ca3..54ee2ff6163 100644 --- a/Common/Core/CMakeLists.txt +++ b/Common/Core/CMakeLists.txt @@ -14,6 +14,7 @@ o2physics_add_library(AnalysisCore OrbitRange.cxx PID/ParamBase.cxx PID/PIDTOF.cxx + PID/PIDTOFService.cxx CollisionAssociation.cxx TrackSelectionDefaults.cxx EventPlaneHelper.cxx @@ -34,6 +35,7 @@ o2physics_target_root_dictionary(AnalysisCore PID/DetectorResponse.h PID/PIDTOF.h PID/TPCPIDResponse.h + PID/PIDTOFService.h CollisionTypeHelper.h FFitWeights.h LINKDEF AnalysisCoreLinkDef.h) diff --git a/Common/Core/PID/PIDTOFService.cxx b/Common/Core/PID/PIDTOFService.cxx new file mode 100644 index 00000000000..aba697b06e1 --- /dev/null +++ b/Common/Core/PID/PIDTOFService.cxx @@ -0,0 +1,293 @@ +// 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. + +/// +/// \file PIDTOFService.cxx +/// \author Nicolò Jacazio nicolo.jacazio@cern.ch +/// \since 30/06/2025 +/// \brief Implementation of the TOF PID service for the detector response +/// + +#include "PIDTOFService.h" + +#include +#include +#include +#include + +#include +#include + +using namespace o2::framework; + +o2::pid::tof::TOFResoParamsV3 o2::pid::tof::TOFResponseImpl::parameters; +o2::common::core::MetadataHelper o2::pid::tof::TOFResponseImpl::metadataInfo; +bool o2::pid::tof::TOFResponseImpl::mIsInit = false; +int o2::pid::tof::TOFResponseImpl::mLastRunNumber = -1; + +void o2::pid::tof::TOFResponseImpl::inheritFromBaseTask(o2::framework::InitContext& initContext, const std::string task) +{ + if (mIsInit) { + LOG(fatal) << "TOFResponseImpl already initialized, cannot re-initialize"; + } + getCfg(initContext, "ccdb-url", mUrl, task); + getCfg(initContext, "ccdb-path-grplhcif", mPathGrpLhcIf, task); + getCfg(initContext, "ccdb-timestamp", mTimestamp, task); + getCfg(initContext, "timeShiftCCDBPathPos", mTimeShiftCCDBPathPos, task); + getCfg(initContext, "timeShiftCCDBPathNeg", mTimeShiftCCDBPathNeg, task); + getCfg(initContext, "timeShiftCCDBPathPosMC", mTimeShiftCCDBPathPosMC, task); + getCfg(initContext, "timeShiftCCDBPathNegMC", mTimeShiftCCDBPathNegMC, task); + getCfg(initContext, "paramFileName", mParamFileName, task); + getCfg(initContext, "parametrizationPath", mParametrizationPath, task); + getCfg(initContext, "reconstructionPass", mReconstructionPass, task); + getCfg(initContext, "reconstructionPassDefault", mReconstructionPassDefault, task); + getCfg(initContext, "fatalOnPassNotAvailable", mFatalOnPassNotAvailable, task); + getCfg(initContext, "enableTimeDependentResponse", mEnableTimeDependentResponse, task); + getCfg(initContext, "collisionSystem", mCollisionSystem, task); + getCfg(initContext, "autoSetProcessFunctions", mAutoSetProcessFunctions, task); +} + +void o2::pid::tof::TOFResponseImpl::initSetup(o2::ccdb::BasicCCDBManager* ccdb, + o2::framework::InitContext& initContext) +{ + if (mIsInit) { + LOG(fatal) << "TOFResponseImpl already initialized, cannot re-initialize"; + } + + if (!ccdb) { + LOG(fatal) << "CCDB manager is not set, cannot initialize TOFResponseImpl"; + } + inheritFromBaseTask(initContext); // Gets the configuration parameters from the base task (tof-signal) + mCcdb = ccdb; // Set the CCDB manager + mCcdb->setURL(mUrl); + mCcdb->setTimestamp(mTimestamp); + mCcdb->setCaching(true); + mCcdb->setLocalObjectValidityChecking(); + // Not later than now objects + mCcdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + + mIsInit = true; // Set the initialization flag + + // Then the information about the metadata + if (mReconstructionPass == "metadata") { + LOG(info) << "Getting pass from metadata"; + if (metadataInfo.isMC()) { + mReconstructionPass = metadataInfo.get("AnchorPassName"); + } else { + mReconstructionPass = metadataInfo.get("RecoPassName"); + } + LOG(info) << "Passed autodetect mode for pass. Taking '" << mReconstructionPass << "'"; + } + LOG(info) << "Using parameter collection, starting from pass '" << mReconstructionPass << "'"; + + if (!mParamFileName.empty()) { // Loading the parametrization from file + LOG(info) << "Loading exp. sigma parametrization from file " << mParamFileName << ", using param: " << mParametrizationPath << " and pass " << mReconstructionPass; + o2::tof::ParameterCollection paramCollection; + paramCollection.loadParamFromFile(mParamFileName, mParametrizationPath); + LOG(info) << "+++ Loaded parameter collection from file +++"; + if (!paramCollection.retrieveParameters(parameters, mReconstructionPass)) { + if (mFatalOnPassNotAvailable) { + LOG(fatal) << "Pass '" << mReconstructionPass << "' not available in the retrieved object from file"; + } else { + LOG(warning) << "Pass '" << mReconstructionPass << "' not available in the retrieved object from file, fetching '" << mReconstructionPassDefault << "'"; + if (!paramCollection.retrieveParameters(parameters, mReconstructionPassDefault)) { + paramCollection.print(); + LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; + } else { + if (metadataInfo.isRun3()) { + parameters.setResolutionParametrization(paramCollection.getPars(mReconstructionPassDefault)); + } else { + parameters.setResolutionParametrizationRun2(paramCollection.getPars(mReconstructionPassDefault)); + } + parameters.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPassDefault)); + } + } + } else { // Pass is available, load non standard parameters + if (metadataInfo.isRun3()) { + parameters.setResolutionParametrization(paramCollection.getPars(mReconstructionPass)); + } else { + parameters.setResolutionParametrizationRun2(paramCollection.getPars(mReconstructionPass)); + } + parameters.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPass)); + } + } else if (!mEnableTimeDependentResponse) { // Loading it from CCDB + LOG(info) << "Loading initial exp. sigma parametrization from CCDB, using path: " << mParametrizationPath << " for timestamp " << mTimestamp; + o2::tof::ParameterCollection* paramCollection = mCcdb->getSpecific(mParametrizationPath, mTimestamp); + if (!paramCollection->retrieveParameters(parameters, mReconstructionPass)) { // Attempt at loading the parameters with the pass defined + if (mFatalOnPassNotAvailable) { + LOG(fatal) << "Pass '" << mReconstructionPass << "' not available in the retrieved CCDB object"; + } else { + LOG(warning) << "Pass '" << mReconstructionPass << "' not available in the retrieved CCDB object, fetching '" << mReconstructionPassDefault << "'"; + if (!paramCollection->retrieveParameters(parameters, mReconstructionPassDefault)) { + paramCollection->print(); + LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; + } else { + if (metadataInfo.isRun3()) { + parameters.setResolutionParametrization(paramCollection->getPars(mReconstructionPassDefault)); + } else { + parameters.setResolutionParametrizationRun2(paramCollection->getPars(mReconstructionPassDefault)); + } + parameters.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPassDefault)); + } + } + } else { // Pass is available, load non standard parameters + if (metadataInfo.isRun3()) { + parameters.setResolutionParametrization(paramCollection->getPars(mReconstructionPass)); + } else { + parameters.setResolutionParametrizationRun2(paramCollection->getPars(mReconstructionPass)); + } + parameters.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPass)); + } + } + + // Loading additional calibration objects + std::map metadata; + if (!mReconstructionPass.empty()) { + metadata["RecoPassName"] = mReconstructionPass; + } + + auto updateTimeShift = [&](const std::string& nameShift, bool isPositive) { + if (nameShift.empty()) { + return; + } + const bool isFromFile = nameShift.find(".root") != std::string::npos; + if (isFromFile) { + LOG(info) << "Initializing the time shift for " << (isPositive ? "positive" : "negative") << " from file '" << nameShift << "'"; + parameters.setTimeShiftParameters(nameShift, "ccdb_object", isPositive); + } else if (!mEnableTimeDependentResponse) { // If the response is fixed fetch it at the init time + LOG(info) << "Initializing the time shift for " << (isPositive ? "positive" : "negative") + << " from ccdb '" << nameShift << "' and timestamp " << mTimestamp + << " and pass '" << mReconstructionPass << "'"; + mCcdb->setFatalWhenNull(false); + parameters.setTimeShiftParameters(mCcdb->getSpecific(nameShift, mTimestamp, metadata), isPositive); + mCcdb->setFatalWhenNull(true); + } + LOG(info) << " test getTimeShift at 0 " << (isPositive ? "pos" : "neg") << ": " + << parameters.getTimeShift(0, isPositive); + }; + + const std::string nameShiftPos = metadataInfo.isMC() ? mTimeShiftCCDBPathPosMC : mTimeShiftCCDBPathPos; + updateTimeShift(nameShiftPos, true); + const std::string nameShiftNeg = metadataInfo.isMC() ? mTimeShiftCCDBPathNegMC : mTimeShiftCCDBPathNeg; + updateTimeShift(nameShiftNeg, false); + + // Calibration object is defined + LOG(info) << "Parametrization at init time:"; + parameters.printFullConfig(); +} + +void o2::pid::tof::TOFResponseImpl::processSetup(const int runNumber, const int64_t timeStamp) +{ + LOG(debug) << "Processing setup for run number " << runNumber << " from run " << mLastRunNumber; + // First we check if this run number was already processed + if (mLastRunNumber == runNumber) { + return; + } + LOG(info) << "Updating the parametrization from last run " << mLastRunNumber << " to " << runNumber << " and timestamp from " << mTimestamp << " " << timeStamp; + mLastRunNumber = runNumber; + mTimestamp = timeStamp; + + // Check the beam type + if (mCollisionSystem == o2::common::core::CollisionSystemType::kCollSysUndef) { + o2::parameters::GRPLHCIFData* grpo = mCcdb->getSpecific(mPathGrpLhcIf, + mTimestamp); + mCollisionSystem = CollisionSystemType::getCollisionTypeFromGrp(grpo); + } else { + LOG(debug) << "Not setting collisions system as already set to " << mCollisionSystem << " " << CollisionSystemType::getCollisionSystemName(mCollisionSystem); + } + + if (!mEnableTimeDependentResponse) { + return; + } + LOG(info) << "Updating parametrization from path '" << mParametrizationPath << "' and timestamp " << mTimestamp << " and reconstruction pass '" << mReconstructionPass << "' for run number " << runNumber; + if (mParamFileName.empty()) { // Not loading if parametrization was taken from file + LOG(info) << "Updating parametrization from ccdb"; + const o2::tof::ParameterCollection* paramCollection = mCcdb->getSpecific(mParametrizationPath, mTimestamp); + if (!paramCollection->retrieveParameters(parameters, mReconstructionPass)) { + if (mFatalOnPassNotAvailable) { + LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + } else { + LOGF(warning, "Pass '%s' not available in the retrieved CCDB object, fetching '%s'", mReconstructionPass.data(), mReconstructionPassDefault.data()); + if (!paramCollection->retrieveParameters(parameters, mReconstructionPassDefault)) { + paramCollection->print(); + LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; + } else { // Found the default case + if (metadataInfo.isRun3()) { + parameters.setResolutionParametrization(paramCollection->getPars(mReconstructionPassDefault)); + } else { + parameters.setResolutionParametrizationRun2(paramCollection->getPars(mReconstructionPassDefault)); + } + parameters.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPassDefault)); + } + } + } else { // Found the non default case + if (metadataInfo.isRun3()) { + parameters.setResolutionParametrization(paramCollection->getPars(mReconstructionPass)); + } else { + parameters.setResolutionParametrizationRun2(paramCollection->getPars(mReconstructionPass)); + } + parameters.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPass)); + } + } + + // Loading additional calibration objects + std::map metadata; + if (!mReconstructionPass.empty()) { + metadata["RecoPassName"] = mReconstructionPass; + } + + auto updateTimeShift = [&](const std::string& nameShift, bool isPositive) { + if (nameShift.empty()) { + return; + } + const bool isFromFile = nameShift.find(".root") != std::string::npos; + if (isFromFile) { + return; + } + LOG(info) << "Updating the time shift for " << (isPositive ? "positive" : "negative") + << " from ccdb '" << nameShift << "' and timestamp " << mTimestamp + << " and pass '" << mReconstructionPass << "'"; + mCcdb->setFatalWhenNull(false); + parameters.setTimeShiftParameters(mCcdb->getSpecific(nameShift, mTimestamp, metadata), isPositive); + mCcdb->setFatalWhenNull(true); + LOG(info) << " test getTimeShift at 0 " << (isPositive ? "pos" : "neg") << ": " + << parameters.getTimeShift(0, isPositive); + }; + + updateTimeShift(metadataInfo.isMC() ? mTimeShiftCCDBPathPosMC : mTimeShiftCCDBPathPos, true); + updateTimeShift(metadataInfo.isMC() ? mTimeShiftCCDBPathNegMC : mTimeShiftCCDBPathNeg, false); + + LOG(info) << "Parametrization at setup time:"; + parameters.printFullConfig(); +} + +struct TOFSupport : o2::framework::ServicePlugin { + o2::framework::ServiceSpec* create() final + { + return new ServiceSpec{ + .name = "tof-response", + .init = [](ServiceRegistryRef, DeviceState&, fair::mq::ProgOptions&) -> ServiceHandle { + auto* wrapper = new o2::pid::tof::TOFResponse(); + auto* ptr = new o2::pid::tof::TOFResponseImpl(); + wrapper->setInstance(ptr); + return ServiceHandle{TypeIdHelpers::uniqueId(), wrapper, ServiceKind::Serial, "database-pdg"}; + }, + .configure = CommonServices::noConfiguration(), + .exit = [](ServiceRegistryRef, void* service) { + auto* resp = reinterpret_cast(service); + delete resp; }, + .kind = ServiceKind::Serial}; + } +}; + +DEFINE_DPL_PLUGINS_BEGIN +DEFINE_DPL_PLUGIN_INSTANCE(TOFSupport, CustomService); +DEFINE_DPL_PLUGINS_END diff --git a/Common/Core/PID/PIDTOFService.h b/Common/Core/PID/PIDTOFService.h new file mode 100644 index 00000000000..cac3346b3b1 --- /dev/null +++ b/Common/Core/PID/PIDTOFService.h @@ -0,0 +1,205 @@ +// 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. + +/// +/// \file PIDTOFService.h +/// \author Nicolò Jacazio nicolo.jacazio@cern.ch +/// \since 30/06/2025 +/// \brief Implementation of the TOF PID service for the detector response +/// + +#ifndef COMMON_CORE_PID_PIDTOFSERVICE_H_ +#define COMMON_CORE_PID_PIDTOFSERVICE_H_ + +#include "Common/Core/CollisionTypeHelper.h" +#include "Common/Core/MetadataHelper.h" +#include "Common/Core/PID/PIDTOF.h" +#include "Common/Core/TableHelper.h" + +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "DataFormatsTOF/ParameterContainers.h" +#include "Framework/DataTypes.h" +#include "Framework/PID.h" +#include "Framework/Plugins.h" +#include "ReconstructionDataFormats/PID.h" + +#include + +namespace o2::pid::tof +{ + +struct TOFResponseImpl { + static o2::pid::tof::TOFResoParamsV3 parameters; // TOF response parameters for the expected resolution + static o2::common::core::MetadataHelper metadataInfo; // Metadata information used for the TOF response + + /// Initialize the TOF response parameters in the init function of each task + /// \param ccdb Pointer to the CCDB manager + /// \param initContext Initialization context + /// \note This function should be called in the init function of each task that uses the TOF response + /// \note The parameters are loaded from the CCDB and stored in the static variable `parameters` + /// \note The metadata information is also initialized in this function + void initSetup(o2::ccdb::BasicCCDBManager* ccdb, o2::framework::InitContext& initContext); + + /// Initialize the TOF response parameters in the init function of each task + /// \param ccdb Service pointer to the CCDB manager + template + void initSetup(T ccdb, o2::framework::InitContext& initContext) + { + initSetup(ccdb.operator->(), initContext); + } + + /// Initialize the TOF response parameters in the process function of each task, should be called only at least once per run + /// \param runNumber Run number for which the calibration is loaded + /// \param timeStamp Timestamp for which the calibration is loaded + /// \note This function should be called in the process function of each task that uses the TOF response + /// \note The parameters are loaded from the CCDB and stored in the static variable `parameters` + /// \note The metadata information is also initialized in this function + void processSetup(const int runNumber, const int64_t timeStamp); + + /// Initialize the TOF response parameters in the process function of each task, should be called only at least once per run + /// \param bc Bunch crossing containing the run number and timestamp for which the calibration is loaded + template + void processSetup(const T& bc) + { + processSetup(bc.runNumber(), bc.timestamp()); + } + + template + static float expectedSigma(const float tofSignal, + const float tofExpMom, + const float momentum, + const float eta, + const float tofEvTimeErr, + const o2::pid::tof::TOFResoParamsV3& params = parameters) + { + if (!mIsInit) { + LOG(fatal) << "TOF response parameters not initialized, call initSetup() first"; + } + if (mLastRunNumber < 0) { + LOG(fatal) << "TOF response parameters not initialized, call processSetup() first"; + } + if (tofSignal <= 0.f) { + // return o2::pid::tof::defaultReturnValue; + } + if (tofExpMom <= 0.f) { + return o2::pid::tof::defaultReturnValue; + } + if (momentum <= 0) { + return o2::pid::tof::defaultReturnValue; + } + const float trackingReso = params.getResolution(momentum, eta); + const float tofReso = params.getParameter(4); + if (trackingReso > 0) { + return std::sqrt(trackingReso * trackingReso + + tofReso * tofReso + + tofEvTimeErr * tofEvTimeErr); + } + constexpr float MassSquared = o2::track::pid_constants::sMasses2[id]; + const float dpp = params.getParameter(0) + + params.getParameter(1) * momentum + + params.getParameter(2) * o2::constants::physics::MassElectron / momentum; + const float sigma = dpp * tofSignal / (1. + momentum * momentum / (MassSquared)); + return std::sqrt(sigma * sigma + + params.getParameter(3) * params.getParameter(3) / momentum / momentum + + tofReso * tofReso + + tofEvTimeErr * tofEvTimeErr); + } + + template + static float expectedSigma(const TrackType& track, const o2::pid::tof::TOFResoParamsV3& params = parameters) + { + return expectedSigma(track.tofSignal(), track.tofExpMom(), track.p(), track.eta(), track.tofEvTimeErr(), params); + } + + template + static float nSigma(const float tofSignal, + const float tofExpMom, + const float length, + const float momentum, + const float eta, + const float tofEvTime, + const float tofEvTimeErr, + const o2::pid::tof::TOFResoParamsV3& params = parameters) + { + if (tofSignal <= 0.f) { + return o2::pid::tof::defaultReturnValue; + } + if (tofExpMom <= 0.f) { + return o2::pid::tof::defaultReturnValue; + } + if (momentum <= 0) { + return o2::pid::tof::defaultReturnValue; + } + + const float resolution = expectedSigma(tofSignal, tofExpMom, momentum, eta, tofEvTimeErr, params); + const float expTime = o2::framework::pid::tof::MassToExpTime(tofExpMom, + length, + o2::track::pid_constants::sMasses2[id]); + const float delta = tofSignal - tofEvTime - expTime; + return delta / resolution; + } + + template + static float nSigma(const TrackType& track, const o2::pid::tof::TOFResoParamsV3& params = parameters) + { + return nSigma(track.tofSignal(), track.tofExpMom(), track.length(), track.p(), track.eta(), track.tofEvTime(), track.tofEvTimeErr(), params); + } + + static bool isInit() { return mIsInit; } //! Get the initialization flag + + // Getters for the configurable options + bool cfgAutoSetProcessFunctions() const { return mAutoSetProcessFunctions; } + o2::common::core::CollisionSystemType::collType cfgCollisionType() const { return mCollisionSystem; } + + private: + void inheritFromBaseTask(o2::framework::InitContext& initContext, const std::string task = "tof-signal"); + + static bool mIsInit; //! Flag to check if the parameters are initialized + static int mLastRunNumber; //! Last run number for which the calibration was loaded + + o2::ccdb::BasicCCDBManager* mCcdb = nullptr; // Pointer to the CCDB manager + + // Configurable options + std::string mUrl = "undefined"; + std::string mPathGrpLhcIf = "undefined"; + int64_t mTimestamp = -1; + std::string mTimeShiftCCDBPathPos = "undefined"; + std::string mTimeShiftCCDBPathNeg = "undefined"; + std::string mTimeShiftCCDBPathPosMC = "undefined"; + std::string mTimeShiftCCDBPathNegMC = "undefined"; + std::string mParamFileName = "undefined"; + std::string mParametrizationPath = "undefined"; + std::string mReconstructionPass = "undefined"; + std::string mReconstructionPassDefault = "undefined"; + bool mFatalOnPassNotAvailable = false; + bool mEnableTimeDependentResponse = false; + o2::common::core::CollisionSystemType::collType mCollisionSystem = o2::common::core::CollisionSystemType::kCollSysUndef; + bool mAutoSetProcessFunctions = false; + + template + void getCfg(o2::framework::InitContext& initContext, const std::string name, VType& v, const std::string task) + { + if (!getTaskOptionValue(initContext, task, name, v, false)) { + LOG(fatal) << "Could not get " << name << " from " << task << " task"; + } + } +}; + +struct TOFResponse : o2::framework::LoadableServicePlugin { + TOFResponse() : LoadableServicePlugin{"O2PhysicsAnalysisCore:TOFSupport"} + { + } +}; + +} // namespace o2::pid::tof + +#endif // COMMON_CORE_PID_PIDTOFSERVICE_H_ diff --git a/Common/DataModel/CMakeLists.txt b/Common/DataModel/CMakeLists.txt index 084222c9648..608f57a2b53 100644 --- a/Common/DataModel/CMakeLists.txt +++ b/Common/DataModel/CMakeLists.txt @@ -19,6 +19,7 @@ o2physics_add_header_only_library(DataModel PIDResponseITS.h PIDResponseTOF.h PIDResponseTPC.h + PIDResponseCombined.h CollisionAssociationTables.h TrackSelectionTables.h McCollisionExtra.h From d45e20a2fc92ed9cbeadac06fa72297a7ef0d5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 17 Oct 2025 21:35:50 +0200 Subject: [PATCH 2/4] Add O2::DataFormatsParamTOF to link libraries --- Common/Core/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/Core/CMakeLists.txt b/Common/Core/CMakeLists.txt index 54ee2ff6163..e7ec8aec5d4 100644 --- a/Common/Core/CMakeLists.txt +++ b/Common/Core/CMakeLists.txt @@ -22,7 +22,7 @@ o2physics_add_library(AnalysisCore MetadataHelper.cxx CollisionTypeHelper.cxx FFitWeights.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsParameters ROOT::EG O2::CCDB ROOT::Physics O2::FT0Base O2::FV0Base) + PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsParameters ROOT::EG O2::CCDB ROOT::Physics O2::FT0Base O2::FV0Base O2::DataFormatsParamTOF) o2physics_target_root_dictionary(AnalysisCore HEADERS TrackSelection.h From f595072f8f4675005b476a5aee8564e8bd741eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 20 Oct 2025 11:43:37 +0200 Subject: [PATCH 3/4] Rename service --- Common/Core/CMakeLists.txt | 4 ++-- .../PID/{PIDTOFService.cxx => PIDTOFParamService.cxx} | 2 +- Common/Core/PID/{PIDTOFService.h => PIDTOFParamService.h} | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) rename Common/Core/PID/{PIDTOFService.cxx => PIDTOFParamService.cxx} (99%) rename Common/Core/PID/{PIDTOFService.h => PIDTOFParamService.h} (98%) diff --git a/Common/Core/CMakeLists.txt b/Common/Core/CMakeLists.txt index e7ec8aec5d4..75695b37c8f 100644 --- a/Common/Core/CMakeLists.txt +++ b/Common/Core/CMakeLists.txt @@ -14,7 +14,7 @@ o2physics_add_library(AnalysisCore OrbitRange.cxx PID/ParamBase.cxx PID/PIDTOF.cxx - PID/PIDTOFService.cxx + PID/PIDTOFParamService.cxx CollisionAssociation.cxx TrackSelectionDefaults.cxx EventPlaneHelper.cxx @@ -35,7 +35,7 @@ o2physics_target_root_dictionary(AnalysisCore PID/DetectorResponse.h PID/PIDTOF.h PID/TPCPIDResponse.h - PID/PIDTOFService.h + PID/PIDTOFParamService.h CollisionTypeHelper.h FFitWeights.h LINKDEF AnalysisCoreLinkDef.h) diff --git a/Common/Core/PID/PIDTOFService.cxx b/Common/Core/PID/PIDTOFParamService.cxx similarity index 99% rename from Common/Core/PID/PIDTOFService.cxx rename to Common/Core/PID/PIDTOFParamService.cxx index aba697b06e1..7d7157c0bba 100644 --- a/Common/Core/PID/PIDTOFService.cxx +++ b/Common/Core/PID/PIDTOFParamService.cxx @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. /// -/// \file PIDTOFService.cxx +/// \file PIDTOFParamService.cxx /// \author Nicolò Jacazio nicolo.jacazio@cern.ch /// \since 30/06/2025 /// \brief Implementation of the TOF PID service for the detector response diff --git a/Common/Core/PID/PIDTOFService.h b/Common/Core/PID/PIDTOFParamService.h similarity index 98% rename from Common/Core/PID/PIDTOFService.h rename to Common/Core/PID/PIDTOFParamService.h index cac3346b3b1..73b6a4e0c93 100644 --- a/Common/Core/PID/PIDTOFService.h +++ b/Common/Core/PID/PIDTOFParamService.h @@ -10,14 +10,14 @@ // or submit itself to any jurisdiction. /// -/// \file PIDTOFService.h +/// \file PIDTOFParamService.h /// \author Nicolò Jacazio nicolo.jacazio@cern.ch /// \since 30/06/2025 /// \brief Implementation of the TOF PID service for the detector response /// -#ifndef COMMON_CORE_PID_PIDTOFSERVICE_H_ -#define COMMON_CORE_PID_PIDTOFSERVICE_H_ +#ifndef COMMON_CORE_PID_PIDTOFPARAMSERVICE_H_ +#define COMMON_CORE_PID_PIDTOFPARAMSERVICE_H_ #include "Common/Core/CollisionTypeHelper.h" #include "Common/Core/MetadataHelper.h" @@ -202,4 +202,4 @@ struct TOFResponse : o2::framework::LoadableServicePlugin { } // namespace o2::pid::tof -#endif // COMMON_CORE_PID_PIDTOFSERVICE_H_ +#endif // COMMON_CORE_PID_PIDTOFPARAMSERVICE_H_ From 9ea5a113b5ca0abfdd69a85fb264cce6993715e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 20 Oct 2025 13:21:53 +0200 Subject: [PATCH 4/4] Update include directive for PIDTOFParamService --- Common/Core/PID/PIDTOFParamService.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/Core/PID/PIDTOFParamService.cxx b/Common/Core/PID/PIDTOFParamService.cxx index 7d7157c0bba..29fe01360fe 100644 --- a/Common/Core/PID/PIDTOFParamService.cxx +++ b/Common/Core/PID/PIDTOFParamService.cxx @@ -16,7 +16,7 @@ /// \brief Implementation of the TOF PID service for the detector response /// -#include "PIDTOFService.h" +#include "PIDTOFParamService.h" #include #include