Skip to content

Commit fc37fa3

Browse files
committed
add a new inheritance interface FinishEvent for fairsource
1 parent 7104250 commit fc37fa3

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ file an issue, so that we can see how to handle this.
9494
* Consider calling `fairroot_check_root_cxxstd_compatibility()`
9595
in your `CMakeLists.txt`.
9696
* `fairsoft-config` isn't searched for and not needed any more.
97+
* `FairSource` now supports additional private virtual function `FinishTask()`, which is called in the end of the run.
9798
9899
### Example Changes in Experiment Repos
99100
* https://github.com/R3BRootGroup/R3BRoot/pull/413

fairroot/base/source/FairSource.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ class FairSource : public TObject
5151
virtual void FillEventHeader(FairEventHeader* feh);
5252
void SetRunId(Int_t runId) { fRunId = runId; }
5353
Int_t GetRunId() const { return fRunId; }
54+
void Finish() { FinishTask(); }
5455

5556
protected:
5657
Int_t fRunId;
5758

59+
private:
60+
virtual void FinishTask() {}
61+
5862
public:
5963
ClassDefOverride(FairSource, 2);
6064
};

fairroot/base/steer/FairRunAna.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ void FairRunAna::TerminateRun()
551551
{
552552
fRootManager->StoreAllWriteoutBufferData();
553553
fTask->FinishTask();
554+
GetSource()->Finish();
554555
// gDirectory->SetName(fRootManager->GetOutFile()->GetName());
555556
// fRunInfo.WriteInfo(); // CRASHES due to file ownership i guess...
556557
// cout << ">>> SlaveTerminate fRootManager->GetInChain()->Print()" << endl;

fairroot/online/steer/FairRunOnline.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ void FairRunOnline::Run(Int_t Ev_start, Int_t Ev_end)
307307
void FairRunOnline::Finish()
308308
{
309309
fTask->FinishTask();
310+
GetSource()->Finish();
310311
fRootManager->LastFill();
311312
fRootManager->Write();
312313
GetSource()->Close();

0 commit comments

Comments
 (0)