Skip to content
Open
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
63 changes: 49 additions & 14 deletions PWGLF/Tasks/Resonances/kstarqa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct Kstarqa {
struct : ConfigurableGroup {
// Configurables for event selections
Configurable<bool> isINELgt0{"isINELgt0", true, "INEL>0 selection"};
Configurable<bool> isSel8{"isSel8", false, "Event selection sel8"};
Configurable<bool> isTriggerTVX{"isTriggerTVX", false, "TriggerTVX"};
Configurable<bool> isGoodZvtxFT0vsPV{"isGoodZvtxFT0vsPV", false, "IsGoodZvtxFT0vsPV"};
Configurable<bool> isApplyOccCut{"isApplyOccCut", true, "Apply occupancy cut"};
Expand Down Expand Up @@ -346,6 +347,10 @@ struct Kstarqa {
hInvMass.add("hAllKstarGenCollisisons1Rec", "All generated Kstar in events with at least one rec event in rapidity in 0.5", kTH2F, {{multiplicityAxis}, {ptAxis}});
hInvMass.add("hAllRecCollisions", "All reconstructed events", kTH1F, {multiplicityAxis});
hInvMass.add("hAllRecCollisionsCalib", "All reconstructed events", kTH1F, {multiplicityAxis});
hInvMass.add("sigEvLossFromGenRec/MultiplicityGen", "Multiplicity in generated MC", kTH1F, {multiplicityAxis});
hInvMass.add("sigEvLossFromGenRec/MultiplicityRec", "Multiplicity in generated MC with at least 1 reconstruction", kTH1F, {multiplicityAxis});
hInvMass.add("sigEvLossFromGenRec/hSignalLossDenominator", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}});
hInvMass.add("sigEvLossFromGenRec/hSignalLossNumerator", "Kstar generated after event selection", kTH2F, {{ptAxis}, {multiplicityAxis}});

if (doprocessEvtLossSigLossMC || doprocessEvtLossSigLossMCPhi) {
hInvMass.add("MCcorrections/hSignalLossDenominator", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}});
Expand Down Expand Up @@ -377,8 +382,13 @@ struct Kstarqa {
hGenEvents->GetYaxis()->SetBinLabel(2, "Generated events with Mc collision V_{z} cut");
hGenEvents->GetYaxis()->SetBinLabel(3, "Generated events with Mc INEL>0");
hGenEvents->GetYaxis()->SetBinLabel(4, "Generated events with at least one reconstructed event");

hInvMass.add("CorrFactors/h2dGenKstar", "Centrality vs p_{T}", kTH2D, {{101, 0.0f, 101.0f}, ptAxis});
hInvMass.add("CorrFactors/h3dGenKstarVsMultMCVsMultiplicity", "MC centrality vs centrality vs p_{T}", kTH3D, {axisNch, {101, 0.0f, 101.0f}, ptAxis});
hInvMass.add("CorrFactors/hSignalLossDenominator", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}});
hInvMass.add("CorrFactors/hSignalLossNumerator", "Kstar generated after event selection", kTH2F, {{ptAxis}, {multiplicityAxis}});
hInvMass.add("CorrFactors/MultiplicityRec", "Multiplicity in generated MC with at least 1 reconstruction", kTH1F, {multiplicityAxis});
hInvMass.add("CorrFactors/MultiplicityGen", "Multiplicity in generated MC", kTH1F, {multiplicityAxis});
}

rEventSelection.add("tracksCheckData", "No. of events in the data", kTH1I, {{10, 0, 10}});
Expand Down Expand Up @@ -446,7 +456,7 @@ struct Kstarqa {
if (fillHist)
rEventSelection.fill(HIST("hEventCut"), 1);

if (!collision.sel8())
if (selectionConfig.isSel8 && !collision.sel8())
return false;
if (fillHist)
rEventSelection.fill(HIST("hEventCut"), 2);
Expand Down Expand Up @@ -1605,15 +1615,23 @@ struct Kstarqa {
}
}

const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end();
hInvMass.fill(HIST("hAllGenCollisions"), multiplicity);
if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection
if (std::abs(mcCollision.posZ()) < selectionConfig.cutzvertex) {
return;
}

const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end();
hInvMass.fill(HIST("hAllGenCollisions"), multiplicity);
// if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection
// return;
// }
double genMultiplicity = mcCollision.centFT0M();
hInvMass.fill(HIST("h1GenMult2"), genMultiplicity);
hInvMass.fill(HIST("hAllGenCollisions1Rec"), multiplicity);
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);
hInvMass.fill(HIST("sigEvLossFromGenRec/MultiplicityGen"), genMultiplicity);
if (evtReconstructedAndSelected) {
hInvMass.fill(HIST("sigEvLossFromGenRec/MultiplicityRec"), genMultiplicity);
hInvMass.fill(HIST("h1GenMult2"), genMultiplicity);
hInvMass.fill(HIST("hAllGenCollisions1Rec"), multiplicity);
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);
}

for (const auto& mcParticle : mcParticles) {

Expand All @@ -1631,7 +1649,8 @@ struct Kstarqa {
if (std::abs(mcParticle.pdgCode()) != o2::constants::physics::kK0Star892) {
continue;
}
hInvMass.fill(HIST("hAllKstarGenCollisisons1Rec"), multiplicity, mcParticle.pt());
if (evtReconstructedAndSelected)
hInvMass.fill(HIST("hAllKstarGenCollisisons1Rec"), multiplicity, mcParticle.pt());

auto kDaughters = mcParticle.daughters_as<aod::McParticles>();
if (kDaughters.size() != selectionConfig.noOfDaughters) {
Expand All @@ -1656,11 +1675,15 @@ struct Kstarqa {
}
if (passkaon && passpion) {
mother = daughter1 + daughter2; // Kstar meson
hInvMass.fill(HIST("hk892GenpT"), mcParticle.pt(), multiplicity);
hInvMass.fill(HIST("hk892GenpT2"), mother.Pt(), multiplicity);
hInvMass.fill(HIST("hk892GenpTCalib1"), mcParticle.pt(), genMultiplicity);
hInvMass.fill(HIST("hk892GenpTCalib2"), mother.Pt(), genMultiplicity);
hInvMass.fill(HIST("h1genmass"), mother.M());
hInvMass.fill(HIST("sigEvLossFromGenRec/hSignalLossDenominator"), mother.Pt(), genMultiplicity);
if (evtReconstructedAndSelected) {
hInvMass.fill(HIST("hk892GenpT"), mcParticle.pt(), multiplicity);
hInvMass.fill(HIST("hk892GenpT2"), mother.Pt(), multiplicity);
hInvMass.fill(HIST("hk892GenpTCalib1"), mcParticle.pt(), genMultiplicity);
hInvMass.fill(HIST("hk892GenpTCalib2"), mother.Pt(), genMultiplicity);
hInvMass.fill(HIST("h1genmass"), mother.M());
hInvMass.fill(HIST("sigEvLossFromGenRec/hSignalLossNumerator"), mother.Pt(), genMultiplicity);
}
}
}
}
Expand All @@ -1672,12 +1695,13 @@ struct Kstarqa {
auto multiplicityRec = -1;
bool isSelectedEvent = false;
auto multiplicity1 = -999.;

for (const auto& RecCollision : recCollisions) {
if (!RecCollision.has_mcCollision())
continue;
if (!selectionEvent(RecCollision, false)) // don't fill event cut histogram
continue;
// multiplicity1 = RecCollision.centFT0M();

const auto& mcCollisionRec = RecCollision.mcCollision_as<EventMCGenerated>();
multiplicityRec = mcCollisionRec.centFT0M();

Expand Down Expand Up @@ -1751,6 +1775,8 @@ struct Kstarqa {
hInvMass.fill(HIST("CorrFactors/hGenEvents"), mcCollision.multMCNParticlesEta08(), 2.5);

float multiplicity = 100.5f;
bool isSelectedEvent = false;

for (auto const& collision : collisions) {
if (!selectionEvent(collision, false)) // don't fill event cut histogram
continue;
Expand All @@ -1766,10 +1792,15 @@ struct Kstarqa {
} else {
multiplicity = collision.centFT0M(); // default
}
isSelectedEvent = true;
}

hInvMass.fill(HIST("CorrFactors/hMultiplicityVsMultMC"), multiplicity, mcCollision.multMCNParticlesEta08());
hInvMass.fill(HIST("CorrFactors/hNrecInGen"), collisions.size());
hInvMass.fill(HIST("CorrFactors/MultiplicityGen"), multiplicity);
if (isSelectedEvent) {
hInvMass.fill(HIST("CorrFactors/MultiplicityRec"), multiplicity);
}

for (const auto& mcParticle : mcParticles) {

Expand Down Expand Up @@ -1815,6 +1846,10 @@ struct Kstarqa {

hInvMass.fill(HIST("CorrFactors/h2dGenKstar"), multiplicity, mother.Pt());
hInvMass.fill(HIST("CorrFactors/h3dGenKstarVsMultMCVsMultiplicity"), mcCollision.multMCNParticlesEta08(), multiplicity, mother.Pt());
hInvMass.fill(HIST("CorrFactors/hSignalLossDenominator"), mother.pt(), multiplicity);
if (isSelectedEvent) {
hInvMass.fill(HIST("CorrFactors/hSignalLossNumerator"), mother.pt(), multiplicity);
}
}
}
}
Expand Down
Loading