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
188 changes: 129 additions & 59 deletions PWGLF/Tasks/Strangeness/lambdapolsp.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
Configurable<std::string> ConfNUA{"ConfNUA", "Users/p/prottay/My/Object/NUAwgtschk", "Path to NUA"};

Configurable<bool> fillnominal{"fillnominal", true, "flag to fill default histograms"};
Configurable<bool> filldefwithsyst{"filldefwithsyst", true, "flag to fill default histograms in syst"};
} QAgrp;

struct : ConfigurableGroup {
Expand Down Expand Up @@ -348,7 +347,7 @@

if (checkwithpub) {
if (useprofile == 2) {
histos.add("hpuxQxpvscentpteta", "hpuxQxpvscentpteta", HistType::kTHnSparseF, {axisGrp.configcentAxis, axisGrp.configthnAxispT, axisGrp.configetaAxis, spAxis}, true);

Check failure on line 350 in PWGLF/Tasks/Strangeness/lambdapolsp.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.
histos.add("hpuyQypvscentpteta", "hpuyQypvscentpteta", HistType::kTHnSparseF, {axisGrp.configcentAxis, axisGrp.configthnAxispT, axisGrp.configetaAxis, spAxis}, true);
histos.add("hpuxQxtvscentpteta", "hpuxQxtvscentpteta", HistType::kTHnSparseF, {axisGrp.configcentAxis, axisGrp.configthnAxispT, axisGrp.configetaAxis, spAxis}, true);
histos.add("hpuyQytvscentpteta", "hpuyQytvscentpteta", HistType::kTHnSparseF, {axisGrp.configcentAxis, axisGrp.configthnAxispT, axisGrp.configetaAxis, spAxis}, true);
Expand Down Expand Up @@ -500,7 +499,18 @@
histos.add("hpQxytpvscent", "hpQxytpvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true);
histos.add("hpQxtQypvscent", "hpQxtQypvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true);
histos.add("hpQxpQytvscent", "hpQxpQytvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true);

histos.add("hSparseLambdaPolSP_xAwgt", "hSparseLambdaPolSP_xAwgt", HistType::kTHnSparseF, runaxes, true);
histos.add("hSparseLambdaPolSP_yAwgt", "hSparseLambdaPolSP_yAwgt", HistType::kTHnSparseF, runaxes, true);
histos.add("hSparseLambdaPolSP_xCwgt", "hSparseLambdaPolSP_xCwgt", HistType::kTHnSparseF, runaxes, true);
histos.add("hSparseLambdaPolSP_yCwgt", "hSparseLambdaPolSP_yCwgt", HistType::kTHnSparseF, runaxes, true);

histos.add("hSparseAntiLambdaPolSP_xAwgt", "hSparseAntiLambdaPolSP_xAwgt", HistType::kTHnSparseF, runaxes, true);
histos.add("hSparseAntiLambdaPolSP_yAwgt", "hSparseAntiLambdaPolSP_yAwgt", HistType::kTHnSparseF, runaxes, true);
histos.add("hSparseAntiLambdaPolSP_xCwgt", "hSparseAntiLambdaPolSP_xCwgt", HistType::kTHnSparseF, runaxes, true);
histos.add("hSparseAntiLambdaPolSP_yCwgt", "hSparseAntiLambdaPolSP_yCwgt", HistType::kTHnSparseF, runaxes, true);
}

if (usesubdet) {
histos.add("hSparseLambdaCosPsiA", "hSparseLambdaCosPsiA", HistType::kTHnSparseF, runaxes, true);
histos.add("hSparseLambdaSinPsiA", "hSparseLambdaSinPsiA", HistType::kTHnSparseF, runaxes, true);
Expand Down Expand Up @@ -545,12 +555,12 @@
// histos.add("hSparseLambda_corr2b", "hSparseLambda_corr2b", HistType::kTHnSparseF, runaxes, true);
histos.add("hSparseAntiLambda_corr2a", "hSparseAntiLambda_corr2a", HistType::kTHnSparseF, runaxes, true);
// histos.add("hSparseAntiLambda_corr2b", "hSparseAntiLambda_corr2b", HistType::kTHnSparseF, runaxes, true);
if (randGrp.useSP) {
/*if (randGrp.useSP) {
histos.add("hSparseAntiLambda_avgux", "hSparseAntiLambda_avgux", HistType::kTHnSparseF, {thnAxisInvMass, axisGrp.configthnAxispT, axisGrp.configthnAxisPol, axisGrp.configcentAxis}, true);
histos.add("hSparseAntiLambda_avguy", "hSparseAntiLambda_avguy", HistType::kTHnSparseF, {thnAxisInvMass, axisGrp.configthnAxispT, axisGrp.configthnAxisPol, axisGrp.configcentAxis}, true);
histos.add("hSparseLambda_avgux", "hSparseLambda_avgux", HistType::kTHnSparseF, {thnAxisInvMass, axisGrp.configthnAxispT, axisGrp.configthnAxisPol, axisGrp.configcentAxis}, true);
histos.add("hSparseLambda_avguy", "hSparseLambda_avguy", HistType::kTHnSparseF, {thnAxisInvMass, axisGrp.configthnAxispT, axisGrp.configthnAxisPol, axisGrp.configcentAxis}, true);
}
}*/
}

if (distGrp.filldist) {
Expand Down Expand Up @@ -647,7 +657,7 @@
const float hi = std::max(a, b);

if (std::abs(hi - lo) < 1.e-12f) {
return lo;

Check failure on line 660 in PWGLF/Tasks/Strangeness/lambdapolsp.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.
}

return systRnd.Uniform(lo, hi);
Expand Down Expand Up @@ -720,6 +730,14 @@
HistType::kTHnSparseF,
runaxesSyst,
true);

histos.add("hSparseAntiLambda_corr1aSyst", "hSparseAntiLambda_corr1aSyst", HistType::kTHnSparseF, runaxesSyst, true);
histos.add("hSparseAntiLambda_corr1bSyst", "hSparseAntiLambda_corr1bSyst", HistType::kTHnSparseF, runaxesSyst, true);
histos.add("hSparseAntiLambda_corr2aSyst", "hSparseAntiLambda_corr2aSyst", HistType::kTHnSparseF, runaxesSyst, true);

histos.add("hSparseLambda_corr1aSyst", "hSparseLambda_corr1aSyst", HistType::kTHnSparseF, runaxesSyst, true);
histos.add("hSparseLambda_corr1bSyst", "hSparseLambda_corr1bSyst", HistType::kTHnSparseF, runaxesSyst, true);
histos.add("hSparseLambda_corr2aSyst", "hSparseLambda_corr2aSyst", HistType::kTHnSparseF, runaxesSyst, true);
}
}

Expand Down Expand Up @@ -1002,11 +1020,11 @@
while (result < 0) {
// result = result + 2. * TMath::Pi();
result = result + 2. * o2::constants::math::PI;
}

Check failure on line 1023 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
while (result > 2. * TMath::Pi()) {
// result = result - 2. * TMath::Pi();

Check failure on line 1025 in PWGLF/Tasks/Strangeness/lambdapolsp.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.
result = result - 2. * o2::constants::math::PI;
}*/

Check failure on line 1027 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
return result;
}

Expand Down Expand Up @@ -1080,6 +1098,20 @@
auto PolSP_A = uy * modqxZDCA - ux * modqyZDCA; // u_y QxA - u_x QyA
auto PolSP_C = uy * modqxZDCC - ux * modqyZDCC; // u_y QxC - u_x QyC

// SP numerator components separately
auto PolSP_xA = -ux * modqyZDCA;
auto PolSP_yA = uy * modqxZDCA;

auto PolSP_xC = -ux * modqyZDCC;
auto PolSP_yC = uy * modqxZDCC;

// acceptance-corrected versions
auto PolSP_xAwgt = PolSP_xA / acvalue;
auto PolSP_yAwgt = PolSP_yA / acvalue;

auto PolSP_xCwgt = PolSP_xC / acvalue;
auto PolSP_yCwgt = PolSP_yC / acvalue;

if (randGrp.useSP) {
Pol = PolSP;
PolA = PolSP_A;
Expand All @@ -1088,6 +1120,7 @@
PolAwgt = PolSP_A / acvalue;
PolCwgt = PolSP_C / acvalue;
}

//////////////////////////////

if (QAgrp.fillnominal) {
Expand Down Expand Up @@ -1116,9 +1149,28 @@
histos.fill(HIST("hSparseAntiLambda_corr2a"), candmass, candpt, sinThetaStar, centrality, desbinvalue, wgtfactor);
// histos.fill(HIST("hSparseAntiLambda_corr2b"), candmass, candpt, sinThetaStarcosphiphiStar, centrality, desbinvalue, wgtfactor);
if (randGrp.useSP) {
histos.fill(HIST("hSparseAntiLambda_avgux"), candmass, candpt, ux, centrality);
histos.fill(HIST("hSparseAntiLambda_avguy"), candmass, candpt, uy, centrality);
// histos.fill(HIST("hSparseAntiLambda_avgux"), candmass, candpt, ux, centrality);
// histos.fill(HIST("hSparseAntiLambda_avguy"), candmass, candpt, uy, centrality);

histos.fill(HIST("hSparseAntiLambdaPolwgt"), candmass, candpt, Polwgt, centrality, desbinvalue, wgtfactor);

histos.fill(HIST("hSparseAntiLambdaPolSP_xAwgt"),
candmass, candpt, PolSP_xAwgt,
centrality, desbinvalue, wgtfactor);

histos.fill(HIST("hSparseAntiLambdaPolSP_yAwgt"),
candmass, candpt, PolSP_yAwgt,
centrality, desbinvalue, wgtfactor);

histos.fill(HIST("hSparseAntiLambdaPolSP_xCwgt"),
candmass, candpt, PolSP_xCwgt,
centrality, desbinvalue, wgtfactor);

histos.fill(HIST("hSparseAntiLambdaPolSP_yCwgt"),
candmass, candpt, PolSP_yCwgt,
centrality, desbinvalue, wgtfactor);
}

} else {
if (usesubdet) {
histos.fill(HIST("hSparseAntiLambdaCosPsiA"), candmass, candpt, (TMath::Cos(GetPhiInRange(psiZDCA))), centrality, wgtfactor);
Expand All @@ -1142,8 +1194,26 @@
histos.fill(HIST("hSparseAntiLambda_corr2a"), candmass, candpt, sinThetaStar, centrality, wgtfactor);
// histos.fill(HIST("hSparseAntiLambda_corr2b"), candmass, candpt, sinThetaStarcosphiphiStar, centrality, wgtfactor);
if (randGrp.useSP) {
histos.fill(HIST("hSparseAntiLambda_avgux"), candmass, candpt, ux, centrality);
histos.fill(HIST("hSparseAntiLambda_avguy"), candmass, candpt, uy, centrality);
// histos.fill(HIST("hSparseAntiLambda_avgux"), candmass, candpt, ux, centrality);
// histos.fill(HIST("hSparseAntiLambda_avguy"), candmass, candpt, uy, centrality);

histos.fill(HIST("hSparseAntiLambdaPolwgt"), candmass, candpt, Polwgt, centrality, wgtfactor);

histos.fill(HIST("hSparseAntiLambdaPolSP_xAwgt"),
candmass, candpt, PolSP_xAwgt,
centrality, wgtfactor);

histos.fill(HIST("hSparseAntiLambdaPolSP_yAwgt"),
candmass, candpt, PolSP_yAwgt,
centrality, wgtfactor);

histos.fill(HIST("hSparseAntiLambdaPolSP_xCwgt"),
candmass, candpt, PolSP_xCwgt,
centrality, wgtfactor);

histos.fill(HIST("hSparseAntiLambdaPolSP_yCwgt"),
candmass, candpt, PolSP_yCwgt,
centrality, wgtfactor);
}
}
}
Expand Down Expand Up @@ -1171,8 +1241,26 @@
histos.fill(HIST("hSparseLambda_corr2a"), candmass, candpt, sinThetaStar, centrality, desbinvalue, wgtfactor);
// histos.fill(HIST("hSparseLambda_corr2b"), candmass, candpt, sinThetaStarcosphiphiStar, centrality, desbinvalue, wgtfactor);
if (randGrp.useSP) {
histos.fill(HIST("hSparseLambda_avgux"), candmass, candpt, ux, centrality);
histos.fill(HIST("hSparseLambda_avguy"), candmass, candpt, uy, centrality);
// histos.fill(HIST("hSparseLambda_avgux"), candmass, candpt, ux, centrality);
// histos.fill(HIST("hSparseLambda_avguy"), candmass, candpt, uy, centrality);

histos.fill(HIST("hSparseLambdaPolwgt"), candmass, candpt, Polwgt, centrality, desbinvalue, wgtfactor);

histos.fill(HIST("hSparseLambdaPolSP_xAwgt"),
candmass, candpt, PolSP_xAwgt,
centrality, desbinvalue, wgtfactor);

histos.fill(HIST("hSparseLambdaPolSP_yAwgt"),
candmass, candpt, PolSP_yAwgt,
centrality, desbinvalue, wgtfactor);

histos.fill(HIST("hSparseLambdaPolSP_xCwgt"),
candmass, candpt, PolSP_xCwgt,
centrality, desbinvalue, wgtfactor);

histos.fill(HIST("hSparseLambdaPolSP_yCwgt"),
candmass, candpt, PolSP_yCwgt,
centrality, desbinvalue, wgtfactor);
}
} else {
if (usesubdet) {
Expand All @@ -1197,8 +1285,26 @@
histos.fill(HIST("hSparseLambda_corr2a"), candmass, candpt, sinThetaStar, centrality, wgtfactor);
// histos.fill(HIST("hSparseLambda_corr2b"), candmass, candpt, sinThetaStarcosphiphiStar, centrality, wgtfactor);
if (randGrp.useSP) {
histos.fill(HIST("hSparseLambda_avgux"), candmass, candpt, ux, centrality);
histos.fill(HIST("hSparseLambda_avguy"), candmass, candpt, uy, centrality);
// histos.fill(HIST("hSparseLambda_avgux"), candmass, candpt, ux, centrality);
// histos.fill(HIST("hSparseLambda_avguy"), candmass, candpt, uy, centrality);

histos.fill(HIST("hSparseLambdaPolwgt"), candmass, candpt, Polwgt, centrality, wgtfactor);

histos.fill(HIST("hSparseLambdaPolSP_xAwgt"),
candmass, candpt, PolSP_xAwgt,
centrality, wgtfactor);

histos.fill(HIST("hSparseLambdaPolSP_yAwgt"),
candmass, candpt, PolSP_yAwgt,
centrality, wgtfactor);

histos.fill(HIST("hSparseLambdaPolSP_xCwgt"),
candmass, candpt, PolSP_xCwgt,
centrality, wgtfactor);

histos.fill(HIST("hSparseLambdaPolSP_yCwgt"),
candmass, candpt, PolSP_yCwgt,
centrality, wgtfactor);
}
}
}
Expand All @@ -1208,7 +1314,7 @@
!systIDs->empty()) {

for (const auto isyst : *systIDs) {

Check failure on line 1317 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
// Lambda
if (systSpecies == 1) {

Expand All @@ -1223,18 +1329,9 @@
static_cast<double>(isyst),
wgtfactor);

histos.fill(HIST("hSparseLambdaPolwgtSyst"),
candmass,
candpt,
Polwgt,
centrality,
desbinvalue,
static_cast<double>(isyst),
wgtfactor);
if (QAgrp.filldefwithsyst) {
histos.fill(HIST("hSparseLambdaPol"), candmass, candpt, Pol, centrality, desbinvalue, wgtfactor);
histos.fill(HIST("hSparseLambdaPolwgt"), candmass, candpt, Polwgt, centrality, desbinvalue, wgtfactor);
}
histos.fill(HIST("hSparseLambda_corr1aSyst"), candmass, candpt, sinPhiStar, centrality, desbinvalue, static_cast<double>(isyst), wgtfactor);
histos.fill(HIST("hSparseLambda_corr1bSyst"), candmass, candpt, cosPhiStar, centrality, desbinvalue, static_cast<double>(isyst), wgtfactor);
histos.fill(HIST("hSparseLambda_corr2aSyst"), candmass, candpt, sinThetaStar, centrality, desbinvalue, static_cast<double>(isyst), wgtfactor);

} else {

Expand All @@ -1246,24 +1343,15 @@
static_cast<double>(isyst),
wgtfactor);

histos.fill(HIST("hSparseLambdaPolwgtSyst"),
candmass,
candpt,
Polwgt,
centrality,
static_cast<double>(isyst),
wgtfactor);

if (QAgrp.filldefwithsyst) {
histos.fill(HIST("hSparseLambdaPol"), candmass, candpt, Pol, centrality, wgtfactor);
histos.fill(HIST("hSparseLambdaPolwgt"), candmass, candpt, Polwgt, centrality, wgtfactor);
}
histos.fill(HIST("hSparseLambda_corr1aSyst"), candmass, candpt, sinPhiStar, centrality, static_cast<double>(isyst), wgtfactor);
histos.fill(HIST("hSparseLambda_corr1bSyst"), candmass, candpt, cosPhiStar, centrality, static_cast<double>(isyst), wgtfactor);
histos.fill(HIST("hSparseLambda_corr2aSyst"), candmass, candpt, sinThetaStar, centrality, static_cast<double>(isyst), wgtfactor);
}
}

// AntiLambda
if (systSpecies == 2) {

Check failure on line 1354 in PWGLF/Tasks/Strangeness/lambdapolsp.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 (needetaaxis) {

histos.fill(HIST("hSparseAntiLambdaPolSyst"),
Expand All @@ -1275,18 +1363,9 @@
static_cast<double>(isyst),
wgtfactor);

histos.fill(HIST("hSparseAntiLambdaPolwgtSyst"),
candmass,
candpt,
Polwgt,
centrality,
desbinvalue,
static_cast<double>(isyst),
wgtfactor);
if (QAgrp.filldefwithsyst) {
histos.fill(HIST("hSparseAntiLambdaPol"), candmass, candpt, Pol, centrality, desbinvalue, wgtfactor);
histos.fill(HIST("hSparseAntiLambdaPolwgt"), candmass, candpt, Polwgt, centrality, desbinvalue, wgtfactor);
}
histos.fill(HIST("hSparseAntiLambda_corr1aSyst"), candmass, candpt, sinPhiStar, centrality, desbinvalue, static_cast<double>(isyst), wgtfactor);
histos.fill(HIST("hSparseAntiLambda_corr1bSyst"), candmass, candpt, cosPhiStar, centrality, desbinvalue, static_cast<double>(isyst), wgtfactor);
histos.fill(HIST("hSparseAntiLambda_corr2aSyst"), candmass, candpt, sinThetaStar, centrality, desbinvalue, static_cast<double>(isyst), wgtfactor);

} else {

Expand All @@ -1298,18 +1377,9 @@
static_cast<double>(isyst),
wgtfactor);

histos.fill(HIST("hSparseAntiLambdaPolwgtSyst"),
candmass,
candpt,
Polwgt,
centrality,
static_cast<double>(isyst),
wgtfactor);

if (QAgrp.filldefwithsyst) {
histos.fill(HIST("hSparseAntiLambdaPol"), candmass, candpt, Pol, centrality, wgtfactor);
histos.fill(HIST("hSparseAntiLambdaPolwgt"), candmass, candpt, Polwgt, centrality, wgtfactor);
}
histos.fill(HIST("hSparseAntiLambda_corr1aSyst"), candmass, candpt, sinPhiStar, centrality, static_cast<double>(isyst), wgtfactor);
histos.fill(HIST("hSparseAntiLambda_corr1bSyst"), candmass, candpt, cosPhiStar, centrality, static_cast<double>(isyst), wgtfactor);
histos.fill(HIST("hSparseAntiLambda_corr2aSyst"), candmass, candpt, sinThetaStar, centrality, static_cast<double>(isyst), wgtfactor);
}
}
}
Expand Down Expand Up @@ -1355,9 +1425,9 @@
else if (centestim == 1)
centrality = collision.centFT0M();
else if (centestim == 2)
centrality = collision.centFT0A();

Check failure on line 1428 in PWGLF/Tasks/Strangeness/lambdapolsp.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.
else if (centestim == 3)
centrality = collision.centFV0A();

Check failure on line 1430 in PWGLF/Tasks/Strangeness/lambdapolsp.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.

// histos.fill(HIST("hCentrality0"), centrality);
if (!collision.triggereventsp()) {
Expand Down Expand Up @@ -1711,7 +1781,7 @@
}

if (TMath::Abs(v0.eta()) > 0.8)
continue;

Check failure on line 1784 in PWGLF/Tasks/Strangeness/lambdapolsp.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.

int taga = LambdaTag;
int tagb = aLambdaTag;
Expand Down
Loading