How to continue sequence of randoms in TRandom3 generator?

I have :

ROOT Version: 6.22/01
Platform: 18.04.1-Ubuntu
Compiler: g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

Problem : I am planning long simulation by geant4, using TRandom3 generator in
a form of series of files and each file should be generated on independent
randoms.I want In one run before close of output file to remember
status of generator,wirte it out( either seed number or …?) and in the following
run to continue since what I had in the end of previous one.

Thanks

Try to gRandom->Write("MyRandom"); to a ROOT file (you can then retrieve it using a standard “Get” / “GetObject” statement).

Actually, there exist TRandom::WriteRandom and TRandom::ReadRandom which you could try to use.

Dear Mr. Wile E. Coyote!
Thanks one more for the respond!
May be you know answer to the next couple of questions:

1.In ROOT documentaion( page 42,ROOTUsersGuideA4.pdf) there is
a phrase “…Setting the seed to 0 implies that the seed will be
uniquely generated using
the TUUID. Any other value will be used as a constant…”. What is the
difference
between these two cases?

  1. According to ROOT documentation, TRandom3 does not have good
    statistical
    characteristics. When I worked on FORTRAN I used to work with
    TRandomRanluxpp
    generator. While using it in root, may I organize the prolongation of
    random
    numbers as you recommended in a prvious e-mail? - In this case I
    should do resetting like this:

root[] delete gRandom;
root[] gRandom = new TRandomRanluxpp(0); //seed=0

Am I right?

V.Kurbatov

{
  // delete gRandom; gRandom = new TRandomRanluxpp();
  gRandom->Print();
  std::cout << "Observe!" << std::endl;
  gRandom->SetSeed(1234); std::cout << gRandom->Rndm() << std::endl;
  gRandom->SetSeed(1234); std::cout << gRandom->Rndm() << std::endl;
  gRandom->SetSeed(0);    std::cout << gRandom->Rndm() << std::endl;
  gRandom->SetSeed(0);    std::cout << gRandom->Rndm() << std::endl;
  gRandom->SetSeed(1234); std::cout << gRandom->Rndm() << std::endl;
  gRandom->SetSeed(1234); std::cout << gRandom->Rndm() << std::endl;
  gRandom->SetSeed(0);    std::cout << gRandom->Rndm() << std::endl;
  gRandom->SetSeed(0);    std::cout << gRandom->Rndm() << std::endl;
  std::cout << "Dashing, no?" << std::endl;
}

Trying :

delete gRandom;
gRandom = new TRandomRanluxpp(0);

root gives :

ROOT_prompt_1:1:15: error: unknown type name ‘TRandomRanluxpp’

Why?

Your ROOT version does not have it (as of today, you need the git “master”).