Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The gen <=> reco mapping tests task #68

Merged
merged 2 commits into from
Sep 7, 2021
Merged
Changes from 1 commit
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
14 changes: 7 additions & 7 deletions PWGCF/Tasks/dptdptcorrelations-simchl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ struct CheckGeneratorLevelVsDetectorLevel {
for (auto& part : mcParticles) {
auto pdgpart = fPDG->GetParticle(part.pdgCode());
if (pdgpart != nullptr) {
float charge = (pdgpart->Charge() / 3 >= 1) ? 1.0 : ((pdgpart->Charge() / 3 <= -1) ? -1.0 : 0.0);
float charge = (pdgpart->Charge() >= 3) ? 1.0 : ((pdgpart->Charge() <= -3) ? -1.0 : 0.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I merge it now, but these three lines I would have just written
if (pdgpart->Charge() != 0) {
ngen++
}
there will be no quarks I assume :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It will not be the first time I've found the quarks at generator level
Thanks anyway for the suggestion
And for the fixes!

if (charge != 0.0) {
ngen++;
}
Expand All @@ -1511,29 +1511,29 @@ struct CheckGeneratorLevelVsDetectorLevel {

// Let's go through the reco-gen mapping to detect multi-reconstructed particles
// For the time being we are only interested in the information based on the reconstructed tracks
LOGF(info, "New chunk with %d generated charged particles and %d reconstructed tracks", ngen, nreco);
LOGF(info, "New dataframe (DF) with %d generated charged particles and %d reconstructed tracks", ngen, nreco);

for (auto& track : tracks) {
int64_t recix = track.globalIndex();
int32_t label = track.mcParticleId();

// LOGF(info, "Track with global Id %d and collision Id %d has label %d associated to MC collision %d", recix, track.collisionId(), label, track.mcParticle().mcCollisionId());
if (track.collisionId() < 0) {
jgrosseo marked this conversation as resolved.
Show resolved Hide resolved
if (label > 0) {
if (label >= 0) {
mclabelpos_negcoll[label].push_back(recix);
} else if (label < 0) {
} else {
mclabelneg_negcoll[-label].push_back(recix);
}
} else {
if (label > 0) {
if (label >= 0) {
mclabelpos[label].push_back(recix);
} else if (label < 0) {
} else {
mclabelneg[-label].push_back(recix);
}
}
}

/* let's provide information on a per chunk level */
/* let's provide information on a per DF level */
int nrec_poslabel = 0;
int nrec_neglabel = 0;
int nrec_poslabel_nc = 0;
Expand Down