# Auto generated configuration file
# using: 
# Revision: 1.19 
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v 
# with command line options: Configuration/GenProduction/python/HIG-RunIISummer20UL16GEN-00055-fragment.py --python_filename HIG-RunIISummer20UL16GEN-00055_1_cfg.py --eventcontent RAWSIM --customise Configuration/DataProcessing/Utils.addMonitoring --datatier GEN --fileout file:HIG-RunIISummer20UL16GEN-00055.root --conditions 106X_mcRun2_asymptotic_v13 --beamspot Realistic25ns13TeV2016Collision --step GEN --geometry DB:Extended --era Run2_2016 --no_exec --mc -n 10000
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run2_2016_cff import Run2_2016

process = cms.Process('GEN',Run2_2016)

# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.EventContent.EventContent_cff')
process.load('SimGeneral.MixingModule.mixNoPU_cfi')
process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
process.load('Configuration.StandardSequences.MagneticField_cff')
process.load('Configuration.StandardSequences.Generator_cff')
process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic25ns13TeV2016Collision_cfi')
process.load('GeneratorInterface.Core.genFilterSummary_cff')
process.load('Configuration.StandardSequences.EndOfProcess_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')

process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(10000)
)

# Input source
process.source = cms.Source("EmptySource")

process.options = cms.untracked.PSet(

)

# Production Info
process.configurationMetadata = cms.untracked.PSet(
    annotation = cms.untracked.string('Configuration/GenProduction/python/HIG-RunIISummer20UL16GEN-00055-fragment.py nevts:10000'),
    name = cms.untracked.string('Applications'),
    version = cms.untracked.string('$Revision: 1.19 $')
)

# Output definition

process.RAWSIMoutput = cms.OutputModule("PoolOutputModule",
    SelectEvents = cms.untracked.PSet(
        SelectEvents = cms.vstring('generation_step')
    ),
    compressionAlgorithm = cms.untracked.string('LZMA'),
    compressionLevel = cms.untracked.int32(1),
    dataset = cms.untracked.PSet(
        dataTier = cms.untracked.string('GEN'),
        filterName = cms.untracked.string('')
    ),
    eventAutoFlushCompressedSize = cms.untracked.int32(20971520),
    fileName = cms.untracked.string('file:HIG-RunIISummer20UL16GEN-00055.root'),
    outputCommands = process.RAWSIMEventContent.outputCommands,
    splitLevel = cms.untracked.int32(0)
)

# Additional output definition

# Other statements
process.genstepfilter.triggerConditions=cms.vstring("generation_step")
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '106X_mcRun2_asymptotic_v13', '')

process.generator = cms.EDFilter("SherpaGeneratorFilter",
    FetchSherpack = cms.bool(True),
    SherpaDefaultWeight = cms.double(1.0),
    SherpaParameters = cms.PSet(
        Run = cms.vstring(
            ' (run){', 
            ' EVENTS 100000;', 
            ' EVENT_GENERATION_MODE P;', 
            ' ME_SIGNAL_GENERATOR Amegic Higgs;', 
            ' RANDOM_SEED XX; XX:=0; WH:=0.00407;', 
            ' QSF:=1.0; SCALES METS{MU_F2}{MU_R2}{QSF*MU_Q2}; CORE_SCALE VAR{Abs2(p[2]+p[3])};', 
            ' HEPMC_USE_NAMED_WEIGHTS=1;', 
            ' SCALE_VARIATIONS 4.0,4.0 1.0,1.0 0.25,0.25 4.0,1.0 1.0,4.0 0.25,1.0 1.0,0.25;', 
            ' BEAM_1 2212; BEAM_ENERGY_1 6500;', 
            ' BEAM_2 2212; BEAM_ENERGY_2 6500;', 
            ' YUKAWA[4] 1.42; YUKAWA[5] 4.8;', 
            ' YUKAWA[15] 1.777; YUKAWA[6] 164;', 
            ' EW_SCHEME 3; RUN_MASS_BELOW_POLE 1;', 
            ' WIDTH[25] WH;', 
            ' MASS[25] 127.;', 
            ' # HIM: 1 -> include signal', 
            ' #      2 -> include loop background', 
            ' #      4 -> include tree background (for qg-channel)', 
            ' #  1|2=3 -> included signal and loop background', 
            ' #    etc...', 
            ' # HIO = 1 : include only interferences', 
            ' # HIO = 0 : include interferences and signal^2, loop background^2, and tree^2', 
            ' # HIO = 2 : include interferences and sinal^2', 
            ' HIGGS_INTERFERENCE_MODE 5; HIGGS_INTERFERENCE_ONLY 1;', 
            ' AMEGIC_ALLOW_MAPPING 0; PSI_ITMIN 100000; ABS_ERROR 1.0;', 
            ' FRAGMENTATION Off; MI_HANDLER None; BEAM_REMNANTS 0; ME_QED Off;', 
            ' SHOWER_GENERATOR CSS; REWEIGHT_MAXEM 0;', 
            ' PDF_LIBRARY LHAPDFSherpa;', 
            ' PDF_SET NNPDF30_nnlo_as_0118;', 
            ' PDF_VARIATIONS NNPDF30_nnlo_as_0118[all];', 
            ' USE_PDF_ALPHAS 1;', 
            ' PP_HPSMODE 4;', 
            '}(run);', 
            ' (processes){', 
            ' Process 93 93 -> 22 22 94;', 
            ' Order (*,2); Enable_MHV 10;', 
            ' Integrator PS3;', 
            ' Loop_Generator Higgs;', 
            ' End process;', 
            '}(processes);', 
            ' (selector){', 
            ' Mass 22 22 20 E_CMS;', 
            '}(selector);'
        ),
        parameterSets = cms.vstring('Run')
    ),
    SherpaPath = cms.string('./'),
    SherpaPathPiece = cms.string('./'),
    SherpaProcess = cms.string('HGG_Int_LO_Sherpa_fromRajdeep_fromATLAS_M127_interference'),
    SherpaResultDir = cms.string('Result'),
    SherpackChecksum = cms.string('d2643fe1916f15ed6c9a0fd02a6a1a24'),
    SherpackLocation = cms.string('/cvmfs/cms.cern.ch/phys_generator/gridpacks/UL/13TeV/sherpa/ggH_interference/interference_qg_LO/'),
    crossSection = cms.untracked.double(0.0),
    filterEfficiency = cms.untracked.double(1.0),
    maxEventsToPrint = cms.int32(0)
)


process.ProductionFilterSequence = cms.Sequence(process.generator)

# Path and EndPath definitions
process.generation_step = cms.Path(process.pgen)
process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
process.endjob_step = cms.EndPath(process.endOfProcess)
process.RAWSIMoutput_step = cms.EndPath(process.RAWSIMoutput)

# Schedule definition
process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.endjob_step,process.RAWSIMoutput_step)
from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
associatePatAlgosToolsTask(process)
# filter all path with the production filter sequence
for path in process.paths:
	getattr(process,path).insert(0, process.ProductionFilterSequence)

# customisation of the process.

# Automatic addition of the customisation function from Configuration.DataProcessing.Utils
from Configuration.DataProcessing.Utils import addMonitoring 

#call to customisation function addMonitoring imported from Configuration.DataProcessing.Utils
process = addMonitoring(process)

# End of customisation functions

# Customisation from command line

# Add early deletion of temporary data products to reduce peak memory need
from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
process = customiseEarlyDelete(process)
# End adding early deletion
