Details
-
Bug
-
Resolution: Fixed
-
High
-
6.12/06, 6.14/00, 6.14/02, 6.14/04, 6.14/06, 6.14/08, 6.18/00, 6.20/00, 6.18/02, 6.18/04, 6.20/02, 6.20/04
-
None
-
Not sure what to fill in here...
Description
The following code works 100% fine on 6.10.06 – but I tried the above ROOT versions and they all crash with the same error
import ROOT
|
|
for fname_in, fname_out in [
|
["copied/Sig_Gbb.offshell_mc16a_21.2.87-1_output_histfitter.root.2", "cloned/Sig_Gbb.offshell_mc16a_21.2.87-1_output_histfitter.root.1"],
|
["copied/Sig_Gbb.offshell_mc16e_21.2.87-1_output_histfitter.root.3", "cloned/Sig_Gbb.offshell_mc16e_21.2.87-1_output_histfitter.root.1"],
|
["copied/Sig_Gtb.offshell_mc16a_21.2.87-1_output_histfitter.root.2", "cloned/Sig_Gtb.offshell_mc16a_21.2.87-1_output_histfitter.root.1"],
|
["copied/Sig_Gtb.offshell_mc16d_21.2.87-1_output_histfitter.root.2", "cloned/Sig_Gtb.offshell_mc16d_21.2.87-1_output_histfitter.root.1"],
|
["copied/Sig_Gtt.offshell_mc16e_21.2.87-1_output_histfitter.root.3", "cloned/Sig_Gtt.offshell_mc16e_21.2.87-1_output_histfitter.root.1"],
|
]:
|
print("Opening ", fname_in)
|
f_in = ROOT.TFile.Open(fname_in)
|
treenames = set(k.GetName() for k in f_in.GetListOfKeys())
|
|
print("Opening ", fname_out)
|
f_out = ROOT.TFile.Open(fname_out, "RECREATE")
|
|
for treename in treenames:
|
print("\t{}".format(treename))
|
tree_in = f_in.Get(treename)
|
print("\t\tCloning")
|
tree_out = tree_in.CloneTree(-1, "fast")
|
print("\t\tWriting")
|
f_out.Write("", ROOT.TObject.kOverwrite)
|
print("\tFinished")
|
|
print("Closing ", fname_out)
|
f_out.Close()
|
print("Closing ", fname_in)
|
f_in.Close()
|
This code will take a file that has a bunch of trees of various cycles, and just clone only the latest cycle into a new file (to try and clean up/reduce file sizes). Use any ROOT file that has a bunch of trees only. This crashes when trying to copy over the second tree with this sort of error
('Opening ', 'copied/Sig_Gbb.offshell_mc16a_21.2.87-1_output_histfitter.root.2')
|
('Opening ', 'cloned/Sig_Gbb.offshell_mc16a_21.2.87-1_output_histfitter.root.1')
|
Gbb_2600_5000_800_JET_EffectiveNP_R10_2__1down
|
Cloning
|
Writing
|
Finished
|
Gbb_1800_5000_1_JET_JER_EffectiveNP_4__1up
|
Cloning
|
|
pure virtual method called
|
terminate called without an active exception
|
Aborted (core dumped)
|
As you can see, the first tree was fine, but the second crashes. Note that this has no issues in 6.10.06.