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
61 changes: 37 additions & 24 deletions PWGLF/Tasks/Resonances/higherMassResonances.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ struct HigherMassResonances {
Configurable<int> configOccCut{"configOccCut", 1000, "Occupancy cut"};
Configurable<bool> isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"};
Configurable<bool> isNoCollInTimeRangeStandard{"isNoCollInTimeRangeStandard", false, "No collision in time range standard"};
Configurable<bool> isSel8{"isSel8", false, "Event Selection 8"};

// Configurables for event selection
// Configurable<bool> isINELgt0{"isINELgt0", true, "INEL>0 selection"};
Expand Down Expand Up @@ -151,8 +152,8 @@ struct HigherMassResonances {
Configurable<bool> iscTVXEvsel{"iscTVXEvsel", true, "Triggger selection"};
Configurable<bool> isavoidsplitrackMC{"isavoidsplitrackMC", false, "avoid split track in MC"};
Configurable<bool> isapplyRapidityMC{"isapplyRapidityMC", true, "Apply rapidity cut on generated and reconstructed particles"};
Configurable<int> selectMCparticles{"selectMCparticles", 1, "0: f0(1710), 1: f2(1525), 2: a2(1320), 3: f0(1370), 4: f0(1500)"};
std::vector<int> pdgCodes = {10331, 335, 115, 10221, 9030221};
Configurable<int> selectMCparticles{"selectMCparticles", 1, "0: f0(1710), 1: f2(1525), 2: a2(1320), 3: f0(1370), 4: f0(1500), 5: f2(1270)"};
std::vector<int> pdgCodes = {10331, 335, 115, 10221, 9030221, 225};

// output THnSparses
Configurable<bool> activateHelicityFrame{"activateHelicityFrame", false, "Activate the THnSparse with cosThStar w.r.t. helicity axis"};
Expand Down Expand Up @@ -245,7 +246,7 @@ struct HigherMassResonances {
rEventSelection.add("htrackscheck_v0", "htrackscheck_v0", kTH1I, {{15, 0, 15}});
rEventSelection.add("htrackscheck_v0_daughters", "htrackscheck_v0_daughters", kTH1I, {{15, 0, 15}});
hMChists.add("events_check", "No. of events in the generated MC", kTH1I, {{20, 0, 20}});
hMChists.add("events_checkrec", "No. of events in the reconstructed MC", kTH1I, {{25, 0, 25}});
hMChists.add("events_checkrec", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}});

rEventSelection.add("hEventCut", "No. of event after cuts", kTH1I, {{20, 0, 20}});
std::shared_ptr<TH1> hCutFlow = rEventSelection.get<TH1>(HIST("hEventCut"));
Expand Down Expand Up @@ -292,12 +293,23 @@ struct HigherMassResonances {
hv0labelmcrec->GetXaxis()->SetBinLabel(2, "V0Daughter Sel.");
hv0labelmcrec->GetXaxis()->SetBinLabel(3, "V0 Sel.");
hv0labelmcrec->GetXaxis()->SetBinLabel(4, "V0 PDG");
hv0labelmcrec->GetXaxis()->SetBinLabel(5, "Mother PDG");
hv0labelmcrec->GetXaxis()->SetBinLabel(6, "Same Mother");
hv0labelmcrec->GetXaxis()->SetBinLabel(7, "Split Track");
hv0labelmcrec->GetXaxis()->SetBinLabel(8, "Global Index");
hv0labelmcrec->GetXaxis()->SetBinLabel(9, "Generator");
hv0labelmcrec->GetXaxis()->SetBinLabel(10, "Rapidity");
hv0labelmcrec->GetXaxis()->SetBinLabel(5, "All Mothers");
hv0labelmcrec->GetXaxis()->SetBinLabel(6, "Mother PDG");
hv0labelmcrec->GetXaxis()->SetBinLabel(7, "Same Mother");
hv0labelmcrec->GetXaxis()->SetBinLabel(8, "Split Track");
hv0labelmcrec->GetXaxis()->SetBinLabel(9, "Global Index");
hv0labelmcrec->GetXaxis()->SetBinLabel(10, "Generator");
hv0labelmcrec->GetXaxis()->SetBinLabel(11, "Rapidity");

std::shared_ptr<TH1> hv0labelmcgen = hMChists.get<TH1>(HIST("events_check"));
hv0labelmcgen->GetXaxis()->SetBinLabel(1, "All Events");
hv0labelmcgen->GetXaxis()->SetBinLabel(2, "Event Sel.");
hv0labelmcgen->GetXaxis()->SetBinLabel(3, "Event reconstructed");
hv0labelmcgen->GetXaxis()->SetBinLabel(4, "PDG check");
hv0labelmcgen->GetXaxis()->SetBinLabel(5, "Rapidity");
hv0labelmcgen->GetXaxis()->SetBinLabel(6, "Daughters2");
hv0labelmcgen->GetXaxis()->SetBinLabel(7, "PhysicalPrimary");
hv0labelmcgen->GetXaxis()->SetBinLabel(8, "Daughters K0s");
}

hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true);
Expand Down Expand Up @@ -367,7 +379,7 @@ struct HigherMassResonances {
if (fillHist)
rEventSelection.fill(HIST("hEventCut"), 1);

if (!collision.sel8())
if (config.isSel8 && !collision.sel8())
return false;
if (fillHist)
rEventSelection.fill(HIST("hEventCut"), 2);
Expand Down Expand Up @@ -1147,42 +1159,42 @@ struct HigherMassResonances {
selectedEvents[nevts++] = collision.mcCollision_as<aod::McCollisions>().globalIndex();
}
selectedEvents.resize(nevts);
hMChists.fill(HIST("events_check"), 3.5);
hMChists.fill(HIST("events_check"), 1.5);
const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end();

if (!config.isallGenCollisions && !evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection
return;
}
hMChists.fill(HIST("events_check"), 4.5);
hMChists.fill(HIST("events_check"), 2.5);
for (const auto& mcParticle : mcParticles) {

if (std::abs(mcParticle.pdgCode()) != config.pdgCodes[config.selectMCparticles]) // f2(1525), f0(1710)
{
continue;
}
hMChists.fill(HIST("events_check"), 5.5);
hMChists.fill(HIST("events_check"), 3.5);

if (config.isapplyRapidityMC && std::abs(mcParticle.y()) >= config.rapidityMotherData) {
continue;
}
hMChists.fill(HIST("events_check"), 6.5);
hMChists.fill(HIST("events_check"), 4.5);

auto kDaughters = mcParticle.daughters_as<aod::McParticles>();
if (kDaughters.size() != config.noOfDaughters) {
continue;
}
hMChists.fill(HIST("events_check"), 7.5);
hMChists.fill(HIST("events_check"), 5.5);

for (const auto& kCurrentDaughter : kDaughters) {
// int daupdg = std::abs(kCurrentDaughter.pdgCode());

if (!kCurrentDaughter.isPhysicalPrimary()) {
continue;
}
hMChists.fill(HIST("events_check"), 8.5);
hMChists.fill(HIST("events_check"), 6.5);
if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kK0Short) {
passKs.push_back(true);
hMChists.fill(HIST("events_check"), 9.5);
hMChists.fill(HIST("events_check"), 7.5);
if (passKs.size() == 1) {
daughter1 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassK0Short);
} else if (static_cast<int>(passKs.size()) == config.noOfDaughters) {
Expand Down Expand Up @@ -1323,45 +1335,46 @@ struct HigherMassResonances {
}

for (const auto& mothertrack2 : mctrackv02.mothers_as<aod::McParticles>()) {
hMChists.fill(HIST("events_checkrec"), 4.5);

if (mothertrack1.pdgCode() != config.pdgCodes[config.selectMCparticles]) {
continue;
}
hMChists.fill(HIST("events_checkrec"), 4.5);
hMChists.fill(HIST("events_checkrec"), 5.5);

if (mothertrack1.pdgCode() != mothertrack2.pdgCode()) {
continue;
}
hMChists.fill(HIST("events_checkrec"), 5.5);
hMChists.fill(HIST("events_checkrec"), 6.5);

gindex2.push_back(mothertrack2.globalIndex());
if (gindex2.size() > 1) {
if (std::find(gindex2.begin(), gindex2.end(), mothertrack2.globalIndex()) != gindex2.end()) {
continue;
}
}
hMChists.fill(HIST("events_checkrec"), 6.5);
hMChists.fill(HIST("events_checkrec"), 7.5);

if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) {
continue;
}
hMChists.fill(HIST("events_checkrec"), 7.5);
hMChists.fill(HIST("events_checkrec"), 8.5);

if (!mothertrack1.producedByGenerator()) {
continue;
}
hMChists.fill(HIST("events_checkrec"), 8.5);
hMChists.fill(HIST("events_checkrec"), 9.5);

if (config.isapplyRapidityMC && std::abs(mothertrack1.y()) >= config.rapidityMotherData) {
continue;
}
hMChists.fill(HIST("events_checkrec"), 9.5);
hMChists.fill(HIST("events_checkrec"), 10.5);

// if (config.isavoidsplitrackMC && oldindex == mothertrack1.globalIndex()) {
// hMChists.fill(HIST("h1Recsplit"), mothertrack1.pt());
// continue;
// }
// hMChists.fill(HIST("events_checkrec"), 20.5);
// hMChists.fill(HIST("events_checkrec"), 11.5);
// oldindex = mothertrack1.globalIndex(); // split tracks is already handled using gindex1 and gindex2

daughter1 = ROOT::Math::PxPyPzMVector(v01.px(), v01.py(), v01.pz(), o2::constants::physics::MassK0Short);
Expand Down
Loading