GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » root files with the same hitcolection structure
root files with the same hitcolection structure [message #5990] Thu, 28 February 2008 18:14 Go to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *gsi.de
Dear all,

i would like to get information about CBMTask,
the problem is the following

i have to run the event generator UrqmdSmm inetrface
with 10k evetns to simulate my particle background.

In the other thand, i should simulate my signal
by runnig 500kevents with AsciiGenertator interface.

As you see i cannot run them together
because the number of events is diffrence.
So i run them separately, and i get two root outputs
for my signal and for background which have the same inner structure(SiHypPoint , GeHypPoint and TofHypPoint).

In order to get rid of them i wanted to build a task(CbmTask)

The point now is how to read the both root output files
by using CBMTask, because both of them have the same structure

and i would like to be able to separate the SihypPoint for the Background from the SihypPoint of the signal.

In a simple c++ macro, i solve the problem by doing the following,

Tfile *g = new TFile("backgroung.root")
Tfile *f = new TFile("signal.root")
TTree *bg = (TTree *)g->Get("cbmsim")
TTree *sig = (TTree *)f->Get("cbmsim")
but how to do in CbmTask?

i hope it's clear what i mean.
Anyway, any idea?

best regards

Alicia
Re: root files with the same hitcolection structure [message #5991 is a reply to message #5990] Thu, 28 February 2008 19:40 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
If I have understood well the request,
in your macro you should do something like:

CbmRunAna *fRun = new CbmRunAna();
fRun->SetInputFile(simfile);
fRun->AddFile(simfile2);
fRun->AddFile(simfile3);
...

and the tasks will run over all of the added files.

Hope it helps.

Re: root files with the same hitcolection structure [message #5992 is a reply to message #5991] Fri, 29 February 2008 10:32 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *gsi.de
Hi
yes
that would work if all the files would have the same number of events, but that it is not the case.

ok, anyway i will try by doing a c++ macro instead of a CMbTask.
Thanks a lot anyway,
alicia S.
Re: root files with the same hitcolection structure [message #5993 is a reply to message #5992] Fri, 29 February 2008 11:12 Go to previous message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Why?
It should not depend on the total event number such as AddFriend.

Are you sure?
Previous Topic: TGeoManager and TGeoVolume
Next Topic: Covariance Matrix for CbmHit
Goto Forum:
  


Current Time: Wed Dec 04 22:50:47 CET 2024

Total time taken to generate the page: 0.00544 seconds