Message: Re: Particle Hit Question (Novice Level) Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Particle Hit Question (Novice Level) 

Forum: Hits, Digitization and Pileup
Re: Question Particle Hit Question (Novice Level) (E Askan)
Date: 10 Sep, 2008
From: Mark Looper <Mark Looper>

A G4Track object has a SetTrackStatus method that can be used to shut down propagation; in, for example, a class you derive from G4UserSteppingAction:

void MySteppingAction::UserSteppingAction(const G4Step * theStep)
G4Track* theTrack = theStep->GetTrack();

However, since you are dealing with "opticalphoton" objects I will note that I don't think these propagate through materials that don't have optical properties defined anyway. That is, to generate and propagate Cerenkov photons you must have created a G4MaterialPropertiesTable, then used its AddProperty method to assign RINDEX and ABSLENGTH tables to it (refractive index and absorption length), and then used the SetMaterialPropertiesTable method of your G4Material object to associate those tables with your optical materials. If your Cu material doesn't have optical properties defined (and why would it?), "opticalphoton" particles will die on entry automatically if I'm not mistaken.

As for how to log the particles, you might also put that in a G4UserSteppingAction class:

G4String nextVol = theTrack->GetNextVolume()->GetName();
if(nextVol == "dump_here") {
G4cout << [whatever info you need to dump] << G4endl;

 Add Message Add Message
to: "Re: Particle Hit Question (Novice Level)"

 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 ]