From fbfce99790d564ed7dac05fa357e60d59dde13eb Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Wed, 1 Oct 2025 12:36:01 +0200 Subject: [PATCH] better handling of values=n/a when dumping the header info. --- src/external/MusrRoot/TMusrRunHeader.cpp | 7 ++++++- src/external/MusrRoot/TMusrRunHeader.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/external/MusrRoot/TMusrRunHeader.cpp b/src/external/MusrRoot/TMusrRunHeader.cpp index c7c653033..5d782e95b 100644 --- a/src/external/MusrRoot/TMusrRunHeader.cpp +++ b/src/external/MusrRoot/TMusrRunHeader.cpp @@ -1290,7 +1290,6 @@ void TMusrRunHeader::DumpHeader() digit_d = GetLeastSignificantDigit(prop.GetDemand()); if (prop.GetDescription() != "n/a") { fmt.Form("%%s: %%.%dlf +- %%.%dlf %%s; SP: %%.%dlf; %%s", digit, digit, digit_d); - tstr.Form(fmt, prop.GetLabel().Data(), prop.GetValue(), prop.GetError(), prop.GetUnit().Data(), prop.GetDemand(), prop.GetDescription().Data()); } else { fmt.Form("%%s: %%.%dlf +- %%.%dlf %%s; SP: %%.%dlf", digit, digit, digit_d); @@ -1327,6 +1326,12 @@ void TMusrRunHeader::DumpHeader() fmt.Form("%%s: %%.%dlf %%s; SP: %%.%dlf", digit, digit_d); tstr.Form(fmt, prop.GetLabel().Data(), prop.GetValue(), prop.GetUnit().Data(), prop.GetDemand()); } + } else if (prop.GetDemand() == MRH_UNDEFINED) { // = n/a + fmt.Form("%%s: %%s %%s"); + if ((prop.GetUnit() != "n/a")) + tstr.Form(fmt, prop.GetLabel().Data(), "n/a", prop.GetUnit().Data()); + else + tstr.Form(fmt, prop.GetLabel().Data(), "n/a", "n/a"); } str.Form(" %03d - %s -@%d", i, tstr.Data(), MRH_TMUSR_RUN_PHYSICAL_QUANTITY); std::cout << std::endl << str; diff --git a/src/external/MusrRoot/TMusrRunHeader.h b/src/external/MusrRoot/TMusrRunHeader.h index 063abf1fa..9c088a1cd 100644 --- a/src/external/MusrRoot/TMusrRunHeader.h +++ b/src/external/MusrRoot/TMusrRunHeader.h @@ -40,7 +40,7 @@ #include #include -#define MRH_UNDEFINED -9.99e99 +#define MRH_UNDEFINED -9.9e99 #define MRH_DOUBLE_PREC 6