File indexing completed on 2023-03-17 10:48:00
0001
0002
0003
0004
0005 from __future__ import print_function
0006 import subprocess
0007 IOVs=[]
0008 for line in subprocess.Popen("conddb --noLimit --db Linear.db list EcalLinearCorrections_from2011_offline",shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT).stdout.readlines():
0009 if "EcalTimeDependentCorrections" in line:
0010
0011 IOVs.append((line.split()[2].strip(')')).strip('('))
0012 print(IOVs)
0013 print("There are %s IOVs!"%len(IOVs))
0014
0015
0016
0017
0018
0019 RelevantIOVs=[(IOV,IOVs[IOVs.index(IOV)+199],IOVs[IOVs.index(IOV)+200]) for IOV in IOVs if IOVs.index(IOV)==0 or ((IOVs.index(IOV))%200==0 and (IOVs.index(IOV)+200)<len(IOVs))]
0020
0021 RelevantIOVs.append((RelevantIOVs[-1][2],IOVs[-1],IOVs[-1]))
0022
0023 print(RelevantIOVs)
0024 for i,splitIOVs in enumerate(RelevantIOVs):
0025 begin=splitIOVs[0]
0026 end=splitIOVs[1]
0027 upperLimit=splitIOVs[1]
0028 print(i,begin,end,upperLimit)
0029 command = "conddb_import -f sqlite:Linear.db -c sqlite:Linear_"+str(begin)+"_"+str(end)+".db -i EcalLinearCorrections_from2011_offline -t EcalLinearCorrections_from2011_offline -b "+str(begin)+" -e "+str(end)
0030 print(command)
0031
0032
0033 STDOUT=subprocess.Popen(command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT).stdout.read()
0034 print(STDOUT)