17testFile =
"/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data24_13p6TeV.00475321.physics_Main.daq.RAW._lb0247._SFO-11._0006.data_150evt"
20def runMonCmd(inputFile,outputBSFile=None,outputMonFile=None):
21 cmdString = f
"l1calo-ath-mon --evtMax 150 --filesInput {inputFile} -- Trigger.CTP.UseEDMxAOD=False Trigger.L1.doeFex=True Trigger.L1.dojFex=True"
22 if outputMonFile: cmdString += f
" Output.HISTFileName={outputMonFile}"
24 if os.path.exists(outputBSFile): os.remove(outputBSFile)
25 cmdString += f
" Output.BSFileName=\"{outputBSFile}\""
26 print(
"Executing: " + cmdString)
31 for bin
in range(h1.GetNcells()):
32 if( abs(h1.GetBinContent(bin)-h2.GetBinContent(bin))>tolerance ):
33 print(f
"Bin {bin} difference: {h1.GetBinContent(bin)} vs {h2.GetBinContent(bin)}")
39 return h.GetEntries() == 0
42with tempfile.TemporaryDirectory()
as tmp:
43 bsFile =
"test.efex.raw"
46 outputMonFile=
"monitoring.orig.root")
47 runMonCmd(inputFile=bsFile,outputMonFile=
"monitoring.root")
51f1 = ROOT.TFile(
"monitoring.orig.root")
52f2 = ROOT.TFile(
"monitoring.root")
54 "h_L1_eEMRoI_LowPtCut_EtaPhiMap",
55 "h_L1_eTauRoI_LowPtCut_EtaPhiMap",
56 "h_L1_eEMxRoI_LowPtCut_EtaPhiMap",
57 "h_L1_eTauxRoI_LowPtCut_EtaPhiMap",
63 h1 = f1.FindObjectAny(h)
65 print(f
"Missing {h} from {f1.GetName()}")
67 h2 = f2.FindObjectAny(h)
69 print(f
"Missing {h} from {f2.GetName()}")
72 print(f
"{h} is empty in {f1.GetName()} - test needs more events to populate")
75 print(f
"{h} is empty in {f2.GetName()} - test needs more events to populate")
78 print(f
"{h} histograms differ")
void print(char *figname, TCanvas *c1)
histosEqual(h1, h2, tolerance=1e-3)
runMonCmd(inputFile, outputBSFile=None, outputMonFile=None)