6 import Alignment.MillePedeAlignmentAlgorithm.mpslib.Mpslibclass
as mpslib
9 parser =
argparse.ArgumentParser(description=
'Merge millePedeMonitor-root-files from eos, that are from the same dataset.',
12 parser.add_argument(
'eosDir',
14 help =
'path of the eos directory')
16 args = parser.parse_args()
20 lib = mpslib.jobdatabase()
22 for i
in xrange(lib.nJobs):
28 for i
in xrange(lib.nJobs):
29 if lib.JOBSP3[i]
not in items:
30 items.append(lib.JOBSP3[i])
32 for i
in xrange(len(items)):
33 occurences.append(lib.JOBSP3.count(items[i]))
36 eos =
'/afs/cern.ch/project/eos/installation/cms/bin/eos.select'
38 for i
in xrange(len(items)):
40 command +=
'monitormerge_'+items[i]+
'.root '
41 for j
in xrange(occurences[i]):
42 os.system(eos+
' cp /eos/cms'+eosDir+
'/millePedeMonitor%03d.root .' % (counter+j+1))
43 command +=
'millePedeMonitor%03d.root ' % (counter+j+1)
45 for j
in xrange(occurences[i]):
46 os.system(
'rm millePedeMonitor%03d.root' % (counter+j+1))
47 counter += occurences[i]