GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » AddFriend
AddFriend [message #4725] Sun, 22 July 2007 22:12 Go to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *dip.t-dialin.net
Hello,
during the weekend I simulated many events, and the output of my simulation macro was composed by several files (bigdata_mega_X.root).

Then I launched my reconstruction, I added all the files with the fRun->AddFile() function, in order to have only one file with the output (full_bigdata_mega.root).

Then I wanted to launch my macro, and to use even the MCTrack information. In mý macro I put the following lines:

TFile* f = new TFile("$DATA/panda/kick/full_bigdata_mega.root"); TTree *t=(TTree *) f->Get("cbmsim") ;
t->AddFriend("cbmsim","$DATA/panda/kick/bigdata_mega.root");
t->AddFriend("cbmsim","$DATA/panda/kick/bigdata_mega_1.root");
t->AddFriend("cbmsim","$DATA/panda/kick/bigdata_mega_2.root");
t->AddFriend("cbmsim","$DATA/panda/kick/bigdata_mega_3.root");


Fist of all I get several warnings, telling me that the size of the friend is less than the original file (of course, but the sum of friends corresponds to the total size of the first file), then the analysis run smoothly, but when it exceeds the number of events of the first friend (so when it has to move to the next one), I have an error (illegal pointer to class...), so the friend mechanism has failed.

What I did wrong? Or is there some bug?

P.S. If I try to create one reconstruction file per each "son" of the first file, the first one is ok (bigdata_mega) but from the 2ns one (bigdata_mega_1) the analysis crashes (-E- CbmRootManager Branch: EventHeader. not found in Tree).

[Updated on: Sun, 22 July 2007 22:16]

Report message to a moderator

Re: AddFriend [message #4726 is a reply to message #4725] Mon, 23 July 2007 09:22 Go to previous messageGo to next message
Aleksandra Wronska is currently offline  Aleksandra Wronska
Messages: 38
Registered: May 2006
Location: Cracow
continuous participant
From: *if.uj.edu.pl
Hi Stefano,

I think AddFriend is used when you want to merge infos from two different trees, but sort of "paralel": e.g. in tree1 you store energy loss and in tree2 you store momenta for the same collection of events.
If you want to add trees one after the other, you should rather use the chain mechanism, I guess:
TChain t("cbmsim");
t.AddFile("$DATA/panda/kick/bigdata_mega.root");
t.AddFile("$DATA/panda/kick/bigdata_mega_1.root");
etc...


hope that helps,
ola
Re: AddFriend [message #4727 is a reply to message #4726] Mon, 23 July 2007 10:57 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Hi,

Aleksandra Wronska wrote on Mon, 23 July 2007 09:22

I think AddFriend is used when you want to merge infos from two different trees, but sort of "paralel": e.g. in tree1 you store energy loss and in tree2 you store momenta for the same collection of events.


Indeed this is what I wanted to do, merge different but parallel trees with different informations (one with MCTrack, the pther with reconstruction categories). The only problem is that the simulation part was composed by several files, while the reconstructed one only by one.

Quote:


If you want to add trees one after the other, you should rather use the chain mechanism, I guess:
TChain t("cbmsim");
t.AddFile("$DATA/panda/kick/bigdata_mega.root");
t.AddFile("$DATA/panda/kick/bigdata_mega_1.root");
etc...




Well, I decided to do the contrary of what I did before, so to define the tree with the simulation and the friend which contains the only reconstruction file:

TChain t("cbmsim");
t->AddFile("$DATA/panda/kick/bigdata_mega.root");
t->AddFile("$DATA/panda/kick/bigdata_mega_1.root");
t->AddFile("$DATA/panda/kick/bigdata_mega_2.root");
t->AddFile("$DATA/panda/kick/bigdata_mega_3.root");
t->AddFriend("cbmsim","$DATA/panda/kick/full_bigdata_mega.root");


In this way I get no warning, but the analysis crashes at the same point.
Re: AddFriend [message #4738 is a reply to message #4725] Tue, 24 July 2007 13:48 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Stefano

Can you please send my all three macros by mail that i can try
to understand what you do.

Ciao

Florian
Re: AddFriend [message #7365 is a reply to message #4725] Wed, 01 October 2008 09:16 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *pools.arcor-ip.net
Hi again,

what i was meaning was

by using the methods from CbmRunAna, in order to lunch
a CbmTask,

not Tchain from pure root.
Re: AddFriend [message #7366 is a reply to message #7365] Wed, 01 October 2008 09:18 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
It is the same problem,
it does not work neither with CbmRun (or at least this is my experience).
icon8.gif  Re: AddFriend [message #7367 is a reply to message #7366] Wed, 01 October 2008 09:30 Go to previous message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *pools.arcor-ip.net
Mad And the question is ,

is that a problem of root, or of how this cbmRoot Manger is implemented?
Are the people involved not here?
where is Mohammad, Florian....?

Because i think that is aseriuos problem, if you want to run a full simulation!!!!
Previous Topic: Dashboard oflline
Next Topic: cbmRunAna.cxx AddFile AddFriend
Goto Forum:
  


Current Time: Thu Oct 10 06:02:45 CEST 2024

Total time taken to generate the page: 0.00727 seconds