Belle II Software development
hadd.py
1
8import os
9
10# merges histograms from all files in g4sim/.../beast_hist
11
12folders = ["phase2.1.3_june_Touschek/EM_2"]
13base = "/group/belle2/BGcampaigns/g4sim/"
14ens = ["LER", "HER"]
15types = ["Touschek", "Coulomb", "Brems"]
16# types = ["BHWideLargeAngle","BHWide"]
17# types = ["twoPhoton"]
18
19for folder in folders:
20 for en in ens:
21 for typee in types:
22 outfile = base + folder + "/beast_hist/" + typee + "_" + en + "_all.root"
23 infiles = base + folder + "/beast_hist/" + typee + "_" + en + "_*.root"
24# outfile = base+folder + "/beast_hist/" + typee + "_all.root"
25# infiles = base+folder + "/beast_hist/" + typee + "_*.root"
26 os.system("rm -rf " + outfile)
27 com = "hadd " + outfile + " " + infiles
28 print(com)
29 os.system(com)