import FWCore.ParameterSet.Config as cms


generator = cms.EDFilter("Herwig7GeneratorFilter",
    hwpp_cmsDefaults = cms.vstring('+hwpp_basicSetup', 
        '+hwpp_setParticlesStableForDetector'),
    run = cms.string('InterfaceMatchboxTest'),
    dumpConfig = cms.untracked.string('HerwigConfig.in'),
    repository = cms.string('${HERWIGPATH}/HerwigDefaults.rpo'),
    dataLocation = cms.string('${HERWIGPATH:-6}'),
    hwpp_setParticlesStableForDetector = cms.vstring('set /Herwig/Particles/mu-:Stable Stable', 
        'set /Herwig/Particles/mu+:Stable Stable', 
        'set /Herwig/Particles/Sigma-:Stable Stable', 
        'set /Herwig/Particles/Sigmabar+:Stable Stable', 
        'set /Herwig/Particles/Lambda0:Stable Stable', 
        'set /Herwig/Particles/Lambdabar0:Stable Stable', 
        'set /Herwig/Particles/Sigma+:Stable Stable', 
        'set /Herwig/Particles/Sigmabar-:Stable Stable', 
        'set /Herwig/Particles/Xi-:Stable Stable', 
        'set /Herwig/Particles/Xibar+:Stable Stable', 
        'set /Herwig/Particles/Xi0:Stable Stable', 
        'set /Herwig/Particles/Xibar0:Stable Stable', 
        'set /Herwig/Particles/Omega-:Stable Stable', 
        'set /Herwig/Particles/Omegabar+:Stable Stable', 
        'set /Herwig/Particles/pi+:Stable Stable', 
        'set /Herwig/Particles/pi-:Stable Stable', 
        'set /Herwig/Particles/K+:Stable Stable', 
        'set /Herwig/Particles/K-:Stable Stable', 
        'set /Herwig/Particles/K_S0:Stable Stable', 
        'set /Herwig/Particles/K_L0:Stable Stable'),
    generatorModule = cms.string('/Herwig/Generators/EventGenerator'),
    eventHandlers = cms.string('/Herwig/EventHandlers'),
    hwpp_basicSetup = cms.vstring('#read Matchbox/GenericCollider.in',
    '#create ThePEG::RandomEngineGlue /Herwig/RandomGlue', 
        '#set /Herwig/Generators/EventGenerator:RandomNumberGenerator /Herwig/RandomGlue', 
        'set /Herwig/Generators/EventGenerator:DebugLevel 2', 
        'set /Herwig/Generators/EventGenerator:PrintEvent 1', 
        'set /Herwig/Generators/EventGenerator:MaxErrors 10000'),
    configFiles = cms.vstring(),
    crossSection = cms.untracked.double(-1),
    parameterSets = cms.vstring(
        'Matchbox',
    'hwpp_cmsDefaults'),
    filterEfficiency = cms.untracked.double(1.0),
    Matchbox = cms.vstring( 'read snippets/Matchbox.in',
    'read snippets/PPCollider.in',
    'cd /Herwig/EventHandlers',
    'set EventHandler:LuminosityFunction:Energy 13000*GeV',
    '## Model assumptions',
    'read Matchbox/StandardModelLike.in',
    'read Matchbox/DiagonalCKM.in',
    '## Set the order of the couplings',
    'cd /Herwig/MatrixElements/Matchbox',
    'set Factory:OrderInAlphaS 0',
    'set Factory:OrderInAlphaEW 2',
    '## Select the process',
    'do Factory:Process p p -> e+ e-',
    '# read Matchbox/MadGraph-GoSam.in',
    '# read Matchbox/MadGraph-MadGraph.in',
    'read Matchbox/MadGraph-OpenLoops.in',
    'set /Herwig/Cuts/ChargedLeptonPairMassCut:MinMass 60*GeV',
    'set /Herwig/Cuts/ChargedLeptonPairMassCut:MaxMass 120*GeV',
    'cd /Herwig/MatrixElements/Matchbox',
    'set Factory:ScaleChoice /Herwig/MatrixElements/Matchbox/Scales/LeptonPairMassScale',
    'read Matchbox/MCatNLO-DefaultShower.in',
    '# read Matchbox/NLO-NoShower.in',
    '# read Matchbox/LO-NoShower.in',
    'read Matchbox/FiveFlavourScheme.in',
    'read Matchbox/MMHT2014.in',
    'do /Herwig/MatrixElements/Matchbox/Factory:ProductionMode',
    )
)


ProductionFilterSequence = cms.Sequence(generator)