diff --git a/Phys/B2KShh/job/download.py b/Phys/B2KShh/job/download.py index 7d23d24..f09ea45 100644 --- a/Phys/B2KShh/job/download.py +++ b/Phys/B2KShh/job/download.py @@ -45,8 +45,25 @@ os.system('mv %s %s/%s/%s.root' % (file_name, dest, k, file_id)) +def hadd(mylist): + #os.system('SetupProject Bender v27r0p1') + paths = ['%s/%s/' % (dest, k) for k in mylist.keys()] + print 'Found folders:' + for path in paths: + target = dest + '/' + path.split('/')[-2] + '.root' + print '\t %s' % path + print '\t\t Target is: %s' % target + files = os.listdir(path) + paths = [path + f for f in files] + command = 'hadd -f %s %s' % (target, ' '.join(paths)) + print command + os.system(command) + + + if __name__ == '__main__': #mylist = getlist(243, 256) #pickle.dump(mylist, open('lfns.pkl', 'wb')) mylist = pickle.load(open('lfns.pkl', 'rb')) - download(mylist) + #download(mylist) + hadd(mylist)