From eecb8066372a2a07e357782cc8f79bc6101bd640 Mon Sep 17 00:00:00 2001
From: P-A Loizeau <p.-a.loizeau@gsi.de>
Date: Tue, 14 Feb 2023 17:53:59 +0100
Subject: [PATCH] In unpack macros, auto map setup also if empty setup name
 given

---
 macro/beamtime/mcbm2022/mcbm_unp_event.C | 4 ++--
 macro/run/run_unpack_online.C            | 4 ++--
 macro/run/run_unpack_online_bmon.C       | 4 ++--
 macro/run/run_unpack_tsa.C               | 4 ++--
 macro/run/run_unpack_tsa_bmon.C          | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/macro/beamtime/mcbm2022/mcbm_unp_event.C b/macro/beamtime/mcbm2022/mcbm_unp_event.C
index 19581d9856..694b29c78f 100644
--- a/macro/beamtime/mcbm2022/mcbm_unp_event.C
+++ b/macro/beamtime/mcbm2022/mcbm_unp_event.C
@@ -367,8 +367,8 @@ Bool_t mcbm_unp_event(std::string infile,
 
 
   // -----   CbmSetup   -----------------------------------------------------
-  /// Do automatic mapping only if not overridden by user
-  if (defaultSetupName == setupName) {
+  /// Do automatic mapping only if not overridden by user or empty
+  if (defaultSetupName == setupName || "" == setupName) {
     cbm::mcbm::ToForceLibLoad dummy;  /// Needed to trigger loading of the library as no fct dict in ROOT6 and CLING
     try {
       setupName = cbm::mcbm::GetSetupFromRunId(runid);
diff --git a/macro/run/run_unpack_online.C b/macro/run/run_unpack_online.C
index f3d9d0a138..d11d8b5015 100644
--- a/macro/run/run_unpack_online.C
+++ b/macro/run/run_unpack_online.C
@@ -73,8 +73,8 @@ void run_unpack_online(std::vector<std::string> publisher = {"tcp://localhost:55
 
 
   // -----   CbmSetup   -----------------------------------------------------
-  /// Do automatic mapping only if not overridden by user
-  if (defaultSetupName == setupName) {
+  /// Do automatic mapping only if not overridden by user or empty
+  if (defaultSetupName == setupName || "" == setupName) {
     cbm::mcbm::ToForceLibLoad dummy;  /// Needed to trigger loading of the library as no fct dict in ROOT6 and CLING
     try {
       setupName = cbm::mcbm::GetSetupFromRunId(runid);
diff --git a/macro/run/run_unpack_online_bmon.C b/macro/run/run_unpack_online_bmon.C
index 80b4113402..65aa2a8c20 100644
--- a/macro/run/run_unpack_online_bmon.C
+++ b/macro/run/run_unpack_online_bmon.C
@@ -65,8 +65,8 @@ void run_unpack_online_bmon(std::vector<std::string> publisher = {"tcp://localho
 
 
   // -----   CbmSetup   -----------------------------------------------------
-  /// Do automatic mapping only if not overridden by user
-  if (defaultSetupName == setupName) {
+  /// Do automatic mapping only if not overridden by user or empty
+  if (defaultSetupName == setupName || "" == setupName) {
     cbm::mcbm::ToForceLibLoad dummy;  /// Needed to trigger loading of the library as no fct dict in ROOT6 and CLING
     try {
       setupName = cbm::mcbm::GetSetupFromRunId(runid);
diff --git a/macro/run/run_unpack_tsa.C b/macro/run/run_unpack_tsa.C
index 295c765cd8..8561750b8c 100644
--- a/macro/run/run_unpack_tsa.C
+++ b/macro/run/run_unpack_tsa.C
@@ -91,8 +91,8 @@ void run_unpack_tsa(std::vector<std::string> infile = {"test.tsa"}, UInt_t runid
 
 
   // -----   CbmSetup   -----------------------------------------------------
-  /// Do automatic mapping only if not overridden by user
-  if (defaultSetupName == setupName) {
+  /// Do automatic mapping only if not overridden by user or empty
+  if (defaultSetupName == setupName || "" == setupName) {
     cbm::mcbm::ToForceLibLoad dummy;  /// Needed to trigger loading of the library as no fct dict in ROOT6 and CLING
     try {
       setupName = cbm::mcbm::GetSetupFromRunId(runid);
diff --git a/macro/run/run_unpack_tsa_bmon.C b/macro/run/run_unpack_tsa_bmon.C
index c9bf7137f8..2479bdf3b6 100644
--- a/macro/run/run_unpack_tsa_bmon.C
+++ b/macro/run/run_unpack_tsa_bmon.C
@@ -78,8 +78,8 @@ void run_unpack_tsa_bmon(std::vector<std::string> infile = {"test.tsa"}, UInt_t
 
 
   // -----   CbmSetup   -----------------------------------------------------
-  /// Do automatic mapping only if not overridden by user
-  if (defaultSetupName == setupName) {
+  /// Do automatic mapping only if not overridden by user or empty
+  if (defaultSetupName == setupName || "" == setupName) {
     cbm::mcbm::ToForceLibLoad dummy;  /// Needed to trigger loading of the library as no fct dict in ROOT6 and CLING
     try {
       setupName = cbm::mcbm::GetSetupFromRunId(runid);
-- 
GitLab