Skip to content

Commit aca23b5

Browse files
minjungkim12claude
andcommitted
Migrate UPC gap classification to SGSelector with BC range checking
This commit updates the UPC (Ultra-Peripheral Collision) gap determination in taskD0 and taskDplus to use SGSelector from PWGUD/Core instead of custom gap classification logic. Key changes: - Migrate from custom GapType enum to SGSelector's TrueGap enum in utilsUpcHf.h - Update gap type classification to support 7 categories: NoGap (-1), SingleGapA (0), SingleGapC (1), DoubleGap (2), NoUpc (3), TrkOutOfRange (4), BadDoubleGap (5) - Add SGSelector instance to taskD0 and taskDplus for gap determination - Add FV0-A amplitude threshold configurable for more comprehensive gap classification - Remove unused energyThresholdZDC parameter as SGCutParHolder only supports FIT amplitudes - Add BC range checking via udhelpers::compatibleBCs for improved gap classification accuracy - Update histogram axes from 3 bins to 7 bins to accommodate new gap types - Add required library dependencies (SGCutParHolder, EventFilteringUtils) to CMakeLists.txt Technical details: - SGSelector uses SGCutParHolder to configure thresholds for FIT detectors (FV0A, FT0A, FT0C) - BC range checking examines multiple BCs around collision using NDtColl=1000ns and MinNBCs=7 - Gap determination now uses SGSelector::IsSelected() with proper BC range instead of simple threshold comparison - This aligns PWGHF UPC analysis with standard gap classification used in PWGUD 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6d12fc5 commit aca23b5

File tree

4 files changed

+92
-69
lines changed

4 files changed

+92
-69
lines changed

PWGHF/D2H/Tasks/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ o2physics_add_dpl_workflow(task-charm-reso-to-d-trk-reduced
7171

7272
o2physics_add_dpl_workflow(task-d0
7373
SOURCES taskD0.cxx
74-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::AnalysisCCDB
74+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::SGCutParHolder O2Physics::EventFilteringUtils
7575
COMPONENT_NAME Analysis)
7676

7777
o2physics_add_dpl_workflow(task-directed-flow-charm-hadrons
@@ -81,7 +81,7 @@ o2physics_add_dpl_workflow(task-directed-flow-charm-hadrons
8181

8282
o2physics_add_dpl_workflow(task-dplus
8383
SOURCES taskDplus.cxx
84-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
84+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::SGCutParHolder O2Physics::EventFilteringUtils
8585
COMPONENT_NAME Analysis)
8686

8787
o2physics_add_dpl_workflow(task-ds

PWGHF/D2H/Tasks/taskD0.cxx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ struct HfTaskD0 {
9797
Configurable<std::string> irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
9898

9999
// UPC gap determination thresholds
100+
Configurable<float> upcFV0AThreshold{"upcFV0AThreshold", 100.0f, "FV0-A amplitude threshold for UPC gap determination (a.u.)"};
100101
Configurable<float> upcFT0AThreshold{"upcFT0AThreshold", 100.0f, "FT0-A amplitude threshold for UPC gap determination (a.u.)"};
101102
Configurable<float> upcFT0CThreshold{"upcFT0CThreshold", 50.0f, "FT0-C amplitude threshold for UPC gap determination (a.u.)"};
102103
Configurable<float> upcZDCThreshold{"upcZDCThreshold", 1.0f, "ZDC energy threshold for UPC gap determination (a.u.)"};
103104

104105
HfEventSelection hfEvSel; // event selection and monitoring
106+
SGSelector sgSelector; // UPC gap selector
105107

106108
ctpRateFetcher mRateFetcher;
107109

@@ -158,7 +160,7 @@ struct HfTaskD0 {
158160
ConfigurableAxis thnConfigAxisMinItsNCls{"thnConfigAxisMinItsNCls", {5, 3, 8}, "axis for minimum ITS NCls of candidate prongs"};
159161
ConfigurableAxis thnConfigAxisMinTpcNCrossedRows{"thnConfigAxisMinTpcNCrossedRows", {10, 70, 180}, "axis for minimum TPC NCls crossed rows of candidate prongs"};
160162
ConfigurableAxis thnConfigAxisIR{"thnConfigAxisIR", {5000, 0, 500}, "Interaction rate (kHz)"};
161-
ConfigurableAxis thnConfigAxisGapType{"thnConfigAxisGapType", {3, -0.5, 2.5}, "axis for UPC gap type (0=GapA, 1=GapC, 2=DoubleGap)"};
163+
ConfigurableAxis thnConfigAxisGapType{"thnConfigAxisGapType", {7, -1.5, 5.5}, "axis for UPC gap type (-1=NoGap, 0=SingleGapA, 1=SingleGapC, 2=DoubleGap, 3=NoUpc, 4=TrkOutOfRange, 5=BadDoubleGap)"};
162164
ConfigurableAxis thnConfigAxisFT0A{"thnConfigAxisFT0A", {1001, -1.5, 999.5}, "axis for FT0-A amplitude (a.u.)"};
163165
ConfigurableAxis thnConfigAxisFT0C{"thnConfigAxisFT0C", {1001, -1.5, 999.5}, "axis for FT0-C amplitude (a.u.)"};
164166

@@ -371,10 +373,7 @@ struct HfTaskD0 {
371373

372374
registry.add("Data/fitInfo/ampFT0A_vs_ampFT0C", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.)", {HistType::kTH2F, {{2500, 0., 250}, {2500, 0., 250}}});
373375
registry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{200, 0., 20}, {200, 0., 20}}});
374-
registry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap side;Counts", {HistType::kTH1F, {{3, -0.5, 2.5}}});
375-
registry.get<TH1>(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast<int>(GapType::GapA) + 1, "A");
376-
registry.get<TH1>(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast<int>(GapType::GapC) + 1, "C");
377-
registry.get<TH1>(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast<int>(GapType::DoubleGap) + 1, "Double");
376+
registry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap type;Counts", {HistType::kTH1F, {{7, -1.5, 5.5}}});
378377

379378
hfEvSel.addHistograms(registry);
380379

@@ -581,15 +580,17 @@ struct HfTaskD0 {
581580
upchelpers::FITInfo fitInfo{};
582581
udhelpers::getFITinfo(fitInfo, bc, bcs, ft0s, fv0as, fdds);
583582

584-
GapType gap = GapType::DoubleGap;
583+
// Determine gap type using SGSelector with BC range checking
584+
int gap = hf_upc::determineGapType(collision, bcs, sgSelector,
585+
upcFV0AThreshold, upcFT0AThreshold, upcFT0CThreshold);
586+
585587
if (bc.has_zdc()) {
586588
const auto& zdc = bc.zdc();
587589
registry.fill(HIST("Data/fitInfo/ampFT0A_vs_ampFT0C"), fitInfo.ampFT0A, fitInfo.ampFT0C);
588590
registry.fill(HIST("Data/zdc/energyZNA_vs_energyZNC"), zdc.energyCommonZNA(), zdc.energyCommonZNC());
589-
gap = hf_upc::determineGapType(fitInfo.ampFT0A, fitInfo.ampFT0C, zdc.energyCommonZNA(), zdc.energyCommonZNC(),
590-
upcFT0AThreshold, upcFT0CThreshold, upcZDCThreshold);
591591
registry.fill(HIST("Data/hUpcGapAfterSelection"), hf_upc::gapTypeToInt(gap));
592592
}
593+
593594
if (hf_upc::isSingleSidedGap(gap)) {
594595
int const gapTypeInt = hf_upc::gapTypeToInt(gap);
595596
const auto thisCollId = collision.globalIndex();
@@ -626,11 +627,11 @@ struct HfTaskD0 {
626627
// Fill THnSparse with structure matching histogram axes: [mass, pt, (mlScores if FillMl), rapidity, d0Type, (cent if storeCentrality), (occ, ir if storeOccupancyAndIR), gapType, FT0A, FT0C]
627628
auto fillTHnData = [&](float mass, int d0Type) {
628629
// Pre-calculate vector size to avoid reallocations
629-
constexpr int nAxesBase = 7; // mass, pt, rapidity, d0Type, gapType, FT0A, FT0C
630-
constexpr int nAxesMl = FillMl ? 3 : 0; // 3 ML scores if FillMl
630+
constexpr int NAxesBase = 7; // mass, pt, rapidity, d0Type, gapType, FT0A, FT0C
631+
constexpr int NAxesMl = FillMl ? 3 : 0; // 3 ML scores if FillMl
631632
int const nAxesCent = storeCentrality ? 1 : 0; // centrality if storeCentrality
632633
int const nAxesOccIR = storeOccupancyAndIR ? 2 : 0; // occupancy and IR if storeOccupancyAndIR
633-
int const nAxesTotal = nAxesBase + nAxesMl + nAxesCent + nAxesOccIR;
634+
int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOccIR;
634635

635636
std::vector<double> valuesToFill;
636637
valuesToFill.reserve(nAxesTotal);

PWGHF/D2H/Tasks/taskDplus.cxx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "PWGHF/Core/DecayChannels.h"
2323
#include "PWGHF/Core/HfHelper.h"
2424
#include "PWGHF/Core/SelectorCuts.h"
25+
#include "PWGHF/DataModel/AliasTables.h"
2526
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
2627
#include "PWGHF/DataModel/CandidateSelectionTables.h"
2728
#include "PWGHF/DataModel/TrackIndexSkimmingTables.h"
@@ -86,11 +87,13 @@ struct HfTaskDplus {
8687
Configurable<std::string> irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
8788

8889
// UPC gap determination thresholds
90+
Configurable<float> upcFV0AThreshold{"upcFV0AThreshold", 100.0f, "FV0-A amplitude threshold for UPC gap determination (a.u.)"};
8991
Configurable<float> upcFT0AThreshold{"upcFT0AThreshold", 100.0f, "FT0-A amplitude threshold for UPC gap determination (a.u.)"};
9092
Configurable<float> upcFT0CThreshold{"upcFT0CThreshold", 50.0f, "FT0-C amplitude threshold for UPC gap determination (a.u.)"};
9193
Configurable<float> upcZDCThreshold{"upcZDCThreshold", 1.0f, "ZDC energy threshold for UPC gap determination (a.u.)"};
9294

9395
HfEventSelection hfEvSel; // event selection and monitoring
96+
SGSelector sgSelector; // UPC gap selector
9497
ctpRateFetcher mRateFetcher; // interaction rate fetcher
9598

9699
Service<o2::ccdb::BasicCCDBManager> ccdb;
@@ -132,7 +135,7 @@ struct HfTaskDplus {
132135
ConfigurableAxis thnConfigAxisMlScore0{"thnConfigAxisMlScore0", {100, 0., 1.}, "axis for ML output score 0"};
133136
ConfigurableAxis thnConfigAxisMlScore1{"thnConfigAxisMlScore1", {100, 0., 1.}, "axis for ML output score 1"};
134137
ConfigurableAxis thnConfigAxisMlScore2{"thnConfigAxisMlScore2", {100, 0., 1.}, "axis for ML output score 2"};
135-
ConfigurableAxis thnConfigAxisGapType{"thnConfigAxisGapType", {3, -0.5, 2.5}, "axis for UPC gap type (0=GapA, 1=GapC, 2=DoubleGap)"};
138+
ConfigurableAxis thnConfigAxisGapType{"thnConfigAxisGapType", {7, -1.5, 5.5}, "axis for UPC gap type (-1=NoGap, 0=SingleGapA, 1=SingleGapC, 2=DoubleGap, 3=NoUpc, 4=TrkOutOfRange, 5=BadDoubleGap)"};
136139
ConfigurableAxis thnConfigAxisFT0A{"thnConfigAxisFT0A", {1001, -1.5, 999.5}, "axis for FT0-A amplitude (a.u.)"};
137140
ConfigurableAxis thnConfigAxisFT0C{"thnConfigAxisFT0C", {1001, -1.5, 999.5}, "axis for FT0-C amplitude (a.u.)"};
138141

@@ -280,10 +283,7 @@ struct HfTaskDplus {
280283

281284
registry.add("Data/fitInfo/ampFT0A_vs_ampFT0C", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.)", {HistType::kTH2F, {{2500, 0., 250}, {2500, 0., 250}}});
282285
registry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{200, 0., 20}, {200, 0., 20}}});
283-
registry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap side;Counts", {HistType::kTH1F, {{3, -0.5, 2.5}}});
284-
registry.get<TH1>(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast<int>(GapType::GapA) + 1, "A");
285-
registry.get<TH1>(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast<int>(GapType::GapC) + 1, "C");
286-
registry.get<TH1>(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast<int>(GapType::DoubleGap) + 1, "Double");
286+
registry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap type;Counts", {HistType::kTH1F, {{7, -1.5, 5.5}}});
287287

288288
hfEvSel.addHistograms(registry); // collision monitoring
289289

@@ -716,13 +716,14 @@ struct HfTaskDplus {
716716
upchelpers::FITInfo fitInfo{};
717717
udhelpers::getFITinfo(fitInfo, bc, bcs, ft0s, fv0as, fdds);
718718

719-
GapType gap = GapType::DoubleGap;
719+
// Determine gap type using SGSelector with BC range checking
720+
int gap = hf_upc::determineGapType(collision, bcs, sgSelector,
721+
upcFV0AThreshold, upcFT0AThreshold, upcFT0CThreshold);
722+
720723
if (bc.has_zdc()) {
721724
const auto& zdc = bc.zdc();
722725
registry.fill(HIST("Data/fitInfo/ampFT0A_vs_ampFT0C"), fitInfo.ampFT0A, fitInfo.ampFT0C);
723726
registry.fill(HIST("Data/zdc/energyZNA_vs_energyZNC"), zdc.energyCommonZNA(), zdc.energyCommonZNC());
724-
gap = hf_upc::determineGapType(fitInfo.ampFT0A, fitInfo.ampFT0C, zdc.energyCommonZNA(), zdc.energyCommonZNC(),
725-
upcFT0AThreshold, upcFT0CThreshold, upcZDCThreshold);
726727
registry.fill(HIST("Data/hUpcGapAfterSelection"), hf_upc::gapTypeToInt(gap));
727728
}
728729
if (hf_upc::isSingleSidedGap(gap)) {
@@ -744,12 +745,12 @@ struct HfTaskDplus {
744745
// Lambda function to fill THn - handles both ML and non-ML cases
745746
auto fillTHnData = [&](const auto& candidate) {
746747
// Pre-calculate vector size to avoid reallocations
747-
constexpr int nAxesBase = 5; // mass, pt, gapType, FT0A, FT0C
748-
constexpr int nAxesMl = FillMl ? 3 : 0; // 3 ML scores if FillMl
748+
constexpr int NAxesBase = 5; // mass, pt, gapType, FT0A, FT0C
749+
constexpr int NAxesMl = FillMl ? 3 : 0; // 3 ML scores if FillMl
749750
int const nAxesCent = storeCentrality ? 1 : 0; // centrality if storeCentrality
750751
int const nAxesOcc = storeOccupancy ? 1 : 0; // occupancy if storeOccupancy
751752
int const nAxesIR = storeIR ? 1 : 0; // IR if storeIR
752-
int const nAxesTotal = nAxesBase + nAxesMl + nAxesCent + nAxesOcc + nAxesIR;
753+
int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOcc + nAxesIR;
753754

754755
std::vector<double> valuesToFill;
755756
valuesToFill.reserve(nAxesTotal);

PWGHF/Utils/utilsUpcHf.h

Lines changed: 66 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,87 +17,108 @@
1717
#ifndef PWGHF_UTILS_UTILSUPCHF_H_
1818
#define PWGHF_UTILS_UTILSUPCHF_H_
1919

20-
#include <cstdint>
20+
#include "PWGUD/Core/SGCutParHolder.h"
21+
#include "PWGUD/Core/SGSelector.h"
22+
#include "PWGUD/Core/UDHelpers.h"
2123

2224
namespace o2::analysis::hf_upc
2325
{
2426

25-
/// \brief Gap type classification for UPC events
26-
enum class GapType : uint8_t {
27-
GapA = 0, ///< Gap on A-side (C-side active)
28-
GapC = 1, ///< Gap on C-side (A-side active)
29-
DoubleGap = 2 ///< Double gap (both sides empty)
30-
};
27+
/// \brief Use TrueGap enum from SGSelector for gap type classification
28+
using o2::aod::sgselector::TrueGap;
3129

3230
/// \brief Default thresholds for gap determination
3331
namespace defaults
3432
{
33+
constexpr float AmplitudeThresholdFV0A = 100.0f; ///< Amplitude threshold for FV0-A (a.u.)
3534
constexpr float AmplitudeThresholdFT0A = 100.0f; ///< Amplitude threshold for FT0-A (a.u.)
3635
constexpr float AmplitudeThresholdFT0C = 50.0f; ///< Amplitude threshold for FT0-C (a.u.)
37-
constexpr float EnergyThresholdZDC = 1.0f; ///< Energy threshold for ZDC (a.u.)
36+
constexpr float MaxFITTime = 4.0f; ///< Maximum FIT time (ns)
37+
constexpr int NDtColl = 1000; ///< Time window for BC range (ns)
38+
constexpr int MinNBCs = 7; ///< Minimum number of BCs to check
39+
constexpr int MinNTracks = 0; ///< Minimum number of tracks
40+
constexpr int MaxNTracks = 100; ///< Maximum number of tracks
3841
} // namespace defaults
3942

40-
/// \brief Determine gap type based on FIT and ZDC signals
41-
/// \param ft0A FT0-A amplitude
42-
/// \param ft0C FT0-C amplitude
43-
/// \param zdcA ZDC-A (ZNA) common energy
44-
/// \param zdcC ZDC-C (ZNC) common energy
43+
/// \brief Determine gap type using SGSelector with BC range checking
44+
/// \tparam TCollision Collision type
45+
/// \tparam TBCs BC table type
46+
/// \param collision Collision object
47+
/// \param bcs BC table
48+
/// \param sgSelector SGSelector instance
49+
/// \param amplitudeThresholdFV0A Threshold for FV0-A (default: 100.0)
4550
/// \param amplitudeThresholdFT0A Threshold for FT0-A (default: 100.0)
4651
/// \param amplitudeThresholdFT0C Threshold for FT0-C (default: 50.0)
47-
/// \param energyThresholdZDC Threshold for ZDC (default: 1.0)
48-
/// \return Gap type classification
49-
inline GapType determineGapType(float ft0A, float ft0C, float zdcA, float zdcC,
50-
float amplitudeThresholdFT0A = defaults::AmplitudeThresholdFT0A,
51-
float amplitudeThresholdFT0C = defaults::AmplitudeThresholdFT0C,
52-
float energyThresholdZDC = defaults::EnergyThresholdZDC)
52+
/// \return TrueGap enum value (-1=NoGap, 0=SingleGapA, 1=SingleGapC, 2=DoubleGap, 3=NoUpc, 4=TrkOutOfRange, 5=BadDoubleGap)
53+
template <typename TCollision, typename TBCs>
54+
inline int determineGapType(TCollision const& collision,
55+
TBCs const& bcs,
56+
SGSelector& sgSelector,
57+
float amplitudeThresholdFV0A = defaults::AmplitudeThresholdFV0A,
58+
float amplitudeThresholdFT0A = defaults::AmplitudeThresholdFT0A,
59+
float amplitudeThresholdFT0C = defaults::AmplitudeThresholdFT0C)
5360
{
54-
// Gap on A-side: FT0-A empty, FT0-C active, ZNA empty, ZNC active
55-
if (ft0A < amplitudeThresholdFT0A && ft0C > amplitudeThresholdFT0C &&
56-
zdcA < energyThresholdZDC && zdcC > energyThresholdZDC) {
57-
return GapType::GapA;
58-
}
61+
// Configure SGSelector thresholds
62+
SGCutParHolder sgCuts;
63+
sgCuts.SetNDtcoll(defaults::NDtColl);
64+
sgCuts.SetMinNBCs(defaults::MinNBCs);
65+
sgCuts.SetNTracks(defaults::MinNTracks, defaults::MaxNTracks);
66+
sgCuts.SetMaxFITtime(defaults::MaxFITTime);
67+
sgCuts.SetFITAmpLimits({amplitudeThresholdFV0A, amplitudeThresholdFT0A, amplitudeThresholdFT0C});
5968

60-
// Gap on C-side: FT0-A active, FT0-C empty, ZNA active, ZNC empty
61-
if (ft0A > amplitudeThresholdFT0A && ft0C < amplitudeThresholdFT0C &&
62-
zdcA > energyThresholdZDC && zdcC < energyThresholdZDC) {
63-
return GapType::GapC;
69+
// Get BC and BC range
70+
if (!collision.has_foundBC()) {
71+
return TrueGap::NoGap;
6472
}
6573

66-
// Default: Double gap (or no clear gap)
67-
return GapType::DoubleGap;
74+
const auto bc = collision.template foundBC_as<TBCs>();
75+
const auto bcRange = udhelpers::compatibleBCs(collision, sgCuts.NDtcoll(), bcs, sgCuts.minNBCs());
76+
77+
// Use SGSelector to determine gap type with BC range checking
78+
const auto sgResult = sgSelector.IsSelected(sgCuts, collision, bcRange, bc);
79+
80+
return sgResult.value;
6881
}
6982

70-
/// \brief Check if the gap type is a single-sided gap (GapA or GapC)
71-
/// \param gap Gap type
83+
/// \brief Check if the gap type is a single-sided gap (SingleGapA or SingleGapC)
84+
/// \param gap TrueGap enum value
7285
/// \return true if single-sided gap, false otherwise
73-
inline bool isSingleSidedGap(GapType gap)
86+
inline bool isSingleSidedGap(int gap)
7487
{
75-
return (gap == GapType::GapA || gap == GapType::GapC);
88+
return (gap == TrueGap::SingleGapA || gap == TrueGap::SingleGapC);
7689
}
7790

7891
/// \brief Get gap type name as string
79-
/// \param gap Gap type
92+
/// \param gap TrueGap enum value
8093
/// \return String representation of gap type
81-
inline const char* getGapTypeName(GapType gap)
94+
inline const char* getGapTypeName(int gap)
8295
{
8396
switch (gap) {
84-
case GapType::GapA:
85-
return "GapA";
86-
case GapType::GapC:
87-
return "GapC";
88-
case GapType::DoubleGap:
97+
case TrueGap::NoGap:
98+
return "NoGap";
99+
case TrueGap::SingleGapA:
100+
return "SingleGapA";
101+
case TrueGap::SingleGapC:
102+
return "SingleGapC";
103+
case TrueGap::DoubleGap:
89104
return "DoubleGap";
105+
case TrueGap::NoUpc:
106+
return "NoUpc";
107+
case TrueGap::TrkOutOfRange:
108+
return "TrkOutOfRange";
109+
case TrueGap::BadDoubleGap:
110+
return "BadDoubleGap";
90111
default:
91112
return "Unknown";
92113
}
93114
}
94115

95116
/// \brief Convert gap type to integer for histogram filling
96-
/// \param gap Gap type
97-
/// \return Integer representation (0=GapA, 1=GapC, 2=DoubleGap)
98-
inline int gapTypeToInt(GapType gap)
117+
/// \param gap TrueGap enum value
118+
/// \return Integer representation (-1, 0, 1, 2, 3, 4, 5)
119+
inline int gapTypeToInt(int gap)
99120
{
100-
return static_cast<int>(gap);
121+
return gap;
101122
}
102123

103124
} // namespace o2::analysis::hf_upc

0 commit comments

Comments
 (0)