Hi Alexander,
We will update SetBranchAddress to return a status code.
However, I can not reproduce your example where the address does not change upon a successful call to SetBranchAddress. Could you send a complete running example? (Note eventhough it does work in most cases, setting the address of subobject/subbranch is not fully supported).
Cheers,
Philippe.
Alexander Mann wrote:
> Hi,
>
> the problem is: it does not change as you can see in the example I gave.
>
> a) SetBranchAddress successful => address does not change
> b) SetBranchAddress not successful => address does not change
>
> So apparently, there is no way to distinguish between those cases.
>
> Best regards,
> Alexander
>
>
> Philippe Canal schrieb:
>> 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 Fri Sep 11 2009 - 16:32:27 CEST
This archive was generated by hypermail 2.2.0 : Fri Sep 11 2009 - 17:50:02 CEST