From 1d126bdf24b02d0752608f3d6502f6dfb7be1f95 Mon Sep 17 00:00:00 2001 From: Javier Galan Date: Wed, 21 Sep 2022 15:30:21 +0200 Subject: [PATCH 1/2] ValidateTrees.C rounding to 2-decimal digits --- pipeline/ValidateTrees.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipeline/ValidateTrees.C b/pipeline/ValidateTrees.C index 3b44ae166..9029e8acc 100644 --- a/pipeline/ValidateTrees.C +++ b/pipeline/ValidateTrees.C @@ -53,8 +53,8 @@ Int_t ValidateTrees(const char* validationFilename, const char* inputFilename = } for (int m = 0; m < (*inputObservableVector).size(); m++) { - if ((Int_t)(1000. * (*inputObservableVector)[m]) != - (Int_t)(1000. * (*validationObservableVector)[m])) { + if (std::round(100. * (*inputObservableVector)[m]) != + std::round(100. * (*validationObservableVector)[m])) { cout << "Double Observable with index " << m << " in entry " << n << " is not the same value!!" << endl; printf(" value: %.15f, should be: %.15f\n", (*inputObservableVector)[m], From 84ce68658bbb0e5998d51b71c4c4f6229d82d368 Mon Sep 17 00:00:00 2001 From: Javier Galan Date: Wed, 21 Sep 2022 16:10:50 +0200 Subject: [PATCH 2/2] ValidateTrees.C fixing tolerance to 0.01 --- pipeline/ValidateTrees.C | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pipeline/ValidateTrees.C b/pipeline/ValidateTrees.C index 9029e8acc..75bd5a1ef 100644 --- a/pipeline/ValidateTrees.C +++ b/pipeline/ValidateTrees.C @@ -53,8 +53,7 @@ Int_t ValidateTrees(const char* validationFilename, const char* inputFilename = } for (int m = 0; m < (*inputObservableVector).size(); m++) { - if (std::round(100. * (*inputObservableVector)[m]) != - std::round(100. * (*validationObservableVector)[m])) { + if (std::abs((*inputObservableVector)[m] - (*validationObservableVector)[m]) > 0.01) { cout << "Double Observable with index " << m << " in entry " << n << " is not the same value!!" << endl; printf(" value: %.15f, should be: %.15f\n", (*inputObservableVector)[m],