LDMX-Software / ldmx-sw

The Light Dark Matter eXperiment simulation and reconstruction framework.
https://ldmx-software.github.io
GNU General Public License v3.0
22 stars 20 forks source link

Update DigitizationProcessor to use RandomNumberSeedService #1332

Closed omar-moreno closed 5 months ago

pbutti commented 1 year ago

@omar-moreno Is this already implemented?

omar-moreno commented 1 year ago

I haven't implemented it. I'll do this as part of the detector load update.

tomeichlersmith commented 1 year ago

Notes for whomever does this in the future:

The seeding currently happens in onProcessStart at

https://github.com/LDMX-Software/ldmx-sw/blob/69f01ee406fa60518c9d0cf1e2ba551040aace8c/Tracking/src/Tracking/Reco/DigitizationProcessor.cxx#L56-L57

Instead, one should seed the generator in onNewRun which is after the conditions are configured and then one could

const auto& rseed = getCondition<framework::RandomNumberSeedService>(
        framework::RandomNumberSeedService::CONDITIONS_OBJECT_NAME);
generator_.seed(rseed.getSeed("Tracking::DigitizationProcessor");
tvami commented 6 months ago

@tomeichlersmith you practically implemented this, is there any reason why you didnt PR it? Should I do it?

tomeichlersmith commented 6 months ago

No real reason, I vaguely remembering that this required an update to Framework so that conditions could be used in onNewRun, but I am confident this is fixed now.