Hi all, I have two trees and I have to add a branch of one tree to the other one. I succeeded to do this adding the branch and looping over all the events of the tree to fill it…
but I have a strange peak in the distribution of the new branch, even if the loop seems ok.
I have to add a branch from t2 to t1…This is the piece of code:
Int_t nentries = (Int_t)t1->GetEntries();
hfile->cd();
auto treew = t1->CloneTree(-1,"fast");
float bdtg;
float Lcbdtg;
TBranch* Lc_bdtg = treew->Branch("Lc_bdtg",&bdtg, "bdtg/F");
t2->SetBranchAddress("bdtg",&bdtg);
for (int i=0; i<nentries; i++){
t2->GetEntry(i);
Lc_bdtg->Fill();
}
Thanks!
Federica
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided