Message: How can I get Initial positiion of primary particle? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question How can I get Initial positiion of primary particle? 

Forum: Particles
Date: 07 Sep, 2015
From: JungEun Elena Suh <JungEun Elena Suh>

Dear all

Hello
Can I ask a stupid and simple question?

I want to get several informations of my primary particle which is defined as below.

For example,

/gps/particle ion
/gps/ion 3 6

/gps/ene/type Mono
/gps/ene/mono 10 GeV

/gps/pos/type Plane
/gps/pos/shape Rectangle
/gps/pos/rot1 0 0 1
/gps/pos/rot2 1 0 0
/gps/pos/halfx 10 cm
/gps/pos/halfy 10 cm
/gps/pos/centre 0 -5 0 cm

/gps/ang/type iso

/gps/ang/minphi 0 deg
/gps/ang/maxphi 360 deg
/gps/ang/mintheta -10 deg
/gps/ang/maxtheta 10 deg


Here I want to get initial position of primary particle for each event.
I also want to get momentum of this particle, so I did as below.

--SteppingAction.cc

  G4PrimaryParticle* PrimaryParticle = aTrack->GetDynamicParticle()->GetPrimaryParticle();
  G4double momentumx = PrimaryParticle->GetMomentum().x();
  G4double primaryy = PrimaryParticle->GetVertexPosition().y();
  G4double primaryz = PrimaryParticle->GetVertexPosition().z();

However I can't find the command to get initial position of primary particle.

I want to draw a plot like 'Source X-Y distribution' below.
How can I do this?


   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2015/09/07/14.07-77791-GPSexample.gif


Thank you so much.
Have a nice day!

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

1 Ok: [SOLVED] Re: How can I get Initial positiion of primary particle?   (JungEun Elena Suh - 10 Sep, 2015)
 Add Message Add Message
to: "How can I get Initial positiion of primary particle?"

 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 ]