I am wondering whether it is possible to compute the hash of a branch value in TTree::Draw().
Motivation: I need a random number, which I know I can get with rndm(). However, I need the random number to be reproducible on the event level. The value of rndm(), however, depends on how often it has been called. For example, if you do
the result differs from the left column in
I imagine this can be solved using a hash of the event number, but maybe there is another way. Do you have any suggestions?
You could do something like:double Randomizer(UInt_t eventNumber)
{
// this or any other 'hashing/randomizing' algorithm.
TRandom3 engine(eventNumber); // setting the seed.
return engine.Rndm();
}and then
You can also have multiple argument to the function (as long as they are not arrays).