Re: checking result of SetBranchAddress

From: Alexander Mann <amann_at_uni-goettingen.de>
Date: Fri, 11 Sep 2009 10:39:19 +0200


Hi,

the problem is: it does not change as you can see in the example I gave.

  1. SetBranchAddress successful => address does not change
  2. 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 - 10:39:52 CEST

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