Skip to content

Commit 1383ef6

Browse files
committed
updated with suggestions
1 parent 6192bf7 commit 1383ef6

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct HfTaskElectronWeakBoson {
126126
Configurable<int> chiSqNdfMax{"chiSqNdfMax", 10, "Chi2 Max for mass reco by KF particle"};
127127

128128
// Centrality estimator configuration
129-
Configurable<int> centralityEstimator{"centralityEstimator", 2, "Centrality estimator (0=FT0A, 1=FT0C, 2=FT0M, 3=FV0A, 4=NTracksPV)"};
129+
Configurable<int> centralityEstimator{"centralityEstimator", CentralityEstimator::FT0M, "Centrality estimator"};
130130
Configurable<bool> enableCentralityAnalysis{"enableCentralityAnalysis", true, "Enable centrality-dependent analysis"};
131131
Configurable<float> centralityMin{"centralityMin", -1, "minimum cut on centrality selection"};
132132
Configurable<float> centralityMax{"centralityMax", 101, "maximum cut on centrality selection"};
@@ -196,6 +196,10 @@ struct HfTaskElectronWeakBoson {
196196
if (cfgSkimmedProcessing) {
197197
zorroSummary.setObject(zorro.getZorroSummary());
198198
}
199+
// check centrality
200+
if (centralityEstimator < CentralityEstimator::FT0A || centralityEstimator > CentralityEstimator::FV0A) {
201+
LOGF(fatal, "Invalid centrality estimator: %d", static_cast<int>(centralityEstimator.value));
202+
}
199203

200204
// add configurable for CCDB path
201205
zorro.setBaseCCDBPath(cfgCCDBPath.value);
@@ -234,7 +238,7 @@ struct HfTaskElectronWeakBoson {
234238
registry.add("hZvtx", "Z vertex", kTH1D, {axisZvtx});
235239
registry.add("hEventCounterInit", "hEventCounterInit", kTH1D, {axisCounter});
236240
registry.add("hEventCounter", "hEventCounter", kTH1D, {axisCounter});
237-
registry.add("hCentrality", "Centrality distribution", kTH1F, {axisCentrality});
241+
registry.add("hCentrality", "Centrality distribution", kTH1D, {axisCentrality});
238242
registry.add("hITSchi2", "ITS #chi^{2}", kTH1F, {axisChi2});
239243
registry.add("hTPCchi2", "TPC #chi^{2}", kTH1F, {axisChi2});
240244
registry.add("hTPCnCls", "TPC NCls", kTH1F, {axisCluster});
@@ -269,14 +273,6 @@ struct HfTaskElectronWeakBoson {
269273
registry.add("hEMCalTrigger", "EMCal trigger", kTH1D, {axisTrigger});
270274
}
271275

272-
// Centrality estimation function
273-
template <typename CollType>
274-
float getCentrality(const CollType& collision)
275-
{
276-
// Use PWGHF centrality estimation framework
277-
return o2::hf_centrality::getCentralityColl(collision, centralityEstimator);
278-
}
279-
280276
double getIsolatedCluster(const o2::aod::EMCALCluster& cluster,
281277
const SelectedClusters& clusters)
282278
{
@@ -465,7 +461,7 @@ struct HfTaskElectronWeakBoson {
465461

466462
// Calculate centrality
467463
if (enableCentralityAnalysis) {
468-
float centrality = getCentrality(collision);
464+
float centrality = o2::hf_centrality::getCentralityColl(collision, centralityEstimator);
469465
// LOG(info) << centrality;
470466
if (centrality < centralityMin || centrality > centralityMax) {
471467
return;

0 commit comments

Comments
 (0)