Re: checking result of SetBranchAddress

From: Alexander Mann <amann_at_uni-goettingen.de>
Date: Thu, 10 Sep 2009 10:51:35 +0200


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 - 10:51:40 CEST

This archive was generated by hypermail 2.2.0 : Thu Sep 10 2009 - 17:50:02 CEST