Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R3BEventHeader registration disabled on purpose? #1092

Open
YanzhaoW opened this issue Dec 9, 2024 · 7 comments
Open

R3BEventHeader registration disabled on purpose? #1092

YanzhaoW opened this issue Dec 9, 2024 · 7 comments

Comments

@YanzhaoW
Copy link
Contributor

YanzhaoW commented Dec 9, 2024

Describe the bug

The Register virtual function of R3BEventHeader is overridden with empty function:

void Register(bool Persistance = true) override{};

This causes the FairRunAna, which calls the register function automatically in the init function, fail to register the event header to the FairRootManager. It also leads to the result FairRootManager::GetObject nullptr if the tasks try to obtain the event header with GetObject function.

I don't know whether this is done on purpose or it's just a bug?

If it's a bug, I suggest to remove the line above.

@jose-luis-rs
Copy link
Contributor

Yes, I guess that happens because the R3BEventHeader was not registered in the analysis macro:

// Create run --------------------------------------------
auto *run = new FairRunAna();
// Set up R3BHeader -----------------------------------
auto *EvntHeader = new R3BEventHeader();
EvntHeader->SetExpId(fExpId);
run->SetEventHeader(EvntHeader);

Do you know how to improve this part?

@YanzhaoW
Copy link
Contributor Author

Hi,

I would say just remove this line of code. In this way, the Register will not be overridden and the original definition from the base class FairEventHeader will be used.

Is there any particular reason R3BEventHeader must not be registered for FairRunAna?

@jose-luis-rs
Copy link
Contributor

Hello

For simulations we don't need the R3BEventHeader

@YanzhaoW
Copy link
Contributor Author

Hi,

But FairRunAna is not for simulations. Instead FairRunSim is for simulations.

@jose-luis-rs
Copy link
Contributor

This depends on how one wants to use the code. FairRunSim is for simulations and to generate the simulated data, but here one can select different options:

  1. Use FairRunSim to generate the simulated data for all levels: point, Cal, Hit, ...
  2. Use FairRunSim to generate the simulated data up to the point level and then FairRunAna to move data from point to Cal, Hit and other analysis tasks.

@YanzhaoW
Copy link
Contributor Author

Hi,

Yes, what you said is correct. But the point is that FairRunAna is for the data analysis, which converts one data to another. The data it converts could be from simulation, could also be from calibration and could be anything.

But I don't think it's correct to say because FairRunAna could be used for simulation and simulation doesn't need FairEventHeader, FairRunAna doesn't need the event header.

@jose-luis-rs
Copy link
Contributor

I use FairRunAna for exp. data analysis but also for simulated data to test the reconstruction algorithms because this way usually reduces the computing time.

"FairRunAna doesn't need the event header" -> Ok, but we need the event header to get the information about the triggers, tpats, timestamp, etc. So if the event header is not there we will miss this very important information for data analysis.

If we use FairRunOnline for unpacking data up to the Cal level and then we want to produce the Hit level without running the code again over the unpacking (just to reduce the computing time), we must use FairRunAna to move the data and this needs to propagate the event header as well.

In the case of simulation, the propagation of the event header (FairMCEventHeader) is not so important, but I don't know if this could be important in the future ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants