GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » cbmRunAna.cxx AddFile AddFriend
cbmRunAna.cxx AddFile AddFriend [message #7363] Tue, 30 September 2008 19:14 Go to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *gsi.de
Dear all, i try to run the following:

i have from my MC simulation the following outfiles

TString inFile="sim_tof_Bgfulljun08.root";
TString inFile2 = "sim_tof_Bgfulljun08____1.root";
TString inFile3 = "sim_tof_Bgfulljun08____2.root";

they are output of 10k event from urqmd generator.

to read them all, and be able to apply my digi task i do

fRun->SetInputFile(inFile.Data());

fRun->AddFile(inFile2.Data());
fRun->AddFile(inFile3.Data());

fRun->SetOutputFile(outFile);

the problem is now that i want
to use also another task for reco, and then i need

the digi output "outFile" and the MC output


TString inFile="sim_tof_Bgfulljun08.root";
TString inFile2 = "sim_tof_Bgfulljun08____1.root";
TString inFile3 = "sim_tof_Bgfulljun08____2.root";

so by using another macro to run my reco i do,


fRun->SetInputFile(inFile.Data());

fRun->AddFile(inFile2.Data());
fRun->AddFile(inFile3.Data());

fRun->AddFriend(outFile.Data());
fRun->SetOutputFile(RecoFile);

the problem is then that by using AddFile and AddFriend together
the files are not properly added and i the task doesn't find
the Tclonesarray from the files.

but if i do only


fRun->SetInputFile(inFile.Data());

fRun->AddFriend(outFile.Data());
fRun->SetOutputFile(RecoFile);


than it work,
can any of you help me?

thanks a lot
Alicia.
Re: cbmRunAna.cxx AddFile AddFriend [message #7364 is a reply to message #7363] Tue, 30 September 2008 21:26 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *dip.t-dialin.net
I had a similar problem more than one year ago:

http://forum.gsi.de/index.php?t=tree&goto=4725&rid=306

And I think the problem is still there. Or at least I did some tries one week ago, and I was not able to make it work.

Re: cbmRunAna.cxx AddFile AddFriend [message #7368 is a reply to message #7363] Wed, 01 October 2008 09: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 Alicia

If i understand it correct you have several MC files but only one DIGI file.

Can you try the following

fRun->SetInputFile(inFile.Data());
fRun->AddFriend(outFile.Data());

fRun->AddFile(inFile2.Data());
fRun->AddFriend(outFile.Data());

fRun->AddFile(inFile3.Data());
fRun->AddFriend(outFile.Data());

fRun->SetOutputFile(RecoFile);

Ciao

Florian
Re: cbmRunAna.cxx AddFile AddFriend [message #7371 is a reply to message #7368] Wed, 01 October 2008 13:33 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *gsi.de
Dear Florian,
thank you very much for your advice
now it seems work properly, anyway i have found some document attached by Mojhammad
http://www.gsi.de/documents/DOC-2004-Nov-122-1.ppt


I have also tried to do the same by using a macro
by doing Tchain with several files and then add also friend to them.

And also works but one has to do the following

Tchain * mychain =new TChain("cbmsim");
mychain->Add("file.root")
mychain->Add("file_2.root")
mychain->Add("file_3.root")

Tchain * myfriend =new TChain("cbmsim");
myfriend->Add("filefriend.root")

mychain->AddFriend(myfriend)

best regrads
ALicia.
Re: cbmRunAna.cxx AddFile AddFriend [message #7372 is a reply to message #7371] Wed, 01 October 2008 17:00 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 Alicia

How does it work? Did you use the TChain or my solution?

Ciao

Florian
Re: cbmRunAna.cxx AddFile AddFriend [message #7373 is a reply to message #7372] Wed, 01 October 2008 17:39 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *gsi.de
Hi
sorry i have used your solution.

best regrads
alicia.
Re: cbmRunAna.cxx AddFile AddFriend [message #7374 is a reply to message #7373] Wed, 01 October 2008 17:47 Go to previous message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Alicia

I only wanted to know if this version works.

Ciao

Florian
Previous Topic: AddFriend
Next Topic: CbmGeo and points from SImulation
Goto Forum:
  


Current Time: Thu Oct 10 06:33:26 CEST 2024

Total time taken to generate the page: 0.00854 seconds