ldmx-sw icon indicating copy to clipboard operation
ldmx-sw copied to clipboard

Update DigitizationProcessor to use RandomNumberSeedService

Open omar-moreno opened this issue 2 years ago • 5 comments

omar-moreno avatar Feb 28 '23 00:02 omar-moreno

@omar-moreno Is this already implemented?

pbutti avatar Jun 21 '23 12:06 pbutti

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

omar-moreno avatar Jun 22 '23 00:06 omar-moreno

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");

tomeichlersmith avatar Sep 13 '23 17:09 tomeichlersmith

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

tvami avatar May 08 '24 21:05 tvami

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.

tomeichlersmith avatar May 08 '24 21:05 tomeichlersmith