Skip to content
Merged
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <TDatabasePDG.h> // FIXME
#include <TPDGCode.h> // FIXME

#include <iostream>

Check failure on line 25 in PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <iterator>
#include <string>
#include <vector>
Expand Down Expand Up @@ -338,7 +338,7 @@
template <typename Collision, typename V0>
bool SelectionV0(Collision const& collision, V0 const& candidate)
{
if (fabs(candidate.dcav0topv()) > cMaxV0DCA) {

Check failure on line 341 in PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return false;
}

Expand Down Expand Up @@ -372,7 +372,7 @@
return false;
}
}
if (fabs(CtauK0s) > cMaxV0LifeTime || candidate.mK0Short() < lowmasscutks0 || candidate.mK0Short() > highmasscutks0) {

Check failure on line 375 in PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return false;
}
return true;
Expand Down Expand Up @@ -452,25 +452,25 @@
for (int i = 0; i < 360 / 0.1; ++i) {
float sum = 0., pt = 0.;
float phiparm = (TMath::Pi() * i * 0.1) / 180.;
float nx = TMath::Cos(phiparm);

Check failure on line 455 in PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
float ny = TMath::Sin(phiparm);

Check failure on line 456 in PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
for (auto const& trk : tracks) {
pt = trk.pt();
if (spdef == 0) {
pt = 1.;
}
float phi = trk.phi();
float px = pt * TMath::Cos(phi);

Check failure on line 463 in PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
float py = pt * TMath::Sin(phi);

Check failure on line 464 in PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
// sum += pt * abs(sin(phiparm - phi));
sum += TMath::Abs(px * ny - py * nx);

Check failure on line 466 in PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
float sph = TMath::Power((sum / ptSum), 2);

Check failure on line 468 in PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (sph < tempSph)
tempSph = sph;
}

return TMath::Power(TMath::Pi() / 2., 2) * tempSph;

Check failure on line 473 in PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}

std::vector<double> BBProton, BBAntiproton, BBPion, BBAntipion, BBKaon, BBAntikaon;
Expand Down Expand Up @@ -779,7 +779,7 @@
PionTPCFinal.push_back(PionTPC.at(i1)); // Pion TPC
KaonTPCFinal.push_back(KaonTPC.at(i2)); // Kaon TPC
KaonTPCPionHypoFinal.push_back(KaonTPCPionHypo.at(i2)); // Kaon TPC
if (pairsign == 1) {
if (pairsign > 0) {
qaRegistry.fill(HIST("hInvMassf1"), F1Vector.M(), F1Vector.Pt());
numberF1 = numberF1 + 1;
for (auto iproton = protons.begin(); iproton != protons.end(); ++iproton) {
Expand Down
99 changes: 55 additions & 44 deletions PWGLF/Tasks/Resonances/f1protoncorrelation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct f1protoncorrelation {
Configurable<float> momentumTOFProton{"momentumTOFProton", 0.7, "Proton momentum TOF"};
Configurable<float> momentumProtonMax{"momentumProtonMax", 3.0, "Maximum proton momentum"};
Configurable<float> lowPtF1{"lowPtF1", 1.0, "PT cut F1"};
Configurable<int> nRot{"nRot", 4, "Number of rotational bkg"};
// Event Mixing
Configurable<int> nEvtMixing{"nEvtMixing", 10, "Number of events to mix"};
ConfigurableAxis CfgVtxBins{"CfgVtxBins", {10, -10, 10}, "Mixing bins - z-vertex"};
Expand Down Expand Up @@ -213,7 +214,7 @@ struct f1protoncorrelation {
}
float combinedTPC;
TLorentzVector F1, Proton, F1ProtonPair, Pion, Kaon, Kshort;
TLorentzVector F1Rot, PionRot, KaonKshortPair, KaonKshortPairRot;
TLorentzVector F1Rot, PionRot, KaonKshortPair;
// Process the data in same event

int currentRunNumber = -999;
Expand Down Expand Up @@ -299,7 +300,9 @@ struct f1protoncorrelation {
histos.fill(HIST("hNsigmaProtonTPC"), protontrack.protonNsigmaTPC(), Proton.Pt());
}
histos.fill(HIST("h2SameEventPtCorrelation"), relative_momentum, F1.Pt(), Proton.Pt());

if (f1track.f1SignalStat() > 0) {
// check charge
int f1Charge = f1track.f1SignalStat();
if (f1Charge == 2) {
f1Charge = -1;
Expand All @@ -312,32 +315,33 @@ struct f1protoncorrelation {
if (fillSparse) {
histos.fill(HIST("SEMassUnlike"), F1.M(), F1.Pt(), Proton.Pt(), relative_momentum, combinedTPC, pairCharge);
}
if (fillRotation) {
for (int nrotbkg = 0; nrotbkg < nRot; nrotbkg++) {
auto anglestart = 5.0 * TMath::Pi() / 6.0;
auto angleend = 7.0 * TMath::Pi() / 6.0;
auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0));
auto rotangle = anglestart + nrotbkg * anglestep;
auto rotPionPx = Pion.Px() * std::cos(rotangle) - Pion.Py() * std::sin(rotangle);
auto rotPionPy = Pion.Px() * std::sin(rotangle) + Pion.Py() * std::cos(rotangle);
PionRot.SetXYZM(rotPionPx, rotPionPy, Pion.Pz(), Pion.M());
F1Rot = PionRot + KaonKshortPair;
if (F1Rot.Pt() < 1.0) {
continue;
}
auto relative_momentum_rot = getkstar(F1Rot, Proton);
histos.fill(HIST("h2SameEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M(), pairCharge);
if (fillSparse) {
histos.fill(HIST("SEMassRot"), F1Rot.M(), F1Rot.Pt(), Proton.Pt(), relative_momentum_rot, combinedTPC, pairCharge);
}
}
}
}
if (f1track.f1SignalStat() == -1) {
histos.fill(HIST("h2SameEventInvariantMassLike_mass"), relative_momentum, F1.Pt(), F1.M(), protontrack.protonCharge());
if (fillSparse) {
histos.fill(HIST("SEMassLike"), F1.M(), F1.Pt(), Proton.Pt(), relative_momentum, combinedTPC, protontrack.protonCharge());
}
}
if (fillRotation) {
for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) {
auto anglestart = 5.0 * TMath::Pi() / 6.0;
auto angleend = 7.0 * TMath::Pi() / 6.0;
auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0));
auto rotangle = anglestart + nrotbkg * anglestep;
auto rotKKPx = KaonKshortPair.Px() * std::cos(rotangle) - KaonKshortPair.Py() * std::sin(rotangle);
auto rotKKPy = KaonKshortPair.Px() * std::sin(rotangle) + KaonKshortPair.Py() * std::cos(rotangle);
KaonKshortPairRot.SetXYZM(rotKKPx, rotKKPy, KaonKshortPair.Pz(), KaonKshortPair.M());
F1Rot = Pion + KaonKshortPairRot;
auto relative_momentum_rot = getkstar(F1Rot, Proton);
if (f1track.f1SignalStat() > 0) {
histos.fill(HIST("h2SameEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M(), protontrack.protonCharge());
if (fillSparse) {
histos.fill(HIST("SEMassRot"), F1Rot.M(), F1Rot.Pt(), Proton.Pt(), relative_momentum_rot, combinedTPC, protontrack.protonCharge());
}
}
}
}
}
}
}
Expand Down Expand Up @@ -430,15 +434,18 @@ struct f1protoncorrelation {
}
}
if (fillRotation) {
for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) {
for (int nrotbkg = 0; nrotbkg < nRot; nrotbkg++) {
auto anglestart = 5.0 * TMath::Pi() / 6.0;
auto angleend = 7.0 * TMath::Pi() / 6.0;
auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0));
auto rotangle = anglestart + nrotbkg * anglestep;
auto rotKKPx = KaonKshortPair.Px() * std::cos(rotangle) - KaonKshortPair.Py() * std::sin(rotangle);
auto rotKKPy = KaonKshortPair.Px() * std::sin(rotangle) + KaonKshortPair.Py() * std::cos(rotangle);
KaonKshortPairRot.SetXYZM(rotKKPx, rotKKPy, KaonKshortPair.Pz(), KaonKshortPair.M());
F1Rot = Pion + KaonKshortPairRot;
auto rotPionPx = Pion.Px() * std::cos(rotangle) - Pion.Py() * std::sin(rotangle);
auto rotPionPy = Pion.Px() * std::sin(rotangle) + Pion.Py() * std::cos(rotangle);
PionRot.SetXYZM(rotPionPx, rotPionPy, Pion.Pz(), Pion.M());
F1Rot = PionRot + KaonKshortPair;
if (F1Rot.Pt() < 1.0) {
continue;
}
auto relative_momentum_rot = getkstar(F1Rot, Proton);
if (t1.f1SignalStat() > 0) {
histos.fill(HIST("h2MixEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M(), 1.0);
Expand Down Expand Up @@ -538,32 +545,36 @@ struct f1protoncorrelation {
if (fillSparse) {
histos.fill(HIST("MEMassUnlike"), F1.M(), F1.Pt(), Proton.Pt(), relative_momentum, combinedTPC, pairCharge);
}

if (fillRotation) {
for (int nrotbkg = 0; nrotbkg < nRot; nrotbkg++) {
auto anglestart = 5.0 * TMath::Pi() / 6.0;
auto angleend = 7.0 * TMath::Pi() / 6.0;
auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0));
auto rotangle = anglestart + nrotbkg * anglestep;
auto rotPionPx = Pion.Px() * std::cos(rotangle) - Pion.Py() * std::sin(rotangle);
auto rotPionPy = Pion.Px() * std::sin(rotangle) + Pion.Py() * std::cos(rotangle);
PionRot.SetXYZM(rotPionPx, rotPionPy, Pion.Pz(), Pion.M());
F1Rot = PionRot + KaonKshortPair;
if (F1Rot.Pt() < 1.0) {
continue;
}
auto relative_momentum_rot = getkstar(F1Rot, Proton);
if (t1.f1SignalStat() > 0) {
histos.fill(HIST("h2MixEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M(), pairCharge);
if (fillSparse) {
histos.fill(HIST("MEMassRot"), F1Rot.M(), F1Rot.Pt(), Proton.Pt(), relative_momentum_rot, combinedTPC, pairCharge);
}
}
}
}
}
if (t1.f1SignalStat() == -1) {
histos.fill(HIST("h2MixEventInvariantMassLike_mass"), relative_momentum, F1.Pt(), F1.M(), t2.protonCharge());
if (fillSparse) {
histos.fill(HIST("MEMassLike"), F1.M(), F1.Pt(), Proton.Pt(), relative_momentum, combinedTPC, t2.protonCharge());
}
}
if (fillRotation) {
for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) {
auto anglestart = 5.0 * TMath::Pi() / 6.0;
auto angleend = 7.0 * TMath::Pi() / 6.0;
auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0));
auto rotangle = anglestart + nrotbkg * anglestep;
auto rotKKPx = KaonKshortPair.Px() * std::cos(rotangle) - KaonKshortPair.Py() * std::sin(rotangle);
auto rotKKPy = KaonKshortPair.Px() * std::sin(rotangle) + KaonKshortPair.Py() * std::cos(rotangle);
KaonKshortPairRot.SetXYZM(rotKKPx, rotKKPy, KaonKshortPair.Pz(), KaonKshortPair.M());
F1Rot = Pion + KaonKshortPairRot;
auto relative_momentum_rot = getkstar(F1Rot, Proton);
if (t1.f1SignalStat() > 0) {
histos.fill(HIST("h2MixEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M(), t2.protonCharge());
if (fillSparse) {
histos.fill(HIST("MEMassRot"), F1Rot.M(), F1Rot.Pt(), Proton.Pt(), relative_momentum_rot, combinedTPC, t2.protonCharge());
}
}
}
}
}
}
}
Expand Down
Loading