Problem 99 - Cerenkov process causes run time crash when material is defined with RINDEX values = 1.0
Summary: Cerenkov process causes run time crash when material is defined with RINDEX v...
Status: CLOSED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/optical (show other problems)
Version: 1.1
Hardware: PC Linux
: P2 normal
Assignee: gum
URL: /afs/cern.ch/user/i/ivana/public/g4ce...
Depends on:
Blocks:
 
Reported: 2000-05-23 02:07 CEST by Ivana.Hrivnacova
Modified: 2012-02-15 04:36 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Ivana.Hrivnacova 2000-05-23 02:07:05 CEST
The Cerenkov process causes run time crash when
 material is defined with RINDEX values = 1.0.
 (We use the same material definitions for G3 and G4
 simulation - in G3 these values are allowed.)

 The crash happens when GetMaxValue() is called on
 empty G4PhysicsOrderedFreeVector.

 I reproduced the problem in example N06
 - I've put modified ExN06DetectorConstruction.cc and
 G4Cerenkov.cc with a possible fix (see below) in
 /afs/cern.ch/user/i/ivana/public/g4cerenkov.

 The fix can be done in
 G4Cerenkov::GetAverageNumberOfPhotons(..)
 {
    // .. skipped

        // Check if CerenkovAngleIntegrals is not empty
	G4int vecLength = CerenkovAngleIntegrals->GetVectorLength();

	// Max Cerenkov Angle Integral
        G4double CAImax;
	if (vecLength)
	  CAImax = CerenkovAngleIntegrals->GetMaxValue();

	G4double dp, ge;

	// If n(Pmax) < 1/Beta -- no photons generated

	if (nMax < BetaInverse || !(vecLength))  {
		dp = 0;
		ge = 0;
	}

    // .. skipped
}
Comment 1 gum 2001-02-06 15:15:59 CET
Problem was fixed at/around Nov. 12 2000 by adding a check on:

CerenkovAngleIntegrals->IsFilledVectorExist() in method
GetAverageNumberOfPhotons

and return ZERO when not filled.