drawing ntuple while filling in a linked member

From: Dirk Meier (Dirk.Meier@cern.ch)
Date: Tue Jan 20 1998 - 16:24:37 MET


Hi,

I am excecuting a .C macro in CINT which calls in a loop 
a member of a class which is linked to ROOT. 
In this member I am filling an Ntuple.
The Ntuple is filled correctly, which I see after my .C
macro has finished (I can look at the ntuple with ->Draw(..)).
Now, when I try to Draw() the ntuple during filling inside
the filling loop I get a segmentation fault.

here is my .C
with Examination* e;                   // *e is object of my class 
				       // linked to ROOT

...
while(e->NextRawEvent() == kTRUE) {    // reads data from disk
  ....
  e->FillNtuple();                     // fills an ntuple
  ...
  e->GetTrackHitNtuple()->Draw("ut-u:vt","plane == 3"); // see below...
}
...

the Ntuple is declared private in my class Examination.h as 
  NTuple* fNtData;

and in a constructor for the object e
  fNtData = new TNtuple("A","B","plane:u:ut:vt");

The member GetTrackHitNtuple() is
TNtuple* Examination::GetTrackHitNtuple(){
  return fNtData;
}

and root knows about the pointer to the Ntuple:
root [2] e->GetTrackHitNtuple()
(class TNtuple*)0x40b953c0


But this ntuple can only be drawn when the .C finished. Why?

Dirk



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