snoplusuk / echidna

MIT License
4 stars 12 forks source link

Sampling MC to make a "fake data" spectrum #117

Open ashleyrback opened 8 years ago

ashleyrback commented 8 years ago

@drjeannewilson and I were discussing how we could build into echidna the ability to create a "fake dataset" by selecting a random sample of say 10% of MC events.

We thought the best way to do this may be to add a get_valid-type method to the extractor base class that would be called per event. A new class member (e.g. _sample_fraction would set the faction you wish to sample. By default it would return True for all events (_sample_fraction = 1.0).

I think the only tricky part here is how we make sure it is only called once per event.

We should also consider this in the Extractor discussions in #96. This is the sort of thing that we probably want to happen (where possible) in a uniform way, rather than in an ad-hock way via a pyroot script filling the spectrum.

@drjeannewilson has agreed to start having a look into this.