diff --git a/python/Generators/Babayaga.py b/python/Generators/Babayaga.py index d65c695..d4727bd 100644 --- a/python/Generators/Babayaga.py +++ b/python/Generators/Babayaga.py @@ -49,7 +49,11 @@ def write_process(self): # output format only hepm2 or hepmc3, the actual version is detected by the linked library, so strip the number self.add_process_option("store", "yes") self.add_process_option("path", ".") - self.process += self.procDB.get_run_out() + + # procDB + for key in self.procDB.getDict(): + self.add_process_option(key,self.procDB.getDict()[key]) + if self.procinfo.eventmode == "unweighted": self.add_process_option("mode", "unweighted") else: diff --git a/python/Generators/BabayagaProcDB.py b/python/Generators/BabayagaProcDB.py index 58fa9dc..7013a2b 100644 --- a/python/Generators/BabayagaProcDB.py +++ b/python/Generators/BabayagaProcDB.py @@ -10,16 +10,3 @@ def __init__(self, process): def write_DBInfo(self): # choose as function of generatorDBLabel label = self.process.get_generatorDBLabel() - if label == "11_11_11_11": - self.write_Difermion() - if label == "11_11_13_13": - self.write_Difermion() - if label == "11_11_22_22": - self.write_Diphoton() - - def write_Difermion(self): - self.runout = "" - - def write_Diphoton(self): - self.runout = "" - diff --git a/python/Generators/KKMCProcDB.py b/python/Generators/KKMCProcDB.py index acbf2c9..a8bfd47 100644 --- a/python/Generators/KKMCProcDB.py +++ b/python/Generators/KKMCProcDB.py @@ -10,16 +10,3 @@ def __init__(self, process): def write_DBInfo(self): # choose as function of generatorDBLabel label = self.process.get_generatorDBLabel() - if label == "11_11_11_11": - self.write_Difermion() - if label == "11_11_13_13": - self.write_Difermion() - if label == "11_11_22_22": - self.write_Diphoton() - - def write_Difermion(self): - self.runout = "" - - def write_Diphoton(self): - self.runout = "" - diff --git a/python/Generators/Madgraph.py b/python/Generators/Madgraph.py index 9578d21..b33fdb4 100644 --- a/python/Generators/Madgraph.py +++ b/python/Generators/Madgraph.py @@ -64,7 +64,9 @@ def fill_datacard(self): if self.procinfo.get_ElectronPolarisation() != 0 or self.procinfo.get_PositronPolarisation()!= 0: self.add_option("set polbeam1", self.procinfo.get_ElectronPolarisation()*100.) self.add_option("set polbeam2", self.procinfo.get_PositronPolarisation()*100.) - self.run += self.procDB.get_run_out() + + for key in self.procDB.getDict(): + self.add_option(key, self.procDB.getDict()[key]) # if self.settings.get_block("selectors"): self.write_selectors() # else: diff --git a/python/Generators/MadgraphProcDB.py b/python/Generators/MadgraphProcDB.py index 190234e..da0356f 100644 --- a/python/Generators/MadgraphProcDB.py +++ b/python/Generators/MadgraphProcDB.py @@ -11,17 +11,9 @@ def write_DBInfo(self): # choose as function of generatorDBLabel if self.process.get_generatorDBLabel().startswith("11_11") and len(self.process.final) == 2 : if abs(self.process.final[0]) <= 16: - self.runout += self.write_Difermion() + self.write_Difermion() label = self.process.get_generatorDBLabel() - if label == "11_11_23_25": - self.runout += self.write_run_ZH() def write_Difermion(self): - out = "" - out += f"\nset pt_min_pdg {{{self.process.final[0]}: 0 }}\n" - return out - - def write_run_ZH(self): - out = "" - return out + self.rundict['set pt_min_pdg'] = f"{{{self.process.final[0]}: 0 }}" diff --git a/python/Generators/Sherpa.py b/python/Generators/Sherpa.py index 2ea8469..ddf664a 100644 --- a/python/Generators/Sherpa.py +++ b/python/Generators/Sherpa.py @@ -59,7 +59,11 @@ def write_run(self): elif self.procinfo.get("output_format") == "hepmc3": eoutname = "HepMC3_GenEvent[{0}.hepmc3]".format(self.GeneratorDatacardBase) self.add_option("EVENT_OUTPUT", eoutname) - self.run += self.procDB.get_run_out() + + # run settings + for key in self.procDB.getDict(): + self.add_option(key,self.procDB.getDict()[key]) + self.add_option("EVENT_GENERATION_MODE", self.procinfo.eventmode) if self.gen_settings is not None: if "run" in self.gen_settings.keys(): diff --git a/python/Generators/SherpaProcDB.py b/python/Generators/SherpaProcDB.py index b2693d3..6741622 100644 --- a/python/Generators/SherpaProcDB.py +++ b/python/Generators/SherpaProcDB.py @@ -20,10 +20,10 @@ def write_DBInfo(self): self.write_Difermion() if label == "11_11_5_5": self.write_Difermion() - self.runout += " MASSIVE[5] 1\n" + self.rundict['MASSIVE[5]'] = 1 if label == "11_11_6_6": self.write_Difermion() - self.runout += " MASSIVE[6] 1\n" + self.rundict['MASSIVE[6]'] = 1 if label == "11_11_12_12": self.write_Difermion() if label == "11_11_13_13": @@ -32,7 +32,7 @@ def write_DBInfo(self): self.write_Difermion() if label == "11_11_15_15": self.write_Difermion() - self.runout += " MASSIVE[15] 1\n" + self.rundict['MASSIVE[15]'] = 1 if label == "11_11_16_16": self.write_Difermion() if label=="11_11_23_23": @@ -46,37 +46,34 @@ def write_DBInfo(self): if label=="11_11_23_25_25": self.write_ZH() # the electroweak scheme is common to all implemented processes so far - self.runout += " EW_SCHEME 3;\n" + self.rundict['EW_SCHEME'] = 3 def write_Difermion(self): - self.runout = "" # Use Gmu scheme as default - self.runout += " MASS[24] 80.419;\n" - self.runout += " WIDTH[24] 2.0476;\n" + self.rundict['MASS[24]'] = 80.419 + self.rundict['WIDTH[24]'] = 2.0476 def write_ZZ(self): - self.runout = "" # Use Gmu scheme as default - self.runout += " MASS[24] 80.419;\n" - self.runout += " WIDTH[24] 2.0476;\n" + self.rundict['MASS[24]'] = 80.419 + self.rundict['WIDTH[24]'] = 2.0476 def write_WW(self): - self.runout = "" # Use Gmu scheme as default - self.runout += " MASS[24] 80.419;\n" - self.runout += " WIDTH[24] 2.0476;\n" + self.rundict['MASS[24]'] = 80.419 + self.rundict['WIDTH[24]'] = 2.0476 def write_ZH(self): - self.runout = " WIDTH[25] 0\n" - self.runout += " WIDTH[23] 0\n" + self.rundict['WIDTH[25]'] = 0 + self.rundict['WIDTH[23]'] = 0 def write_Hnunu(self): - self.runout = " WIDTH[25] 0\n" - self.runout += " MASS[24] 80.419;\n" - self.runout += " WIDTH[24] 2.0476;\n" + self.rundict['WIDTH[25]'] = 0 + self.rundict['MASS[24]'] = 80.419 + self.rundict['WIDTH[24]'] = 2.0476 def write_ZHH(self): - self.runout = " WIDTH[25] 0\n" - self.runout += " WIDTH[23] 0\n" + self.rundict['WIDTH[25]'] = 0 + self.rundict['WIDTH[23]'] = 0 diff --git a/python/Generators/Whizard.py b/python/Generators/Whizard.py index 3e4e95e..4f44241 100644 --- a/python/Generators/Whizard.py +++ b/python/Generators/Whizard.py @@ -82,7 +82,10 @@ def write_process(self): ) self.add_option("?hepmc_output_cross_section", "true") self.add_option("?write_raw", "false") - self.process += self.procDB.get_run_out() + + for key in self.procDB.getDict(): + self.add_option(key,self.procDB.getDict()[key]) + if self.procinfo.eventmode == "unweighted": self.add_option("?unweighted", "true") else: diff --git a/python/Generators/WhizardProcDB.py b/python/Generators/WhizardProcDB.py index 9cf55b2..8d3c0f7 100644 --- a/python/Generators/WhizardProcDB.py +++ b/python/Generators/WhizardProcDB.py @@ -11,29 +11,27 @@ def write_DBInfo(self): # choose as function of generatorDBLabel label = self.process.get_generatorDBLabel() if label == "11_11_12_12": - self.runout += self.write_Difermion() + self.write_Difermion() if label == "11_11_13_13": - self.runout += self.write_Difermion() + self.write_Difermion() if label == "11_11_14_14": - self.runout += self.write_Difermion() + self.write_Difermion() if label == "11_11_15_15": - self.runout += self.write_Difermion() + self.write_Difermion() if label == "11_11_16_16": - self.runout += self.write_Difermion() + self.write_Difermion() if label == "11_11_12_12": - self.runout += self.write_Difermion() + self.write_Difermion() elif label == "11_11_23_25": - self.runout += self.write_ZH() + self.write_ZH() def write_Difermion(self): - self.runout += "mW = 80.419 GeV\n" - self.runout += "wW = 2.0476 GeV\n" - return self.runout + self.rundict['mW'] = "80.419 GeV" + self.rundict['wW'] = "2.0476 GeV" def write_ZH(self): - self.runout += "?resonance_history = true\n" - self.runout += "resonance_on_shell_limit = 16\n" - self.runout += "resonance_on_shell_turnoff = 2\n" - self.runout += "resonance_on_shell_turnoff = 2\n" - return self.runout + self.rundict['?resonance_history'] = "true\n" + self.rundict['resonance_on_shell_limit'] = 16 + self.rundict['resonance_on_shell_turnoff'] = 2 + self.rundict['resonance_on_shell_turnoff'] = 2