Problem 2276

Summary: /random/setSeeds accepts only integer type, not long int type
Product: Geant4 Reporter: Anna Zaborowska <anna.zaborowska>
Component: runAssignee: asai
Status: RESOLVED FIXED    
Severity: major    
Priority: P4    
Version: 10.6   
Hardware: All   
OS: All   

Description Anna Zaborowska 2020-09-29 14:28:45 CEST
UI command /random/setSeeds parses the arguments as integers instead of long int. Passing long type results in conversion to INT_MAX.

Relevant code in G4RunMessenger.cc (line 614+)

    G4Tokenizer next(newValue);
    G4int idx = 0;
    long seeds[100];
    G4String vl;
    while(!(vl = next()).isNull())
    {
      seeds[idx] = (long) (StoI(vl));
      idx++;
    }

I suggest we create `G4long G4UImessenger::StoL(G4String)` method to fix it.

Bug reported on Geant4 forum (https://geant4-forum.web.cern.ch/t/random-setseeds-seems-to-not-work/3541/7).
Comment 1 Anna Zaborowska 2020-09-30 19:49:48 CEST
Fixed by introducing `G4long G4UImessenger::StoL(G4String)` method.