Skip to content

Conversation

@gipert
Copy link
Member

@gipert gipert commented Sep 11, 2025

I'm a bit unsatisfied by the fact that we still have a jagged energy structure in the output, even if I would like to store only the total energy deposited. I'm not sure we want to implement an exception for this scheme though.

@gipert gipert marked this pull request as draft September 11, 2025 16:20
@gipert gipert added the output label Sep 11, 2025
@tdixon97
Copy link
Contributor

I agree with your dissatisfaction

@tdixon97
Copy link
Contributor

I think it is worth storing this as flat, since it allows some users to read it in with numpy or pandas, for some applications I think its a nice selling point for remage, and a way to convince people that LH5 file output is maybe fine for them.

@gipert
Copy link
Member Author

gipert commented Sep 12, 2025

Thank you @ManuelHu for checking I can fix (or someone else can take over if they have time).

The question now is how to flatten this array in the python wrapper without implementing ugly things. Any idea?

@tdixon97
Copy link
Contributor

  • custom reboost config? (just ak.flatten() one each)
  • detect that a VoV is really 1D and automatically flatten?

@gipert
Copy link
Member Author

gipert commented Sep 12, 2025

The question is how do we identify the calorimeter table. at the moment it differs just for the field names.

@ManuelHu
Copy link
Contributor

you have not only the field names, but the name of the output scheme for each table available in the output scheme

@gipert
Copy link
Member Author

gipert commented Sep 12, 2025

You mean via IPC?

@ManuelHu
Copy link
Contributor

yes, this info is sent via IPC:

RMGIpc::SendIpcNonBlocking(
RMGIpc::CreateMessage("output_ntuple", std::string(oscheme).append("\x1e").append(table_name))
);

@gipert gipert linked an issue Sep 18, 2025 that may be closed by this pull request
@ManuelHu ManuelHu force-pushed the calo branch 2 times, most recently from 898aab6 to 35e0910 Compare September 26, 2025 07:42
@gipert
Copy link
Member Author

gipert commented Oct 1, 2025

This should be now good, I just need to add some tests

@gipert
Copy link
Member Author

gipert commented Oct 2, 2025

I realized that the unflattening doesn't make sense (actually creates problems) if the user requested all the detectors to be in one single table and more than a calorimeter is defined... What should we do?

hit->physical_volume = pv;
hit->detector_uid = det_uid;
hit->energy_deposition += step->GetTotalEnergyDeposit();
hit->global_time = prestep->GetGlobalTime();
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont understand the logic here. So there is only ever 1 hit in the Calorimeter hit collection?

And this hit sums the energy, but keeps only the physical volume, uid and time of the last hit?

So what is even the use of tracking the last physical volume etc.?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also the timestamp of the last hit is completly random. It is not even guaranteed to be the last hit in time, as the time sequence does not play any role for the order in which G4 tracks particles

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah good point, we might just keep all values and store the lowest time at the end.

Copy link
Contributor

Choose a reason for hiding this comment

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

That would also be more useful for custom outputschemes. As a customscheme would have access to the hitcollection and can then just store away any time wanted.

And i think you would need a new hit for each hit anyways if you want to differentiate between the different registered calorimeters

@EricMEsch
Copy link
Contributor

The way it is written now, shouldnt there always only be one entry per event? So after the unflattening there would always just be one entry no matter what?

And if the user requested all of the calorimeters to be in a single table, that table would contain the det_uid of the last hit.

On the other hand, requesting one table per calorimeter would not really make sense, as there would only be an entry for one of the calorimeters in which the last hit occured? And that entry would contain the total energy of all calorimeters?

Am i misunderstanding the current implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calorimeter detector and output scheme

5 participants