Message: Geant4 G4ParticleGun Output Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Geant4 G4ParticleGun Output 

Forum: Event and Track Management
Date: 27 Jul, 2010
From: Andreas Tepe <Andreas Tepe>

Dear Forum,

I hope, this is the correct forum (and I hope I'm not asking something many people asked before). I was searching for my problem, but could not find it here.

I could track down the problem to this point in G4ParticleGun.cc:

void G4ParticleGun::SetParticleEnergy(G4double aKineticEnergy)
{
  particle_energy = aKineticEnergy;
  if(particle_momentum>0.0){
    if(particle_definition){
      G4cout << "G4ParticleGun::" << particle_definition->GetParticleName()
             << G4endl;
    }else{
      G4cout << "G4ParticleGun::" << " " << G4endl;
    }
    G4cout << " was defined in terms of Momentum: "
           << particle_momentum/GeV << "GeV/c" << G4endl;
    G4cout << " is now defined in terms of KineticEnergy: "
           << particle_energy/GeV   << "GeV"   << G4endl;
    particle_momentum = 0.0;
  }
}

It seems like this method (there are two more in the source file which potentially can produce this kind of output, so it may also be one of those) is complaining whenever a new energy is defined and the old energy had been defined in terms of momentum. We checked our code to see if we are altering the
units somewhere (means using SetParticleEnergy and SetParticleMomentum subsequently), but don't have this in our file.

Unfortunately, we get this waring message very (really very) often:
G4ParticleGun::gamma
 was defined in terms of Momentum: 0.0039373441GeV/c
 is now defined in terms of KineticEnergy: 0GeV
G4ParticleGun::gamma
 was defined in terms of Momentum: 0.0054026528GeV/c
 is now defined in terms of KineticEnergy: 0GeV

Do you have an idea, how to deactivate the message? Do we have to modify this part of the Geant4 code, or can we do something in our own code to avoid it?

Thanks a lot for your help!

Kind Regards,
Andreas

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

1 Feedback: Re: Geant4 G4ParticleGun Output   (Gumplinger Peter - 27 Jul, 2010)
(_ Question: Re: Geant4 G4ParticleGun Output   (Emanuele Leonardi - 11 Feb, 2016)
(_ Feedback: Re: Geant4 G4ParticleGun Output   (Gumplinger Peter - 11 Feb, 2016)
 Add Message Add Message
to: "Geant4 G4ParticleGun Output"

 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 ]