Skip to content

CAFMaker blinding random stream uses the same random numbers as the "fake" reconstruction #306

Open

Description

@PetrilloAtWork

The blinding code introduced in #287 uses a random stream to decide whether the event is going to be kept unchanged.

The bug is that the random seed may end up being the same as the one of the other random stream (which is used for "fake" reconstruction):

fBlindTRandom = new TRandomMT64(art::ServiceHandle<rndm::NuRandomService>()->getSeed());

A different instance should be used instead.
As it is, it is not even clear to me if running the job twice, the same events would be left unblinded.

Also, I would have had CAFMaker, which is an art module, rather use more standard random engine approach, that is using CLHEP engines instead of ROOT's, and taking full advantage of art services to manage those engines. This may be a topic for a separate issue, and is not about blinding alone (same holds for the simplified reconstruction).


I also personally don't love the technical approach, but that's not strictly my call.
Anyway, a more "workflow-based" approach is to have the CAFMaker module write one single stream, either the blinded one or the clear one, instantiate two modules, one for each type, and steer the events to one or the other via a prescale filter. In this way, less complexity is shoved into CAFMaker.

Activity

  1. PetrilloAtWork commented on Oct 20, 2022

    @PetrilloAtWork
    MemberAuthor

    "Assigned" to @etworcester mostly because she should be aware of the issue.
    I don't have much time, but I consider myself bound to help.

  2. etworcester commented on Nov 1, 2022

    @etworcester
    Contributor

    Sorry, just saw this when Wes pinged about it - seems that I don't receive notifications when tagged here. It doesn't really matter to me what random scheme is used - I just wanted something that would work, which this does. If @PetrilloAtWork would like to change the algorithm that is also fine with me - I just want some way of generating three files with prescaled, blinded, and nominal CAF output, with the POT also adjusted accordingly, where I am sure that all events are assigned to the blind or prescaled files with the right proportions and distributed in time the same way as the full data. I did think this would be reproducible (and I think it seemed to be on my quick checks, though I didn't do a dedicated test), but personally don't think it is terribly critical whether or not this is strictly reproducible in multiple CAF productions - the idea was for CAFMaker to be run by keep-up (or in additional production passes) with analyzers using the resulting CAF files - so as long as the desired behavior exists in a given production, I think it's ok. But again, feel free to make it better if you like.

  3. etworcester commented on Nov 1, 2022

    @etworcester
    Contributor

    Also, Jacob pointed out that the fake reco and the blinding will in practice not be run on the same data set (fake reco is MC only, blinding is data only) so that may mitigate the concern about the impact of re-using the random number generator

  4. wesketchum commented on Nov 2, 2022

    @wesketchum
    Contributor

    @PetrilloAtWork can you comment if you are happy with the reply or not?

    If we think something should still be done, then my proposal would be to keep the issue open but target it for a future release, since it sounds like it may not be urgent

  5. wesketchum commented on Nov 8, 2022

    @wesketchum
    Contributor

    OK, very very very very very briefly summing up my understanding of the Slack discussion:

    • what's there is OK for now.
    • it's not critical to change it now
    • we can re-think on a future release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions