TTree->Branch() problems

Today I update my ROOT from Version 5.28/00c to be 6.12/04.
My old code

TFile *file=new TFile(argv[1],"recreate");
  LHEvent *event = new LHEvent();  
   TTree *EventTree = new TTree("event", "Data Events");
        EventTree->Branch("Event","LHEvent",&event, 32000, 2); 
        EventTree->SetAutoSave(1000); 
        for(i=0;i<100;i++){
           event->Clear();
           event->SetEvN(i);
           event->SetMjd(-1);
           for(j=0;j<13;j++)event->AddHitE(i,3.2,5.4,j);
           for(j=0;j<4;j++)event->AddHitM(i,3,5,6); 
           EventTree->Fill();
   }   
  file->Write();
  file->Close();

This code can be compiled, but, it is error when run:

"Warning in <TTree::Bronch>: LHEvent cannot be split, resetting splitlevel to 0 "

While it is OK in the old ROOT version.

I don’t know what is problem and How to solve it?
Can some help me?
Thank you very much!

Hi,

welcome to ROOT6!
What is the LHEEvent class you are using? Is there a link on the web of its header?

In ROOT6 you have much more functionality and performance than ROOT5. For example, you can generate your LHE events in parallel and write them in parallel with TDataFrame. For example, you can have a look at this post if you are interested: Error in <TTree::Branch>: The pointer specified for event is not of a class known to ROOT (the topic name is admittedly misleading :slight_smile: )

Cheers,
D

Hi Dpiparo,
Thank you very much for reply.
I have found a similar problem inside this web and get the answer there.
The problem is in the file of LHEventLinkDef.h
The code of
#pragma link C++ class LHEvent;
should be changed to
#pragma link C++ class LHEvent+;
in this new ROOT version.
Best wishes,

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.