diff --git a/Common/TableProducer/PID/CMakeLists.txt b/Common/TableProducer/PID/CMakeLists.txt index e0ea2d40ab3..86787fd13b7 100644 --- a/Common/TableProducer/PID/CMakeLists.txt +++ b/Common/TableProducer/PID/CMakeLists.txt @@ -55,7 +55,7 @@ o2physics_add_dpl_workflow(pid-tpc-base o2physics_add_dpl_workflow(pid-tpc SOURCES pidTPC.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::MLCore COMPONENT_NAME Analysis) # HMPID diff --git a/Common/TableProducer/PID/pidTPC.cxx b/Common/TableProducer/PID/pidTPC.cxx index e9c2015afbc..7f95b39e5a0 100644 --- a/Common/TableProducer/PID/pidTPC.cxx +++ b/Common/TableProducer/PID/pidTPC.cxx @@ -33,6 +33,7 @@ #include "TableHelper.h" #include "pidTPCBase.h" +#include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/PID/TPCPIDResponse.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -151,7 +152,8 @@ struct tpcPid { Configurable useNetworkAl{"useNetworkAl", 1, {"Switch for applying neural network on the alpha mass hypothesis (if network enabled) (set to 0 to disable)"}}; Configurable networkBetaGammaCutoff{"networkBetaGammaCutoff", 0.45, {"Lower value of beta-gamma to override the NN application"}}; Configurable networkInputBatchedMode{"networkInputBatchedMode", -1, {"-1: Takes all tracks, >0: Takes networkInputBatchedMode number of tracks at once"}}; - + Configurable irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; + ctpRateFetcher mRateFetcher; // Parametrization configuration bool useCCDBParam = false; std::vector track_properties; @@ -400,6 +402,16 @@ struct tpcPid { if (input_dimensions == 7 && networkVersion == "2") { track_properties[counter_track_props + 6] = trk.has_collision() ? collisions.iteratorAt(trk.collisionId()).ft0cOccupancyInTimeRange() / 60000. : 1.; } + if (input_dimensions == 8 && networkVersion == "3") { + if (trk.has_collision()) { + auto trk_bc = (collisions.iteratorAt(trk.collisionId())).template bc_as(); + float hadronicRate = mRateFetcher.fetch(ccdb.service, trk_bc.timestamp(), trk_bc.runNumber(), irSource) * 1.e-3; + track_properties[counter_track_props + 7] = hadronicRate / 50.; + } else { + track_properties[counter_track_props + 7] = 1; + } + } + counter_track_props += input_dimensions; in_batch_counter++; total_input_count++;