Skip to content

[Common,PWGHF] Add reduced q vectors for Event-shape Engineering#15636

Open
Marcellocosti wants to merge 5 commits intoAliceO2Group:masterfrom
Marcellocosti:red_q_vecs
Open

[Common,PWGHF] Add reduced q vectors for Event-shape Engineering#15636
Marcellocosti wants to merge 5 commits intoAliceO2Group:masterfrom
Marcellocosti:red_q_vecs

Conversation

@Marcellocosti
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

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

@github-actions github-actions bot changed the title [Common, PWGHF] Add reduced q vectors for Event-shape Engineering [Common,PWGHF] Add reduced q vectors for Event-shape Engineering Apr 2, 2026
@Marcellocosti Marcellocosti requested review from a team, ddobrigk, dsekihat, iarsene and ktf as code owners April 2, 2026 19:30
@stefanopolitano stefanopolitano enabled auto-merge (squash) April 2, 2026 19:39
Comment on lines +774 to +777
for (std::size_t iTrack = 0; iTrack < tracksRedQx.size(); ++iTrack) {
xRedQVec -= tracksRedQx[iTrack];
yRedQVec -= tracksRedQy[iTrack];
}
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.

How about using std::accumulate?

Comment on lines +781 to +784
redQVec = std::sqrt(xRedQVec * xRedQVec + yRedQVec * yRedQVec) * amplRedQVec / std::sqrt(amplRedQVec - tracksRedQx.size());
} else {
redQVec = std::sqrt(xRedQVec * xRedQVec + yRedQVec * yRedQVec) * std::sqrt(amplRedQVec);
}
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.

How about using std::hypot?

// taking into account that the Q-vector is normalized by 1/M
// and the EsE reduced Q-vector must be normalized to 1/sqrt(M)
if (useDetector["QvectorFT0Cs"]) {
qVecRedFT0C = TMath::Sqrt(qvecReFT0C.at(0) * qvecReFT0C.at(0) + qvecImFT0C.at(0) * qvecImFT0C.at(0)) * TMath::Sqrt(qvecAmp[kFT0C]);
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.

Why don't you use std::sqrt and std::hypot?

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.

4 participants