Skip to content

Commit 59d0769

Browse files
Maxim VirtaMaxim Virta
authored andcommitted
[PWGCF] Similar output procedure added for V02 and V0
1 parent 1fbe0d1 commit 59d0769

1 file changed

Lines changed: 114 additions & 106 deletions

File tree

PWGCF/GenericFramework/Tasks/flowGfwV02.cxx

Lines changed: 114 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//
1212
/// \file flowGfwV02.cxx
1313
/// \brief Skeleton copy of flowGfwLightIons with empty function bodies
14-
/// \author Emil Gorm Nielsen, NBI, emil.gorm.nielsen@cern.ch
14+
/// \author Maxim Virta, NBI, maxim.virta@cern.ch
1515

1616
#include "PWGCF/DataModel/CorrelationsDerived.h"
1717
#include "PWGCF/GenericFramework/Core/FlowContainer.h"
@@ -132,6 +132,7 @@ struct FlowGfwV02 {
132132
O2_DEFINE_CONFIGURABLE(cfgNormalizeByCharged, bool, true, "Enable or disable the normalization by charged particles");
133133
O2_DEFINE_CONFIGURABLE(cfgConsistentEventFlag, int, 15, "Flag for consistent event selection");
134134
O2_DEFINE_CONFIGURABLE(cfgMultCut, bool, true, "Use additional event cut on mult correlations");
135+
O2_DEFINE_CONFIGURABLE(cfgUseV02, bool, false, "Use V02 analysis");
135136
O2_DEFINE_CONFIGURABLE(cfgUseV0, bool, false, "Use V0 analysis");
136137

137138
// Event selection cuts
@@ -221,7 +222,6 @@ struct FlowGfwV02 {
221222
} cfg{};
222223

223224
// Define output
224-
OutputObj<FlowContainer> fFC{FlowContainer("FlowContainer")};
225225
HistogramRegistry registry{"registry"};
226226

227227
enum CentEstimators {
@@ -413,28 +413,42 @@ struct FlowGfwV02 {
413413
AxisSpec dcaXYAxis = {200, -0.5, 0.5, "DCA_{xy} (cm)"};
414414
AxisSpec bsAxis = {gfwMemberCache.nBootstrap, -0.5, gfwMemberCache.nBootstrap - 0.5, "Bootstrap Index"};
415415

416-
registry.add("v02pt", "", {HistType::kTProfile3D, {ptAxis, centAxis, nchAxis}});
417-
registry.add("nchMid", "", {HistType::kTProfile3D, {ptAxis, centAxis, nchAxis}});
418-
registry.add("v02centmult", "", {HistType::kTProfile2D, {centAxis, nchAxis}});
419-
416+
// V0 spectra
420417
registry.add("analysis/charged/v0AB", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}});
421418
registry.add("analysis/charged/v0BA", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}});
422419
registry.add("analysis/charged/nchA", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}});
423420
registry.add("analysis/charged/nchB", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}});
424-
registry.add("analysis/charged/ptA", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}});
425-
registry.add("analysis/charged/ptB", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}});
426-
registry.add("analysis/charged/ptAB", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}});
421+
422+
// V02 spectra
423+
registry.add("analysis/charged/v22npt", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}});
424+
registry.add("analysis/charged/nchC", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}});
425+
427426
if (cfgUseMultiplicityFracWeights) {
428427
registry.add("analysis/charged/nchA2pc", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}});
429428
registry.add("analysis/charged/nchB2pc", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}});
430-
registry.add("analysis/charged/ptA2pc", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}});
431-
registry.add("analysis/charged/ptB2pc", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}});
429+
registry.add("analysis/charged/nchC3pc", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}});
432430
}
433431

434432
registry.addClone("analysis/charged/", "analysis/pion/");
435433
registry.addClone("analysis/charged/", "analysis/kaon/");
436434
registry.addClone("analysis/charged/", "analysis/proton/");
437435

436+
// Only charged particles
437+
registry.add("analysis/charged/v22pt", "", {HistType::kTProfile2D, {bsAxis, centAxis}});
438+
registry.add("analysis/charged/ptA", "", {HistType::kTProfile2D, {bsAxis, centAxis}});
439+
registry.add("analysis/charged/ptB", "", {HistType::kTProfile2D, {bsAxis, centAxis}});
440+
registry.add("analysis/charged/ptAB", "", {HistType::kTProfile2D, {bsAxis, centAxis}});
441+
registry.add("analysis/charged/ptC", "", {HistType::kTProfile2D, {bsAxis, centAxis}});
442+
registry.add("analysis/charged/v22", "", {HistType::kTProfile2D, {bsAxis, centAxis}});
443+
444+
if (cfgUseMultiplicityFracWeights) {
445+
registry.add("analysis/charged/ptA2pc", "", {HistType::kTProfile2D, {bsAxis, centAxis}});
446+
registry.add("analysis/charged/ptB2pc", "", {HistType::kTProfile2D, {bsAxis, centAxis}});
447+
registry.add("analysis/charged/ptC3pc", "", {HistType::kTProfile2D, {bsAxis, centAxis}});
448+
registry.add("analysis/charged/v223pc", "", {HistType::kTProfile2D, {bsAxis, centAxis}});
449+
}
450+
451+
438452
ccdb->setURL("http://alice-ccdb.cern.ch");
439453
ccdb->setCaching(true);
440454
ccdb->setLocalObjectValidityChecking();
@@ -510,9 +524,6 @@ struct FlowGfwV02 {
510524
oba->SetOwner(kTRUE);
511525
addConfigObjectsToObjArray(oba, corrconfigs);
512526
LOGF(info, "Number of correlators: %d", oba->GetEntries());
513-
fFC->SetName("FlowContainer");
514-
fFC->SetXAxis(fSecondAxis.get());
515-
fFC->Initialize(oba, centAxis, cfgNbootstrap);
516527
delete oba;
517528

518529
if (cfgConsistentEventFlag != 0) {
@@ -842,45 +853,84 @@ struct FlowGfwV02 {
842853
void fillOutputContainers(const float& centmult, const int& multiplicity, const double& rndm, const int& /*run*/ = 0)
843854
{
844855
double threshold = 1.01;
845-
for (uint l_ind = 0; l_ind < corrconfigs.size(); ++l_ind) {
846-
if (!corrconfigs.at(l_ind).pTDif) {
847-
auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), 0, kTRUE).real();
848-
if (dnx == 0)
849-
continue;
850-
auto val = fGFW->Calculate(corrconfigs.at(l_ind), 0, kFALSE).real() / dnx;
851-
852-
if (std::abs(val) < threshold) {
853-
fFC->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm);
854-
}
855-
continue;
856-
}
857856

858-
// Fill pt profiles for different particles
859-
int pidInd = getPIDIndex(corrconfigs.at(l_ind).Head);
860-
861-
auto dnx = fGFW->Calculate(corrconfigs.at(0), 0, kTRUE).real();
862-
if (dnx == 0)
863-
continue;
864-
auto val = fGFW->Calculate(corrconfigs.at(0), 0, kFALSE).real() / dnx;
865-
double ebyeWeight = (cfgUseMultiplicityFlowWeights) ? dnx : 1.0;
866-
for (int i = 1; i <= fSecondAxis->GetNbins(); i++) {
867-
if (corrconfigs.at(l_ind).Head.find("nch") != std::string::npos) {
868-
ebyeWeight = 1.0;
869-
val = 1.0;
857+
// Calculate V02
858+
if (cfgUseV02) {
859+
double v22npt = 0;
860+
double ptMeanMid = pidStates.hPtMid[PidCharged]->GetMean();
861+
double ptFractionMid = 0.;
862+
int bootstrap = fRndm->Integer(gfwMemberCache.nBootstrap);
863+
double dnxAB = fGFW->Calculate(corrconfigs.at(0), 0, kTRUE).real(); // V22 weight for AB
864+
auto valAB = fGFW->Calculate(corrconfigs.at(0), 0, kFALSE).real() / dnxAB;
865+
if (std::abs(valAB) > threshold) {
866+
return;
867+
}
868+
double v22pt = valAB * ptMeanMid;
869+
double WeightAB = (cfgUseMultiplicityFlowWeights) ? dnxAB : 1.0;
870+
double WeightC = 1.0;
871+
// Calculate V02 for each particle type
872+
for (int pid = 0; pid < PidTotal; pid++) {
873+
int normIndex = (cfgNormalizeByCharged) ? PidCharged : pid;
874+
if (!(pidStates.hPtMid[normIndex]->Integral() > 0)) {
875+
continue; // Mid pT distribution is not defined
870876
}
871-
if (cfgUseMultiplicityFracWeights && pidStates.hPtMid[PidCharged]->Integral() > 0) {
872-
ebyeWeight *= pidStates.hPtMid[PidCharged]->Integral();
877+
if (cfgUseMultiplicityFracWeights) {
878+
WeightC = pidStates.hPtMid[PidCharged]->Integral(); // Mean pt/npt C weight
873879
}
874-
double ptFraction = 0;
875-
int normIndex = (cfgNormalizeByCharged) ? PidCharged : pidInd; // Configured to normalize by charged particles or the selected particle
876-
if (pidStates.hPtMid[normIndex]->Integral() > 0) {
877-
ptFraction = pidStates.hPtMid[pidInd]->GetBinContent(i) / pidStates.hPtMid[normIndex]->Integral();
878-
if (std::abs(val) < threshold)
879-
fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val * ptFraction, ebyeWeight, rndm);
880+
for (int i = 1; i <= fSecondAxis->GetNbins(); i++) {
881+
ptFractionMid = pidStates.hPtMid[pid]->GetBinContent(i) / pidStates.hPtMid[normIndex]->Integral();
882+
v22npt = valAB * ptFractionMid;
883+
884+
switch (pid) {
885+
case PidCharged:
886+
registry.fill(HIST("analysis/charged/v22npt"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v22npt, WeightC * WeightAB);
887+
registry.fill(HIST("analysis/charged/nchC"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionMid, WeightC);
888+
if (cfgUseMultiplicityFracWeights) {
889+
registry.fill(HIST("analysis/charged/nchC3pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionMid, WeightC * WeightAB);
890+
}
891+
break;
892+
case PidPions:
893+
registry.fill(HIST("analysis/pion/v22npt"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v22npt, WeightC * WeightAB);
894+
registry.fill(HIST("analysis/pion/nchC"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionMid, WeightC);
895+
if (cfgUseMultiplicityFracWeights) {
896+
registry.fill(HIST("analysis/pion/nchC3pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionMid, WeightC * WeightAB);
897+
}
898+
break;
899+
case PidKaons:
900+
registry.fill(HIST("analysis/kaon/v22npt"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v22npt, WeightC * WeightAB);
901+
registry.fill(HIST("analysis/kaon/nchC"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionMid, WeightC);
902+
if (cfgUseMultiplicityFracWeights) {
903+
registry.fill(HIST("analysis/kaon/nchC3pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionMid, WeightC * WeightAB);
904+
}
905+
break;
906+
case PidProtons:
907+
registry.fill(HIST("analysis/proton/v22npt"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v22npt, WeightC * WeightAB);
908+
registry.fill(HIST("analysis/proton/nchC"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionMid, WeightC);
909+
if (cfgUseMultiplicityFracWeights) {
910+
registry.fill(HIST("analysis/proton/nchC3pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionMid, WeightC * WeightAB);
911+
}
912+
break;
913+
default:
914+
break;
915+
}
880916
}
881917
}
882-
}
883918

919+
// Calculate NCv22pt
920+
if (cfgUseMultiplicityFracWeights) {
921+
WeightC = pidStates.hPtMid[PidCharged]->Integral();
922+
}
923+
924+
registry.fill(HIST("analysis/charged/v22pt"), bootstrap, centmult, v22pt, WeightC * WeightAB);
925+
registry.fill(HIST("analysis/charged/v22"), bootstrap, centmult, valAB, WeightAB);
926+
registry.fill(HIST("analysis/charged/ptC"), bootstrap, centmult, ptMeanMid, WeightC);
927+
if (cfgUseMultiplicityFracWeights) {
928+
registry.fill(HIST("analysis/charged/v223pc"), bootstrap, centmult, valAB, WeightC * WeightAB);
929+
registry.fill(HIST("analysis/charged/ptC3pc"), bootstrap, centmult, ptMeanMid, WeightC * WeightAB);
930+
}
931+
} // End of V02
932+
933+
// Calculate V0
884934
if (cfgUseV0) {
885935
double v0corrAB = 0;
886936
double v0corrBA = 0;
@@ -889,13 +939,13 @@ struct FlowGfwV02 {
889939
double ptFractionForward = 0.;
890940
double ptFractionBackward = 0.;
891941
int bootstrap = fRndm->Integer(gfwMemberCache.nBootstrap);
942+
double WeightA = 1.0;
943+
double WeightB = 1.0;
892944
for (int pid = 0; pid < PidTotal; pid++) {
893945
int normIndex = (cfgNormalizeByCharged) ? PidCharged : pid;
894946
if (!(pidStates.hPtForward[normIndex]->Integral() > 0) || !(pidStates.hPtBackward[normIndex]->Integral() > 0)) {
895947
continue; // Forward or backward pT distribution is not defined
896948
}
897-
double WeightA = 1.0;
898-
double WeightB = 1.0;
899949
if (cfgUseMultiplicityFracWeights) {
900950
WeightA = pidStates.hPtForward[PidCharged]->Integral();
901951
WeightB = pidStates.hPtBackward[PidCharged]->Integral();
@@ -950,65 +1000,23 @@ struct FlowGfwV02 {
9501000
break;
9511001
}
9521002
}
953-
switch (pid) {
954-
case PidCharged:
955-
registry.fill(HIST("analysis/charged/ptA"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA);
956-
registry.fill(HIST("analysis/charged/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightB);
957-
if (cfgUseMultiplicityFracWeights) {
958-
registry.fill(HIST("analysis/charged/ptA2pc"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA * WeightB);
959-
registry.fill(HIST("analysis/charged/ptB2pc"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightA * WeightB);
960-
}
961-
registry.fill(HIST("analysis/charged/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward, WeightA * WeightB);
962-
break;
963-
case PidPions:
964-
registry.fill(HIST("analysis/pion/ptA"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA);
965-
registry.fill(HIST("analysis/pion/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightB);
966-
if (cfgUseMultiplicityFracWeights) {
967-
registry.fill(HIST("analysis/pion/ptA2pc"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA * WeightB);
968-
registry.fill(HIST("analysis/pion/ptB2pc"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightA * WeightB);
969-
}
970-
registry.fill(HIST("analysis/pion/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward, WeightA * WeightB);
971-
break;
972-
case PidKaons:
973-
registry.fill(HIST("analysis/kaon/ptA"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA);
974-
registry.fill(HIST("analysis/kaon/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightB);
975-
if (cfgUseMultiplicityFracWeights) {
976-
registry.fill(HIST("analysis/kaon/ptA2pc"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA * WeightB);
977-
registry.fill(HIST("analysis/kaon/ptB2pc"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightA * WeightB);
978-
}
979-
registry.fill(HIST("analysis/kaon/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward, WeightA * WeightB);
980-
break;
981-
case PidProtons:
982-
registry.fill(HIST("analysis/proton/ptA"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA);
983-
registry.fill(HIST("analysis/proton/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightB);
984-
if (cfgUseMultiplicityFracWeights) {
985-
registry.fill(HIST("analysis/proton/ptA2pc"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA * WeightB);
986-
registry.fill(HIST("analysis/proton/ptB2pc"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightA * WeightB);
987-
}
988-
registry.fill(HIST("analysis/proton/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward, WeightA * WeightB);
989-
break;
990-
default:
991-
break;
992-
}
993-
}
994-
}
1003+
} // End of PID dependent parts of V0
9951004

996-
// Fill the profiles for each pT bin
997-
auto dnx = fGFW->Calculate(corrconfigs.at(0), 0, kTRUE).real();
998-
if (dnx == 0)
999-
return;
1000-
auto val = fGFW->Calculate(corrconfigs.at(0), 0, kFALSE).real() / dnx;
1001-
for (int i = 1; i <= fSecondAxis->GetNbins(); i++) {
1002-
double ptFraction = 0;
1003-
if (pidStates.hPtMid[PidCharged]->Integral() > 0) {
1004-
ptFraction = pidStates.hPtMid[PidCharged]->GetBinContent(i) / pidStates.hPtMid[PidCharged]->Integral();
1005-
if (std::abs(val) < threshold)
1006-
registry.fill(HIST("v02pt"), fSecondAxis->GetBinCenter(i), centmult, multiplicity, val * ptFraction, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0);
1007-
registry.fill(HIST("nchMid"), fSecondAxis->GetBinCenter(i), centmult, multiplicity, ptFraction);
1005+
// Calculate PID independent parts of V0
1006+
if (cfgUseMultiplicityFracWeights) {
1007+
WeightA = pidStates.hPtForward[PidCharged]->Integral();
1008+
WeightB = pidStates.hPtBackward[PidCharged]->Integral();
10081009
}
1009-
}
1010-
registry.fill(HIST("v02centmult"), centmult, multiplicity, val);
1011-
}
1010+
registry.fill(HIST("analysis/charged/ptA"), bootstrap, centmult, ptMeanForward, WeightA);
1011+
registry.fill(HIST("analysis/charged/ptB"), bootstrap, centmult, ptMeanBackward, WeightB);
1012+
if (cfgUseMultiplicityFracWeights) {
1013+
registry.fill(HIST("analysis/charged/ptA2pc"), bootstrap, centmult, ptMeanForward, WeightA * WeightB);
1014+
registry.fill(HIST("analysis/charged/ptB2pc"), bootstrap, centmult, ptMeanBackward, WeightA * WeightB);
1015+
}
1016+
registry.fill(HIST("analysis/charged/ptAB"), bootstrap, centmult, ptMeanForward * ptMeanBackward, WeightA * WeightB);
1017+
1018+
} // End of V0
1019+
} // End of Filling
10121020

10131021
struct XAxis {
10141022
float centrality;

0 commit comments

Comments
 (0)