#--------------------------------------------------------------
# General Application Configuration options
#--------------------------------------------------------------
theApp.setup( MONTECARLO )

include( "PartPropSvc/PartPropSvc.py" )

#--------------------------------------------------------------
# Private Application Configuration options
#--------------------------------------------------------------
theApp.Dlls  += [ "TruthExamples", "Pythia_i" ]
theApp.TopAlg += [ "Pythia" ]

# ------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
# ------------------------------------------------------------
MessageSvc = Service( "MessageSvc" )
MessageSvc.OutputLevel = INFO

#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
# Number of events to be processed (default is 10)
theApp.EvtMax = 10

#--------------------------------------------------------------
# Algorithms Private Options
#--------------------------------------------------------------
theApp.ExtSvc += ["AtRndmGenSvc"]
AtRndmGenSvc = Service( "AtRndmGenSvc" )
AtRndmGenSvc.Seeds = ["PYTHIA 4789899 989240512", "PYTHIA_INIT 820021 2347532"]

# Generate Z->ee
Pythia = Algorithm( "Pythia" )
Pythia.PythiaCommand = ["pysubs msel 0","pysubs msub 1 1",
                                                "pypars mstp 43 2","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 0",
                                                "pydat3 mdme 185 1 0","pydat3 mdme 186 1 0",
                                                "pydat3 mdme 187 1 0"]
#-- PrintMC
theApp.Dlls  += ["TruthExamples" ]
theApp.TopAlg += ["PrintMC"]
PrintMC = Algorithm( "PrintMC" )
PrintMC.McEventKey = "GEN_EVENT"  # the storegate key for reading
PrintMC.VerboseOutput = TRUE      # dumps the event to stout (TRUE/FALSE)
PrintMC.PrintStyle = "Barcode"    # Event print style (Vertex/Barcode)
PrintMC.VertexInfo = FALSE        # print the production vertex position as well
PrintMC.FirstEvent = 1            # First event to print
PrintMC.LastEvent = 10            # Last event to print or all after FirstEvent are printed

#--- DumpMC
theApp.Dlls  += ["TruthExamples" ]
theApp.TopAlg += ["DumpMC"]
DumpMC=Algorithm("DumpMC")
DumpMC.McEventKey='GEN_EVENT'
DumpMC.McEventOutputKey='GEN_EVENT'

#
#---------------------------------------------------------------
# Pool Persistency
#---------------------------------------------------------------
#
include( "AthenaPoolCnvSvc/WriteAthenaPool_jobOptions.py" )
theApp.Dlls   += [ "GeneratorObjectsAthenaPoolPoolCnv" ]
Stream1 = Algorithm( "Stream1" )
Stream1.ItemList += [ 'EventInfo#*', 'McEventCollection#*' ]
Stream1.OutputFile = "pythia-2.pool.root"
#
###############################################################
