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
72 changes: 57 additions & 15 deletions PWGLF/Tasks/Strangeness/cascadecorrelations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,22 @@
registry.add("gen/hXiPlus", "hXiPlus", HistType::kTH2F, {ptAxis, rapidityAxis});
registry.add("gen/hOmegaMinus", "hOmegaMinus", HistType::kTH2F, {ptAxis, rapidityAxis});
registry.add("gen/hOmegaPlus", "hOmegaPlus", HistType::kTH2F, {ptAxis, rapidityAxis});

registry.add("genwithrec/hXiMinus", "hXiMinus", HistType::kTH2F, {ptAxis, rapidityAxis});
registry.add("genwithrec/hXiPlus", "hXiPlus", HistType::kTH2F, {ptAxis, rapidityAxis});
registry.add("genwithrec/hOmegaMinus", "hOmegaMinus", HistType::kTH2F, {ptAxis, rapidityAxis});
registry.add("genwithrec/hOmegaPlus", "hOmegaPlus", HistType::kTH2F, {ptAxis, rapidityAxis});

registry.add("genwithrec/hNevents", "hNevents", HistType::kTH1F, {{1, 0, 1, "N generated events with reconstructed event"}});
registry.add("gen/hNevents", "hNevents", HistType::kTH1F, {{1, 0, 1, "N generated events"}});
}
}

bool eventSelection(MyCollisions::iterator const& collision)
template <typename TCollision>
bool eventSelection(TCollision const& collision)
{
if (useTrigger) {
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
auto bc = collision.template bc_as<aod::BCsWithTimestamps>();
zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), triggerList);
bool eventTrigger = zorro.isSelected(bc.globalBC());
if (eventTrigger) {
Expand Down Expand Up @@ -282,7 +291,8 @@
return true;
}

void fillMatchedHistos(LabeledCascades::iterator rec, int flag, MyCollisions::iterator collision)
template <typename TCollision>
void fillMatchedHistos(LabeledCascades::iterator rec, int flag, TCollision collision)
{
if (flag == 0)
return;
Expand All @@ -292,7 +302,7 @@
if (!gen.isPhysicalPrimary())
return;
int genpdg = gen.pdgCode();
if ((flag < 3 && TMath::Abs(genpdg) == 3312) || (flag > 1 && TMath::Abs(genpdg) == 3334)) {

Check failure on line 305 in PWGLF/Tasks/Strangeness/cascadecorrelations.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 casc is consistent with Xi and has matched gen Xi OR cand is consistent with Omega and has matched gen omega
// have to do this in case we reco true Xi with only Omega hypothesis (or vice versa) (very unlikely)
registry.fill(HIST("truerec/hV0Radius"), rec.v0radius());
Expand Down Expand Up @@ -335,8 +345,8 @@
}
}

template <typename TCascade>
int processCandidate(TCascade const& casc, MyCollisions::iterator const& collision)
template <typename TCascade, typename TCollision>
int processCandidate(TCascade const& casc, TCollision const& collision)
{
// these are the tracks:
auto bachTrack = casc.template bachelor_as<FullTracksExtIUWithPID>();
Expand Down Expand Up @@ -403,18 +413,18 @@
casc.v0cosPA(pvx, pvy, pvz) < v0setting_cospa ||
casc.casccosPA(pvx, pvy, pvz) < cascadesetting_cospa ||
casc.dcav0topv(pvx, pvy, pvz) < cascadesetting_mindcav0topv ||
TMath::Abs(casc.mLambda() - 1.115683) > cascadesetting_v0masswindow)

Check failure on line 416 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return 0; // It failed at least one topo selection

registry.fill(HIST("hSelectionStatus"), 4); // passes topo
// registry.fill(HIST("hMassXi3"), casc.mXi(), casc.pt());

if (TMath::Abs(posTrack.eta()) > etaTracks || TMath::Abs(negTrack.eta()) > etaTracks || TMath::Abs(bachTrack.eta()) > etaTracks)

Check failure on line 422 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return 0;

registry.fill(HIST("hSelectionStatus"), 5); // passes track eta

if (TMath::Abs(casc.eta()) > etaCascades)

Check failure on line 427 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return 0;

registry.fill(HIST("hSelectionStatus"), 6); // passes candidate eta
Expand All @@ -425,25 +435,25 @@
// Lambda check
if (casc.sign() < 0) {
// Proton check:
if (TMath::Abs(posTrack.tpcNSigmaPr()) > tpcNsigmaProton)

Check failure on line 438 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return 0;
// Pion check:
if (TMath::Abs(negTrack.tpcNSigmaPi()) > tpcNsigmaPion)

Check failure on line 441 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return 0;
} else {
// Proton check:
if (TMath::Abs(negTrack.tpcNSigmaPr()) > tpcNsigmaProton)

Check failure on line 445 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return 0;
// Pion check:
if (TMath::Abs(posTrack.tpcNSigmaPi()) > tpcNsigmaPion)

Check failure on line 448 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return 0;
}
registry.fill(HIST("hSelectionStatus"), 7); // passes V0 daughters PID
// registry.fill(HIST("hMassXi4"), casc.mXi(), casc.pt());

// Bachelor check
if (TMath::Abs(bachTrack.tpcNSigmaPi()) < tpcNsigmaBachelor) {

Check failure on line 455 in PWGLF/Tasks/Strangeness/cascadecorrelations.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 (TMath::Abs(bachTrack.tpcNSigmaKa()) < tpcNsigmaBachelor) {

Check failure on line 456 in PWGLF/Tasks/Strangeness/cascadecorrelations.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
// consistent with both!
registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID
// registry.fill(HIST("hMassXi5"), casc.mXi(), casc.pt());
Expand Down Expand Up @@ -477,8 +487,11 @@
return 0;
} // processCandidate

void processGenMC(aod::McCollision const&, soa::SmallGroups<soa::Join<aod::McCollisionLabels, MyCollisionsMult>> const&, aod::McParticles const& mcParticles)
void processGenMC(aod::McCollision const&, soa::SmallGroups<soa::Join<aod::McCollisionLabels, MyCollisions>> const& collisions, aod::McParticles const& mcParticles)
{
// N gen events without any event selection or matched reco event
registry.fill(HIST("gen/hNevents"), 0);

for (auto const& mcPart : mcParticles) {
if (!mcPart.isPhysicalPrimary())
continue;
Expand All @@ -501,15 +514,44 @@
}
}

// if (matchedCollisions.size() < 1) {
// return;
// } else if (matchedCollisions.size() == 1) {
// for (auto const& collision : matchedCollisions) { // not really a loop, as there is only one collision
// }
// } else if (matchedCollisions.size() > 1) {
// registry.fill(HIST("MC/hSplitEvents"), matchedCollisions.size());
// return;
// }
// Do the same thing, but now making sure there is at least one matched reconstructed event:
if (collisions.size() < 1) {
return;
} else {
bool evSel = false; // will be true if at least one rec. collision passes evsel
for (auto const& collision : collisions) {
// can be more than 1 rec. collisions due to event splitting
evSel = eventSelection(collision);
if (evSel) // exit loop if we find 1 rec. event that passes evsel
break;
}
if (evSel) {
// N gen events with a reconstructed event
registry.fill(HIST("genwithrec/hNevents"), 0);

for (auto const& mcPart : mcParticles) {
if (!mcPart.isPhysicalPrimary())
continue;
if (TMath::Abs(mcPart.eta()) > etaCascades)
continue;

switch (mcPart.pdgCode()) {
case 3312:
registry.fill(HIST("genwithrec/hXiMinus"), mcPart.pt(), mcPart.y());
break;
case -3312:
registry.fill(HIST("genwithrec/hXiPlus"), mcPart.pt(), mcPart.y());
break;
case 3334:
registry.fill(HIST("genwithrec/hOmegaMinus"), mcPart.pt(), mcPart.y());
break;
case -3334:
registry.fill(HIST("genwithrec/hOmegaPlus"), mcPart.pt(), mcPart.y());
break;
}
}
}
}
} // processGen

// wrappers for data/MC processes on reco level
Expand Down
Loading