Skip to content

Commit 2dbcac7

Browse files
authored
[PWGHF] UPC utils: Make SGSelector parameters configurable (#14923)
1 parent cd4fa62 commit 2dbcac7

File tree

2 files changed

+35
-20
lines changed

2 files changed

+35
-20
lines changed

PWGHF/D2H/Tasks/taskLc.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ struct HfTaskLc {
265265
addHistogramsRec("hDecLenErrVsPt", "decay length error (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, 0., 1.}, {vbins}}});
266266

267267
if (isUpc) {
268-
qaRegistry.add("Data/fitInfo/ampFT0A_vs_ampFT0C", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.)", {HistType::kTH2F, {{1500, 0., 1500}, {1500, 0., 1500}}});
269-
qaRegistry.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}}});
268+
qaRegistry.add("Data/fitInfo/ampFT0A_vs_ampFT0C", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.)", {HistType::kTH2F, {{500, 0., 500}, {500, 0., 500}}});
269+
qaRegistry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{100, 0., 10}, {100, 0., 10}}});
270270
qaRegistry.add("Data/zdc/timeZNA_vs_timeZNC", "ZNA vs ZNC time;ZNA Time;ZNC time", {HistType::kTH2F, {{200, -10., 10}, {200, -10., 10}}});
271271
qaRegistry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap side;Counts", {HistType::kTH1F, {{7, -1.5, 5.5}}});
272272
}

PWGHF/Utils/utilsUpcHf.h

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/// \brief Utility functions for Ultra-Peripheral Collision (UPC) analysis in Heavy Flavor physics
1414
///
1515
/// \author Minjung Kim <minjung.kim@cern.ch>, CERN
16+
/// \author Ran Tu <ran.tu@cern.ch>, Fudan University, GSI Darmstadt
1617

1718
#ifndef PWGHF_UTILS_UTILSUPCHF_H_
1819
#define PWGHF_UTILS_UTILSUPCHF_H_
@@ -32,28 +33,32 @@ namespace o2::analysis::hf_upc
3233
/// \brief Use TrueGap enum from SGSelector for gap type classification
3334
using o2::aod::sgselector::TrueGap;
3435

35-
/// \brief Configurable group for UPC gap determination thresholds
36-
struct HfUpcGapThresholds : o2::framework::ConfigurableGroup {
37-
std::string prefix = "upc"; // JSON group name
38-
o2::framework::Configurable<float> fv0aThreshold{"fv0aThreshold", 100.0f, "FV0-A amplitude threshold for UPC gap determination (a.u.)"};
39-
o2::framework::Configurable<float> ft0aThreshold{"ft0aThreshold", 100.0f, "FT0-A amplitude threshold for UPC gap determination (a.u.)"};
40-
o2::framework::Configurable<float> ft0cThreshold{"ft0cThreshold", 50.0f, "FT0-C amplitude threshold for UPC gap determination (a.u.)"};
41-
o2::framework::Configurable<float> zdcThreshold{"zdcThreshold", 1.0f, "ZDC energy threshold for UPC gap determination (a.u.)"};
42-
};
43-
4436
/// \brief Default thresholds for gap determination
4537
namespace defaults
4638
{
4739
constexpr float AmplitudeThresholdFV0A = 100.0f; ///< Amplitude threshold for FV0-A (a.u.)
4840
constexpr float AmplitudeThresholdFT0A = 100.0f; ///< Amplitude threshold for FT0-A (a.u.)
4941
constexpr float AmplitudeThresholdFT0C = 50.0f; ///< Amplitude threshold for FT0-C (a.u.)
50-
constexpr float MaxFITTime = 4.0f; ///< Maximum FIT time (ns)
51-
constexpr int NDtColl = 1000; ///< Time window for BC range (ns)
52-
constexpr int MinNBCs = 7; ///< Minimum number of BCs to check
53-
constexpr int MinNTracks = 0; ///< Minimum number of tracks
54-
constexpr int MaxNTracks = 100; ///< Maximum number of tracks
42+
constexpr float MaxFITTime = 34.0f; ///< Maximum FIT time (ns)
43+
constexpr int NDtColl = 1; ///< Time window for BC range (ns)
44+
constexpr int MinNBCs = 2; ///< Minimum number of BCs to check
45+
constexpr int MinNTracks = 2; ///< Minimum number of tracks
46+
constexpr int MaxNTracks = 1000; ///< Maximum number of tracks
5547
} // namespace defaults
5648

49+
/// \brief Configurable group for UPC gap determination thresholds
50+
struct HfUpcGapThresholds : o2::framework::ConfigurableGroup {
51+
std::string prefix = "upc"; // JSON group name
52+
o2::framework::Configurable<int> nDtColl{"nDtColl", static_cast<int>(defaults::NDtColl), "Number of standard deviations to consider in BC range"};
53+
o2::framework::Configurable<int> nBcsMin{"nBcsMin", static_cast<int>(defaults::MinNBCs), "Minimum number of BCs to consider in BC range"};
54+
o2::framework::Configurable<int> nContributorsPvMin{"nContributorsPvMin", static_cast<int>(defaults::MinNTracks), "Minimum number of PV contributors"};
55+
o2::framework::Configurable<int> nContributorsPvMax{"nContributorsPvMax", static_cast<int>(defaults::MaxNTracks), "Maximum number of PV contributors"};
56+
o2::framework::Configurable<float> timeFitMax{"timeFitMax", static_cast<float>(defaults::MaxFITTime), "Maximum time in FIT"};
57+
o2::framework::Configurable<float> fv0aThreshold{"fv0aThreshold", static_cast<float>(defaults::AmplitudeThresholdFV0A), "FV0-A amplitude threshold for UPC gap determination (a.u.)"};
58+
o2::framework::Configurable<float> ft0aThreshold{"ft0aThreshold", static_cast<float>(defaults::AmplitudeThresholdFT0A), "FT0-A amplitude threshold for UPC gap determination (a.u.)"};
59+
o2::framework::Configurable<float> ft0cThreshold{"ft0cThreshold", static_cast<float>(defaults::AmplitudeThresholdFT0C), "FT0-C amplitude threshold for UPC gap determination (a.u.)"};
60+
};
61+
5762
/// \brief Determine gap type using SGSelector with BC range checking
5863
/// \tparam TCollision Collision type
5964
/// \tparam TBCs BC table type
@@ -66,6 +71,11 @@ constexpr int MaxNTracks = 100; ///< Maximum number of tracks
6671
template <typename TCollision, typename TBCs>
6772
inline auto determineGapType(TCollision const& collision,
6873
TBCs const& bcs,
74+
int nDtColl = defaults::NDtColl,
75+
int nBcsMin = defaults::MinNBCs,
76+
int nContributorsPvMin = defaults::MinNTracks,
77+
int nContributorsPvMax = defaults::MaxNTracks,
78+
float timeFitMax = defaults::MaxFITTime,
6979
float amplitudeThresholdFV0A = defaults::AmplitudeThresholdFV0A,
7080
float amplitudeThresholdFT0A = defaults::AmplitudeThresholdFT0A,
7181
float amplitudeThresholdFT0C = defaults::AmplitudeThresholdFT0C)
@@ -74,10 +84,10 @@ inline auto determineGapType(TCollision const& collision,
7484

7585
// Configure SGSelector thresholds
7686
SGCutParHolder sgCuts;
77-
sgCuts.SetNDtcoll(defaults::NDtColl);
78-
sgCuts.SetMinNBCs(defaults::MinNBCs);
79-
sgCuts.SetNTracks(defaults::MinNTracks, defaults::MaxNTracks);
80-
sgCuts.SetMaxFITtime(defaults::MaxFITTime);
87+
sgCuts.SetNDtcoll(nDtColl);
88+
sgCuts.SetMinNBCs(nBcsMin);
89+
sgCuts.SetNTracks(nContributorsPvMin, nContributorsPvMax);
90+
sgCuts.SetMaxFITtime(timeFitMax);
8191
sgCuts.SetFITAmpLimits({amplitudeThresholdFV0A, amplitudeThresholdFT0A, amplitudeThresholdFT0C});
8292

8393
// Get BC and BC range
@@ -108,6 +118,11 @@ inline auto determineGapType(TCollision const& collision,
108118
HfUpcGapThresholds const& thresholds)
109119
{
110120
return determineGapType(collision, bcs,
121+
thresholds.nDtColl.value,
122+
thresholds.nBcsMin.value,
123+
thresholds.nContributorsPvMin.value,
124+
thresholds.nContributorsPvMax.value,
125+
thresholds.timeFitMax.value,
111126
thresholds.fv0aThreshold.value,
112127
thresholds.ft0aThreshold.value,
113128
thresholds.ft0cThreshold.value);

0 commit comments

Comments
 (0)