diff --git a/generation/Generate.py b/generation/Generate.py index 10a8a81..3ffadf3 100644 --- a/generation/Generate.py +++ b/generation/Generate.py @@ -40,10 +40,10 @@ def create_CMSSW_tar(release, singularity): if release =="CMSSW_10_2_22": script += "git cms-init\n" script += "git cms-merge-topic giorgiopizz:patch_10_2_22_nanoAOD_reweight\n" - elif release == "CMSSW_10_2_6": - print("--> Patching 10_2_6") - script += "git cms-init\n" - script += "git cms-merge-topic GiacomoBoldrini:patch_10_2_6_gridpack\n" +# elif release == "CMSSW_10_2_6": +# print("--> Patching 10_2_6") +# script += "git cms-init\n" +# script += "git cms-merge-topic GiacomoBoldrini:patch_10_2_6_gridpack\n" script += "scram b\n" script += "cd ../..\n" script += "tar -zcf {}.tgz {}\n".format(release, release) @@ -54,7 +54,7 @@ def create_CMSSW_tar(release, singularity): process = subprocess.Popen("chmod +x {}; ./{}; rm {}".format(nameTmpScript,nameTmpScript,nameTmpScript), shell=True) process.wait() -def generate(name, year, gridpack, removeOldRoot, dipoleRecoil, events, jobs, doBatch, eos_out_path): +def generate(name, year, gridpack, removeOldRoot, dipoleRecoil, decayTauLeptonic, events, jobs, doBatch, eos_out_path): with open("Steps.json") as file: Steps = json.load(file) gridpack = os.path.expanduser(gridpack) @@ -197,8 +197,14 @@ def generate(name, year, gridpack, removeOldRoot, dipoleRecoil, events, jobs, do wrapper += "sed -i 's#^.*input[^=]*=[^=]*cms.untracked.int32.*$# input = cms.untracked.int32({})#g' -i {}\n".format(events, file) wrapper += 'sed -i "s/^.*nEvents = .*$/ nEvents = cms.untracked.uint32({}),/g" -i {}\n'.format(events, file) wrapper += 'sed -i "s/^process.RandomNumberGeneratorService.externalLHEProducer.initialSeed.*$/process.RandomNumberGeneratorService.externalLHEProducer.initialSeed=int($(($1+1)))/g" -i {} \n'.format(file) - if dipoleRecoil: - wrapper += "sed -i '/^.*pythia8CP5Settings[^=]*=.*/i \ \ \ \ \ \ \ \ processParameters = cms.vstring(\"SpaceShower:dipoleRecoil = on\"),' -i {}\n".format(file) + if dipoleRecoil or decayTauLeptonic: + procParams = [] + if dipoleRecoil: + procParams.append("\"SpaceShower:dipoleRecoil = on\"") + if decayTauLeptonic: + procParams.extend(["\"15:onMode = off\"", "\"15:onIfMatch = 16 11 -12\"", "\"15:onIfMatch = 16 11 -12\""]) + # wrapper += "sed -i '/^.*pythia8CP5Settings[^=]*=.*/i \ \ \ \ \ \ \ \ processParameters = cms.vstring(\"SpaceShower:dipoleRecoil = on\", \"15:onMode = off\", \"15:onIfMatch = 16 11 -12\", \"15:onIfMatch = 16 11 -12\"),' -i {}\n".format(file) + wrapper += "sed -i '/^.*pythia8CP5Settings[^=]*=.*/i \ \ \ \ \ \ \ \ processParameters = cms.vstring({}),' -i {}\n".format(', '.join(procParams),file) if Steps[year]['lhe'].get('runTarball', 'default') != 'default': runTarballFilename = Steps[year]['lhe']['runTarball'].split('/')[-1] @@ -260,6 +266,7 @@ def helperJsonParse(Samples, sample): paramsD = { "removeOldRoot": True, "dipoleRecoil": True, + "decaytauleptonic": True, "events": 2500, "jobs": 400, "doBatch": 0, @@ -275,7 +282,7 @@ def helperJsonParse(Samples, sample): return True, [] paramsD[p] = Samples[sample][p] - optional_params = ["removeOldRoot", "dipoleRecoil", "events", "jobs", "doBatch", "eosPath"] + optional_params = ["removeOldRoot", "dipoleRecoil", "decayTauLeptonic", "events", "jobs", "doBatch", "eosPath"] for p in optional_params: if p in Samples[sample].keys(): paramsD[p] = Samples[sample][p] diff --git a/generation/Samples.json b/generation/Samples.json index 6c2c336..491e230 100644 --- a/generation/Samples.json +++ b/generation/Samples.json @@ -7,5 +7,24 @@ "events": 2500, "jobs": 300, "doBatch":0 + }, + "provaNano": { + "year": "2018", + "gridpack": "~/Zjj_ewk_dim6_all_slc7_amd64_gcc700_CMSSW_10_6_19_tarball.tar.xz", + "dipoleRecoil": true, + "decayTauLeptonic": true, + "removeOldRoot": false, + "events": 10, + "jobs": 1, + "doBatch":0 + }, + "provaNano2": { + "year": "2018", + "gridpack": "~/Zjj_ewk_dim6_all_slc7_amd64_gcc700_CMSSW_10_6_19_tarball.tar.xz", + "dipoleRecoil": true, + "removeOldRoot": false, + "events": 500, + "jobs": 2, + "doBatch":1 } -} \ No newline at end of file +}