diff --git a/macros/CCEScan/batch/hadd.py b/macros/CCEScan/batch/hadd.py index 0b6047a..b4c7607 100644 --- a/macros/CCEScan/batch/hadd.py +++ b/macros/CCEScan/batch/hadd.py @@ -4,6 +4,10 @@ fills = sys.argv[1:] +if len(fills) < 1: + print 'give me the fill numbers as input!' + sys.exit(-1) + disk = os.path.expandvars('$DISK') + '/data/ST/Aging' ll = {} @@ -12,6 +16,11 @@ targets = [] for fill in fills: targets += ll[fill] + +os.system('rm haddfile.sh') + with open('haddfile.sh', 'wb') as f: f.write('hadd -f %s/CCEScan_temp.root %s\n' % (disk, ' '.join(targets))) - f.write('hadd -f %s/CCEScan.root %s/CCEScan.root /disk/data1/hep/elena/data/ST/Aging/CCEScan_temp.root\n' % (disk, disk)) + f.write('hadd -f %s/CCEScan_all.root %s/CCEScan.root /disk/data1/hep/elena/data/ST/Aging/CCEScan_temp.root\n' % (disk, disk)) + f.write('mv %s/CCEScan.root %s/CCEScan_lastbk.root\n' % (disk, disk)) + f.write('mv %s CCEScan_all.root %s/CCEScan.root\n' % (disk, disk))