babymaker  e95a6a9342d4604277fe7cc6149b6b5b24447d89
crab_cfg_template.py
Go to the documentation of this file.
1 ## Template file for CRAB submission. The script generate_crab_config.py
2 ## replaces the following two lines with the appropriate values
3 ## Do not edit manually!
4 dataset = 'DATASETNAME'
5 nevents = NEVENTS
6 
7 # CRAB3 task names can no longer be greater than 100 characters; need to shorten task name
8 # Do NOT replace: "PUSpring16Fast" since it is used by the bmaker_full code to decide how to read GenInfo !!!
9 taskname = dataset[1:].replace('/','__')
10 taskname = taskname.replace('RunIISpring15MiniAODv2-74X_mcRun2_asymptotic_v2','MiniAODv2')
11 taskname = taskname.replace('TuneCUETP8M1_13TeV-madgraphMLM-pythia8','13TeV-MG-PY8')
12 taskname = taskname.replace('RunIISpring15MiniAODv2-Asympt25ns_74X_mcRun2_asymptotic_v2','MiniAODv2')
13 taskname = taskname.replace('RunIISpring16MiniAODv1-PUSpring16_80X_mcRun2_asymptotic_2016','80XMiniAODv1')
14 taskname = taskname.replace('RunIISpring16MiniAODv2-PUSpring16_80X_mcRun2_asymptotic_2016_miniAODv2','80XMiniAODv2')
15 taskname = taskname.replace('RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV','Moriond17_80XMiniAODv2')
16 taskname = taskname.replace(':','___')
17 # make sure task name is unique for each part of RunF
18 if ('RUN_RANGE'=='Run2016F1'): taskname = taskname.replace('Run2016F', 'Run2016F1')
19 elif ('RUN_RANGE'=='Run2016F2'): taskname = taskname.replace('Run2016F', 'Run2016F2')
20 
21 if(len(taskname)>100): taskname = taskname[0:99]
22 
23 datasetID = dataset.replace('/','',1).replace('/', '_', 1)
24 datasetID = datasetID[0:datasetID.find('/')]
25 # make sure baby filename is unique for each part of RunF
26 if ("Run2016F1" in taskname): datasetID = datasetID.replace('Run2016F', 'Run2016F1')
27 elif ("Run2016F2" in taskname): datasetID = datasetID.replace('Run2016F', 'Run2016F2')
28 
29 from WMCore.Configuration import Configuration
30 config = Configuration()
31 
32 config.section_("General")
33 config.General.requestName = taskname
34 config.General.workArea = 'out_crab'
35 config.General.transferLogs = True
36 
37 config.section_("JobType")
38 config.JobType.pluginName = 'Analysis'
39 config.JobType.psetName = 'babymaker/bmaker/python/bmaker_full_cfg.py'
40 config.JobType.disableAutomaticOutputCollection = True
41 # config.JobType.sendExternalFolder = True #DAK8
42 config.JobType.outputFiles = ['fullbaby_' + datasetID + '.root']
43 config.JobType.pyCfgParams = ['nEventsSample=' + str(nevents), 'outputFile=fullbaby_' + datasetID + '.root']
44 
45 config.section_("Data")
46 config.Data.inputDataset = dataset
47 config.Data.inputDBS = 'global'
48 config.Data.ignoreLocality = True
49 if "Run201" in taskname:
50  config.Data.splitting = 'LumiBased'
51  config.Data.unitsPerJob = 75
52  config.Data.lumiMask = 'babymaker/data/json/golden_Cert_314472-319851_13TeV_PromptReco_Collisions18.json'
53  # split due to JECs: https://hypernews.cern.ch/HyperNews/CMS/get/jes/642.html
54  if ("Run2016F1" in taskname): config.Data.runRange = '277772-278801'
55  elif ("Run2016F2" in taskname): config.Data.runRange = '278802-278808'
56 else:
57  config.Data.splitting = 'FileBased'
58  config.Data.unitsPerJob = 4
59 
60 config.Data.publication = False # used to be True for cfA production
61 # config.Data.publishDBS = 'phys03'
62 
63 config.section_("Site")
64 config.Site.storageSite = 'T2_US_UCSD'
65 #config.Site.storageSite = 'T3_US_UCSB'
66 config.Site.whitelist = ['T2_US_Caltech','T2_US_Florida', 'T2_US_MIT', 'T2_US_Nebraska', 'T2_US_Purdue', 'T2_US_UCSD', 'T2_US_Wisconsin', 'T1_US_FNAL','T2_US_MIT', 'T3_US_UCSB']
67 #config.Site.blacklist = ['T2_US_Vanderbilt']
68 # you may want to uncomment this line and force jobs to run in the US
69 # only a few datasets (mostly very new ones) will not be accessible