Seeding the random engines inside the MixFilter templates
he real issue is that we found ourselves painting ourselves into one corner and came up with a very clever solution that I just realized paints us into a different, deeper corner.
The short description is that we would like you to add a callback in the mixing template so that we (Mu2e) can supply a seed to the random engine that is made for us by the template.
Here is the background. We were starting to encounter poor scaling with the way that we manage seeds for random number engines; we had been using the function get_seed_value(pSet). The problem was that every time we added a new module, everyone had to rewrite their grid workflow scripts to update one more seed.
Our solution was to create a new service, the SeedService, which can then hand out seeds according to an algorithm and which only needs two numbers from the workflow system, regardless of how many engines are being seeded. I just finished converting all of our own modules to use this.
The outstanding issue is how to deal with the mixing template. I see two solutions. Do you/can you instantiate the mixing detail object before you instantiate the random engine? If so, we can solve the problem by having you call a method of the detail class to get the seed. If the required ordering is not possible, then we will need to reseed the engine after creation.
We also need to understand how to maintain compatibility with other experiments who are still using the old system. I presume that there are good solutions for that.
One more comment. I strongly suspect that the SeedService needs to remain experiment specific for now.
#2 Updated by Rob Kutschke about 9 years ago
I believe that I have a solution that will work for now. In my detail method
I trap the first call, get the engine and reseed the engine. This will work for now but I don't think that it is a good long term solution - it's misleading that the seed is set twice, with the second over riding the first and with things documented in different places.