1515// / \author Vít Kučera <vit.kucera@cern.ch>, Inha University
1616
1717#include " PWGHF/DataModel/CandidateReconstructionTables.h"
18+ #include " PWGHF/Utils/utilsPid.h"
1819
1920#include " Common/Core/TableHelper.h"
20- #include " Common/DataModel/PIDResponseTOF.h"
21- #include " Common/DataModel/PIDResponseTPC.h"
2221
2322#include < Framework/AnalysisDataModel.h>
2423#include < Framework/AnalysisHelpers.h>
3231
3332using namespace o2 ;
3433using namespace o2 ::framework;
34+ using namespace o2 ::aod::pid_tpc_tof_utils;
3535
3636struct HfPidCreator {
3737 Produces<aod::PidTpcTofFullEl> trackPidFullEl;
@@ -47,9 +47,6 @@ struct HfPidCreator {
4747 Produces<aod::PidTpcTofFullDe> trackPidFullDe;
4848 Produces<aod::PidTpcTofTinyDe> trackPidTinyDe;
4949
50- static constexpr float NSigmaToleranceDefault = .1f ;
51- static constexpr float NSigmaDefault = -999 .f + NSigmaToleranceDefault; // -999.f is the default value set in TPCPIDResponse.h and PIDTOF.h
52-
5350 // / Function to check whether the process function flag matches the need for filling the table
5451 // / \param initContext workflow context (argument of the init function)
5552 // / \param table name of the table
@@ -85,30 +82,6 @@ struct HfPidCreator {
8582 checkTableSwitch (initContext, " PidTpcTofTinyDe" , doprocessTinyDe);
8683 }
8784
88- // / Function to combine TPC and TOF NSigma
89- // / \param tiny switch between full and tiny (binned) PID tables
90- // / \param tpcNSigma is the (binned) NSigma separation in TPC (if tiny = true)
91- // / \param tofNSigma is the (binned) NSigma separation in TOF (if tiny = true)
92- // / \return combined NSigma of TPC and TOF
93- template <bool Tiny, typename T1>
94- T1 combineNSigma (T1 tpcNSigma, T1 tofNSigma)
95- {
96- if constexpr (Tiny) {
97- tpcNSigma *= aod::pidtpc_tiny::binning::bin_width;
98- tofNSigma *= aod::pidtof_tiny::binning::bin_width;
99- }
100- if ((tpcNSigma > NSigmaDefault) && (tofNSigma > NSigmaDefault)) { // TPC and TOF
101- return std::sqrt (.5f * (tpcNSigma * tpcNSigma + tofNSigma * tofNSigma));
102- }
103- if (tpcNSigma > NSigmaDefault) { // only TPC
104- return std::abs (tpcNSigma);
105- }
106- if (tofNSigma > NSigmaDefault) { // only TOF
107- return std::abs (tofNSigma);
108- }
109- return tofNSigma; // no TPC nor TOF
110- }
111-
11285 void processDummy (aod::Collisions const &) {}
11386 PROCESS_SWITCH (HfPidCreator, processDummy, " Process nothing" , true );
11487
0 commit comments