Message: Re: How to record the exit point of a particle in the detector? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: How to record the exit point of a particle in the detector? 

Keywords: Exit point of a gamma
Forum: Event and Track Management
Re: Question How to record the exit point of a particle in the detector? (Carlos Martinez)
Date: 20 Mar, 2008
From: Gumplinger Peter <Gumplinger Peter>

in your SteppingAction:

G4StepPoint* thePrePoint = theStep->GetPreStepPoint();

G4VPhysicalVolume* thePrePV = thePrePoint->GetPhysicalVolume();

G4StepPoint* thePostPoint = theStep->GetPostStepPoint();

G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();

if( thePostPoint->GetStepStatus()==fGeomBoundary ){

  if( thePostPV ){

    if( thePostPV->GetName()=="Outside" && 
        thePrePV ->GetName()=="Scintillator" ) {

          G4double exitX = pPostPoint->GetPosition().x();

          G4double exitY = pPostPoint->GetPosition().y();

          G4double exitZ = pPostPoint->GetPosition().z();

    }

  }

}

A look at many of G4 examples would also reveal similar code. A good tool

is: http://www-geant4.kek.jp/LXR/index.html

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

 Add Message Add Message
to: "Re: How to record the exit point of a particle in the detector?"

 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 ]