-
Notifications
You must be signed in to change notification settings - Fork 483
Reset mParticles before filled with new set of particles #13768
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
Conversation
|
REQUEST FOR PRODUCTION RELEASES: This will add The following labels are available |
|
Hello @pbuehler, this is done already in Generator::ReadEvent. Could you please provide an example in which you're experiencing such a behaviour? When running o2-sim and the o2dpg machinery I don't see it with EPOS4, JETSCAPE or STARlight. |
jackal1-66
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done already in ReadEvent, where do you get a not cleared particles array?
|
For me this looks ok. Clearing the vector cannot hurt, or can it? However, it would be good having a reproducer of the bug, because I also agree with @jackal1-66 that the vector seems to be cleared in a higher level framework function. If something goes wrong there, we might have a more serious logic problem. @pbuehler : Do you have a reproducer? |
|
|
I'll try to provide a simple example. |
|
Hi @sawenzel , @jackal1-66, the number of particles in the output continuous to increase. // to test do ... namespace o2 { bool openHepMCFile(std::string fname) { }; bool generateEvent() override { bool importParticles() override { }; void printParticles() private: }; } // namespace eventgen |
|
REQUEST FOR PRODUCTION RELEASES: This will add The following labels are available |
Return with false instead of stopping execution.
|
Ok I see. This is because not everyone is calling ReadEvent but one may choose to call generateEvent + importParticles. |
|
@sawenzel most of the generators are not calling the function in importParticles. The only ones which do this for the moment are BoxGenerator and Hybrid (from a fast search in the repo). Indeed if ReadEvent is not called the array won't be cleared and this PR becomes a necessity (as it is for the other generators). |
Without this the particle buffer mParticles is continuously growing.