if args.remove : if os.path.isdir(args.output) : print "Are you sure you want to execute the following command ?" print "rm -r " + args.output print "Type enter if yes, ctrl-c if not." raw_input() os.system("rm -r " + args.output) print "Deleted ", args.output, " folder." #print rootFileName if args.test : os.system("../../CommonTools/histFactory/build/createPlotter.sh %s %s %s"%(rootFileName, args.plotter, args.output)) else : os.system("../../CommonTools/histFactory/build/createPlotter.sh %s %s %s"%(files[0], args.plotter, args.output)) mySub = condorSubmitter(samples, "%s/build/plotter.exe"%args.output, "DUMMY", args.output+"/", rescale = True) ## Create test_condor directory and subdirs mySub.setupCondorDirs() ## Write command and data files in the condor directory mySub.createCondorFiles() ## Modifies the input sample jsons to add sample cuts if args.filter : jsonSampleFileList = [os.path.join(mySub.inDir,jsonSampleFile) for jsonSampleFile in os.listdir(mySub.inDir) if "sample" in jsonSampleFile] for jsonSampleFilePath in jsonSampleFileList : with open(jsonSampleFilePath, 'r') as jsonSampleFile : jsonSample = json.load(jsonSampleFile) for sampleName in jsonSample.keys(): if 'TT_TuneCUETP8M1_13TeV-powheg-pythia8_MiniAODv2' in sampleName :
## - specifying: * path to the executable (relative to where this script is launched) ## * path to the plot configuration python/JSON (relative to where this script is launched) ## * folder where the inputs/outputs/logs will be stored samples = [ { "ID": 517, # Either specify ID *OR* DB name #"db_name": "ST_t-channel_4f_leptonDecays_13TeV-amcatnlo_MiniAODv2_v1.0.0+7415_TTAnalysis_12d3865", "files_per_job": 10, # Optional: specify a path to a "json skeleton" that will be filled and used for this sample (see below) #"json_skeleton": "myJson.json", } ] mySub = condorSubmitter(samples, "build/createHistoWithMultiDraw.exe", "plots/TTAnalysis/generatePlots.py", "test_condor/") ## Create test_condor directory and subdirs mySub.setupCondorDirs() ## Write command and data files in the condor directory mySub.createCondorFiles() ## Actually submit the jobs ## It is recommended to do a dry-run first without submitting to condor #mySub.submitOnCondor() ## Example Json skeleton: the field "#DB_NAME#" will be filled by condorSubmitter. ## You can specify anything else you want that will be passed to createHistoWithtMultiDraw ## for this particular sample.
## - specifying: * path to the executable (relative to where this script is launched) ## * path to the plot configuration python/JSON (relative to where this script is launched) ## * folder where the inputs/outputs/logs will be stored #samples = [ # { # "ID": 517, # # Either specify ID *OR* DB name # #"db_name": "ST_t-channel_4f_leptonDecays_13TeV-amcatnlo_MiniAODv2_v1.0.0+7415_TTAnalysis_12d3865", # "files_per_job": 10, # # Optional: specify a path to a "json skeleton" that will be filled and used for this sample (see below) # #"json_skeleton": "myJson.json", # } # ] mySub = condorSubmitter("createLayerHisto.py", '/storage/data/cms/store/user/obondu/CRAB_PrivateMC/crab_HIPAnalysis/160616_162801/0000/', 1, "160629_layerhistos_condor/") #mySub = condorSubmitter(samples, "build/createHistoWithMultiDraw.exe", "plots/TTAnalysis/generatePlots.py", "test_condor/") ## Create test_condor directory and subdirs mySub.setupCondorDirs() ## Write command and data files in the condor directory mySub.createCondorFiles() ## Actually submit the jobs ## It is recommended to do a dry-run first without submitting to condor mySub.submitOnCondor() ## Example Json skeleton: the field "#DB_NAME#" will be filled by condorSubmitter. ## You can specify anything else you want that will be passed to createHistoWithtMultiDraw
## - sample n.517 ## - 10 files per job ## - specifying: * path to the executable (relative to where this script is launched) ## * path to the plot configuration python/JSON (relative to where this script is launched) ## * folder where the inputs/outputs/logs will be stored samples = [{ "ID": 517, # Either specify ID *OR* DB name #"db_name": "ST_t-channel_4f_leptonDecays_13TeV-amcatnlo_MiniAODv2_v1.0.0+7415_TTAnalysis_12d3865", "files_per_job": 10, # Optional: specify a path to a "json skeleton" that will be filled and used for this sample (see below) #"json_skeleton": "myJson.json", }] mySub = condorSubmitter(samples, "build/createHistoWithMultiDraw.exe", "plots/TTAnalysis/generatePlots.py", "test_condor/") ## Create test_condor directory and subdirs mySub.setupCondorDirs() ## Write command and data files in the condor directory mySub.createCondorFiles() ## Actually submit the jobs ## It is recommended to do a dry-run first without submitting to condor #mySub.submitOnCondor() ## Example Json skeleton: the field "#DB_NAME#" will be filled by condorSubmitter. ## You can specify anything else you want that will be passed to createHistoWithtMultiDraw ## for this particular sample. #{
if os.path.isdir(args.output) : print "Are you sure you want to execute the following command ?" print "rm -r " + args.output print "Type enter if yes, ctrl-c if not." raw_input() os.system("rm -r " + args.output) print "Deleted ", args.output, " folder." #print rootFileName if not args.skip : if args.test : os.system("../../CommonTools/histFactory/build/createPlotter.sh %s %s %s"%(rootFileName, args.plotter, args.output)) else : os.system("../../CommonTools/histFactory/build/createPlotter.sh %s %s %s"%(files[0], args.plotter, args.output)) mySub = condorSubmitter(samples, "%s/build/plotter.exe"%args.output, "DUMMY", args.output+"/", rescale = True) ## Create test_condor directory and subdirs mySub.setupCondorDirs() ## Write command and data files in the condor directory mySub.createCondorFiles() ## Modifies the input sample jsons to add sample cuts if args.filter : jsonSampleFileList = [os.path.join(mySub.inDir,jsonSampleFile) for jsonSampleFile in os.listdir(mySub.inDir) if "sample" in jsonSampleFile] for jsonSampleFilePath in jsonSampleFileList : with open(jsonSampleFilePath, 'r') as jsonSampleFile : jsonSample = json.load(jsonSampleFile) for sampleName in jsonSample.keys(): # if 'TT_TuneCUETP8M1_13TeV-powheg-pythia8_MiniAODv2' in sampleName :