Skip to content

Commit b2545bc

Browse files
Merge pull request #27 from alibuild/alibot-cleanup-12205
Please consider the following formatting changes to #12205
2 parents 6dcfbb1 + 45b6697 commit b2545bc

File tree

1 file changed

+65
-57
lines changed

1 file changed

+65
-57
lines changed

PWGLF/TableProducer/Strangeness/cascadeflow.cxx

Lines changed: 65 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ using V0Candidates = soa::Join<aod::V0CollRefs, aod::V0Cores, aod::V0Extras>;
5151
using CascCandidates = soa::Join<aod::CascCollRefs, aod::CascCores, aod::CascExtras, aod::CascBBs>;
5252
using CascMCCandidates = soa::Join<aod::CascCollRefs, aod::CascCores, aod::CascExtras, aod::CascBBs, aod::CascCoreMCLabels>;
5353

54-
const int nParticles = 2; //Xi, Omega
55-
const int nCharges = 2; //Lambda, AntiLambda
54+
const int nParticles = 2; // Xi, Omega
55+
const int nCharges = 2; // Lambda, AntiLambda
5656
const int nParameters = 4;
5757

5858
namespace cascadev2
@@ -238,7 +238,7 @@ struct cascadeFlow {
238238
Configurable<float> rapidityLambda{"rapidityLambda", 0.5, "rapidityLambda"};
239239
Configurable<float> etaLambda{"etaLambda", 0.8, "etaLambda"};
240240
} V0Configs;
241-
241+
242242
Configurable<double> sideBandStart{"sideBandStart", 5, "Start of the sideband region in number of sigmas"};
243243
Configurable<double> sideBandEnd{"sideBandEnd", 7, "End of the sideband region in number of sigmas"};
244244
Configurable<double> downsample{"downsample", 1., "Downsample training output tree"};
@@ -399,7 +399,7 @@ struct cascadeFlow {
399399
// TPC cuts as those implemented for the training of the signal
400400
if (doNTPCSigmaCut) {
401401
if (std::abs(posExtra.tpcNSigmaPr()) > nsigmatpcPr || std::abs(negExtra.tpcNSigmaPi()) > nsigmatpcPi)
402-
return false;
402+
return false;
403403
}
404404
counter++;
405405

@@ -415,7 +415,7 @@ struct cascadeFlow {
415415
// TPC cuts as those implemented for the training of the signal
416416
if (doNTPCSigmaCut) {
417417
if (std::abs(negExtra.tpcNSigmaPr()) > nsigmatpcPr || std::abs(posExtra.tpcNSigmaPi()) > nsigmatpcPi)
418-
return false;
418+
return false;
419419
}
420420
counter++;
421421

@@ -427,7 +427,7 @@ struct cascadeFlow {
427427
}
428428

429429
template <typename TV0>
430-
bool isV0TopoAccepted(TV0 v0)
430+
bool isV0TopoAccepted(TV0 v0)
431431
{
432432
// topological selections
433433
if (v0.v0radius() < V0Configs.v0radius)
@@ -447,7 +447,7 @@ struct cascadeFlow {
447447
return false;
448448
if (std::abs(v0.eta()) > V0Configs.etaLambda)
449449
return false;
450-
450+
451451
return true;
452452
}
453453

@@ -587,7 +587,7 @@ struct cascadeFlow {
587587
TList* listAcceptancePrimaryLambda = ccdb->get<TList>(acceptancePathsCCDBPrimaryLambda);
588588
if (!listAcceptancePrimaryLambda)
589589
LOG(fatal) << "Problem getting TList object with acceptance for Primary Lambda!";
590-
590+
591591
hAcceptanceXi = static_cast<TH2F*>(listAcceptanceXi->FindObject(Form("%s", acceptanceHistoNameCasc->data())));
592592
if (!hAcceptanceXi) {
593593
LOG(fatal) << "The histogram for Xi is not there!";
@@ -621,7 +621,7 @@ struct cascadeFlow {
621621
const AxisSpec massCascAxis[2]{{static_cast<int>((maxMass[0] - minMass[0]) / 0.001f), minMass[0], maxMass[0], "#Xi candidate mass (GeV/c^{2})"},
622622
{static_cast<int>((maxMass[1] - minMass[1]) / 0.001f), minMass[1], maxMass[1], "#Omega candidate mass (GeV/c^{2})"}};
623623
const AxisSpec massLambdaAxis[2]{{static_cast<int>((maxMassLambda[0] - minMassLambda[0]) / 0.001f), minMassLambda[0], maxMassLambda[0], "#Lambda candidate mass (GeV/c^{2})"},
624-
{static_cast<int>((maxMassLambda[1] - minMassLambda[1]) / 0.001f), minMassLambda[1], maxMassLambda[1], "#bar{#Lambda} candidate mass (GeV/c^{2})"}};
624+
{static_cast<int>((maxMassLambda[1] - minMassLambda[1]) / 0.001f), minMassLambda[1], maxMassLambda[1], "#bar{#Lambda} candidate mass (GeV/c^{2})"}};
625625
const AxisSpec ptAxisCasc{static_cast<int>((CandidateConfigs.MaxPt - CandidateConfigs.MinPt) / 0.2), CandidateConfigs.MinPt, CandidateConfigs.MaxPt, "#it{p}_{T} (GeV/#it{c})"};
626626
const AxisSpec ptAxisLambda{static_cast<int>((V0Configs.MaxPtV0 - V0Configs.MinPtV0) / 0.2), V0Configs.MinPtV0, V0Configs.MaxPtV0, "#it{p}_{T} (GeV/#it{c})"};
627627
const AxisSpec v2Axis{200, -1., 1., "#it{v}_{2}"};
@@ -764,7 +764,7 @@ struct cascadeFlow {
764764
if (fillingConfigs.isFillTHN_Pz)
765765
histos.add("hLambdaPzVsPsi", "THn for cosTheta of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPtLambda, thnAxisMassLambda, thnAxisCosThetaProtonAlpha, thnAxisPsiDiff});
766766
if (fillingConfigs.isFillTHN_Acc)
767-
histos.add("hLambdaCos2ThetaVsPsi", "THn for cos2Theta of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPtLambda, thnAxisMassLambda,thnAxisCos2Theta, thnAxisPsiDiff});
767+
histos.add("hLambdaCos2ThetaVsPsi", "THn for cos2Theta of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPtLambda, thnAxisMassLambda, thnAxisCos2Theta, thnAxisPsiDiff});
768768
}
769769

770770
histosMCGen.add("h2DGenXiEta08", "h2DGenXiEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}});
@@ -1500,17 +1500,19 @@ struct cascadeFlow {
15001500

15011501
std::vector<float> bdtScore[nParticles];
15021502
for (auto const& v0 : V0s) {
1503-
1503+
15041504
/// Add some minimal cuts for single track variables (min number of TPC clusters)
15051505
auto negExtra = v0.negTrackExtra_as<DauTracks>();
15061506
auto posExtra = v0.posTrackExtra_as<DauTracks>();
15071507

15081508
int counter = 0;
15091509
bool isLambdaCandidate = 0;
15101510
bool isALambdaCandidate = 0;
1511-
if (isLambdaAccepted(negExtra, posExtra, counter)) isLambdaCandidate = 1;
1512-
if (isAntiLambdaAccepted(negExtra, posExtra, counter)) isALambdaCandidate = 1;
1513-
1511+
if (isLambdaAccepted(negExtra, posExtra, counter))
1512+
isLambdaCandidate = 1;
1513+
if (isAntiLambdaAccepted(negExtra, posExtra, counter))
1514+
isALambdaCandidate = 1;
1515+
15141516
// pt cut
15151517
if (v0.pt() < V0Configs.MinPtV0 || v0.pt() > V0Configs.MaxPtV0) {
15161518
continue;
@@ -1520,34 +1522,39 @@ struct cascadeFlow {
15201522
lambdav2::hMassBeforeSelVsPt[0]->Fill(massV0[0], v0.pt());
15211523
lambdav2::hMassBeforeSelVsPt[1]->Fill(massV0[1], v0.pt());
15221524

1523-
bool isSelectedV0[2]{false, false};
1524-
if (isV0TopoAccepted(v0) && isLambdaCandidate) isSelectedV0[0] = true;
1525-
if (isV0TopoAccepted(v0) && isALambdaCandidate) isSelectedV0[1] = true;
1525+
bool isSelectedV0[2]{false, false};
1526+
if (isV0TopoAccepted(v0) && isLambdaCandidate)
1527+
isSelectedV0[0] = true;
1528+
if (isV0TopoAccepted(v0) && isALambdaCandidate)
1529+
isSelectedV0[1] = true;
15261530

15271531
int ChargeIndex = -1;
1528-
if (isSelectedV0[0] && !isSelectedV0[1]) { //Lambdas
1529-
histos.fill(HIST("hLambdaCandidate"), 0);
1530-
ChargeIndex = 0;
1532+
if (isSelectedV0[0] && !isSelectedV0[1]) { // Lambdas
1533+
histos.fill(HIST("hLambdaCandidate"), 0);
1534+
ChargeIndex = 0;
15311535
}
1532-
if (isSelectedV0[1] && !isSelectedV0[0]) { //AntiLambdas
1533-
histos.fill(HIST("hLambdaCandidate"), 1);
1534-
ChargeIndex = 1;
1536+
if (isSelectedV0[1] && !isSelectedV0[0]) { // AntiLambdas
1537+
histos.fill(HIST("hLambdaCandidate"), 1);
1538+
ChargeIndex = 1;
15351539
}
15361540
if (isSelectedV0[0] && isSelectedV0[1]) {
1537-
histos.fill(HIST("hLambdaCandidate"), 2);
1538-
if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) {
1539-
histos.fill(HIST("hLambdaCandidate"), 3);
1540-
continue; //in case of ambiguity between Lambda and AntiLambda, I skip the particle
1541-
}
1542-
if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda) ChargeIndex = 0;
1543-
else if (v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) ChargeIndex = 1;
1544-
else {
1545-
histos.fill(HIST("hLambdaCandidate"), 4);
1546-
continue; //in case of ambiguity between Lambda and AntiLambda, I skip the particle
1547-
}
1541+
histos.fill(HIST("hLambdaCandidate"), 2);
1542+
if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) {
1543+
histos.fill(HIST("hLambdaCandidate"), 3);
1544+
continue; // in case of ambiguity between Lambda and AntiLambda, I skip the particle
1545+
}
1546+
if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda)
1547+
ChargeIndex = 0;
1548+
else if (v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda)
1549+
ChargeIndex = 1;
1550+
else {
1551+
histos.fill(HIST("hLambdaCandidate"), 4);
1552+
continue; // in case of ambiguity between Lambda and AntiLambda, I skip the particle
1553+
}
15481554
}
1549-
if (!isSelectedV0[0] && !isSelectedV0[1]) continue;
1550-
1555+
if (!isSelectedV0[0] && !isSelectedV0[1])
1556+
continue;
1557+
15511558
ROOT::Math::XYZVector lambdaQvec{std::cos(2 * v0.phi()), std::sin(2 * v0.phi()), 0};
15521559
auto v2CSP = lambdaQvec.Dot(eventplaneVecT0C); // not normalised by amplitude
15531560
auto lambdaminuspsiT0C = GetPhiInRange(v0.phi() - PsiT0C);
@@ -1561,8 +1568,10 @@ struct cascadeFlow {
15611568
lambdaVector.SetCoordinates(v0.px(), v0.py(), v0.pz(), massLambda);
15621569
ROOT::Math::Boost lambdaBoost{lambdaVector.BoostToCM()};
15631570
for (int i{0}; i < nCharges; ++i) {
1564-
if (i==0) protonVector[i].SetCoordinates(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassProton);
1565-
else protonVector[i].SetCoordinates(v0.pxneg(), v0.pyneg(), v0.pzneg(), o2::constants::physics::MassProton);
1571+
if (i == 0)
1572+
protonVector[i].SetCoordinates(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassProton);
1573+
else
1574+
protonVector[i].SetCoordinates(v0.pxneg(), v0.pyneg(), v0.pzneg(), o2::constants::physics::MassProton);
15661575
auto boostedProton{lambdaBoost(protonVector[i])};
15671576
cosThetaStarProton[i] = boostedProton.Pz() / boostedProton.P();
15681577
}
@@ -1578,14 +1587,13 @@ struct cascadeFlow {
15781587
double Cos2ThetaLambda = 0;
15791588
double CosThetaLambda = 0;
15801589
if (ChargeIndex == 0) {
1581-
Pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda;
1582-
Cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0];
1583-
CosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda;
1584-
}
1585-
else {
1586-
Pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda;
1587-
Cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1];
1588-
CosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda;
1590+
Pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda;
1591+
Cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0];
1592+
CosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda;
1593+
} else {
1594+
Pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda;
1595+
Cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1];
1596+
CosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda;
15891597
}
15901598

15911599
histos.fill(HIST("hv2CEPvsFT0C"), coll.centFT0C(), v2CEP);
@@ -1594,19 +1602,19 @@ struct cascadeFlow {
15941602
histos.fill(HIST("hlambdaminuspsiT0C"), lambdaminuspsiT0C);
15951603

15961604
if (fillingConfigs.isFillTHNLambda) {
1597-
if (fillingConfigs.isFillTHN_V2)
1598-
histos.get<THn>(HIST("hLambdaV2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), v2CEP);
1599-
if (fillingConfigs.isFillTHN_Pz){
1600-
histos.get<THn>(HIST("hLambdaPzs2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), Pzs2Lambda);
1601-
}
1602-
if (fillingConfigs.isFillTHN_Acc)
1603-
histos.get<THn>(HIST("hLambdaCos2Theta"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda);
1605+
if (fillingConfigs.isFillTHN_V2)
1606+
histos.get<THn>(HIST("hLambdaV2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), v2CEP);
1607+
if (fillingConfigs.isFillTHN_Pz) {
1608+
histos.get<THn>(HIST("hLambdaPzs2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), Pzs2Lambda);
1609+
}
1610+
if (fillingConfigs.isFillTHN_Acc)
1611+
histos.get<THn>(HIST("hLambdaCos2Theta"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda);
16041612
}
16051613
if (fillingConfigs.isFillTHNLambda_PzVsPsi) {
1606-
if (fillingConfigs.isFillTHN_Pz)
1607-
histos.get<THn>(HIST("hLambdaPzVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), CosThetaLambda, 2 * lambdaminuspsiT0C);
1608-
if (fillingConfigs.isFillTHN_Acc)
1609-
histos.get<THn>(HIST("hLambdaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda, 2 * lambdaminuspsiT0C);
1614+
if (fillingConfigs.isFillTHN_Pz)
1615+
histos.get<THn>(HIST("hLambdaPzVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), CosThetaLambda, 2 * lambdaminuspsiT0C);
1616+
if (fillingConfigs.isFillTHN_Acc)
1617+
histos.get<THn>(HIST("hLambdaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda, 2 * lambdaminuspsiT0C);
16101618
}
16111619
}
16121620
}

0 commit comments

Comments
 (0)