Message: Problem with CLHEP RandGeneral Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Problem with CLHEP RandGeneral 

Forum: Run Management
Date: 16 Jan, 2009
From: valentina <valentina>

Hi all,

I have a problem with CLHEP RandGeneral.
My run crashes giving the message:

FirsovXMMTel: src/RandGeneral.cc:201: double CLHEP::RandGeneral::mapRandom(double) const: Assertion `theIntegralPdf[nbelow] <= rand' failed.

This error occurs randomly during the run (it can happen at the start or after millions of particles).

I simulate the interaction of protons with the optics of XMM Newton space telescope at grazing incidence angles.
For this purpose, I have implemented the G4FirsovScattering process (not in the GEANT4 distribution) that generates the proton scattering angle randomly according to the Firsov probability distribution using Rand General:

 G4double G4FirsovScattering::DoFirsovReflection( G4double phy )
{
    G4double thetaMin = 0.0;
    G4double thetaMax = pi/2;
    G4int nBins = 1000;
    G4double probDist[1000];

    for( G4int i=0; i<nBins; i++ ) {
	G4double theta = thetaMin + ((thetaMax-thetaMin)/nBins)*i;
	probDist[i] = 3*pow(phy*theta,1.5)/
	    (2*pi*phy*(pow(phy,3)+pow(theta,3)));
    }

    CLHEP::RandGeneral randGeneral( probDist, nBins );
    G4double random = randGeneral.shoot();
    G4double scatAngle = thetaMin + (thetaMax-thetaMin)*random;

    return scatAngle;
}

I think that there is some problem with the random distribution of the incident particles, because if I change the seed in currentEvent.rndm, the run doesn't crash or it crashes in another point.

The protons are generated randomly in a macro file:
/random/resetEngineFrom currentEvent.rndm
/run/beamOn 100000000
/random/saveThisRun

the seed is given by (as example):

currentRun.rndm:
Uvec
1878463799
0
1609882275
1339746368

currentEvent.rndm
Uvec
1878463799
0
1943482995
577063730

I hope that my message is enough clear...
Thank you all for your work!!

Best regards,
Valentina Fioretti

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: Problem with CLHEP RandGeneral   (Gumplinger Peter - 16 Jan, 2009)
(_ Ok: Re: Problem with CLHEP RandGeneral   (valentina - 20 Jan, 2009)
(_ Feedback: Re: Problem with CLHEP RandGeneral   (Giovanni Santin - 12 Feb, 2009)
 Add Message Add Message
to: "Problem with CLHEP RandGeneral"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]