ATLAS Offline Software
Loading...
Searching...
No Matches
mc.MGPy8EG_ttbar_p83_art.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from EvgenJobTransforms.EvgenCAConfig import EvgenConfig
4
5class Sample(EvgenConfig):
6
7 def setupFlags(self, flags):
8 self.description = "MadGraph LO ttbar OTF with Pythia8 showering"
9 self.keywords = ["ttbar", "jets"]
10 self.contact = ["spyros.argyropoulos@cern.ch"]
11 self.nEventsPerJob = 10000
12
13 def setupProcess(self, flags):
14 # MadGraph process to generate
15 process_def = """
16 import model sm
17 define p = g u c d s u~ c~ d~ s~
18 define j = g u c d s u~ c~ d~ s~
19 generate p p > t t~
20 output -f
21 """
22
23 # Custom settings to pass to MadGraphControl.
24 # These are native MadGraph settings, not MadGraphControl settings.
25 settings = {
26 'lhe_version':'3.0',
27 'cut_decays':'F',
28 'pdlabel':"'nn23lo1'",
29 'use_syst':"False"
30 }
31
32 # Run MG to prepare the LHE file for showering
33 from MadGraphControl.MadGraphConfig import MadGraphCfg
34 sampleConfig = MadGraphCfg(
35 flags,
36 process_definition=process_def,
37 settings=settings,
38 prepare_lhe_for_shower=True
39 )
40
41 # Merge Pythia8 specifying the shower configuration
42 # with the A14 tune and NNPDF23LO PDF set,
43 # adding EvtGen for hadron decays on top.
44 from Pythia8_i.Pythia8Config import (
45 Pythia8_MadGraph_Cfg,
46 Pythia8_A14_NNPDF23LO_EvtGen_Common_Cfg
47 )
48
49 # Pythia8_MadGraph_Cfg tells the CA to run Pythia8 reading LHE
50 # generated by MadGraph.
51 # ShowerCfg specifies which configuration
52 # (tune,PDF) to use in the shower and whether EvtGen should be
53 # added on top.
54 sampleConfig.merge(Pythia8_MadGraph_Cfg(
55 flags,
56 ShowerCfg=Pythia8_A14_NNPDF23LO_EvtGen_Common_Cfg
57 ))
58
59 return sampleConfig
setupProcess(self, flags)
setupFlags(self, flags)