Message: Read Energy Spectrum from a text file. Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Read Energy Spectrum from a text file. 

Forum: Particles
Date: 21 Sep, 2016
From: Victor Meldrew <Victor Meldrew>

Hello All,

   My complete code is here: https://goo.gl/YzIeFc

   My energy spectrum is generated by another simulation program, and saved to a text file (say "spectrum.txt") and its format is:

Energy1 , NormalisedValue1
Energy2 , NormalisedValue2
Energy3 , NormalisedValue3
...
EnergyN , NormalisedValueN

   
   I implemented both the PrimaryGeneratorAction and PrimaryGeneratorMessenger.
The PrimaryGeneratorMessenger reads a "scalefactor" double value from the input macro file:

/experiment1/spectrum/scalefactor 1.03


 What I would like to do is read "spectrum.txt", and multiply NormalisedValue1 by the scalefactor.

  Could you point out to any examples where this is done?

  I am aware that I can set the histogram by using something like
"/gps/hist/point 1.0023 202.26", but I want to read this from a text file.

  Hopefully my question is clear.

  My skeleton code is here: https://goo.gl/YzIeFc

  Thanks

Victor.

  

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

1 None: Re: Read Energy Spectrum from a text file.   (Youming Yang - 23 Sep, 2016)
 Add Message Add Message
to: "Read Energy Spectrum from a text file."

 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 ]