12Test import for Offline root file
13processing of several input files
17from ROOT
import TFile, TH1F, gROOT
25 fname = f
"histin6{i}.root"
26 f = TFile(fname,
"RECREATE")
29 h_expno = TH1F(
"DQMInfo/expno", f
"{i}", 1, 0, 1)
30 h_runno = TH1F(
"DQMInfo/runno", f
"{i}", 1, 0, 1)
31 h_rtype = TH1F(
"DQMInfo/rtype",
"null", 1, 0, 1)
32 h_test = TH1F(f
"TEST/test{i}",
"", 1, 0, 1)
33 h_nevent = TH1F(
"DAQ/Nevent",
"", 1, 0, 1)
34 for n
in range(0, 10):
40main = b2.create_path()
42dqminput = b2.register_module(
'DQMHistAnalysisInputRootFile')
43dqminput.param(
'FileList', filein)
44dqminput.param(
'EventInterval', 0)
45dqminput.param(
"EnableRunInfo",
True)
46main.add_module(dqminput)
48main.add_module(
"DQMHistAutoCanvas")
50dqmoutput = b2.register_module(
'DQMHistAnalysisOutputFile')
51dqmoutput.param(
'OutputFolder',
'./')
53main.add_module(dqmoutput)
60 fileout = f
"dqm_canvas_e000{i}r00000{i}.root"
61 expected = [
"DQMInfo/c_info",
"DAQ/c_Nevent",
"DQMInfo/c_expno",
"DQMInfo/c_runno",
"DQMInfo/c_rtype", f
"TEST/c_test{i}"]
62 print(f
"== resulting file {fileout} content ==")
63 f = TFile(fileout,
"READ")
64 for k
in f.GetListOfKeys():
66 print(o.ClassName(), k)
67 if o.GetName() ==
"DQMInfo/c_info":
68 if f
"Exp {i}, Run {i}, RunType null" not in o.GetTitle():
69 b2.B2ERROR(f
"Run Info not found in {o.GetName()}: {o.GetTitle()}")
70 if o.GetName()
in expected:
71 expected.remove(o.GetName())
72 print(
"============================")
74 b2.B2ERROR(
"missing items in outfile: ", expected)