Message: negative currentInteractionLength Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question negative currentInteractionLength 

Forum: Event and Track Management
Date: 22 Jul, 2010
From: Mehmet <Mehmet>

Dear all,

I shoot 4 GeV protons on 100 absorbers (total of 100 km) made of air with different characteristics (1 km each and different temperature, pressure and density). I would like to get the kinetic energy and z distance of the mu- or mu+ when they are just about to pass the last absorber. Here is part of the code in SteppingAction.cc:

void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
G4Track* aTrack = aStep->GetTrack();
   ParticleName = aTrack->GetDefinition()->GetParticleName();
float z=aStep->GetPostStepPoint()->GetPosition().z()/km;
G4double kineticEnergy=aStep->GetTrack()->GetKineticEnergy();

 if ((aTrack->GetDefinition()->GetParticleName()=="mu-")||(aTrack->GetDefinition()->GetParticleName()=="mu+")) {
	   if(z >= 49.9 && z <=50.0) {

G4cout<<"energy="<<aStep->GetTrack()->GetDynamicParticle()->GetKineticEnergy()/MeV<<" energy "<<G4endl;

 G4cout<<"Position "<<z<<"km"<<G4endl;
 G4cout << "Particle name : " << ParticleName<<G4endl;

 FILE *myFile;
	 myFile=fopen("zPosition.txt","a");
	 fprintf(myFile,"%e  %e \n",z,kineticEnergy);
	   fclose (myFile);			
}
}
}

However, no information is written out, and from time to time it complains about "negative currentInteractionLength". When I require the same information for gammas, everything works fine. Apparently, some other users faced similar problem when they dealt with the muons, and either the compiler or the geant4 version is pointed out as the source of the problem.

I have gcc version 4.3.2 (Debian 4.3.2-1.1) as compiler and geant4.9.3. Could anyone please tell me if any of these be the problem? If so, how cold I resolve that? Thank you.

Mehmet

PS: Sorry for the repeated message, but I have just realized my previous post showed up at very close to bottom of the list which I thought would be unrecognized.

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

1 Question: Re: negative currentInteractionLength   (Hisaya Kurashige - 22 Jul, 2010)
(_ None: Re: negative currentInteractionLength   (Mehmet - 23 Jul, 2010)
(_ Feedback: Re: negative currentInteractionLength   (Hisaya Kurashige - 25 Jul, 2010)
 Add Message Add Message
to: "negative currentInteractionLength"

 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 ]