Skip to content
Closed
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
154 changes: 117 additions & 37 deletions PWGLF/Tasks/Resonances/kstarqa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ struct Kstarqa {

struct : ConfigurableGroup {
// Configurables for event selections
Configurable<bool> isCheckMotherClosure{"isCheckMotherClosure", false, "Check mother globalid in MC for closure"};
Configurable<bool> isSquarePIDcut{"isSquarePIDcut", false, "Apply square PID cut"};
Configurable<bool> isINELgt0{"isINELgt0", true, "INEL>0 selection"};
Configurable<bool> isINELgt0Gen{"isINELgt0Gen", false, "Apply INEL>0 in Gen direclty from collisions in addition to already applied from pwglf::inelGt"};
Expand Down Expand Up @@ -406,6 +407,7 @@ struct Kstarqa {

rEventSelection.add("tracksCheckData", "No. of events in the data", kTH1I, {{10, 0, 10}});
rEventSelection.add("eventsCheckGen", "No. of events in the generated MC", kTH1I, {{10, 0, 10}});
rEventSelection.add("eventsCheckRec", "No. of events in the generated MC", kTH1I, {{5, 0, 5}});
rEventSelection.add("recMCparticles", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}});
rEventSelection.add("hOccupancy", "Occupancy distribution", kTH1F, {{1000, 0, 15000}});

Expand Down Expand Up @@ -439,11 +441,16 @@ struct Kstarqa {

std::shared_ptr<TH1> hGenTracks = rEventSelection.get<TH1>(HIST("eventsCheckGen"));
hGenTracks->GetXaxis()->SetBinLabel(1, "All events");
hGenTracks->GetXaxis()->SetBinLabel(2, "INELgt0+vtz");
hGenTracks->GetXaxis()->SetBinLabel(2, "Vz cut");
hGenTracks->GetXaxis()->SetBinLabel(3, "INELgt0");
hGenTracks->GetXaxis()->SetBinLabel(4, "All Collisions");
hGenTracks->GetXaxis()->SetBinLabel(5, "Gen events with at least 1 rec event");
hGenTracks->GetXaxis()->SetBinLabel(6, "Rec events");
hGenTracks->GetXaxis()->SetBinLabel(4, "PWGlf:INELgt0");
hGenTracks->GetXaxis()->SetBinLabel(5, "Atleat 1rec");

std::shared_ptr<TH1> hRecTracks = rEventSelection.get<TH1>(HIST("eventsCheckRec"));
hRecTracks->GetXaxis()->SetBinLabel(1, "All events");
hRecTracks->GetXaxis()->SetBinLabel(2, "has_MCcollision");
hRecTracks->GetXaxis()->SetBinLabel(3, "INELgt0");
hRecTracks->GetXaxis()->SetBinLabel(4, "Event_Selection");

// Multplicity distribution
if (cQAevents) {
Expand Down Expand Up @@ -658,7 +665,15 @@ struct Kstarqa {
return true;
}
} else {
<<<<<<< HEAD
<<<<<<< HEAD
if (!configGp.isSquarePIDcut) {
=======
if (!isSquarePIDcut) {
>>>>>>> 935384c59 (added square PID cut)
=======
if (!configGp.isSquarePIDcut) {
>>>>>>> 2e2ba799d (added configurable group)
if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (std::pow(configGp.nsigmaCutCombinedPi, 2))) {
return true;
}
Expand All @@ -681,7 +696,15 @@ struct Kstarqa {
return true;
}
} else {
<<<<<<< HEAD
<<<<<<< HEAD
if (!configGp.isSquarePIDcut) {
=======
if (!isSquarePIDcut) {
>>>>>>> 935384c59 (added square PID cut)
=======
if (!configGp.isSquarePIDcut) {
>>>>>>> 2e2ba799d (added configurable group)
if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedKa, 2))) {
return true;
}
Expand Down Expand Up @@ -736,7 +759,15 @@ struct Kstarqa {
return true;
}
} else {
<<<<<<< HEAD
<<<<<<< HEAD
if (!configGp.isSquarePIDcut) {
=======
if (!isSquarePIDcut) {
>>>>>>> 935384c59 (added square PID cut)
=======
if (!configGp.isSquarePIDcut) {
>>>>>>> 2e2ba799d (added configurable group)
if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (std::pow(configGp.nsigmaCutCombinedMID, 2))) {
return true;
}
Expand All @@ -759,7 +790,15 @@ struct Kstarqa {
return true;
}
} else {
<<<<<<< HEAD
<<<<<<< HEAD
if (!configGp.isSquarePIDcut) {
=======
if (!isSquarePIDcut) {
>>>>>>> 935384c59 (added square PID cut)
=======
if (!configGp.isSquarePIDcut) {
>>>>>>> 2e2ba799d (added configurable group)
if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedMID, 2))) {
return true;
}
Expand Down Expand Up @@ -858,7 +897,15 @@ struct Kstarqa {
return true;
}
}
<<<<<<< HEAD
<<<<<<< HEAD
if (!configGp.isSquarePIDcut) {
=======
if (!isSquarePIDcut) {
>>>>>>> 935384c59 (added square PID cut)
=======
if (!configGp.isSquarePIDcut) {
>>>>>>> 2e2ba799d (added configurable group)
if (candidate.pt() >= configGp.lowPtCutPID && std::abs(candidate.tpcNSigmaPi()) < configGp.nsigmaCutTPCPi && candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (std::pow(configGp.nsigmaCutCombinedPi, 2))) {
return true;
}
Expand Down Expand Up @@ -894,7 +941,15 @@ struct Kstarqa {
return true;
}
}
<<<<<<< HEAD
<<<<<<< HEAD
if (!configGp.isSquarePIDcut) {
=======
if (!isSquarePIDcut) {
>>>>>>> 935384c59 (added square PID cut)
=======
if (!configGp.isSquarePIDcut) {
>>>>>>> 2e2ba799d (added configurable group)
if (candidate.pt() >= configGp.lowPtCutPID && candidate.hasTOF()) {
if (candidate.pt() < ptCut2 && std::abs(candidate.tpcNSigmaKa()) < configGp.nsigmaCutTPCKa && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedKa, 2))) {
return true;
Expand Down Expand Up @@ -936,7 +991,15 @@ struct Kstarqa {
return true;
}
} else {
<<<<<<< HEAD
<<<<<<< HEAD
if (!configGp.isSquarePIDcut) {
=======
if (!isSquarePIDcut) {
>>>>>>> 935384c59 (added square PID cut)
=======
if (!configGp.isSquarePIDcut) {
>>>>>>> 2e2ba799d (added configurable group)
if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (configGp.nsigmaCutCombinedPi * configGp.nsigmaCutCombinedPi)) {
return true;
}
Expand All @@ -958,7 +1021,15 @@ struct Kstarqa {
return true;
}
} else {
<<<<<<< HEAD
<<<<<<< HEAD
if (!configGp.isSquarePIDcut) {
=======
if (!isSquarePIDcut) {
>>>>>>> 935384c59 (added square PID cut)
=======
if (!configGp.isSquarePIDcut) {
>>>>>>> 2e2ba799d (added configurable group)
if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedKa, 2))) {
return true;
}
Expand Down Expand Up @@ -1443,7 +1514,9 @@ struct Kstarqa {

void processSEMC(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/)
{
// auto oldindex = -999;
if (configGp.isCheckMotherClosure) {
auto oldindex = -999;
}
if (!collision.has_mcCollision()) {
return;
}
Expand Down Expand Up @@ -1580,45 +1653,48 @@ struct Kstarqa {
hPID.fill(HIST("After/hNsigma_TPC_TOF_Pi_after"), track2.tpcNSigmaPi(), track2.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, track2.pt());
}

// for (const auto& mothertrack1 : mctrack1.mothers_as<aod::McParticles>()) {
// for (const auto& mothertrack2 : mctrack2.mothers_as<aod::McParticles>()) {
if (configGp.isCheckMotherClosure) {
for (const auto& mothertrack1 : mctrack1.mothers_as<aod::McParticles>()) {
for (const auto& mothertrack2 : mctrack2.mothers_as<aod::McParticles>()) {

// if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) {
// continue;
// }
if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) {
continue;
}

// if (!mothertrack1.producedByGenerator()) {
// continue;
// }
if (!mothertrack1.producedByGenerator()) {
continue;
}

// if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) {
// continue;
// }
// rEventSelection.fill(HIST("recMCparticles"), 11.5);
if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) {
continue;
}
rEventSelection.fill(HIST("recMCparticles"), 11.5);

// oldindex = mothertrack1.globalIndex();
oldindex = mothertrack1.globalIndex();

// daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
// daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
// mother = daughter1 + daughter2; // Kstar meson
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
mother = daughter1 + daughter2; // Kstar meson

// hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
// hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());
hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());

// isMix = false;
// fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
// }
// }
isMix = false;
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
}
}
} else {

daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
mother = daughter1 + daughter2; // Kstar meson
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
mother = daughter1 + daughter2; // Kstar meson

hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());
hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());

isMix = false;
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
isMix = false;
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
}
}
}
PROCESS_SWITCH(Kstarqa, processSEMC, "Process same event in MC", false);
Expand All @@ -1633,10 +1709,12 @@ struct Kstarqa {
if (configGp.isApplyMCGenVz && std::abs(mcCollision.posZ()) > configGp.cutzvertex) {
return;
}
rEventSelection.fill(HIST("eventsCheckGen"), 1.5);

if (configGp.isINELgt0Gen && !mcCollision.isInelGt0()) {
return;
}
rEventSelection.fill(HIST("eventsCheckGen"), 2.5);

std::vector<int64_t> selectedEvents(collisions.size());
int nevts = 0;
Expand All @@ -1651,10 +1729,9 @@ struct Kstarqa {
if (configGp.isINELgt0 && !isINELgt0true) {
return;
}
rEventSelection.fill(HIST("eventsCheckGen"), 2.5);
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);

for (const auto& collision : collisions) {
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);

if (!selectionEvent(collision, false)) { // don't fill event cut histogram
continue;
Expand Down Expand Up @@ -1944,10 +2021,12 @@ struct Kstarqa {

void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, EventMCGenerated const&)
{
rEventSelection.fill(HIST("eventsCheckRec"), 0.5);

if (!collision.has_mcCollision()) {
return;
}
rEventSelection.fill(HIST("eventsCheckRec"), 1.5);

double multiplicityRec = -1.0;
// multiplicityRec = collision.mcCollision_as<EventMCGenerated>().centFT0M();
Expand All @@ -1957,6 +2036,7 @@ struct Kstarqa {
if (configGp.isINELgt0 && !collision.isInelGt0()) {
return;
}
rEventSelection.fill(HIST("eventsCheckRec"), 2.5);
// multiplicity = collision.centFT0M();

if (cSelectMultEstimator == kFT0M) {
Expand All @@ -1977,8 +2057,8 @@ struct Kstarqa {
if (!selectionEvent(collision, true)) { // fill MC event cut histogram
return;
}
rEventSelection.fill(HIST("eventsCheckRec"), 3.5);

rEventSelection.fill(HIST("eventsCheckGen"), 5.5);
hInvMass.fill(HIST("h1RecMult"), multiplicity);
hInvMass.fill(HIST("h1RecMult2"), multiplicityRec);

Expand Down
Loading