Message: Re: How to get start and end position of a particle hit inside geometry Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: How to get start and end position of a particle hit inside geometry 

Forum: Hits, Digitization and Pileup
Re: Question How to get start and end position of a particle hit inside geometry (Tapasi Ghosh)
Date: 17 Mar, 2013
From: Tsukasa Aso <Tsukasa Aso>

Hi,

 For example,

   The created position can be taken by 

   G4Track* track = aStep->GetTrack();
   const G4ThreeVector& vtx = track->GetVertexPosition();  
  // This is the position where this particle has been created.
  // If the particle is primary particle, then the position is same as beam injection position.
  //  If the particle is secondary, then the position is where the particle has been created.


   The final position of the particle will be tank by
  ( include  G4TrackStatus.hh too. )  

   G4Track* track = aStep->GetTrack();
   G4TrackStatus  status = track->GetTrackStatus();
   if  ( status != fAlive ) {         
    //                 ^^^^  Please check the other flags in /source/track/include/G4TrackStatus.hh
        const G4ThreeVector& pos = track->GetPosition();
   }


Tsukasa Aso

 Add Message Add Message
to: "Re: How to get start and end position of a particle hit inside geometry"

 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 ]