Message: Re: Spectrum of Optical photons generated in scintillator Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Spectrum of Optical photons generated in scintillator 

Forum: Processes Involving Optical Photons
Re: Question Spectrum of Optical photons generated in scintillator (Amit Kumar)
Date: 12 Dec, 2014
From: Gumplinger Peter <Gumplinger Peter>

> I want to see energy spectrum of optical photons generated by gamma ray
> in a scintillator. For that I have introduced following lines in
> ClassifyNewTrack() of StackingAction

Note, your code is in ClassifyNewTrack of StackingAction. This code is called before G4SteppingManager::SetInitialStep. It is in SetInitialStep that the G4Track gets its fVtxKineticEnergy class member filled:

http://www-geant4.kek.jp/lxr/source/tracking/src/G4SteppingManager.cc#L325

The G4Track of a secondary is only filled in as much as is done in the constructor:

http://www-geant4.kek.jp/lxr/source/track/src/G4Track.cc#L55

> OpRun is pointing RunAction where I am plotting Energy spectrum but I am
> not getting any spectrum in histogramme and all energy values printed in
> beam_Energy.txt is zero.

No surprise!

> But when I used
> 
> G4double E = (aTrack->GetKineticEnergy())/MeV;
> 
> then I am getting some spectrum non zero energy values in the text file.
> 
> I want to know whether it is the actual spectrum to what I am looking
> for. Because I don't know whether GetKineticenergy is giving energy at
> the starting point or end point of a optical photon track or it is at
> some different point.

Well, your StackingAction is called during the tracking of the particle that generates scintillation photons. Those photons have not yet been tracked.

aTrack->GetKineticEnergy()

is the initial optical photon's energy you want in StackingAction!

I agree it is a bit strange that the 'vertex energy' is not also filled in the constructor. I don't know why? It may be an oversight.

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

1 None: Re: Spectrum of Optical photons generated in scintillator   (Amit Kumar - 15 Dec, 2014)
 Add Message Add Message
to: "Re: Spectrum of Optical photons generated in scintillator"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews