Hello, with the file attached I have the following problem:
import ROOT
f = ROOT.TFile("egammaEnergyCorrectionData.root", "update")
scales = f.Get("Scales")
scales.cd()
f.Scales.mkdir("es2015_day0")
es2012c = f.Scales.Get("es2012c")
f.Scales.Get("es2015_day0").cd()
es2012c.ls()
I get
TDirectoryFile* es2012c es2012c
KEY: TH1F alphaZee_L1Scaled_errStat;1
KEY: TH1D alphaPS_uncor;1 PS scale - b12 raw, total error
KEY: TH1D dalphaPS_cor;1 PS scale - b12 raw, LAr error
KEY: TH1D alphaS12_uncor;1 hE1E2ave
KEY: TH1D dalphaS12_cor;1 hCalibSym
KEY: TH1D momentum_errSyst;1
KEY: TH1D alphaZee_errSyst;1 2012 scales vs eta, no weights for Powheg+Pythia8 MC
KEY: TH1D alphaZee_errStat;1 2012 scales vs eta, no weights for Powheg+Pythia8 MC
then:
es2012c.ReadAll() # not documented function
es2012c.GetList().Write()
ROOT.gDirectory.ls()
and I get
TDirectoryFile* es2015_day0 es2015_day0
KEY: TH1F h_scale;1
KEY: TH1D alphaPSmod_b12Hist_errTot;1 PS scale - b12 raw, total error
KEY: TH1D alphaPSmod_b12Hist_errLAr;1 PS scale - b12 raw, LAr error
KEY: TH1D hE1E2ave;1 hE1E2ave
KEY: TH1D hCalibSym;1 hCalibSym
KEY: TH1D h_alphas;1
KEY: TH1D hScalesFull;2 2012 scales vs eta, no weights for Powheg+Pythia8 MC
KEY: TH1D hScalesFull;1 2012 scales vs eta, no weights for Powheg+Pythia8 MC
the content of the histogram is ok (and also their title), but the names are wrong.
Is there an easier way to copy a TDirectory?
egammaEnergyCorrectionData.root (372 KB)