Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
Comment on lines 551 to +554
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one is the one where I wonder, whether Close is called at all.

This is in FairRunAna::TerminateRun. And the only place I could find that calls into TerminateRun is in FairAnaSelector, which is only used in FairRunAnaProof. So it looks like this is never called. I again wonder, where GetSource()->Close() gets really called?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TerminateRun is never called (see this issue #1462)

GetSource()->Close() is only called in FairRunOnline::Finish(), which is called in FairRun::Run(). It won't be called neither if Run() is skipped.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's take a deeper look at #1462 first, please!

// 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