ATLAS Offline Software
Rtt_histogram.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 import xml.etree.ElementTree as ET
3 import sys
4 import string
5 import ROOT
6 
7 theApp.EvtMax = 0
8 print (sys.version)
9 #tree = ET.parse("tesr.xml")
10 listhis = [] #list for combine perf his
11 listhisIndetG = [] #list for indet global his
12 print ("############# reading combine performance ")
13 tree = ET.parse("/afs/cern.ch/user/y/yunju/working/yunju/public/Rtt_ohpxml/CombPerf.xml")
14 #tree = ET.parse("ohp.xml")
15 root = tree.getroot()
16 for neighbor in root.getiterator('histos'):
17  #print (neighbor.attrib)
18  #print (neighbor.text)
19  listpaths=neighbor.text
20  print ("info: %s %s" % (neighbor,listpaths))
21  n1 = neighbor.text.split(',')
22  print ("list:%s" %n1)
23  for stringth in n1:
24  print (stringth.find("Global_ISSERVER"))
25  if stringth.find("Global_ISSERVER")!=-1:
26  finalpath=string.replace(stringth,"${Global_ISSERVER}/${Global_PROVIDER}","run_302347")
27  print (stringth.find("MET"))
28  if stringth.find("MET")!=-1:
29  finalpath=string.replace(finalpath,"run_302347","run_302347/lb_432")
30  finalpath2=string.replace(finalpath," ", "")
31  finalpath2=string.replace(finalpath2,"\t","")#remove tab
32  finalpath3=string.replace(finalpath2,"\n","")
33  listhis.append(finalpath3)
34 print (listhis )
35 print ("############# reading indetglobal ")
36 treeindetglobal = ET.parse("/afs/cern.ch/user/y/yunju/working/yunju/public/Rtt_ohpxml/globaldq-indet_20_11_0_25_1.xml")
37 #treeindetglobal = ET.parse("ohp.xml")
38 rootindetglobal = treeindetglobal.getroot()
39 for neighbor in rootindetglobal.getiterator('histos'):
40  listpaths=neighbor.text
41  print ("info: %s %s" % (neighbor,listpaths))
42  n1 = neighbor.text.split(',')
43  print ("list:%s" %n1)
44  for stringth in n1:
45  print (stringth.find("Global_ISSERVER"))
46  if stringth.find("Histogramming-Global-iss/GM-Gatherer-MIG:GlobalMonitoringSegment")!=-1:
47  finalpath=string.replace(stringth,"Histogramming-Global-iss/GM-Gatherer-MIG:GlobalMonitoringSegment","run_302347")
48  print (stringth.find("${ID_AL_BASE_PATH}"))
49  if stringth.find("${ID_AL_BASE_PATH}")!=-1:
50  finalpath=string.replace(finalpath,"${ID_AL_BASE_PATH}","ExtendedTracks_NoTriggerSelection") #defined in idgl-options.xml
51  print ("info with empty: %s" % ([finalpath]))
52  finalpath2=string.replace(finalpath,"\t","")#remove tab
53  finalpath2=string.replace(finalpath2," ","")#remove space
54  print ("info with out empty: %s" % (finalpath2))
55  finalpath3=string.replace(finalpath2,"\n","")
56  listhisIndetG.append(finalpath3)
57 print (listhisIndetG )
58 f = ROOT.TFile("Monitor.root")
59 print ("############# checking combine perf ")
60 for ith in listhis:
61  print ("get his %s" %ith)
62  histCount = f.Get(ith)
63  if histCount :
64  histCount.Draw()
65  else:
66  print ("missing combined perf %s " %ith )
67 
68 
69 print ("############# checking indetglobal ")
70 for ith in listhisIndetG:
71  print ("get his %s" %ith)
72  histCount = f.Get(ith)
73  if histCount :
74  histCount.Draw()
75  else:
76  print ("missing indet global %s " %ith )
77