GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » [FIXED] Produce ROOT file with FairRoot Structure
[FIXED] Produce ROOT file with FairRoot Structure [message #22371] Mon, 19 March 2018 13:24 Go to next message
wesmail is currently offline  wesmail
Messages: 2
Registered: March 2018
Location: Juelich
occasional visitor
From: *ext.kfa-juelich.de
Dear experts,

I have a ROOT file that contains probability distributions of different particles (e, mu, pi, k, p) stored in TClonesArray "branch named PidAlgoMl" (image 1), but I want it to be of the same structure of image 2, that is the branch "PidAlgoMl" inside folder "Pid" which is inside folder "cbmout". How to do this using PANDARoot or FairROOT classes.

Thank you very much in advance,

index.php?t=getfile&id=9881&private=0
index.php?t=getfile&id=9884&private=0
  • Attachment: 1.png
    (Size: 225.94KB, Downloaded 555 times)
  • Attachment: 2.png
    (Size: 300.24KB, Downloaded 461 times)


Waleed Esmail

[Updated on: Wed, 21 March 2018 10:34] by Moderator

Report message to a moderator

Re: Produce ROOT file with FairRoot Structure [message #22374 is a reply to message #22371] Mon, 19 March 2018 13:42 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 88.128.82*
How have you created your container? The proper way is using a Task which fills for each event and each PidCandidate the proper probabilities.
The correct way is shown, as example, in pid/PidClassifier/PndPidDrcAssociatorTask class, which is quite simple. You have to follow such structure, just change the name of the classes and the numbers you put inside.
cbmout.pid.XXX is not business of the developer if you use the suggested structure. Anyway, the line which write your container inside pid is:

FairRootManager::Instance()->Register("PidAlgoDrc","Pid", fPidChargedProb, kTRUE); 


Re: Produce ROOT file with FairRoot Structure [message #22377 is a reply to message #22374] Mon, 19 March 2018 14:20 Go to previous messageGo to next message
wesmail is currently offline  wesmail
Messages: 2
Registered: March 2018
Location: Juelich
occasional visitor
From: *ext.kfa-juelich.de
Dear Stefano,

thank you very much for your instant reply. I am aware of the associator task, but I don't know how to use it because at Init() method it tries to get the TClonesArray from the input file and I face the same problem ("PidAlgoMl is not in cbmout folder" because my file is not in the same RootFair structure) and crashes.

N.B I fill the TClonesArray in a python program independent of FairRoot package, but I can access FairRoot from python. How to use Register method independent from associator Task?!.

Thank you again,


Waleed Esmail
Re: Produce ROOT file with FairRoot Structure [message #22381 is a reply to message #22377] Mon, 19 March 2018 14:26 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 88.128.82*
The starting point is a TClonesArray filled with PidCandidate objects, event by event. For each event, for each PidCandidate, the Associator produces a PidProbability object, and registers it. Without the input PidCandidate you cannot fill the probabilities.
Other ways to fill TCAs, such us using python, are not using the fairroot tree and are not compatible. Register is a function of fairroot, then you cannot use it in python.
Re: Produce ROOT file with FairRoot Structure [message #22389 is a reply to message #22381] Wed, 21 March 2018 10:13 Go to previous message
Waleed Esmail is currently offline  Waleed Esmail
Messages: 9
Registered: March 2018
occasional visitor
From: *ikp.kfa-juelich.de
thank you very much, I solved the problem by reading the output python file explicitly in the Init() method of the associator task, and register the output to have the same branch structure of FairRoot.

Thanks again for your help Smile

[Updated on: Wed, 21 March 2018 10:14]

Report message to a moderator

Previous Topic: new gitlab-runner for dev branch
Next Topic: Problems with new GEM Geometry
Goto Forum:
  


Current Time: Thu Jun 13 02:58:21 CEST 2024

Total time taken to generate the page: 0.00877 seconds