|
1 | 1 | /******************************************************************************** |
2 | | - * Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * |
| 2 | + * Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * |
3 | 3 | * * |
4 | 4 | * This software is distributed under the terms of the * |
5 | 5 | * GNU Lesser General Public Licence (LGPL) version 3, * |
@@ -47,30 +47,34 @@ Bool_t FairParSet::init() |
47 | 47 | // the second input. If this failes too, it returns an error. |
48 | 48 | // (calls internally the init function in the derived class) |
49 | 49 | FairRuntimeDb* rtdb = FairRuntimeDb::instance(); |
50 | | - // FairRunAna* fRun =FairRunAna::Instance(); |
51 | | - // cout << "-I- FairParSet::init() " << GetName() << endl; |
| 50 | + if (!rtdb) { |
| 51 | + LOG(error) << "FairParSet::init()/" << GetName() << ": No RTDB"; |
| 52 | + return false; |
| 53 | + } |
52 | 54 |
|
53 | 55 | Bool_t allFound = kFALSE; |
54 | | - FairParIo* io = 0; |
55 | | - if (rtdb) { |
56 | | - io = rtdb->getFirstInput(); |
| 56 | + FairParIo* io = rtdb->getFirstInput(); |
| 57 | + if (io) { |
| 58 | + allFound = init(io); |
| 59 | + } else { |
| 60 | + LOG(warn) << "FairParSet::init()/" << GetName() << ": No first input"; |
| 61 | + } |
| 62 | + if (!allFound) { |
| 63 | + io = rtdb->getSecondInput(); |
| 64 | + // cout << "-I FairParSet::init() 2 " << io << std::endl; |
57 | 65 | if (io) { |
58 | 66 | allFound = init(io); |
59 | | - } |
60 | | - if (!allFound) { |
61 | | - io = rtdb->getSecondInput(); |
62 | | - // cout << "-I FairParSet::init() 2 " << io << std::endl; |
63 | | - if (io) { |
64 | | - allFound = init(io); |
65 | | - } |
66 | 67 | } else { |
67 | | - setInputVersion(-1, 2); |
| 68 | + LOG(warn) << "FairParSet::init()/" << GetName() << ": No second input"; |
68 | 69 | } |
| 70 | + } else { |
| 71 | + setInputVersion(-1, 2); |
69 | 72 | } |
| 73 | + |
70 | 74 | if (allFound) { |
71 | 75 | return kTRUE; |
72 | 76 | } |
73 | | - LOG(error) << "init() " << GetName() << " not initialized"; |
| 77 | + LOG(error) << "FairParSet::init()/" << GetName() << ": not initialized"; |
74 | 78 | return kFALSE; |
75 | 79 | } |
76 | 80 |
|
|
0 commit comments