I am trying to use a TSelector using Proof and in my code, I want to pass a parameter to the TSelector. For this, I have in my macro which launch the TSelector:
TProof *p = TProof::Open("");
The problem is that when I want to get this parameter in my TSelector using:
I obtain a seg fault because fInput is a NULL pointer. I don"t understand what I am doing wrong… if someone can help me.
Thanks in advance
I do not see anything wrong either except perhaps the template specialization.
In which point of the TSelector are you calling this?
Can you check if the list get anything by doing a
instead of the statement that crashes?
I call this in the SlaveBegin method.
fInput->Print() crash also because fInput is equal to 0x0, as if it is never initialized…
Sorry, I overlooked that fInput is null, not the return from FindObject.
That’s very strange, fInput should never be null.
Unfortunately I am not able to reproduce te problem. Attached is code for a very similar example: just unpack and run testSel .
If you want I can give a look at (the essential parts of) your code.
What ROOT version is this with?
simple-input.tgz (2.67 KB)
Ok now it works, thank you. I have re-built my code following yours. The only difference that I saw is that I was reading a TTree and not a TChain in wich a TTree has been added.
Thank you for your help
Good to read that.
I will then mark the issue as solved.
Thanks for the feedback.