Re: [ROOT] Chain and MakeClass Problem

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Mar 05 2003 - 22:02:46 MET


Hi Dan,

On 5 Mar 2003, Dan Krop wrote:

> Hi,
> 	Thank you for the solution and the fast response time.  I would like to
> point out 2 things:
> 
> 1. The script which created the analysis class actually was, 
> {
>   
>   TChain chain("ntuple");
>   chain.Add("ntup1.root");  // Ntuple with floats
>   chain.Add("ntup2.root");  // Ntuple with doubles 
> 
>   ntuple.MakeClass("Analysis");
> }
> 
> So, the reason floats was declared in the Analysis.h file was because
> the 1st file had floats.  It would be desirable to have TChain exit with
> an error or at least warn the user when there is an incompatibility
> between data types in its TFiles.

This would imply looking at all the files in the TChain. This could be an 
option when calling MakeClass.

> 
> 2.  When I change the decalaration of branch types to doubles, the
> analysis loop does not correctly see the floats in the 1st file.  There
> does not seem to be any automatic casting here.

The automatic promotion or change of type is supported only with objects
not for the code generated by MakeClass.

Rene Brun

> 
> 				Thanks again,
> 					Dan
> 
> On Tue, 2003-03-04 at 13:58, Rene Brun wrote:
> > Hi Dan,
> > 
> > I have investigated your problem and found the solution.
> > Your first file has a TNtuple (with float variables). Your second file
> > has a TNtupleD (with double variables).
> > You have generated the header file via TTree::MakeClass on the TNtuple 
> > file. Then you use it on a TChain combining the two files.
> > This is wrong. You should have done the inverse. 
> ><snip>
> > Rene Brun
> > 
> > On 4 
> > Mar 2003, Dan 
> > Krop wrote:
> > 
> > > Hi,
> > > 	I tried 3.05/02 and the behavior is the same.  I've made an even
> > > simpler example which requires no external shared libs.  It is on the
> > > same website:
> > > 
> > > http://dustbunny.physics.indiana.edu/~dkrop/root_problems
> > > 
> > > Note that the location of the ntuple files must be correctly declared in
> > > the header file before testing.  I would be interested if anybody can
> > > reproduce the behavior I have seen.
> > > 
> > > 			Thanks again,
> > > 				Dan
> > > 
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET