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',
    'read Matchbox/DefaultPPJets.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 2',
    'set Factory:OrderInAlphaEW 0',
    '## Select the process',
    'do Factory:Process p p -> j j',
    '#read Matchbox/MadGraph-GoSam.in',
    'read Matchbox/MadGraph-MadGraph.in',
    '#read Matchbox/MadGraph-OpenLoops.in',
    'cd /Herwig/MatrixElements/Matchbox',
    'set /Herwig/Cuts/FirstJet:PtMin 30.*GeV',
    '#set /Herwig/MatrixElements/Matchbox/ScalesHTScale:JetPtCut 30.*GeV',
    'set Factory:ScaleChoice Scales/SHatScale',
    '#set Factory:ScaleChoice Scales/HTScale',
    'read Matchbox/MCatNLO-DefaultShower.in',
    '# read Matchbox/NLO-NoShower.in',
    '# read Matchbox/LO-NoShower.in',
    'read Matchbox/LO.in',
    'read Matchbox/FiveFlavourScheme.in',
    'read Matchbox/MMHT2014.in',
    'do /Herwig/MatrixElements/Matchbox/Factory:ProductionMode',
    )
)


ProductionFilterSequence = cms.Sequence(generator)
