Message: Re: Units in g4.10-patch03 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Units in g4.10-patch03 

Forum: Analysis
Re: Feedback Units in g4.10-patch03 (Alexey Solovyev)
Date: 07 Nov, 2014
From: Ivana Hrivnacova <Ivana Hrivnacova>


The old behavior was found inconsistent with the way how physical quantities with units are passed in Geant4 code in general. Unit is always required.

So the meaning of the unit (the last argument provided) in the call

 analysisManager->CreateH1("B_spectrum", "Boron Spectrum", 1000, 0, 2*GeV, "GeV");

is really the unit in which the values will be filled and displayed in the histogram. This way is also more suitable when you pass a value of a physicical quantity; eg. myDetector->GetLength():

 analysisManager->CreateH1("myH1", "Title", 100, 0, myDetector->GetLength(), "cm");

Note that when using the UI commands, the values passed are interpreted with the unit which is provided. So the equivalent of your setting is:

 /analysis/h1/create "B_spectrum" "Boron Spectrum" 1000 0 2 GeV

When checking this, I realized that a part of the fix was not correctly propagated from the development version in the patch03, due to which passing units with create/set commands does not work properly. I have attach a tar file with a fix in the bug report system:

Please, take this file if you are using the analysis UI commands with units. If not, you don't need it.

Best regards,

 Add Message Add Message
to: "Re: Units in g4.10-patch03"

 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 ]