Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-25 02:29:23

0001 #! python3
0002 
0003 
0004 ### this script takes a file with a list of IOVs and subdir name where separated xmls files are located
0005 ### the xml files have the iov start runno in the name and in the body (iov node of the xml) which should match
0006 ### for large xml with multiple IOVs we preferred to break into single-iov xmls to check for identical consecutive payloads
0007 ### for each new IOV start cmsRun write... is called to update the sqlite file
0008 ### the resulting sqlite file has a table of several IOV start and payloads
0009 
0010 import subprocess
0011 import sys
0012 
0013 iovs_file = open(sys.argv[1])
0014 path="."
0015 if len(sys.argv)>2:
0016     path=sys.argv[2]
0017 iovs_list = iovs_file.readlines()
0018 iovs_list.sort()
0019 iovs_file.close()
0020 
0021 for i in range(0,len(iovs_list)):
0022     runno = iovs_list[i].strip()
0023     if i >0 and runno != "286693" and runno != "309055": ## runs where rpix change
0024         previov = iovs_list[i-1].strip()
0025         a= subprocess.check_output(
0026             "diff "+path+"/real_alignment_iov"+runno+".xml "+path+"/real_alignment_iov"+previov+".xml  | wc"
0027             ,shell=True)
0028         if int(a.split()[0] ) ==4 :
0029             #print("skipping file of IOV "+runno)
0030             continue
0031     print("Processing payload for IOV start "+runno)
0032     print (subprocess.check_output(
0033         "cmsRun write-ctpps-rprealalignment_table_cfg.py "+runno+"  "+path
0034         ,shell=True )
0035         )
0036 
0037 print("finished")