Message: Re: 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

None Re: Easy way to suppress G4ParticleGun messages on event-by-event changes? 

Forum: Event and Track Management
Re: Question Easy way to suppress G4ParticleGun messages on event-by-event changes? (Michael H. Kelsey)
Re: Feedback Re: Easy way to suppress G4ParticleGun messages on event-by-event changes? (Gumplinger Peter)
Re: None Re: Easy way to suppress G4ParticleGun messages on event-by-event changes? (Michael H. Kelsey)
Re: None Re: Easy way to suppress G4ParticleGun messages on event-by-event changes?
Date: 04 Dec, 2011
From: Michael H. Kelsey <Michael H. Kelsey>

tntakahasi@gmail.com writes:
> #include <G4strstreambuf.hh>
>         :
> 
> G4strstreambuf* oldBuffer =
> dynamic_cast<G4strstreambuf*>(G4cout.rdbuf(0));
> 
> particleGun->SetParticleEnergy(energy); 
> particleGun->SetParticleMomentum(momentum); 
>         :
> 
> G4cout.rdbuf(oldBuffer);

That's tricky!  It's sort of like temporarily redirecting to /dev/null.  I
am curious if this technique is thread safe (our application is currently
single-threaded, but that may not be true for production running).

Thanks!
     -- Mike Kelsey

 Add Message Add Message
to: "Re: 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 ]