From 4becb12a80f74981db32a466d517d695d4eb7261 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Fri, 7 Jun 2024 16:09:37 +0200 Subject: [PATCH 1/4] AOD: Fix aod-thinner for new-ish datamodel changes Signed-off-by: Felix Schlepper --- Framework/AODMerger/src/aodThinner.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Framework/AODMerger/src/aodThinner.cxx b/Framework/AODMerger/src/aodThinner.cxx index 6d474aae511c6..531bf3c019f0b 100644 --- a/Framework/AODMerger/src/aodThinner.cxx +++ b/Framework/AODMerger/src/aodThinner.cxx @@ -214,7 +214,9 @@ int main(int argc, char* argv[]) uint8_t tpcNClsFindable = 0; bool bTPClsFindable = false; uint8_t ITSClusterMap = 0; + UInt_t ITSClusterSizes = 0; bool bITSClusterMap = false; + bool bITSClusterSizes = false; uint8_t TRDPattern = 0; bool bTRDPattern = false; float_t TOFChi2 = 0; @@ -231,6 +233,9 @@ int main(int argc, char* argv[]) } else if (brName == "fITSClusterMap") { trackExtraTree->SetBranchAddress("fITSClusterMap", &ITSClusterMap); bITSClusterMap = true; + } else if (brName == "fITSClusterSizes") { + trackExtraTree->SetBranchAddress("fITSClusterSizes", &ITSClusterSizes); + bITSClusterSizes = true; } else if (brName == "fTRDPattern") { trackExtraTree->SetBranchAddress("fTRDPattern", &TRDPattern); bTRDPattern = true; @@ -256,6 +261,7 @@ int main(int argc, char* argv[]) // Remove TPC only tracks, if (opt.) they are not assoc. to a V0 if ((!bTPClsFindable || tpcNClsFindable > 0.) && (!bITSClusterMap || ITSClusterMap == 0) && + (!bITSClusterSizes || ITSClusterSizes == 0) && (!bTRDPattern || TRDPattern == 0) && (!bTOFChi2 || TOFChi2 < -1.) && (keepV0TPCs.find(i) == keepV0TPCs.end())) { From 78d06062b4e63272c8f92299b0d3bd1a62fe9b33 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Fri, 7 Jun 2024 18:22:09 +0200 Subject: [PATCH 2/4] AOD: Add sanity-check for branch detection Fatal if necessary branches are not detected. Signed-off-by: Felix Schlepper --- Framework/AODMerger/src/aodThinner.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Framework/AODMerger/src/aodThinner.cxx b/Framework/AODMerger/src/aodThinner.cxx index 531bf3c019f0b..58a88a3b871c0 100644 --- a/Framework/AODMerger/src/aodThinner.cxx +++ b/Framework/AODMerger/src/aodThinner.cxx @@ -26,6 +26,7 @@ #include "TGrid.h" #include "TMap.h" #include "TLeaf.h" +#include "TError.h" #include "aodMerger.h" @@ -245,6 +246,13 @@ int main(int argc, char* argv[]) } } + // Sanity-Check + // If any (%ITSClusterMap or %ITSClusterSizes) of these are not found, continuation is not possible, hence fataling + if (!bTPClsFindable || !bTRDPattern || !bTOFChi2 || + (!bITSClusterMap && !bITSClusterSizes)) { + Fatal("Sanity-Check", "Branch detection failed for trackextra.[(fITSClusterMap=%d,fITSClusterSizes=%d),fTPCNClsFindable=%d,fTRDPattern=%d,fTOFChi2=%d]", bITSClusterMap, bITSClusterSizes, bTPClsFindable, bTRDPattern, bTOFChi2); + } + int fIndexCollisions = 0; track_iu->SetBranchAddress("fIndexCollisions", &fIndexCollisions); @@ -258,12 +266,10 @@ int main(int argc, char* argv[]) // Flag collisions hasCollision[i] = (fIndexCollisions >= 0); - // Remove TPC only tracks, if (opt.) they are not assoc. to a V0 - if ((!bTPClsFindable || tpcNClsFindable > 0.) && + // Remove TPC only tracks, if they are not assoc. to a V0 + if (tpcNClsFindable > 0 && TRDPattern == 0 && TOFChi2 < -1. && (!bITSClusterMap || ITSClusterMap == 0) && (!bITSClusterSizes || ITSClusterSizes == 0) && - (!bTRDPattern || TRDPattern == 0) && - (!bTOFChi2 || TOFChi2 < -1.) && (keepV0TPCs.find(i) == keepV0TPCs.end())) { counter++; } else { From 071c4ca97defb2a23a8ecb75b88f903d7c5b5431 Mon Sep 17 00:00:00 2001 From: Jan Fiete Date: Sat, 8 Jun 2024 10:47:27 +0200 Subject: [PATCH 3/4] Update aodThinner.cxx Adjust to use exitCode --- Framework/AODMerger/src/aodThinner.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Framework/AODMerger/src/aodThinner.cxx b/Framework/AODMerger/src/aodThinner.cxx index 58a88a3b871c0..101d42c853759 100644 --- a/Framework/AODMerger/src/aodThinner.cxx +++ b/Framework/AODMerger/src/aodThinner.cxx @@ -26,7 +26,6 @@ #include "TGrid.h" #include "TMap.h" #include "TLeaf.h" -#include "TError.h" #include "aodMerger.h" @@ -250,7 +249,9 @@ int main(int argc, char* argv[]) // If any (%ITSClusterMap or %ITSClusterSizes) of these are not found, continuation is not possible, hence fataling if (!bTPClsFindable || !bTRDPattern || !bTOFChi2 || (!bITSClusterMap && !bITSClusterSizes)) { - Fatal("Sanity-Check", "Branch detection failed for trackextra.[(fITSClusterMap=%d,fITSClusterSizes=%d),fTPCNClsFindable=%d,fTRDPattern=%d,fTOFChi2=%d]", bITSClusterMap, bITSClusterSizes, bTPClsFindable, bTRDPattern, bTOFChi2); + printf(" *** FATAL *** Branch detection failed for trackextra.[(fITSClusterMap=%d,fITSClusterSizes=%d),fTPCNClsFindable=%d,fTRDPattern=%d,fTOFChi2=%d]", bITSClusterMap, bITSClusterSizes, bTPClsFindable, bTRDPattern, bTOFChi2); + exitCode = 10; + break; } int fIndexCollisions = 0; From b456154eb26edf8e5d8a3eede184a1b9e17a533c Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Sat, 8 Jun 2024 17:17:45 +0200 Subject: [PATCH 4/4] AOD: Thinner add newline to print and skip stat print if errored Signed-off-by: Felix Schlepper --- Framework/AODMerger/src/aodThinner.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Framework/AODMerger/src/aodThinner.cxx b/Framework/AODMerger/src/aodThinner.cxx index 101d42c853759..1f1fb2978d91d 100644 --- a/Framework/AODMerger/src/aodThinner.cxx +++ b/Framework/AODMerger/src/aodThinner.cxx @@ -249,7 +249,7 @@ int main(int argc, char* argv[]) // If any (%ITSClusterMap or %ITSClusterSizes) of these are not found, continuation is not possible, hence fataling if (!bTPClsFindable || !bTRDPattern || !bTOFChi2 || (!bITSClusterMap && !bITSClusterSizes)) { - printf(" *** FATAL *** Branch detection failed for trackextra.[(fITSClusterMap=%d,fITSClusterSizes=%d),fTPCNClsFindable=%d,fTRDPattern=%d,fTOFChi2=%d]", bITSClusterMap, bITSClusterSizes, bTPClsFindable, bTRDPattern, bTOFChi2); + printf(" *** FATAL *** Branch detection failed in %s for trackextra.[(fITSClusterMap=%d,fITSClusterSizes=%d),fTPCNClsFindable=%d,fTRDPattern=%d,fTOFChi2=%d]\n", dfName, bITSClusterMap, bITSClusterSizes, bTPClsFindable, bTRDPattern, bTOFChi2); exitCode = 10; break; } @@ -423,6 +423,7 @@ int main(int argc, char* argv[]) if (exitCode != 0) { printf("Removing incomplete output file %s.\n", outputFile->GetName()); gSystem->Unlink(outputFile->GetName()); + return exitCode; // skip output below } clock.Stop();