Exemplo n.º 1
0
# ./printDecayTree_cfg.py fileName=myfile.root

process = cms.Process("Demo")

process.load("FWCore.MessageService.MessageLogger_cfi")
process.load("PhysicsTools.HepMCCandAlgos.genParticles_cfi")
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")



from FWCore.ParameterSet.VarParsing import VarParsing
options = VarParsing ('standard')
options.setDefault('maxEvents', 10)
options.parseArguments()
if not len(options.files):
    options.help()
    print "   ---   you need to setup the 'inputFiles' option"
myFile=[ 'file:{}'.format(iF) for iF in options.files ]

process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
process.source = cms.Source("PoolSource",
        fileNames = cms.untracked.vstring( myFile )
        #eventsToProcess = cms.untracked.VEventRange('1:8-1:6','2:100-3:max'),
        #eventsToSkip = cms.untracked.VEventRange('1:1-1:6','2:100-3:max'),
        #lumisToProcess = cms.untracked.VLuminosityBlockRange('1:1-1:6','2:100-3:max'),
        #lumisToSkip = cms.untracked.VLuminosityBlockRange('1:1-1:6','2:100-3:max'),
        )

process.printGenParticle = cms.EDAnalyzer("ParticleListDrawer",
        src = cms.InputTag("genParticles"),
        maxEventsToPrint = cms.untracked.int32(-1)