4 import os, sys, subprocess
9 oldfolder =
'/net/cms27/cms27r0/babymaker/2016_04_29/mc/unskimmed/' 10 newfolder =
'/net/cms2/cms2r0/babymaker/babies/2016_06_14/mc/unskimmed/' 11 link_dest =
'/net/cms2/cms2r0/babymaker/babies/2016_06_14/mc/unskimmed/' 14 oldsamples, newsamples = set(), set()
15 oldfiles = glob.glob(oldfolder+
'/*.root')
16 newfiles = glob.glob(newfolder+
'/*.root')
17 for file
in oldfiles+newfiles:
18 tag = file.split(
"RunII")[0]
19 if "SMS-" in tag:
continue 20 if (
"TTJets_Tune" not in tag)
and (
"DYJetsToLL_M-50_Tune" not in tag): tag = tag.split(
"Tune")[0]
21 tag = tag.split(
"13TeV")[0]
22 tag = tag.split(
"pythia")[0]
23 tag = tag.split(
"baby_")[1]
24 tag = tag.split(
"__")[0]
25 if tag[0] !=
'_': tag =
"_"+tag
26 if tag[-1] !=
'_': tag = tag+
"_" 27 if oldfolder
in file: oldsamples.add(tag)
28 else: newsamples.add(tag)
31 missing = sorted(list(oldsamples-newsamples))
33 print "Samples in the old folder that are not found in the new folder:" 39 os.symlink(file, link_dest+
"/"+file.split(
"/")[-1])
41 print "No missing samples in the new production" 43 extras = sorted(list(newsamples-oldsamples))
45 print "Samples in the new folder that are not found in the old folder:" 49 print "No extra samples in the new production"