Re: TTree with TClonesArray

William J. Deninger (deninger@uiuc.edu)
Tue, 6 Jan 1998 19:34:39 -0600


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()
>{
>}
>
>
>