Skip to content

Commit e0807d9

Browse files
committed
Allow running without sink
Replaced `LOG(fatal)` with `LOG(warning)` in `FairRootManager::RegisterImpl()`. Note that in this mode also persistent branches would not be stored anywhere. Without sink, `FairRootManager::InitSink()` returns `false`. Addresses issue #1355.
1 parent 70aa91d commit e0807d9

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ All notable changes to FairRoot will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

7+
## 18.8.1 (UNRELEASED) - 2023-01-XX
8+
9+
### Breaking Changes
10+
* The output folder name changed from 'folderName_0' to 'folderName'.
11+
In the MT mode of Geant4 the folder names changed from 'folderName_1' and 'folderName_2' to 'folderName'.
12+
13+
### Bug fixes
14+
* Check the return value of `source->InitUnpackers()`/`source->ReinitUnpackers()`
15+
in `FairRunOnline`. Stop run if `false` returned.
16+
17+
### Other Notable Changes
18+
* Allow running without output sink. In this case even persistent branches would not be stored anywhere.
19+
720
## 18.8.0 - 2022-12-16
821

922
### Breaking Changes

base/steer/FairRootManager.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ Bool_t FairRootManager::InitSink()
179179
{
180180
if (fSink) {
181181
fSink->InitSink();
182+
return true;
182183
}
183-
return kTRUE;
184+
LOG(info) << "The output sink is not set. No branches will be stored.";
185+
return false;
184186
}
185187

186188
template<typename T>
@@ -204,7 +206,7 @@ void FairRootManager::RegisterImpl(const char* name, const char* folderName, T*
204206
if (fSink) {
205207
fSink->RegisterImpl(name, folderName, obj);
206208
} else {
207-
LOG(fatal) << "The sink does not exist to store persistent branches.";
209+
LOG(warning) << "The sink does not exist to store persistent branches (" << name << ").";
208210
}
209211
}
210212
AddMemoryBranch(name, obj);

base/steer/FairRunAna.cxx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void FairRunAna::Init()
213213
fRunId = GetEvtHeaderRunId();
214214

215215
// Copy the Event Header Info to Output
216-
fEvtHeader->Register(fStoreEventHeader);
216+
fEvtHeader->Register(GetSink() ? fStoreEventHeader : false);
217217

218218
// Init the containers in Tasks
219219
LOG(info) << "--- Initialize with RunId --- " << fRunId;
@@ -225,7 +225,7 @@ void FairRunAna::Init()
225225
} else { // end----- if(fMixedInput)
226226
LOG(info) << "Initializing without input file or Mixed input";
227227
FairEventHeader* evt = GetEventHeader();
228-
evt->Register(fStoreEventHeader);
228+
evt->Register(GetSink() ? fStoreEventHeader : false);
229229
FairRunIdGenerator genid;
230230
fRunId = genid.generateId();
231231
fRtdb->addRun(fRunId);
@@ -269,7 +269,6 @@ void FairRunAna::Init()
269269
// create the output tree after tasks initialisation
270270
fRootManager->WriteFolder();
271271
fRootManager->WriteFileHeader(fFileHeader);
272-
273272
}
274273
//_____________________________________________________________________________
275274

base/steer/FairRunAnaProof.cxx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,7 @@ void FairRunAnaProof::Init()
179179
fRunId = GetEvtHeaderRunId();
180180

181181
// Copy the Event Header Info to Output
182-
fEvtHeader->Register(kTRUE);
183-
184-
// Copy the Event Header Info to Output
185-
fEvtHeader->Register();
182+
fEvtHeader->Register(GetSink() ? fStoreEventHeader : false);
186183

187184
// Init the containers in Tasks
188185

@@ -196,7 +193,7 @@ void FairRunAnaProof::Init()
196193
} else {
197194
LOG(info) << "Initializing without input file or Mixed input";
198195
FairEventHeader* evt = GetEventHeader();
199-
evt->Register();
196+
evt->Register(GetSink() ? fStoreEventHeader : false);
200197
FairRunIdGenerator genid;
201198
fRunId = genid.generateId();
202199
fRtdb->addRun(fRunId);

0 commit comments

Comments
 (0)