Hi Colin, The problem you see with TTree::Draw is solely a consequence of the problem you see in the MakeClass object. Once you create the MakeClass object, it sets up the address of the TTree. Once you reopen the file, those address are not set anymore and TTree::Draw sets its own and has no problem. So anyway, the only problem you have is that the MakeClass somehow does not properly set the addresses. Cheers, Philippe -----Original Message----- From: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Colin Bernet Sent: Wednesday, September 18, 2002 10:27 AM To: roottalk@pcroot.cern.ch Subject: [ROOT] bug in Tree::Draw() ??? Hello rooters ! Sorry to bug you again with my tree... I'm now one step further (thanks to Rene and Davide), and I noticed something peculiar : When I use a tree inside a MakeClass generated code, using functions like sin or sqrt in Tree::Draw doesn't seem to be possible anymore. Here is what I did : root [7] TFile f("/home/data2002/minidst/DstOut20230/chunk10001/MDST_0.root") root [8] TTree *tree=(TTree*)f.Get("MDST") root [9] tree->MakeClass("TestMC") Info in <TTreePlayer::MakeClass>: Files: TestMC.h and TestMC.C generated from Tr ee: MDST (Int_t)0 root [10] .L TestMC.C root [11] TestMC tmc(tree) root [13] tmc.fChain ->Draw("sqrt(number)") *** Break *** segmentation violation Root > root [14] root [14] tree->Draw("sqrt(number)") *** Break *** segmentation violation Root > root [15] root [15] TFile f("/home/data2002/minidst/DstOut20230/chunk10001/MDST_0.root") root [16] TTree *tree=(TTree*)f.Get("MDST") root [17] tree->Draw("sqrt(number)") now ok. Strange, isn't it ? I'm usually using the MakeClass generated codes to implement a more convenient way of chaining the files : MyClass::MyClass(const char* pattern) will chain together all files matching pattern. Therefore I often use MyClass only to chain the files automatically and then use MyClass::fChain directly. This is why I would need to have all functionnalities of Tree::Draw working also in this case. Do you know what is happening ? Many thanks, Colin ROOT 3.03/08 for gcc 2.95.2 on RH 6.2
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:10 MET