Skip to content

[PWGJE,Infrastructure] Create qg tree creator#15555

Draft
Physicistdana wants to merge 29 commits intoAliceO2Group:masterfrom
Physicistdana:createqgTreeCreator
Draft

[PWGJE,Infrastructure] Create qg tree creator#15555
Physicistdana wants to merge 29 commits intoAliceO2Group:masterfrom
Physicistdana:createqgTreeCreator

Conversation

@Physicistdana
Copy link
Copy Markdown

Jet analysis code

@github-actions github-actions bot added the pwgje label Mar 28, 2026
@github-actions github-actions bot changed the title Createqg tree creator [PWGJE] Createqg tree creator Mar 28, 2026
@Physicistdana Physicistdana marked this pull request as draft March 28, 2026 04:45
@Physicistdana Physicistdana reopened this Mar 28, 2026
@Physicistdana Physicistdana marked this pull request as ready for review March 28, 2026 21:01
@Physicistdana Physicistdana changed the title [PWGJE] Createqg tree creator [Infrastructure,PWGJE] Create qg tree creator Mar 28, 2026
@Physicistdana Physicistdana changed the title [Infrastructure,PWGJE] Create qg tree creator [PWGJE] Create qg tree creator Mar 28, 2026
@Physicistdana Physicistdana changed the title [PWGJE] Create qg tree creator [Infrastructure,PWGJE] Create qg tree creator Mar 28, 2026
@Physicistdana Physicistdana changed the title [Infrastructure,PWGJE] Create qg tree creator [PWGJE,Infrastructure] Create qg tree creator Mar 28, 2026
return std::remainder(phi1 - phi2, 2.f * static_cast<float>(M_PI));
}

float deltaR(float eta1, float phi1, float eta2, float phi2)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Isn't this an existing method?

@vkucera
Copy link
Copy Markdown
Collaborator

vkucera commented Mar 29, 2026

Hi @Physicistdana , please:

  • Get familiar with the contribution guidelines.
  • Mention your name on your GitHub account. (How can we know who you are?)
  • Name your fork repository the same as the main one, i.e. "O2Physics".
  • Don't open your PR as ready for review if it doesn't pass the formatting check.
  • Don't include unrelated changes in your PR, like modifying the .github directory.
  • Don't scatter your modifications across many commits.
  • Give your commits meaningful titles.

Comment on lines +30 to +32
constexpr int kGluon = 21;
constexpr int kQuarkMin = 1;
constexpr int kQuarkMax = 6;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use existing constants.

Comment on lines +10 to +12
// or submit itself to any jurisdiction.
#include "PWGJE/DataModel/Jet.h"
#include "PWGJE/DataModel/JetMatching.h"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add Doxygen documentation.

@vkucera vkucera marked this pull request as draft March 29, 2026 13:30
// find initiating parton by ancestry
//------------------------------------------------
int getInitiatingParton(auto const& particle,
aod::McParticles const& mcParticles)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please use the derived tables such as JetParticles

const int mpdg = mom.pdgCode();

if (std::abs(mpdg) == kGluon ||
(std::abs(mpdg) >= kQuarkMin && std::abs(mpdg) <= kQuarkMax)) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what happens in the case of g->qqbar? you wrongly get a q as the mother whereas it should be a g

void process(aod::ChargedMCDetectorLevelJets const& recoJets,
aod::ChargedMCParticleLevelJets const& truthJets,
aod::ChargedMCDetectorLevelJetsMatchedToChargedMCParticleLevelJets const& matches,
aod::McParticles const& mcParticles)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

use the derived tables

qg = 1;
} else if (std::abs(pdg) >= kQuarkMin && std::abs(pdg) <= kQuarkMax) {
qg = 0;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the indentations look wrong somehow

int pdg = 0;

for (auto const& tc :
truthJet.tracks_as<aod::ChargedMCParticleLevelJetConstituent>()) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is not correct, as the table given here should be JetParticles. Does this even compile?

float sumPt2 = 0;
float sumPtDr = 0;

for (auto const& c : jet.tracks_as<aod::ChargedMCDetectorLevelJetConstituent>()) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

here the table is wrong too, please see below


void process(aod::ChargedMCDetectorLevelJets const& recoJets,
aod::ChargedMCParticleLevelJets const& truthJets,
aod::ChargedMCDetectorLevelJetsMatchedToChargedMCParticleLevelJets const& matches,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this table should be joined to ChargedMCDetectorLevelJets

float ptResp = -1;
int qg = -1;

for (auto const& match : matches) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

once it is joined you can access it differently

int qg = -1;

for (auto const& match : matches) {
if (match.chargedMCDetectorLevelJetId() != jet.globalIndex()) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this also will change

continue;
}

auto truthJet = truthJets.iteratorAt(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

and this

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

Development

Successfully merging this pull request may close these issues.

3 participants