from AthenaServices.AthenaServicesConf import AtRndmGenSvc
svcMgr += AtRndmGenSvc()

# get a handle on topalg
from AthenaCommon.AlgSequence import AlgSequence
topAlg = AlgSequence("TopAlg")

svcMgr.MessageSvc.OutputLevel = evgenMsgLevel
#--------------------------------------------------------------
# Private Application Configuration options
#--------------------------------------------------------------
atRndmGenSvc = svcMgr.AtRndmGenSvc
AtRndmGenSvc.Seeds = ["PYTHIA 330020611 841000366", "PYTHIA_INIT 824021 3247532"]

from Pythia_i.Pythia_iConf import Pythia
topAlg += Pythia()

from TruthExamples.TruthExamplesConf import PrintMC
topAlg += PrintMC()
#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
# Number of events to be processed (default is 10)
theApp.EvtMax = 10
#--------------------------------------------------------------
# Algorithms Private Options
#--------------------------------------------------------------
Pythia = topAlg.Pythia
Pythia.PythiaCommand = ["pyinit user madgraph"]

theApp.EvtMax = 10
#--------------------------------------------------------------
# Private Application Configuration options
#--------------------------------------------------------------
# OUTPUT PRINTOUT LEVEL
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
# you can override this for individual modules if necessary
ServiceMgr.MessageSvc.OutputLevel = 3
#--------------------------------------------------------------
#GENERATORS SETUP (select by uncommenting/commenting)
#--------------------------------------------------------------
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()

from Pythia_i.Pythia_iConf import Pythia
topSequence += Pythia()

#-------------------------------------------------------------
# define your physics process here
# Declare the Pythia to be the Generator to be used
topSequence.Pythia.PythiaCommand += ["pysubs msel 6"]
#selection of the subprocess gg -> ttbar
topSequence.Pythia.PythiaCommand += ["pysubs msub 81 1"]
topSequence.Pythia.PythiaCommand += ["pysubs msub 82 1"]

#-------------------------------------------------------------

#-------------------------------------------------------------
# Pool Persistency
#-------------------------------------------------------------
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
#--------------------------------------------------------------
# Number of events to be processed
theApp.EvtMax = 10
#--------------------------------------------------------------
# Algorithms Private Options
#--------------------------------------------------------------
from AthenaServices.AthenaServicesConf import AtRndmGenSvc
ServiceMgr += AtRndmGenSvc()
ServiceMgr.AtRndmGenSvc.Seeds = [
    "PYTHIA 4789899 989240512", "PYTHIA_INIT 820021 2347532"
]

from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()
from Pythia_i.Pythia_iConf import Pythia
job += Pythia()
job.Pythia.SetAtlasDefaults = False
job.Pythia.PythiaCommand = [
    "pyinit user matchig", "pyinit pylistf 1", "pyinit dumpr 1 1",
    "pysubs msel 0", "pysubs msub 161 1", "pysubs msub 401 1",
    "pysubs msub 402 1", "pypars mstp 129 1000", "pypars mstp 81 0"
]

job.Pythia.PythiaCommand += [
    "pydat1 paru 141 30.",  #tan beta
    "pydat2 pmas 37 1 300."
]  #H+ mass

#uncomment when using TAUOLA/PHOTOS
#job.Pythia.PythiaCommand += ["pydat1 parj 90 20000",   # Turn off lepton radiation
#                             "pydat3 mdcy 15 1 0"]     # Turn off tau decays
Beispiel #4
0
def makeGenEvents( genName    = "Pythia",
                   genProcess = "ttbar",
                   cfgGenName = "EvGen" ):
    """
    Little helper method to provide a quick way to produce Mc-events
    """
    msg = logging.getLogger( "McParticleTests" )
    
    if genName.lower() not in [ "pythia", "herwig" ]:
        raise RuntimeError ("Unknown GENERATOR [%s]" % str(genName))
    if genProcess not in ["ttbar", "HiggsTo4Leptons", "Z+j"]:
        raise RuntimeError ("Unknown PROCESS [%s]" % str(genProcess))

    if genName.lower() == "pythia":
        try:
            from Pythia_i.Pythia_iConf import Pythia
        except ImportError as err:
            msg.warning( "Could not load module Pythia_iConf" )
            raise err
        
        genAlg = Pythia(cfgGenName)
        genAlg.Tune_Name='ATLAS_20110103'
        if genProcess == "Z+j":
            genAlg.PythiaCommand = [ "pysubs msel 13",
                                     "pysubs ckin 3 18.",
                                     "pypars mstp 43 2" ]
        elif genProcess == "ttbar":
            # semi-leptonic decay of a ttbar pair (lepton=e,mu)
            genAlg.PythiaCommand = [
                "pysubs msel 6",
                "pysubs ckin 3 18.",
                "pypars mstp 43 2",
                # Customisation of subprocess generation
                "pysubs msub 81 1",    # qqbar -> QQbar
                "pysubs msub 82 1",    # gq -> QQbar
                "pysubs msub 96 1",    # SemiHard QCD 2 -> 2
                # top
                "pydat3 mdme 41 1 0", # gt
                "pydat3 mdme 42 1 0", # gamma t
                "pydat3 mdme 43 1 0", # Z0 t
                "pydat3 mdme 44 1 0", # W+ d
                "pydat3 mdme 45 1 0", # W+ s
                "pydat3 mdme 46 1 1", # W+ b
                "pydat3 mdme 47 1 0", # W+ b'
                "pydat3 mdme 48 1 0", # h0 t
                "pydat3 mdme 49 1 0", # H+ b
                "pydat3 mdme 50 1 0", # ~chi_10 ~t_1
                "pydat3 mdme 51 1 0", # ~chi_20 ~t_1
                "pydat3 mdme 52 1 0", # ~chi_30 ~t_1
                "pydat3 mdme 53 1 0", # ~chi_40 ~t_1
                "pydat3 mdme 54 1 0", # ~g ~t_1
                "pydat3 mdme 55 1 0", # ~gravitino ~t_1
                # W
                "pydat3 mdme 190 1 2", # dbar u
                "pydat3 mdme 191 1 2", # dbar c
                "pydat3 mdme 192 1 2", # dbar t
                "pydat3 mdme 193 1 0", # dbar t'
                "pydat3 mdme 194 1 2", # sbar u
                "pydat3 mdme 195 1 2", # sbar c
                "pydat3 mdme 196 1 2", # sbar t
                "pydat3 mdme 197 1 0", # sbar t'
                "pydat3 mdme 198 1 2", # bbar u
                "pydat3 mdme 199 1 2", # bbar c
                "pydat3 mdme 200 1 2", # bbar t
                "pydat3 mdme 201 1 0", # bbar t'
                "pydat3 mdme 202 1 0", # b'bar u
                "pydat3 mdme 203 1 0", # b'bar c
                "pydat3 mdme 204 1 0", # b'bar t
                "pydat3 mdme 205 1 0", # b'bar t'
                "pydat3 mdme 206 1 0", # e+ nu_e
                "pydat3 mdme 207 1 3", # mu+ nu_mu
                "pydat3 mdme 208 1 0", # tau+ nu_tau
                "pydat3 mdme 209 1 0"  # tau'+ nu'_tau
                ]
        elif genProcess == "HiggsTo4Leptons":
            genAlg.PythiaCommand = [
                # Higgs mass set:
                "pydat2 pmas 25 1 150.",
                # Select Higgs production
                "pysubs msel 16",
                # Higgs Decays
                "pydat3 mdme 210 1 0",
                "pydat3 mdme 211 1 0",
                "pydat3 mdme 212 1 0",
                "pydat3 mdme 213 1 0",
                "pydat3 mdme 214 1 0",
                "pydat3 mdme 215 1 0",
                "pydat3 mdme 218 1 0",
                "pydat3 mdme 219 1 0",
                "pydat3 mdme 220 1 0",
                "pydat3 mdme 222 1 0",
                "pydat3 mdme 223 1 0",
                "pydat3 mdme 224 1 0",
                "pydat3 mdme 225 1 1",
                "pydat3 mdme 226 1 0",
                
                # Z Decays
                "pydat3 mdme 174 1 0",
                "pydat3 mdme 175 1 0",
                "pydat3 mdme 176 1 0",
                "pydat3 mdme 177 1 0",
                "pydat3 mdme 178 1 0",
                "pydat3 mdme 179 1 0",
                "pydat3 mdme 180 1 0",
                "pydat3 mdme 181 1 0",
                "pydat3 mdme 182 1 1",
                "pydat3 mdme 183 1 0",
                "pydat3 mdme 184 1 1",
                "pydat3 mdme 185 1 0",
                "pydat3 mdme 186 1 0",
                "pydat3 mdme 187 1 0",
                "pydat3 mdme 188 1 0",
                "pydat3 mdme 189 1 0"
                ]
        else:
            raise RuntimeError ("Unknown PROCESS [%s]" % str(genProcess))

        # Some ISR,FSR,MultipleInteractions and Hadronization parameters
        genAlg.PythiaCommand += [
            "pypars mstp 61 1", # ISR
            "pypars mstp 71 1", # FSR
            "pypars mstp 81 1", # MultInt 
            "pypars mstp 111 1", # Hadronization
            ]
        
        # Pythia listing documentation level (0-1-2)
        genAlg.PythiaCommand += [ "pypars mstp 125 2" ]

    elif genName.lower() == "herwig":
        try:
            from Herwig_i.Herwig_iConf  import Herwig
        except ImportError as err:
            msg.warning( "Could not load module Herwig_iConf" )
            raise err
        genAlg = Herwig(cfgGenName)
        if genProcess == "Z+j":
            genAlg.HerwigCommand = [
                "iproc 2150",
                "modpdf 10042",
                "autpdf HWLHAPDF"
                ]
        
        elif genProcess == "ttbar":
            genAlg.HerwigCommand = ["iproc 1706","modpdf 10042",
                                    "autpdf HWLHAPDF" ]
        else:
            raise RuntimeError ("Unknown PROCESS [%s]" % str(genProcess))
        pass
        
    else:
        raise RuntimeError ("Unknown GENERATOR [%s]" % str(genName))

    return genAlg
Beispiel #5
0
## Base configuration for PYTHIA 6
from Pythia_i.Pythia_iConf import Pythia
genSeq += Pythia()
evgenConfig.generators += ["Pythia"]

genSeq.Pythia.PythiaCommand = [
    # initializations
    "pyinit pylisti 12",
    "pyinit pylistf 1",
    "pystat 1 3 4 5",
    "pyinit dumpr 1 5",
    # Weak mixing angle
    "pydat1 paru 102 0.23113",
    # Masses
    "pydat2 pmas 6 1 172.5",     # Top mass
    "pydat2 pmas 24 1 80.399",   # PDG2010 W mass
    "pydat2 pmas 23 1 91.1876",  # PDG2010 Z0 mass
    # Widths (these have no effect since widths are calculated perturbatively in PYTHIA)
    #"pydat2 pmas 24 2 2.085",   # PDG2010 W width
    #"pydat2 pmas 23 2 2.4952",  # PDG2010 Z0 width
    ]
import AthenaCommon.AtlasUnixGeneratorJob
from AthenaCommon.AppMgr import ServiceMgr
from PartPropSvc.PartPropSvcConf import PartPropSvc
ServiceMgr += PartPropSvc()
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()

from AthenaServices.AthenaServicesConf import AtRndmGenSvc
ServiceMgr += AtRndmGenSvc()
ServiceMgr.AtRndmGenSvc.Seeds = [
    "PYTHIA 47890" + SeedNumber + " 98978" + SeedNumber,
    "PYTHIA_INIT 82056" + SeedNumber + " 23434" + SeedNumber
]

from Pythia_i.Pythia_iConf import Pythia
Pythia = Pythia()
topSequence += Pythia

selector = "min_bias"
#selector = "wz"
#Wtojj = "0"
#Wtoen = "1"
#Wtomn = "0"
#Ztojj = "0"
#Ztoee = "1"
#Ztomm = "0"
uetune = 1

#####--------- Min_bias
if selector == "min_bias":
    Pythia.Tune_Name = "ATLAS_20080001"