TTree and class with pointers

From: Manuel Mussini <Manuel.Mussini_at_bo.infn.it>
Date: Tue, 13 Oct 2009 13:55:14 -0500


Hi,
I'm trying to create a TTree containing objects of the attached event class (to select some CDF event's infos). The class members are 3:

- a header
- an array of tracks
- an array of vertices (not filled yet !!!)

I've tried to modify the tree4.C example in the tutorials to fit my needs but something works wrong!

The first step is to run the skimmer in CDF's environment to write the file!
I've removed in the code all the stuff not related to this issue! Here I get no errors; this is how the output looks like:

...
Run = 161792, Event = 90512, InstLumi = 1.510291e+31, Triggered = 1 ( 12, 31)

                                       Beam = (-1.876444e-01,  
4.996734e-01) +- (5.521803e-06, 4.988194e-06)
Pt =  1.882, Eta =  0.79, Charge = 1
Pt =  1.267, Eta =  0.16, Charge = 1
Pt =  1.216, Eta =  1.72, Charge = 1
Pt =  1.080, Eta =  1.15, Charge = -1
Pt =  1.008, Eta =  0.59, Charge = -1
Pt =  0.947, Eta = -0.64, Charge = 1
Pt =  0.857, Eta =  0.34, Charge = -1

...

But with the second step (read the file) I can see that it seems to be empty:

root [0]
Processing TManuEvent.C("ReducedStntuple.root")... TFile** ReducedStntuple.root Events with at least one D0 -> K pi candidate
  TFile* ReducedStntuple.root Events with at least one D0 -> K pi candidate

   KEY: TTree MinBiasCDF;1 MinBias Tree

OBJ: TTree MinBiasCDF MinBias Tree : 0 at: 0x91e3208

==>Dumping object at:9227978, name=TManuEvent, class=TManuEvent

*fHeader                      ->f5050000
fNTracks                      0
*fTracks                      ->9227f08   ->array with all tracks
fNVertices                    0
*fVertices                    ->92279a0   ->array with all vertices
fUniqueID                     0           object unique identifier
fBits                         50331648    bit field status word

Error: illegal pointer to class object branch 0x0 473 FILE:TManuEvent.C LINE:15
*** Interpreter error recovered ***
root [1]

What am I missing?
Did I forget to set something related to the pointers of my class data members?

Thanks in advance!

Bye...

Received on Tue Oct 13 2009 - 20:55:30 CEST

This archive was generated by hypermail 2.2.0 : Wed Oct 14 2009 - 05:50:06 CEST