Skip to content

Conversation

@nkaratze
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Dec 12, 2025

O2 linter results: ❌ 1 errors, ⚠️ 0 warnings, 🔕 0 disabled

@github-actions github-actions bot changed the title PWGLF:Added derived process for Data and MC-Reco [PWGLF] PWGLF:Added derived process for Data and MC-Reco Dec 12, 2025
// This is the process for Real Data
void dataProcess(soa::Join<aod::Collisions, aod::EvSels, aod::PVMults, aod::CentFT0Ms /*,aod::CentNGlobals*/>::iterator const& collision,
void dataProcess(soa::Join<aod::StraCollisions, aod::StraEvSels, aod::PVMults, aod::CentFT0Ms /*,aod::CentNGlobals*/>::iterator const& collision,
aod::V0Datas const& V0s,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the subscription to aod::V0Datas will not work because V0Datas = soa::Join<V0Indices, V0TrackXs, V0Cores>; and the tables aod::V0Indices and aod::V0TrackXs are not stored in derived data. That's why we only subscribe to aod::V0CollRefs, aod::V0Cores, aod::V0Extras> (aod::V0CollRefs which stores the index to aod::StraCollisions and aod::V0Extras which stores the index to the daughter track extra table, aod::DauTrackExtras, containing the detector information of the track)
In the similar fashion, the DaughterTracks table subscription needs to be changed to soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs>.

}
}
// This is the process for Real Derived Data
void dataProcessDerived(soa::Join<aod::StraCollisions, aod::StraEvSels, aod::PVMults, aod::CentFT0Ms /*,aod::CentNGlobals*/>::iterator const& collision,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as for the previous process function

}
}
}
// This is the Process for the MC reconstructed Data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as previously
Here for the MC information, it is a bit particular as we do not save the table aod::McParticles containing all generated particles. Instead, we save only the V0 and cascade generated information stored in aod::V0MCCores and aod::CascMCCores.
The interlink table aod::V0Cores <-> aod::V0MCCores is not aod::McV0Labels but aod::V0CoreMCLabels
Similarly, aod::McCollisionLabels becomes aod::StraCollLabels and you should uncomment the subscription to the McCollisions (which also need to be changed for derived data)

}
// K0sh Signla Split Numerator End
if (v0.has_mcParticle()) {
auto v0mcParticle = v0.mcParticle();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the aod::McParticles table is not saved in the derived data, the logic has to be slightly changed.
Instead of checking whether the v0 has a mcparticle, we need now to check that it has a V0MCCorewith v0.has_v0MCCore()
To access information about the mother of the V0, we need to subscribe to a new table called aod::MotherMCParts containing the kinematics of the mother particle, as well as the PDG code and whether it is primary or not. These information are accessible by adding a subscription to the v0 table, aod::V0MCMothers.
The code should then look something like:

if (v0.has_v0MCCore()) {
    auto v0mcParticle = v0.v0MCCore_as<aod::V0MCCores>();
    if (dotruthk0sh && (v0mcParticle.pdgCode() == kK0Short)) { // kzero matched
        if (v0mcParticle.isPhysicalPrimary()) {
            for (int i = 0; i < nKaonHistograms; i++) {
                if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges
                    pthistos::kaonPt[i]->Fill(v0.mK0Short(), collision.centFT0M());          // filling the k0s namespace histograms
                }
            }
        } else {
            if (v0.has_motherMCPart()) {
                auto v0mother = v0.motherMCPart(); // Get mothers
                rFeeddownMatrices.fill(HIST("hK0shFeeddownMatrix"), v0mcParticle.ptMC(), std::hypot(v0mother.px(), v0mother.py()), collision.centFT0M());
                if (v0mother.pdgCode() == kPhi) { // Phi Mother Matched
                    rFeeddownMatrices.fill(HIST("hK0shPhiFeeddownMatrix"), v0mcParticle.ptMC(), std::hypot(v0mother.px(), v0mother.py()), collision.centFT0M());
                }
            }
        }
    }
}

@vkucera
Copy link
Collaborator

vkucera commented Dec 17, 2025

@nkaratze Don't add the PR title prefix if you cannot do it correctly.

@vkucera vkucera changed the title [PWGLF] PWGLF:Added derived process for Data and MC-Reco [PWGLF] Added derived process for Data and MC-Reco Dec 17, 2025
@vkucera vkucera marked this pull request as draft December 17, 2025 16:02
@vkucera
Copy link
Collaborator

vkucera commented Dec 17, 2025

@romainschotter Please convert a PR to a draft if you request major changes. Otherwise it's being recompiled for nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants