Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions PWGCF/GenericFramework/Tasks/flowGfwV02.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -244,22 +244,22 @@
std::array<float, 6> tofNsigmaCut;
std::array<float, 6> itsNsigmaCut;
std::array<float, 6> tpcNsigmaCut;
TH1D* hPtMid[4] = {nullptr, nullptr, nullptr, nullptr};
std::array<std::unique_ptr<TH1D>, 4> hPtMid{};
};
PIDState pidStates;

// Event selection cuts - Alex
TF1* fMultPVCutLow = nullptr;
TF1* fMultPVCutHigh = nullptr;
TF1* fMultCutLow = nullptr;
TF1* fMultCutHigh = nullptr;
TF1* fMultPVGlobalCutHigh = nullptr;
TF1* fMultGlobalV0ACutLow = nullptr;
TF1* fMultGlobalV0ACutHigh = nullptr;
TF1* fMultGlobalT0ACutLow = nullptr;
TF1* fMultGlobalT0ACutHigh = nullptr;

TF1* fPtDepDCAxy = nullptr;
std::unique_ptr<TF1> fMultPVCutLow;
std::unique_ptr<TF1> fMultPVCutHigh;
std::unique_ptr<TF1> fMultCutLow;
std::unique_ptr<TF1> fMultCutHigh;
std::unique_ptr<TF1> fMultPVGlobalCutHigh;
std::unique_ptr<TF1> fMultGlobalV0ACutLow;
std::unique_ptr<TF1> fMultGlobalV0ACutHigh;
std::unique_ptr<TF1> fMultGlobalT0ACutLow;
std::unique_ptr<TF1> fMultGlobalT0ACutHigh;

std::unique_ptr<TF1> fPtDepDCAxy;

using GFWTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFbeta, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>>;

Expand Down Expand Up @@ -361,10 +361,10 @@
o2::analysis::gfw::multGlobalPVCorrCutPars = cfgMultCorrCuts.cfgMultGlobalPVCutPars;

// Initialise pt spectra histograms for different particles
pidStates.hPtMid[PidCharged] = new TH1D("hPtMid_charged", "hPtMid_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]);
pidStates.hPtMid[PidPions] = new TH1D("hPtMid_pions", "hPtMid_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]);
pidStates.hPtMid[PidKaons] = new TH1D("hPtMid_kaons", "hPtMid_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]);
pidStates.hPtMid[PidProtons] = new TH1D("hPtMid_protons", "hPtMid_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]);
pidStates.hPtMid[PidCharged] = std::make_unique<TH1D>("hPtMid_charged", "hPtMid_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]);
pidStates.hPtMid[PidPions] = std::make_unique<TH1D>("hPtMid_pions", "hPtMid_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]);
pidStates.hPtMid[PidKaons] = std::make_unique<TH1D>("hPtMid_kaons", "hPtMid_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]);
pidStates.hPtMid[PidProtons] = std::make_unique<TH1D>("hPtMid_protons", "hPtMid_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]);
pidStates.hPtMid[PidCharged]->SetDirectory(nullptr);
pidStates.hPtMid[PidPions]->SetDirectory(nullptr);
pidStates.hPtMid[PidKaons]->SetDirectory(nullptr);
Expand Down Expand Up @@ -466,6 +466,7 @@
LOGF(error, "Configuration contains vectors of different size - check the GFWCorrConfig configurable");
fGFW->CreateRegions();
TObjArray* oba = new TObjArray();
oba->SetOwner(kTRUE);
addConfigObjectsToObjArray(oba, corrconfigs);
LOGF(info, "Number of correlators: %d", oba->GetEntries());
fFC->SetName("FlowContainer");
Expand Down Expand Up @@ -501,19 +502,19 @@
}

if (cfgUseAdditionalEventCut) {
fMultPVCutLow = new TF1("fMultPVCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100);
fMultPVCutLow = std::make_unique<TF1>("fMultPVCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100);
fMultPVCutLow->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0]));
fMultPVCutHigh = new TF1("fMultPVCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100);
fMultPVCutHigh = std::make_unique<TF1>("fMultPVCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100);
fMultPVCutHigh->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0]));
fMultCutLow = new TF1("fMultCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100);
fMultCutLow = std::make_unique<TF1>("fMultCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100);
fMultCutLow->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0]));
fMultCutHigh = new TF1("fMultCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100);
fMultCutHigh = std::make_unique<TF1>("fMultCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100);
fMultCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0]));
fMultPVGlobalCutHigh = new TF1("fMultPVGlobalCutHigh", cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction->c_str(), 0, nchbinning.back());
fMultPVGlobalCutHigh = std::make_unique<TF1>("fMultPVGlobalCutHigh", cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction->c_str(), 0, nchbinning.back());
fMultPVGlobalCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalPVCorrCutPars[0]));
}
// Set DCAxy cut
fPtDepDCAxy = new TF1("ptDepDCAxy", Form("[0]*%s", cfgTrackCuts.cfgDCAxy->c_str()), 0.001, 100);
fPtDepDCAxy = std::make_unique<TF1>("ptDepDCAxy", Form("[0]*%s", cfgTrackCuts.cfgDCAxy->c_str()), 0.001, 100);
fPtDepDCAxy->SetParameter(0, cfgTrackCuts.cfgDCAxyNSigma);
}

Expand Down Expand Up @@ -605,7 +606,7 @@
}
if (cfgPIDEfficiency) {
const std::array<std::string, 4> pidStrings = {"ch", "pi", "ka", "pr"};
for (int i = 1; i < 4; i++) {

Check failure on line 609 in PWGCF/GenericFramework/Tasks/flowGfwV02.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

cfg.mEfficiency[i] = ccdb->getForTimeStamp<TH1D>(cfgEfficiency.value + pidStrings[i], timestamp);
if (cfg.mEfficiency[i] == nullptr) {
Expand Down Expand Up @@ -843,7 +844,7 @@
int normIndex = (cfgNormalizeByCharged) ? PidCharged : pidInd; // Configured to normalize by charged particles or the selected particle
if (pidStates.hPtMid[normIndex]->Integral() > 0) {
ptFraction = pidStates.hPtMid[pidInd]->GetBinContent(i) / pidStates.hPtMid[normIndex]->Integral();
if (std::abs(val) < 1.01)

Check failure on line 847 in PWGCF/GenericFramework/Tasks/flowGfwV02.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val * ptFraction, ebyeWeight, rndm);
}
}
Expand Down Expand Up @@ -900,11 +901,11 @@
AcceptedTracks acceptedTracks{0, 0, 0, 0};
for (const auto& track : tracks) {
processTrack(track, vtxz, xaxis.multiplicity, run, acceptedTracks);
if (track.eta() > -0.4 && track.eta() < 0.4)

Check failure on line 904 in PWGCF/GenericFramework/Tasks/flowGfwV02.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pidStates.hPtMid[PidCharged]->Fill(track.pt(), getEfficiency(track, PidCharged));
// If PID is identified, fill pt spectrum for the corresponding particle
int pidInd = getNsigmaPID(track);
if (pidInd != -1 && track.eta() > -0.4 && track.eta() < 0.4) {

Check failure on line 908 in PWGCF/GenericFramework/Tasks/flowGfwV02.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (cfgPIDEfficiency)
pidStates.hPtMid[pidInd]->Fill(track.pt(), getEfficiency(track, pidInd));
else
Expand Down
Loading