Problem 99

Summary: Cerenkov process causes run time crash when material is defined with RINDEX values = 1.0
Product: Geant4 Reporter: Ivana.Hrivnacova
Component: processes/opticalAssignee: gum
Status: CLOSED FIXED    
Severity: normal    
Priority: P2    
Version: 1.1   
Hardware: PC   
OS: Linux   
URL: /afs/cern.ch/user/i/ivana/public/g4cerenkov

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.