FairRootGroup / FairRoot

C++ simulation, reconstruction and analysis framework for particle physics experiments
http://fairroot.gsi.de
Other
59 stars 96 forks source link

[BUG] FairRootManager::GetObject is broken in FairRoot19 #1556

Closed YanzhaoW closed 5 months ago

YanzhaoW commented 5 months ago

Describe the bug

The usage of FairRootManager::GetObject is broken after upgrading to FairRoot 19. This issue only occurs when GetObject is called more than once for one branch name. But such practice happens quite often as some branches (like event header) need to be used in different tasks at the same run.

This issue doesn't occur in FairRoot 18.8.

To Reproduce

  1. Go to this repository.
  2. Define env vairable SIMPATH and FAIRROOTPATH
  3. Compile and build project using FairRoot 18. Run executable ./write_data and ./read_data.
  4. Compile and build project using FairRoot 19. Run executable ./write_data and ./read_data.
  5. With FairRoot 19, outputs are all zeros. But if there exists only one task in read_task.cpp, then the output is correct.

System information:

Additional context

  1. This issue basically makes FairRoot 19 unusable for the data calibration, as event header is needed in almost every task.
  2. Please do consider an alternative way of using TTreeReader used in read.cpp in the github repo.

@dennisklein @ChristianTackeGSI

dennisklein commented 5 months ago

I can confirm the behaviour.

ChristianTackeGSI commented 5 months ago

Just to be sure: The problem is the GetObject, right?

For example running write_data with 18.8 and then read_data with 19, would also fail?

We should write a (failing) test for FairRoot!

dennisklein commented 5 months ago

For example running write_data with 18.8 and then read_data with 19, would also fail?

Yes, but only if used from more than one task as in his example code. With a single read task it works across versions.

YanzhaoW commented 5 months ago

Fixed by #1557