Skip to content

Commit 26db4bd

Browse files
committed
Rename RadFlowDecorr.cxx → radFlowDecorr.cxx and update workflow name
1 parent f8a7f12 commit 26db4bd

File tree

2 files changed

+23
-96
lines changed

2 files changed

+23
-96
lines changed

PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@ o2physics_add_dpl_workflow(part-num-fluc
8080
COMPONENT_NAME Analysis)
8181

8282
o2physics_add_dpl_workflow(radial-flow-decorr
83-
SOURCES RadFlowDecorr.cxx
83+
SOURCES radFlowDecorr.cxx
8484
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
8585
COMPONENT_NAME Analysis)

PWGCF/EbyEFluctuations/Tasks/RadFlowDecorr.cxx renamed to PWGCF/EbyEFluctuations/Tasks/radFlowDecorr.cxx

Lines changed: 22 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,11 @@ struct RadFlowDecorr {
111111
static constexpr int kNbinsDca = 400;
112112
static constexpr float kDcaMax = 0.2f;
113113
static constexpr int kNbinsPtCoarse = 50;
114-
115-
enum PID { kInclusive = 0,
116-
kCombinedPID,
117-
kNumPID };
114+
static constexpr float kPtMinDefault = 0.2f;
115+
static constexpr float kPtMidMax = 3.0f;
116+
static constexpr float kPtHighMax = 5.0f;
117+
static constexpr float kPtFullMax = 10.0f;
118+
enum PID { kInclusive = 0, kCombinedPID, kNumPID };
118119
const std::vector<std::string> pidSuffix = {"", "_PID"};
119120

120121
const std::vector<float> etaLw = {
@@ -124,20 +125,20 @@ struct RadFlowDecorr {
124125
0.8,
125126
-0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8};
126127

127-
const std::vector<float> pTLw = {0.2, 0.2, 0.2};
128-
const std::vector<float> pTUp = {3, 5.0, 10.0};
129-
//==============================
130-
//  Configurables
131-
//==============================
132-
Configurable<float> cfgVtxZCut{"cfgVtxZCut", 10.f, "z-vertex range"};
133-
Configurable<float> cfgPtMin{"cfgPtMin", 0.2f, "min pT"};
134-
Configurable<float> cfgPtMax{"cfgPtMax", 10.0f, "max pT"};
135-
Configurable<float> cfgEtaCut{"cfgEtaCut", 0.8f, "|η| cut"};
136-
Configurable<float> cfgDCAXY{"cfgDCAXY", 2.4f, "DCAxy cut"};
137-
Configurable<float> cfgDCAZ{"cfgDCAZ", 3.2f, "DCAz cut"};
138-
Configurable<float> cfgTPCClsMin{"cfgTPCClsMin", 70.f, "min TPC clusters"};
139-
Configurable<float> cfgChi2TPCMax{"cfgChi2TPCMax", 4.0f, "max TPC χ²"};
140-
Configurable<float> cfgPIDnSigmaCut{"cfgPIDnSigmaCut", 3.f, "TPC PID |nσ| cut"};
128+
const std::vector<float> pTLw = {kPtMinDefault, kPtMinDefault, kPtMinDefault};
129+
const std::vector<float> pTUp = {kPtMidMax, kPtHighMax, kPtFullMax};
130+
//==============================
131+
// Configurables
132+
//==============================
133+
Configurable<float> cfgVtxZCut{"cfgVtxZCut", 10.f, "z-vertex range"};
134+
Configurable<float> cfgPtMin{"cfgPtMin", 0.2f, "min pT"};
135+
Configurable<float> cfgPtMax{"cfgPtMax", 10.0f, "max pT"};
136+
Configurable<float> cfgEtaCut{"cfgEtaCut", 0.8f, "|η| cut"};
137+
Configurable<float> cfgDCAXY{"cfgDCAXY", 2.4f, "DCAxy cut"};
138+
Configurable<float> cfgDCAZ{"cfgDCAZ", 3.2f, "DCAz cut"};
139+
Configurable<float> cfgTPCClsMin{"cfgTPCClsMin", 70.f, "min TPC clusters"};
140+
Configurable<float> cfgChi2TPCMax{"cfgChi2TPCMax", 4.0f, "max TPC χ²"};
141+
Configurable<float> cfgPIDnSigmaCut{"cfgPIDnSigmaCut", 3.f, "TPC PID |nσ| cut"};
141142

142143
Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
143144
Configurable<float> cfgCutTpcChi2NCl{"cfgCutTpcChi2NCl", 2.5f, "Maximum TPCchi2NCl"};
@@ -413,80 +414,6 @@ struct RadFlowDecorr {
413414
return val;
414415
}
415416

416-
/*
417-
float getEfficiency(float mult, float pt, float eta, PID pidType, int effidx) const {
418-
TH3F* h;
419-
if(effidx==0) h = hEff[pidType]; // Efficiency map
420-
if(effidx==1) h = hFake[pidType]; // Fake map
421-
422-
if (!h) {
423-
LOGF(error, "getEfficiency: Histogram is null for pidType %d, effidx %d", pidType, effidx);
424-
return -1.0;
425-
}
426-
427-
const int ibx = h->GetXaxis()->FindBin(mult);
428-
const int iby = h->GetYaxis()->FindBin(pt);
429-
const int ibz = h->GetZaxis()->FindBin(eta);
430-
float val = h->GetBinContent(ibx, iby, ibz);
431-
432-
if (effidx == 1) { // This is a FAKE map
433-
// For fakes, "it's ok if it is zero"
434-
// But it's not ok if it's < 0 or >= 1. Set those to 0.
435-
if (val < 0.f || val >= 1.0) {
436-
return -1;
437-
}
438-
return val; // Return the valid fake value (which can be 0)
439-
}
440-
441-
// If we are here, this is an EFFICIENCY map (effidx == 0)
442-
// For efficiency, "it's ok if it is 1"
443-
// "but not vice versa" (i.e., val <= 0 is the problem)
444-
445-
if (val > 0.f || val<1.1) {
446-
// val > 0 is valid (including 1.0).
447-
return val;
448-
}
449-
450-
// --- PROBLEM CASE: val <= 0. We must interpolate. ---
451-
// We will scan along the pT axis (iby) to find neighbors
452-
453-
// 1. Find bin "before" (lower pT)
454-
int yBinBefore = iby - 1;
455-
float valBefore = 0.f;
456-
while (yBinBefore >= 1) {
457-
valBefore = h->GetBinContent(ibx, yBinBefore, ibz);
458-
if (valBefore > 0.f) break; // Found a valid bin
459-
yBinBefore--;
460-
}
461-
462-
// 2. Find bin "after" (higher pT)
463-
int yBinAfter = iby + 1;
464-
float valAfter = 0.f;
465-
int nBinsY = h->GetNbinsY();
466-
while (yBinAfter <= nBinsY) {
467-
valAfter = h->GetBinContent(ibx, yBinAfter, ibz);
468-
if (valAfter > 0.f) break; // Found a valid bin
469-
yBinAfter++;
470-
}
471-
472-
// 3. Interpolate/Extrapolate
473-
if (valBefore > 0.f && valAfter > 0.f) {
474-
// We found valid bins on both sides. Do linear interpolation.
475-
float m = (valAfter - valBefore) / (yBinAfter - yBinBefore);
476-
float interpolatedVal = valBefore + m * (iby - yBinBefore);
477-
return interpolatedVal;
478-
} else if (valBefore > 0.f) {
479-
// Only found a bin before. Extrapolate using that value.
480-
return valBefore;
481-
} else if (valAfter > 0.f) {
482-
// Only found a bin after. Extrapolate using that value.
483-
return valAfter;
484-
} else {
485-
return -1;
486-
}
487-
}
488-
*/
489-
// Getter for (Cent, eta, phi) maps (Flattening)
490417
float getFlatteningWeight(float cent, float eta, float phi, PID pidType) const
491418
{
492419
TH3F* h = hWeightMap3D[pidType];
@@ -900,7 +827,7 @@ return -1;
900827

901828
// --- Efficiency ---
902829
if (auto* hNum = dynamic_cast<TH3F*>(dir->Get(hEff_NumName.c_str()))) {
903-
hEff[pidType] = (TH3F*)hNum->Clone(Form("hEff%s", suffix.c_str()));
830+
hEff[pidType] = reinterpret_cast<TH3F*>(hNum->Clone(Form("hEff%s", suffix.c_str())));
904831
hEff[pidType]->SetDirectory(nullptr);
905832
if (auto* hDen = dynamic_cast<TH3F*>(dir->Get(hEff_DenName.c_str()))) {
906833
hDen->SetDirectory(nullptr);
@@ -916,7 +843,7 @@ return -1;
916843
if (auto* hNumS = dynamic_cast<TH3F*>(dir->Get(hFake_NumSecName.c_str()))) {
917844
auto* hNumF = dynamic_cast<TH3F*>(dir->Get(hFake_NumFakName.c_str()));
918845
if (hNumS && hNumF) {
919-
hFake[pidType] = (TH3F*)hNumS->Clone(Form("hFake%s", suffix.c_str()));
846+
hFake[pidType] = reinterpret_cast<TH3F*>(hNumS->Clone(Form("hFake%s", suffix.c_str())));
920847
hFake[pidType]->Add(hNumF);
921848
hFake[pidType]->SetDirectory(nullptr);
922849
if (auto* hDenF = dynamic_cast<TH3F*>(dir->Get(hFake_DenName.c_str()))) {
@@ -1017,7 +944,7 @@ return -1;
1017944
if (!f->IsZombie()) {
1018945
if (auto* dir = dynamic_cast<TDirectory*>(f->Get("rad-flow-decorr"))) {
1019946
if (auto* tp = dynamic_cast<TProfile3D*>(dir->Get(histname))) {
1020-
target = (TProfile3D*)tp->Clone();
947+
target = reinterpret_cast<TProfile3D*>(tp->Clone());
1021948
target->SetDirectory(nullptr);
1022949
} else {
1023950
LOGF(error, "Histogram %s missing in %s", histname, filename);

0 commit comments

Comments
 (0)