Re: TTree with TClonesArray

From: William J. Deninger (deninger@uiuc.edu)
Date: Wed Jan 07 1998 - 02:34:39 MET


Hello all,

I'm still hoping that someone out there will discover a cure to my
TClonesArray dilemma.  Although adding the "new" call before the Branch
eliminates ROOT crashes with other data types (haven't checked but
simplest), the TClonesArray type still seems to crash ROOT during the
TTree::Fill() call.

I have a copy of example source at
ftp://ftp.npl.uiuc.edu/incoming/simple.zip

William J Deninger
deninger@uiuc.edu

-----Original Message-----
From: William J. Deninger <deninger@uiuc.edu>
To: roottalk@hpsalo.cern.ch <roottalk@hpsalo.cern.ch>
Date: Friday, January 02, 1998 5:43 PM
Subject: TTree with TClonesArray


>Hello,
>
>I'm having troubles with TTree::Fill() crashing ROOT with the following
>example.  I've noticed that if the split option in tree->Branch is set to
0,
>things do run.  But I'm partial to having my tree automatically branched if
>possible.  I'm I doing something wrong here?
>
>Thanks again for all you help.
>
>William J Deninger
>deninger@uiuc.edu
>//_______________________
>// Test.C
>{
>gROOT->Reset("a");
>TFile *hfile = new TFile("d:/data/test.root","RECREATE","G2073_073");
>hfile->SetCompressionLevel(1);
>
>Simple *raw;
>tree->Branch("test","Simple",&raw,10000,1);
>raw = new Simple;
>tree->Fill();
>hfile->Write();
>}
>
>//_______________________
>// Simple.h
>#include "TObject.h"
>#include "MPXPAIR.h"
>#include "TClonesArray.h"
>class Simple : public TObject
>{
>public:
> Simple();
> virtual ~Simple();
> TClonesArray test;
> ClassDef(Simple,1)
>};
>//_______________________
>// Simple.cpp
>#include "Simple.h"
>ClassImp(Simple)
>Simple::Simple() : test("MPXPAIR", 10)
>{ 
>}
>Simple::~Simple()
>{
>}
>
>
>



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:29 MET