Problem with seed generation and storage

REST version : v2.2.12_dev
REST commit : dc729211

The new update of seed is not working in my case. There are two independent problems.

  1. The random number is not retrieved properly.

When I do in my console echo $RANDOM a random number comes out normally. But when I enter in a ROOT session and I do.

TRestTools::Execute("echo $RANDOM")

it returns an empty string. This is the method used in restG4.cc and so it results in the same fixed number for each simulation.

This echo RANDOM method was working previously?

  1. The second problem is that when the seed is assigned/updated to TRestG4Metadata in restG4.cc that value is not registered/stored to disk, since Write call must happen before, probably once the RML is read.

A solution to this second problem would be to integrate the random number generation inside TRestG4Metadata when using a keyword? For example, <parameter name="seed" value="random" />?

On our daq server and bl server it is normal
Snipaste_2019-10-30_13-45-12

Maybe it is another OS dependent problem?

An alternative to using echo $RANDOM could be, getting the values from memory address. e.g.

double* dd=new double();
seed=(uintptr_t)dd;
delete dd;

This is a good idea.

That’s strange. We are using Debian, and ROOT 6.14/04. You?

Yes, that’s awesome!

I see you pushed that commit. I have added also the case where seed=“0” will be also random type seed.