Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
import FWCore.ParameterSet.Config as cms

process = cms.Process("Gen")

process.load("Configuration.StandardSequences.SimulationRandomNumberGeneratorSeeds_cff")

process.source = cms.Source("LHESource",
    fileNames = cms.untracked.vstring('file:../../Pythia6Interface/test/ttbar_5flavours_xqcut20_10TeV.lhe')
    # fileNames = cms.untracked.vstring('file:/uscms_data/d2/yarba_j/lhe_for_tests/7TeV_Zbb_run45040_unweighted_events_qcut13_mgPostv2.lhe')
    # fileNames = cms.untracked.vstring('file:/uscms_data/d2/yarba_j/lhe_for_tests/7TeV_ttbarjets_run621_unweighted_events_qcut40_mgPost.lhe')
    # fileNames = cms.untracked.vstring('file:/storage/local/data1/condor/mrenna/lhe/7TeV_avjets_run50000_unweighted_events_qcut15_mgPost.lhe')
    # fileNames = cms.untracked.vstring('file:/storage/local/data1/condor/mrenna/lhe/7TeV_zvv_200_HT_inf_run114000_unweighted_events_qcut20_mgPostv2.lhe')
)


# process.load("Configuration.Generator.Hadronizer_MgmMatchTune4C_7TeV_madgraph_pythia8_cff")

process.generator = cms.EDFilter("Pythia8HadronizerFilter",
    maxEventsToPrint = cms.untracked.int32(1),
    pythiaPylistVerbosity = cms.untracked.int32(1),
    filterEfficiency = cms.untracked.double(1.0),
    pythiaHepMCVerbosity = cms.untracked.bool(False),
    comEnergy = cms.double(7000.),
    jetMatching = cms.untracked.PSet(
       scheme = cms.string("MadgraphFastJet"),
       mode = cms.string("auto"),	# soup, or "inclusive"/"exclusive"
       #
       # ATTENTION PLEASE !
       # One can set some parameters to -1 to make the tool pock it up from LHE file.
       # However, -1 is ONLY possible if a givcen parameter is present in LHE file
       # - otherwise the code will throw. 
       # So the user should make sure what it is and what she/he wants to do.
       #
       MEMAIN_etaclmax = cms.double(5.),
       MEMAIN_qcut = cms.double(30.),       
       MEMAIN_minjets = cms.int32(-1),
       MEMAIN_maxjets = cms.int32(-1),
       MEMAIN_showerkt = cms.double(0),    # use 1=yes only for pt-ordered showers !
       MEMAIN_nqmatch = cms.int32(5),      # PID of the flavor until which the QCD radiation are kept in the matching procedure. 
                                           # If nqmatch=4, then all showered partons from b's are NOT taken into account.
				           # In many cases the D=5
       MEMAIN_excres = cms.string(""),
       outTree_flag = cms.int32(1)         # 1=yes, write out the tree for future sanity check
    ),    
    PythiaParameters = cms.PSet(
        pythia8_mg = cms.vstring(''), # this pset is for very initial testing
        # this pset below is actually used in large-scale (production-type) tests
	processParameters = cms.vstring(
            'Main:timesAllowErrors    = 10000', 
        'ParticleDecays:limitTau0 = on',
            'ParticleDecays:tauMax = 10',
	    # '15:onMode = off', # tmp turn off tau decays, to process av sample (crash in Tau::decay in Py8)
        'Tune:ee 3',
        'Tune:pp 5',
	'ParticleDecays:sophisticatedTau = 0' ),
        parameterSets = cms.vstring('processParameters')
    )
)

process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger = cms.Service("MessageLogger",
    cerr = cms.untracked.PSet(
        enable = cms.untracked.bool(False)
    ),
    cout = cms.untracked.PSet(
        default = cms.untracked.PSet(
            limit = cms.untracked.int32(2)
        ),
        enable = cms.untracked.bool(True)
    )
)

process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
    generator = cms.PSet(
        initialSeed = cms.untracked.uint32(123456789),
    )
)

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

process.GEN = cms.OutputModule("PoolOutputModule",
    fileName = cms.untracked.string('Py8Had_mgmatching.root')
)

process.p = cms.Path(process.generator)
process.outpath = cms.EndPath(process.GEN)

#process.schedule = cms.Schedule(process.p, process.outpath)
process.schedule = cms.Schedule(process.p)