Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:44

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