Re: Trouble with trees

From: Constantin Loizides <loizides_at_MIT.EDU>
Date: Wed, 8 Jul 2009 10:07:57 +0200


Hi,
could it be a reflex vs cint problem?
(Mario, it would be useful to say which root version in CMSSW you are using) Constantin

Mario Kadastik wrote:

>> It is likely an alignment problem within a struct when using data 
>> types of different lengths. I cannot reproduce it on my machines.
>> Could you run the attached script on your machine and let me know if 
>> it works?
>> It is better to pass the struct pointer instead that the description 
>> of the individual members, ie replace
>>  tree->Branch("cutvars",&cutvars.s,"s/I:mRel/D:sumpt:pt1:pt2:pt3:pt4:dRp:dRn:met:nTau/I"); 
>>
>> by
>>  tree->Branch("cutvars",&cutvars);

>
> Ran your code and it worked just fine. Then I took the generated root
> file and ran my code on it (the same printTree.C that I copied to the
> e-mail previously) and it produced the same result (worked just fine).
> So it seems to be a saving issue with CMSSW somehow. By the way I can
> get the variables out manually:
>
> root [2] t->Show(1)
> ======> EVENT:1
> s = 1
> mRel = 1.00941
> sumpt = 447.262
> pt1 = 44.2483
> pt2 = 88.4943
> pt3 = 113.021
> pt4 = 201.498
> dRp = 0.967189
> dRn = 1.10596
> met = 22.8287
> nTau = 0
> root [3] t->GetLeaf("mRel")->GetValue()
> (const Double_t)1.00940619557053046e+00
>
> And you see that it's Double_t. The interesting part is that GetLeaf
> also shows s to be Double_t:
>
> root [4] t->GetLeaf("s")->GetValue()
> (const Double_t)1.00000000000000000e+00
>
> Odd...
>
> You can get my tree.root file (generated with CMSSW) from
> http://neptune.hep.kbfi.ee/~mario/tree.root just to see if you can
> understand what goes wrong in the saving process...
>
> Mario
>
-- 
Phone: 74450 (+41 22 76 74450)
Cell: 161989 (+41 76 487 1989)
Skype: loizides / AOL: ConLoi
Received on Wed Jul 08 2009 - 10:08:13 CEST

This archive was generated by hypermail 2.2.0 : Wed Jul 08 2009 - 11:50:03 CEST