Re: weight in TH1F from Tree

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Fri, 20 May 2005 15:57:48 +0200 (MEST)


Hi Jean-Eric,

For real beginners, I have added a new tutorial "basic2.C" in CVS head. It is a variant of the existing short tutorial basic.C showing how to create a tree from an ascii file.

Could you give more details about the examples described in the manual that you find "ugly" and desperating?

We are relectant to add either trivial or too complex information in a Users Guide that is already pretty big. However, I agree that showing simple examples is always good for people starting with the system. Our original expectation was that users will also look in the numerous tutorials provided in the standard distribution.

Rene Brun

On
Fri, 20 May 2005, Jean-Eric Campagne wrote:

> Thanks Rene.
>
> May I suggest you to put on the manual, the very simple TTree creation
> following lines
> TTree T2("t2","Flux Opt Pi-");
>
> T2.ReadFile("sploptiminus130.dat","sene/F:snue:snumu:snutau:sanue:sanumu:sanutau");
> you have suggested to me in one of your previous mails. I know many people
> that this kind of things will help very much... The examples described in the
> manual are a little bit urgly and desperate some well PAW experienced
> people...
>
> Best W.
> J.E
>
>
>
> --On vendredi 20 mai 2005 12:26 +0200 Rene Brun <brun_at_pcroot.cern.ch> wrote:
>
>> Hi Jean-Eric,
>>
>> When you need to include a C++ variable in one of the
>> expressions of TTree::Draw use the Form function (defined in TString)
>> eg
>>
>> const double SCALE = 0.3464e-12/1.e-6;
>> T3.Draw("sene>>h222(501,0.01604,2.00396)",
>> Form("snumu*%g*(sene<1.5)",SCALE));
>>
>> Rene Brun
>>
>> On Fri, 20 May 2005, Jean-Eric Campagne wrote:
>>
>>> Dear developpers,
>>>
>>> Imagine that I have a simple tree (T3) with "sene" and "snumu" as
>>> variable. I would like to produce a 1D histo with "sene" weighted by
>>> "snumu". Up to now there is no problem.
>>> Now, I would like to rescale the weight with a SCALE factor, I have tried
>>>
>>> const double SCALE = 0.3464e-12/1.e-6; //To rescale Old Flux format to
>>> Opti Flux
>>> T3.Draw("sene>>h222(501,0.01604,2.00396)","snumu*SCALE*(sene<1.5)");
>>>
>>> But ROOT give me this error message:
>>>
>>> *ERROR 30 :
>>> Bad numerical expression : "SCALE"
>>>
>>> what can I do?
>>>
>>> NB: I have not done snumu%sene has I would like to impose the binning
>>> via the histo definition...
>>>
>>>
>>> ........................................................................
>>> ... .LAL - IN2P3 - CNRS
>>> .LAL - B.P 34 - 91898 Orsay Cedex - France
>>> .Piece 108
>>> .Tel +33 (0)1 64 46 84 29
>>> .Fax +33 (0)1 64 46 83 97
>>> ........................................................................
>>> ...
>>>
>>>
>
>
>
> ...........................................................................
> .LAL - IN2P3 - CNRS
> .LAL - B.P 34 - 91898 Orsay Cedex - France
> .Piece 108
> .Tel +33 (0)1 64 46 84 29
> .Fax +33 (0)1 64 46 83 97
> ...........................................................................
>
>
Received on Fri May 20 2005 - 15:57:55 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:08 MET