Re: checking result of SetBranchAddress

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Thu, 10 Sep 2009 09:56:22 -0500


Hi Alexander,

 > no, it returns the same value before and after the call of SetBranchAddress, regardless of the success of SetBranchAddress, i.e. I get e.g.

So your best bet is to check whether the address did change :)

Cheers,
Philippe.

Alexander Mann wrote:
> Hello,
>
> are there any ideas how to check whether SetBranchAddress() has been
> successful?
>
> Best regards,
> Alexander
>
>
> Alexander Mann schrieb:
>> Hello Rene,
>>
>> no, it returns the same value before and after the call of
>> SetBranchAddress, regardless of the success of SetBranchAddress, i.e.
>> I get e.g.
>>
>> .
>> .
>> .
>> --> StacoMuon_nucone20 before 0x9af93a0
>> [ SetBranchAddress is called ]
>> --> now is 0x9af93a0
>>
>> --> StacoMuon_bestMatch before 0x9afb4c8
>> [ SetBranchAddress is called ]
>> Error in <TTree::SetBranchAddress>: The pointer type give
>> (vector<bool>) does not correspond to the class needed (vector<int>)
>> by the branch: StacoMuon_bestMatch
>> --> now is 0x9afb4c8
>> .
>> .
>> .
>>
>> Best regards,
>> Alexander
>>
>> Rene Brun schrieb:
>>> You can use TBranch::GetAddress. If it returns 0 the
>>> SetBranchAddress was not successful.
>>>
>>> Rene Brun
>>>
>>> Alexander Mann wrote:
>>>> Hi,
>>>>
>>>> is there a way to determine whether TTree::SetBranchAddress has been
>>>> successful? If I try to call it with the wrong variable type it will
>>>> print an error message, which is useless as long as I cannot catch
>>>> this
>>>> error in my code. So is there a way to find out if the command has
>>>> been successful?
>>>>
>>>> Best regards,
>>>> Alexander Mann
>>>>
>>>
>>
>
Received on Thu Sep 10 2009 - 16:56:26 CEST

This archive was generated by hypermail 2.2.0 : Fri Sep 11 2009 - 11:50:02 CEST