Message: Re: Histogram starting from -0.5 x-axis Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Histogram starting from -0.5 x-axis 

Forum: Analysis
Re: Question Histogram starting from -0.5 x-axis
Re: None Re: Histogram starting from -0.5 x-axis (Ivana Hrivnacova)
Re: None Re: Histogram starting from -0.5 x-axis
Re: None Re: Histogram starting from -0.5 x-axis (Ivana Hrivnacova)
Date: 28 Aug, 2016
From: <jeonyboy@gmail.com>

On Thu, 25 Aug 2016 15:17:13 GMT, Ivana Hrivnacova wrote:
> The histogram range is defined via min, max value which you pass when
> you create (or set) the histogram. The values in underflow and overflow
> bin do not contribute to the histogram mena() etc.
> 
> So you need to use the command
> 
>  /analysis/h1/set 1 100 0 100 MeV"
> 
> When you fill this histogram with 0. value, it will be accounted in the
> bin [1], which center is at 0.5 MeV, but its range is [0.,1.] MeV. You
> can for example try to add such a fill in the B4a example (in
> B4aEventAction class)
> 
>   analysisManager->FillH1(1, fEnergyAbs);
>   analysisManager->FillH1(1, 0.);                 // added
> 
> and then, when you print the resulting histogram, you will get (I ran
> 1000 events):
> 
>  root [3] h1->Print("all") 
>  TH1.Print Name  = 1, Entries= 2000, Total sum= 2000
>   fSumw[0]=0, x=-4, error=0
>   fSumw[1]=1000, x=4, error=31.6228   <==  the bin which was filled
>    (note that the histogram range in this example is 100 bins within 0. and 800. MeV)
>   fSumw[2]=0, x=12, error=0
> 
> Best regards,
> 

Thanks for your help! However, I am not clear on your solution to my problem. What I want is number of particles that deposit exactly 0 energy. I am not sure how your solution helps with that problem.

Are you saying that since bin[1] which is x= 0.5 MeV is range between 0~1, I cannot get just 0?

Again thanks for your help.

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

1 None: Re: Histogram starting from -0.5 x-axis   (Michael H. Kelsey - 29 Aug, 2016)
(_ None: Re: Histogram starting from -0.5 x-axis   (jeonyboy@gmail.com - 30 Aug, 2016)
 Add Message Add Message
to: "Re: Histogram starting from -0.5 x-axis"

 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 ]