Message: Easy way to suppress G4ParticleGun messages on event-by-event changes? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Easy way to suppress G4ParticleGun messages on event-by-event changes? 

Forum: Event and Track Management
Date: 25 May, 2011
From: Michael H. Kelsey <Michael H. Kelsey>

I've written a source where I generate a random gamma from a discrete spectrum, and feed the four-vector to G4ParticleGun for each event. The gamma energy and direction changes on each event, so this seemed like the easiest method:

  G4LorentzVector myGamma = chooseGamma();
  particleGun->SetParticleEnergy(myGamma.e());
  particleGun->SetParticleMomentum(myGamma.vect());

Unfortunately, on every single event I get three lines of output:

[...]
G4ParticleGun::gamma
 was defined in terms of KineticEnergy: 5.9541e-05GeV
 is now defined in terms Momentum: 5.9541e-05GeV/c
G4ParticleGun::gamma
 was defined in terms of KineticEnergy: 5.9541e-05GeV
 is now defined in terms Momentum: 1.7061e-05GeV/c
G4ParticleGun::gamma
 was defined in terms of KineticEnergy: 1.7061e-05GeV
 is now defined in terms Momentum: 5.9541e-05GeV/c
[...]

It doesn't matter whether I set momentum or energy; I get the equivalent messages every time. I've looked at the source, and these messages are not protected. It wasn't obvious to me whether there was any calling sequence I could use which would let me change the gun on every event without the verbosity.

Does anyone out there have a suggestion for how I can configure G4ParticleGun on each event more silently?

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

1 Feedback: Re: Easy way to suppress G4ParticleGun messages on event-by-event changes?   (Gumplinger Peter - 03 Jun, 2011)
(_ None: Re: Easy way to suppress G4ParticleGun messages on event-by-event changes?   (Mike Kelsey - 03 Jun, 2011)
(_ None: Re: Easy way to suppress G4ParticleGun messages on event-by-event changes?   (tntakahashi - 03 Dec, 2011)
(_ None: Re: Easy way to suppress G4ParticleGun messages on event-by-event changes?   (Mike Kelsey - 04 Dec, 2011)
 Add Message Add Message
to: "Easy way to suppress G4ParticleGun messages on event-by-event changes?"

 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 ]