Multiple root files addition in a single root file

How to add same histogram of multiple root files (let’s say 20 or more) in a single root file? Of course I have to use for loop but I am unable to proceed .

This is how I am able to read branches (here ‘Edep’ ) of my root file ‘test.root’ .

 char const* InputFileName = "test.root"; 

    TFile* Input_file = new TFile(InputFileName);

    TTree* Scoring_tree = (TTree*)Input_file->Get("Scoring");

    cout<<"No. of Entries: "<<Scoring_tree->GetEntries()<<endl;

    Double_t Edep_info;

    TBranch* Edep_Branch = Scoring_tree->GetBranch("Edep");

1 Like

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