[ROOT] TEventList and TTree->Draw()

From: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
Date: Wed May 19 2004 - 09:35:25 MEST


I need to manage a TTree object which contains a unique branch, which is
in the form of a class that does not inherit from TObject.
Is is created this way:


// Tree declaration
t_data = new TTree("t_data","data tree");

// autosave when 100 MB written

// Data objects for the tree
branchData = new branch();
branchNoisyPixels = new branchCoordinates();

t_branchData = t_data->Branch ("branchData", branchData,


Now, when I open the file which contains it and I try to draw a member
via clicking on its name in a TBrowser, I get no plots.
Moreover, if I try to use the TTree->Draw() method from the ROOT prompt,
I get no plots.
I made also a trial to use TEventList:

TCut cut_ev = Form("eventNumber < %d", evMax);
TCut cut_p1 = Form("plane == %d", plane1);
TCut cut_p2 = Form("plane == %d", plane2);
t_branch->Draw(">>list1", cut_ev && cut_p1);
TEventList *list1 = (TEventList*)gDirectory->Get("list1");
t_branch->Draw(">>list2", cut_ev && cut_p2);
TEventList *list2 = (TEventList*)gDirectory->Get("list2");
Int_t N1 = list1->GetN();
Int_t N2 = list2->GetN();
cout << "Entries in the given planes: " << N1 << " , " << N2 << endl;

and in this case I get an error message which tells me that the object
"list1" and "list2" are 0x0 pointers.

Is there some techique to deal with these data?


This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET