From 024a0ca29a63588441507b03735ec2fa7aebeff5 Mon Sep 17 00:00:00 2001 From: Ni Kaixiang Date: Thu, 20 Apr 2023 15:35:58 +0200 Subject: [PATCH 1/2] TRestAnalysisTree add branch types of unsigned xx Can use `SetObservableValue("xxx", (UChar_t)value)` now --- source/framework/core/src/TRestAnalysisTree.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/framework/core/src/TRestAnalysisTree.cxx b/source/framework/core/src/TRestAnalysisTree.cxx index e2b2767e3..e605825cd 100644 --- a/source/framework/core/src/TRestAnalysisTree.cxx +++ b/source/framework/core/src/TRestAnalysisTree.cxx @@ -416,11 +416,19 @@ void TRestAnalysisTree::UpdateBranches() { } else if (typeName == "int") { this->Branch(brName, (int*)ref); } else if (typeName == "short") { - this->Branch(brName, (short*)ref); + this->Branch(brName, (unsigned short*)ref); + } else if (typeName == "unsigned char") { + this->Branch(brName, (unsigned char*)ref); + } else if (typeName == "unsigned int") { + this->Branch(brName, (unsigned int*)ref); + } else if (typeName == "unsigned short") { + this->Branch(brName, (unsigned short*)ref); } else if (typeName == "long") { this->Branch(brName, (long*)ref); } else if (typeName == "long long") { this->Branch(brName, (long long*)ref); + } else if (typeName == "unsigned long") { + this->Branch(brName, (unsigned long*)ref); } else if (typeName == "unsigned long long") { this->Branch(brName, (unsigned long long*)ref); } else { From 75f76bbbea01593390f29642575b7bf2baba6ccd Mon Sep 17 00:00:00 2001 From: Ni Kaixiang Date: Thu, 20 Apr 2023 15:39:53 +0200 Subject: [PATCH 2/2] Update TRestAnalysisTree.cxx --- source/framework/core/src/TRestAnalysisTree.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/framework/core/src/TRestAnalysisTree.cxx b/source/framework/core/src/TRestAnalysisTree.cxx index e605825cd..eea161e65 100644 --- a/source/framework/core/src/TRestAnalysisTree.cxx +++ b/source/framework/core/src/TRestAnalysisTree.cxx @@ -416,7 +416,7 @@ void TRestAnalysisTree::UpdateBranches() { } else if (typeName == "int") { this->Branch(brName, (int*)ref); } else if (typeName == "short") { - this->Branch(brName, (unsigned short*)ref); + this->Branch(brName, (short*)ref); } else if (typeName == "unsigned char") { this->Branch(brName, (unsigned char*)ref); } else if (typeName == "unsigned int") {