Re: : how to add additional (energy) abscissa to a TOF spectrum?

From: Kazuyoshi Furutaka <furutaka_at_jb3.so-net.ne.jp>
Date: Mon, 05 Nov 2007 22:16:13 +0900 (JST)


Dear Olivier,

Thanks for your followup and sorry not to be descriptive enough...

From: "Olivier Couet" <Olivier.Couet_at_cern.ch> Subject: RE: : [ROOT] how to add additional (energy) abscissa to a TOF spectrum? Date: Mon, 5 Nov 2007 13:45:04 +0100

> I guess what you do not like is the overlapping labels on the axis on
> top ? When you use a TGaxis with tick marks placed according to a
> function there is no labeling optimization performed. Therefore you can
> sometimes get such situation. I tried a few things to try to improve it
> but none of them are really satisfactory. Do you have an picture showing
> the kind of plot you would like ?

Well, E(eV)=(72.3*FlightLength(meter)/TOF(microsec))**2 for low-energy neutrons, and therefore for 10-meter flight path length, a neutron TOF of 10 microsec should correspond to (72.3*10.0/10.0)**2=(72.3)**2 eV.
By using the script I've attached to my previous e-mail, however, I couldn't get the correct scale for energy in the upper abscissa.
I'm sure I'm doing wrong in some places (maybe the use of TF1 or TGaxis) but I couldn't figure out what are wrong... Are there any existing examples which properly depict energy as well as time-of-flight axes?

(Of course it's better to have a through control over the labels, by the way.)

The attached is the same script as the previous one.

Thanks in advance.

Yours,
Kazuyoshi

--
Kazuyoshi Furutaka
furutaka_at_jb3.so-net.ne.jp

{ gStyle->SetOptStat(0); TH1F* tof = new TH1F("tof","10-m neutron TOF: E(eV)=(72.3*10(m)/TOF(#mus))^2", 90,10.0,100.0); tof->GetYaxis()->SetRangeUser(0,10); tof->GetXaxis()->SetTitle("neutron TOF (#mus)"); tof->Draw(); TF1* fEne = new TF1("fEne","pow(72.3*10.0/x,2)",10.0,100.0); TGaxis* energyAxis = new TGaxis(10,10,100,10,"fEne",510,"-"); energyAxis->SetTitle("energy (eV)"); energyAxis->Draw(); }

Received on Mon Nov 05 2007 - 14:16:50 CET

This archive was generated by hypermail 2.2.0 : Mon Nov 05 2007 - 23:50:02 CET