hello experts
i got this error when use rdataframe to add new column to dataset: Error in <TChain::LoadTree>: Cannot find tree with name fitter_tree in file DYJetsToLL_LHEFilterPtZ-650ToInf_MatchEWPDG20_TuneCP5_13TeV-amcatnloFXFX-pythia8.root
the code is here: import ROOT fileName = "DYJetsToLL_LHEFilterPtZ-650ToInf_MatchEWPDG20_TuneCP5_13TeV-amcatnloFXFX-pythia8.root" treeName = "tnpEleTrig" d = ROOT.RDataFrame(treeName, fileName) df=d.Define("weight_new", "2")
the root file structure is like this:
i’m not sure get the tree here since there’s another layer tnpEleTrig?
thanks, this works.
there’s another question about Snapshot in RDataFrame.
i defined a new branch weight_new and trying to save in tree tnpEleTrig/fitter_tree by doing this: fileName = "DYJetsToLL_LHEFilterPtZ-650ToInf_MatchEWPDG20_TuneCP5_13TeV-amcatnloFXFX-pythia8.root" treeName = "tnpEleTrig/fitter_tree" d = ROOT.RDataFrame(treeName, fileName) df=d.Define("weight_new", "2") df.Snapshot("tnpEleTrig/fitter_tree", "newfile.root")