From b21f978a4938825be41f032b194af226f102699e Mon Sep 17 00:00:00 2001 From: upasanasharma31 <84681984+upasanasharma31@users.noreply.github.com> Date: Thu, 19 Dec 2024 10:45:19 +0530 Subject: [PATCH 1/2] Bug: Fix histogram filling for Mother pT and Decay Length Bug: Fix histogram filling for Mother pT and Decay Length --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 20edd0ace9f..0222f2e0506 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -1156,12 +1156,13 @@ struct QaEfficiency { for (const auto& pdgToCheck : mothersPDGs.value) { if (mother.pdgCode() == pdgToCheck) { motherIsAccepted = true; + // Calculate the decay length + double decayLength = std::sqrt(std::pow(mother.vx() - mother.mcCollision().posX(), 2) + std::pow(mother.vy() - mother.mcCollision().posY(), 2) + std::pow(mother.vz() - mother.mcCollision().posZ(), 2)); + hdecaylengthmother[histogramIndex]->Fill(decayLength); break; } if (motherIsAccepted) { - // Calculate the decay length - double decayLength = std::sqrt(std::pow(mother.vx() - mother.mcCollision().posX(), 2) + std::pow(mother.vy() - mother.mcCollision().posY(), 2) + std::pow(mother.vz() - mother.mcCollision().posZ(), 2)); - hdecaylengthmother[histogramIndex]->Fill(decayLength); + break; } } } @@ -1260,10 +1261,11 @@ struct QaEfficiency { for (const auto& pdgToCheck : mothersPDGs.value) { if (mother.pdgCode() == pdgToCheck) { motherIsAccepted = true; // Mother matches the list of specified PDGs + hPtmotherGenerated[histogramIndex]->Fill(mother.pt()); // Fill generated pT for mother break; } if (motherIsAccepted) { - hPtmotherGenerated[histogramIndex]->Fill(mother.pt()); // Fill generated pT for mother + break; } } } From 3b0c5a1bb101afa4e3950166425aa8891811dbe0 Mon Sep 17 00:00:00 2001 From: upasanasharma31 <84681984+upasanasharma31@users.noreply.github.com> Date: Thu, 19 Dec 2024 10:51:02 +0530 Subject: [PATCH 2/2] Update qaEfficiency.cxx --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 0222f2e0506..e202302c950 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -1157,8 +1157,8 @@ struct QaEfficiency { if (mother.pdgCode() == pdgToCheck) { motherIsAccepted = true; // Calculate the decay length - double decayLength = std::sqrt(std::pow(mother.vx() - mother.mcCollision().posX(), 2) + std::pow(mother.vy() - mother.mcCollision().posY(), 2) + std::pow(mother.vz() - mother.mcCollision().posZ(), 2)); - hdecaylengthmother[histogramIndex]->Fill(decayLength); + double decayLength = std::sqrt(std::pow(mother.vx() - mother.mcCollision().posX(), 2) + std::pow(mother.vy() - mother.mcCollision().posY(), 2) + std::pow(mother.vz() - mother.mcCollision().posZ(), 2)); + hdecaylengthmother[histogramIndex]->Fill(decayLength); break; } if (motherIsAccepted) {