Repository navigation
[PWGJE] Added weighted-MC processes for jet background analysis - #18754
choich08365 wants to merge 3 commits into
Conversation
|
O2 linter results: ❌ 0 errors, |
|
Error while checking build/O2Physics/code-check for 0782eb3 at 2026-11-15 13:58: Full log here. |
| * Kinematic acceptance cuts are applied to the input particle table separately. | ||
| */ | ||
| template <typename T, typename U> | ||
| bool isParticleSelected(T const& particle, const std::string& particleSelection, int jetTypeParticleLevel, U const& pdgDatabase) |
There was a problem hiding this comment.
you should replace this block in analyseParticles with this new function so that anywhere that the code changes it changes for both
There was a problem hiding this comment.
Hi @nzardosh, thanks for your comment. In this commit, it seems that they are already replaced with isParticleSelected function in analyseParticles.
| if (std::isinf(particle.eta())) { | ||
| return false; | ||
| } | ||
| auto pdgParticle = pdgDatabase->GetParticle(particle.pdgCode()); |
There was a problem hiding this comment.
instead of giving the function the pdgDatabse you could get the pdgParticle before the function is called and give it to the function instead. It avoids having the pdgParticle retrieved twice from the database
There was a problem hiding this comment.
Hi @nzardosh, I've overloaded the function isParticleSelected to output pdgParticle as a pointer parameter.
There was a problem hiding this comment.
I think it would be better that pdgParticle is given as an input to the function instead. Also currently you set it to a nullptr
There was a problem hiding this comment.
I would prefer to keep the line pdgDatabase->GetParticle(particle.pdgCode()) inside isParticleSelected. This function is also called directly by jetBackgroundAnalysis.cxx, where the caller does not otherwise need pdgParticle. Making it an input would require those callers to perform a lookup solely to pass the result back into the selection function.
Since pdgParticle is derived from particle and pdgDatabase, exposing it as an additional input feels redundant. In analyseParticles, it is only needed afterward to obtain the PDG mass; the overload allows us to reuse the lookup for that purpose.
The initial nullptr assignment resets the output pointer before any early return. It is populated by GetParticle() once the status and eta checks pass.
There was a problem hiding this comment.
but in any case whether pdgDatabase->GetParticle(particle.pdgCode()) is done in the function or before, it has to anyways be called. And like this in analyseParticles it doesnt need to be called twice which it currently is since the id is needed for the mass
There was a problem hiding this comment.
Calling the overloaded wrapper function adds negligible overhead. This implementation allows analyseParticles() to reuse the PDG pointer for the mass, while callers in jetBackgroundAnalysis.cxx do not need to handle a pointer they otherwise have no use for. I consider keeping that implementation detail out of those callers a reasonable encapsulation choice.
|
Error while checking build/O2Physics/code-check for 7bb0eb2 at 2026-11-16 14:19: Full log here. |
| template <typename T, typename U> | ||
| bool isParticleSelected(T const& particle, const std::string& particleSelection, int jetTypeParticleLevel, U const& pdgDatabase, TParticlePDG const*& pdgParticle) | ||
| { | ||
| pdgParticle = nullptr; |
There was a problem hiding this comment.
why does this need to be there?
| } | ||
| if (jetTypeParticleLevel == static_cast<int>(JetType::neutral) && pdgCharge != 0.0) { | ||
| TParticlePDG const* pdgParticle = nullptr; | ||
| if (!isParticleSelected(particle, particleSelection, jetTypeParticleLevel, pdgDatabase, pdgParticle) || pdgParticle == nullptr) { |
There was a problem hiding this comment.
Thanks for the comments. I’ll need to rerun the O2 builders.
Dear @aimeric-landou, @nzardosh, and @YubiaoWang,
I've drafted an update to the jet background analysis task, which enables the analysis on jet–jet MC. Could you please review it when you have time?
Thanks in advance!
PWGJE/Tasks/jetBackgroundAnalysis.cxxprocessRhoMCDWeighted,processRhoMCPWeighted,processBkgFluctuationsMCDWeighted, andprocessBkgFluctuationsMCPWeighted.JCollisionOutliersandJMcCollisionOutliers.applyMCDSelectionToMCPoption. When enabled, require the matched MCD collision to pass the same event selection as MCD processes. This change is necessary for validating the unfolding of jet pT spectra with underlying-event subtraction, in my opinion.PWGJE/Core/JetFindingUtilities.hanalyseParticlesinto the sharedisParticleSelectedfunction.