Skip to content

Commit

Permalink
add a new inheritance interface FinishTask for fairsource
Browse files Browse the repository at this point in the history
  • Loading branch information
YanzhaoW committed Nov 17, 2023
1 parent 7104250 commit b600b05
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ file an issue, so that we can see how to handle this.
* Consider calling `fairroot_check_root_cxxstd_compatibility()`
in your `CMakeLists.txt`.
* `fairsoft-config` isn't searched for and not needed any more.
* `FairSource` now supports additional private virtual function `FinishTask()`, which is called in the end of the run.
### Example Changes in Experiment Repos
* https://github.com/R3BRootGroup/R3BRoot/pull/413
Expand Down
4 changes: 4 additions & 0 deletions fairroot/base/source/FairSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ class FairSource : public TObject
virtual void FillEventHeader(FairEventHeader* feh);
void SetRunId(Int_t runId) { fRunId = runId; }
Int_t GetRunId() const { return fRunId; }
void Finish() { FinishTask(); }

protected:
Int_t fRunId;

private:
virtual void FinishTask() {}

public:
ClassDefOverride(FairSource, 2);
};
Expand Down
1 change: 1 addition & 0 deletions fairroot/base/steer/FairRunAna.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ void FairRunAna::TerminateRun()
{
fRootManager->StoreAllWriteoutBufferData();
fTask->FinishTask();
GetSource()->Finish();
// gDirectory->SetName(fRootManager->GetOutFile()->GetName());
// fRunInfo.WriteInfo(); // CRASHES due to file ownership i guess...
// cout << ">>> SlaveTerminate fRootManager->GetInChain()->Print()" << endl;
Expand Down
1 change: 1 addition & 0 deletions fairroot/online/steer/FairRunOnline.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ void FairRunOnline::Run(Int_t Ev_start, Int_t Ev_end)
void FairRunOnline::Finish()
{
fTask->FinishTask();
GetSource()->Finish();
fRootManager->LastFill();
fRootManager->Write();
GetSource()->Close();
Expand Down

0 comments on commit b600b05

Please sign in to comment.