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
252 changes: 161 additions & 91 deletions PWGLF/Tasks/Resonances/kstarqa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ struct kstarqa {
Configurable<int> nBins{"nBins", 100, "N bins in all histos"};

// Confugrable for QA histograms
Configurable<bool> QAbefore{"QAbefore", false, "QAbefore"};
Configurable<bool> QAafter{"QAafter", false, "QAafter"};
Configurable<bool> QAv0{"QAv0", false, "QAv0"};
Configurable<bool> onlyTPC{"onlyTPC", false, "only TPC tracks"};
Configurable<bool> QA{"QA", false, "QA"};
Configurable<bool> QAbefore{"QAbefore", true, "QAbefore"};
Configurable<bool> QAafter{"QAafter", true, "QAafter"};
Configurable<bool> onlyTPCQA{"onlyTPCQA", false, "only TPC tracks"};
Configurable<bool> onlyTOF{"onlyTOF", false, "only TOF tracks"};

// Configurable for event selection
Configurable<float>
Expand All @@ -100,8 +101,14 @@ struct kstarqa {
Configurable<float> cfgCutDCAxy{"cfgCutDCAxy", 2.0f,
"DCAxy range for tracks"};
Configurable<float> cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"};
Configurable<float> nsigmaCutTPC{"nsigmacutTPC", 3.0,
"Value of the TPC Nsigma cut"};
Configurable<float> nsigmaCutTPCPi{"nsigmacutTPCPi", 3.0,
"Value of the TPC Nsigma cut for pions"};
Configurable<float> nsigmaCutTPCKa{"nsigmacutTPCKa", 3.0,
"Value of the TPC Nsigma cut for kaons"};
Configurable<float> nsigmaCutTOFPi{"nsigmacutTOFPi", 3.0,
"Value of the TOF Nsigma cut for pions"};
Configurable<float> nsigmaCutTOFKa{"nsigmacutTOFKa", 3.0,
"Value of the TOF Nsigma cut for kaons"};
Configurable<float> nsigmaCutCombined{"nsigmaCutCombined", 3.0,
"Value of the Combined Nsigma cut"};
Configurable<int> cfgNoMixedEvents{"cfgNoMixedEvents", 5,
Expand All @@ -111,6 +118,8 @@ struct kstarqa {
Configurable<bool> iscustomDCAcut{"iscustomDCAcut", false, "iscustomDCAcut"};
Configurable<bool> ismanualDCAcut{"ismanualDCAcut", true, "ismanualDCAcut"};
Configurable<int> cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"};
Configurable<int> cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"};
Configurable<float> cfgRCRFC{"cfgRCRFC", 0.8f, "Crossed Rows to Findable Clusters"};
ConfigurableAxis cMixMultBins{"cMixMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f}, "Mixing bins - multiplicity"};
Configurable<bool> timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"};

Expand All @@ -131,31 +140,39 @@ struct kstarqa {
// for primary tracks
if (QAbefore && QAafter) {
histos.add("hNsigmaPionTPC_before", "NsigmaPion TPC distribution before",
kTH1F, {{200, -10.0f, 10.0f}});
kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}});
histos.add("hNsigmaPionTOF_before", "NsigmaPion TOF distribution before",
kTH1F, {{200, -10.0f, 10.0f}});
kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}});
histos.add("hNsigmaKaonTPC_before", "NsigmaKaon TPC distribution before",
kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}});
histos.add("hNsigmaKaonTOF_before", "NsigmaKaon TOF distribution before",
kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}});

histos.add("hEta_after", "Eta distribution", kTH1F, {{200, -1.0f, 1.0f}});
histos.add("hDcaxy_after", "Dcaxy distribution", kTH1F,
{{200, -10.0f, 10.0f}});
histos.add("hDcaz_after", "Dcaz distribution", kTH1F,
{{200, -10.0f, 10.0f}});
histos.add("hNsigmaPionTPC_after", "NsigmaPion TPC distribution", kTH1F,
{{200, -10.0f, 10.0f}});
histos.add("hNsigmaPionTOF_after", "NsigmaPion TOF distribution", kTH1F,
{{200, -10.0f, 10.0f}});
histos.add("hCRFC_after", "CRFC after distribution", kTH1F,
{{100, 0.0f, 10.0f}});
histos.add("hCRFC_before", "CRFC before distribution", kTH1F,
{{100, 0.0f, 10.0f}});
histos.add("hNsigmaPionTPC_after", "NsigmaPion TPC distribution",
kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}});
histos.add("hNsigmaPionTOF_after", "NsigmaPion TOF distribution",
kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}});
histos.add("hNsigmaKaonTPC_after", "NsigmaKaon TPC distribution",
kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}});
histos.add("hNsigmaKaonTOF_after", "NsigmaKaon TOF distribution",
kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}});
}

// CKStar histograms
histos.add("h3CKSInvMassUnlikeSign",
"Invariant mass of CKS meson Unlike Sign", kTHnSparseF,
{{200, 0.0, 200.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true);
{{100, 0.0, 1.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true);
histos.add("h3CKSInvMasslikeSign",
"Invariant mass of CKS meson like Sign", kTHnSparseF,
{{200, 0.0, 200.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true);
{{100, 0.0, 1.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true);
histos.add("h3CKSInvMassMixed", "Invariant mass of CKS meson Mixed",
kTHnSparseF,
{{200, 0.0, 200.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true);
{{100, 0.0, 1.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true);
}

double massPi = TDatabasePDG::Instance()
Expand All @@ -176,7 +193,7 @@ struct kstarqa {
!(candidate.isGlobalTrackWoDCA() && candidate.isPVContributor() &&
std::abs(candidate.dcaXY()) < cfgCutDCAxy &&
std::abs(candidate.dcaZ()) < cfgCutDCAz &&
candidate.itsNCls() > cfgITScluster)) {
candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster && candidate.tpcCrossedRowsOverFindableCls() > cfgRCRFC)) {
return false;
}
return true;
Expand All @@ -186,28 +203,47 @@ struct kstarqa {
bool selectionPID(const T& candidate, int PID)
{
if (PID == 0) {
if (candidate.hasTOF() &&
(candidate.tofNSigmaPi() * candidate.tofNSigmaPi() +
candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) <
(nsigmaCutCombined * nsigmaCutCombined)) {
return true;
}
if (onlyTPC) {
if (onlyTOF) {
if (candidate.hasTOF() &&
std::abs(candidate.tofNSigmaPi()) < nsigmaCutTOFPi) {
return true;
}
} else if (onlyTPCQA) {
if (std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) {
return true;
}
} else {
if (candidate.hasTOF() &&
(candidate.tofNSigmaPi() * candidate.tofNSigmaPi() +
candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) <
(nsigmaCutCombined * nsigmaCutCombined)) {
return true;
}
if (!candidate.hasTOF() &&
std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPC) {
std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) {
return true;
}
}
} else if (PID == 1) {
if (candidate.hasTOF() &&
(candidate.tofNSigmaKa() * candidate.tofNSigmaKa() +
candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) <
(nsigmaCutCombined * nsigmaCutCombined)) {
return true;
if (onlyTOF) {
if (candidate.hasTOF() &&
std::abs(candidate.tofNSigmaKa()) < nsigmaCutTOFKa) {
return true;
}
}
if (onlyTPC) {
if (onlyTPCQA) {
if (std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) {
return true;
}
} else {
if (candidate.hasTOF() &&
(candidate.tofNSigmaKa() * candidate.tofNSigmaKa() +
candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) <
(nsigmaCutCombined * nsigmaCutCombined)) {
return true;
}
if (!candidate.hasTOF() &&
std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC) {
std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) {
return true;
}
}
Expand Down Expand Up @@ -249,12 +285,12 @@ struct kstarqa {

using BinningTypeTPCMultiplicity =
ColumnBinningPolicy<aod::collision::PosZ, aod::mult::MultTPC>;
// using BinningTypeVertexContributor =
// ColumnBinningPolicy<aod::collision::PosZ, aod::collision::NumContrib>;
using BinningTypeCentralityM =
ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0M>;
using BinningTypeVertexContributor =
ColumnBinningPolicy<aod::collision::PosZ, aod::collision::NumContrib>;
using BinningTypeCentralityM =
ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0M>;
// using BinningTypeVertexContributor =
// ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0M>;

BinningTypeVertexContributor binningOnPositions{
{axisVertex, axisMultiplicity},
Expand All @@ -264,6 +300,13 @@ struct kstarqa {
BinningTypeVertexContributor>
pair{binningOnPositions, cfgNoMixedEvents, -1, &cache};

double totmomka = 0.0;
double totmompi = 0.0;
double totmomkamix = 0.0;
double totmompimix = 0.0;
double openingangle = 0.0;
double openinganglemix = 0.0;

void processSE(EventCandidates::iterator const& collision,
TrackCandidates const& tracks,
aod::BCs const&)
Expand All @@ -286,6 +329,15 @@ struct kstarqa {
std::vector<int64_t> PionSign = {};
std::vector<int64_t> KaonSign = {};

std::vector<double_t> PionPx = {};
std::vector<double_t> KaonPx = {};
std::vector<double_t> PionPy = {};
std::vector<double_t> KaonPy = {};
std::vector<double_t> PionPz = {};
std::vector<double_t> KaonPz = {};
std::vector<double_t> PionP = {};
std::vector<double_t> KaonP = {};

float multiplicity = 0.0f;
/* if (cfgMultFT0)
multiplicity = collision.multZeqFT0A() + collision.multZeqFT0C();
Expand All @@ -299,89 +351,98 @@ struct kstarqa {
rEventSelection.fill(HIST("hmult"), multiplicity);

for (auto track1 : tracks) {
/*

if (QAbefore) {
histos.fill(HIST("hNsigmaPionTPC_before"), track1.tpcNSigmaPi());
histos.fill(HIST("hNsigmaPionTOF_before"), track1.tofNSigmaPi());
histos.fill(HIST("hNsigmaKaonTPC_before"), track1.pt(), track1.tpcNSigmaKa());
histos.fill(HIST("hNsigmaKaonTOF_before"), track1.pt(), track1.tofNSigmaKa());
histos.fill(HIST("hCRFC_before"), track1.tpcCrossedRowsOverFindableCls());
}
*/

if (!selectionPID(track1, 1))
continue; // for primary particle PID

if (!selectionTrack(track1)) {
continue;
}

/*
if (QAafter) {
histos.fill(HIST("hEta_after"), track1.eta());
histos.fill(HIST("hDcaxy_after"), track1.dcaXY());
histos.fill(HIST("hDcaz_after"), track1.dcaZ());
histos.fill(HIST("hNsigmaPionTPC_after"), track1.tpcNSigmaPi());
histos.fill(HIST("hNsigmaPionTOF_after"), track1.tofNSigmaPi());
histos.fill(HIST("hCRFC_after"), track1.tpcCrossedRowsOverFindableCls());
histos.fill(HIST("hNsigmaKaonTPC_after"), track1.pt(), track1.tpcNSigmaKa());
histos.fill(HIST("hNsigmaKaonTOF_after"), track1.pt(), track1.tofNSigmaKa());
}
*/

if (!selectionPID(track1, 1)) // kaon
continue;

totmomka = TMath::Sqrt(track1.px() * track1.px() + track1.py() * track1.py() + track1.pz() * track1.pz());

ROOT::Math::PtEtaPhiMVector temp1(track1.pt(), track1.eta(), track1.phi(),
massKa);
kaons.push_back(temp1);
KaonIndex.push_back(track1.globalIndex());
KaoncollIndex.push_back(track1.collisionId());
KaonSign.push_back(track1.sign());
KaonPx.push_back(track1.px());
KaonPy.push_back(track1.py());
KaonPz.push_back(track1.pz());
KaonP.push_back(totmomka);

} // track loop ends

for (auto track2 : tracks) {
/*

if (QAbefore) {
histos.fill(HIST("hNsigmaPionTPC_before"), track1.tpcNSigmaPi());
histos.fill(HIST("hNsigmaPionTOF_before"), track1.tofNSigmaPi());
histos.fill(HIST("hNsigmaPionTPC_before"), track2.pt(), track2.tpcNSigmaPi());
histos.fill(HIST("hNsigmaPionTOF_before"), track2.pt(), track2.tofNSigmaPi());
}
*/

if (!selectionPID(track2, 0))
continue; // for primary particle PID

if (!selectionTrack(track2)) {
continue;
}

/*
if (QAafter) {
histos.fill(HIST("hEta_after"), track1.eta());
histos.fill(HIST("hDcaxy_after"), track1.dcaXY());
histos.fill(HIST("hDcaz_after"), track1.dcaZ());
histos.fill(HIST("hNsigmaPionTPC_after"), track1.tpcNSigmaPi());
histos.fill(HIST("hNsigmaPionTOF_after"), track1.tofNSigmaPi());
histos.fill(HIST("hNsigmaPionTPC_after"), track2.pt(), track2.tpcNSigmaPi());
histos.fill(HIST("hNsigmaPionTOF_after"), track2.pt(), track2.tofNSigmaPi());
}
*/

if (!selectionPID(track2, 0)) // pion
continue;

totmompi = TMath::Sqrt(track2.px() * track2.px() + track2.py() * track2.py() + track2.pz() * track2.pz());

ROOT::Math::PtEtaPhiMVector temp2(track2.pt(), track2.eta(), track2.phi(),
massPi);
pions.push_back(temp2);
PionIndex.push_back(track2.globalIndex());
PioncollIndex.push_back(track2.collisionId());
PionSign.push_back(track2.sign());

PionPx.push_back(track2.px());
PionPy.push_back(track2.py());
PionPz.push_back(track2.pz());
PionP.push_back(totmompi);
} // track loop ends

if (pions.size() != 0 && kaons.size() != 0) {
for (auto ikaon = kaons.begin(); ikaon != kaons.end(); ++ikaon) {
auto i1 = std::distance(kaons.begin(), ikaon);
for (auto ipion = pions.begin(); ipion != pions.end();
++ipion) {
auto i3 = std::distance(pions.begin(), ipion);

if (PionIndex.at(i3) <= KaonIndex.at(i1))
continue;
CKSVector = kaons.at(i1) + pions.at(i3);

if (TMath::Abs(CKSVector.Rapidity()) < 0.5) {
if (PionSign.at(i3) * KaonSign.at(i1) < 0)
histos.fill(HIST("h3CKSInvMassUnlikeSign"), multiplicity,
CKSVector.Pt(), CKSVector.M());
else if (PionSign.at(i3) * KaonSign.at(i1) > 0)
histos.fill(HIST("h3CKSInvMasslikeSign"), multiplicity,
CKSVector.Pt(), CKSVector.M());
if (!QA) {
if (pions.size() != 0 && kaons.size() != 0) {
for (auto ikaon = kaons.begin(); ikaon != kaons.end(); ++ikaon) {
auto i1 = std::distance(kaons.begin(), ikaon);
for (auto ipion = pions.begin(); ipion != pions.end();
++ipion) {
auto i3 = std::distance(pions.begin(), ipion);

if (PionIndex.at(i3) <= KaonIndex.at(i1))
continue;
CKSVector = kaons.at(i1) + pions.at(i3);

openingangle = TMath::Abs((PionPx.at(i3) * KaonPx.at(i1) + PionPy.at(i3) * KaonPy.at(i1) + PionPz.at(i3) * KaonPz.at(i1)) / (PionP.at(i3) * KaonP.at(i1)));
// openingangle = (PionPx.at(i3)*KaonPx.at(i1) + PionPy.at(i3)*KaonPy.at(i1) + PionPz.at(i3)*KaonPz.at(i1));
// LOG(info) << "opening angle" << openingangle;
if (TMath::Abs(CKSVector.Rapidity()) < 0.5) {
if (PionSign.at(i3) * KaonSign.at(i1) < 0)
histos.fill(HIST("h3CKSInvMassUnlikeSign"), openingangle,
CKSVector.Pt(), CKSVector.M());
else if (PionSign.at(i3) * KaonSign.at(i1) > 0)
histos.fill(HIST("h3CKSInvMasslikeSign"), openingangle,
CKSVector.Pt(), CKSVector.M());
}
}
}
}
Expand Down Expand Up @@ -411,9 +472,9 @@ struct kstarqa {
float multiplicity = 0.0f;
/* if (cfgMultFT0)
multiplicity = c1.multZeqFT0A() + c1.multZeqFT0C();
if (cfgMultFT0 == 0 && cfgCentFT0C == 1)
if (cfgMultFT0 == 0 && cfgCentFT0C == 1)
multiplicity = c1.centFT0C();
if (cfgMultFT0 == 0 && cfgCentFT0C == 0)*/
if (cfgMultFT0 == 0 && cfgCentFT0C == 0)*/
multiplicity = c1.centFT0M();

for (auto& [t1, t2] : o2::soa::combinations(
Expand All @@ -433,12 +494,21 @@ struct kstarqa {
TLorentzVector PION;
PION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi);

totmompimix = TMath::Sqrt(t2.px() * t2.px() + t2.py() * t2.py() + t2.pz() * t2.pz());
totmomkamix = TMath::Sqrt(t1.px() * t1.px() + t1.py() * t1.py() + t1.pz() * t1.pz());

openinganglemix = TMath::Abs((t1.px() * t2.px() + t1.py() * t2.py() + t1.pz() * t2.pz()) / (totmomkamix * totmompimix));

// LOG(info) << "mix angle" << openinganglemix;

TLorentzVector CKSmix = KAON + PION;

if (TMath::Abs(CKSmix.Rapidity()) < 0.5) {
if (t1.sign() * t2.sign() < 0)
histos.fill(HIST("h3CKSInvMassMixed"), multiplicity, CKSmix.Pt(),
CKSmix.M());
if (!QA) {
if (TMath::Abs(CKSmix.Rapidity()) < 0.5) {
if (t1.sign() * t2.sign() < 0)
histos.fill(HIST("h3CKSInvMassMixed"), openingangle, CKSmix.Pt(),
CKSmix.M());
}
}
}
}
Expand Down