Previous page


This page contains a few instructions on how to do quick analysis with CMSSW

On this page:

Useful links

Setting CMSSW

The CMSSW versions are rapidly evolving, the recommendation is to use the most recent version. To get the full versions list run scram list CMSSW

Create a new empty/template plugin

The following lines will build a new analysis plugin. For more information see WorkBookWriteFrameworkModule.

Create the template:

mkedanlzr DemoAnalyzer
cd DemoAnalyzer
scram b -j

It will create which is the cpp main code

Add python configuration python folder

import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing

process = cms.Process("Demo")

# import of standard configurations
process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(100)

process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
process.source = cms.Source("PoolSource",fileNames = cms.untracked.vstring(options.inputFiles))

process.demo = cms.EDAnalyzer('DemoAnalyzer')

process.p = cms.Path(process.demo)

Then you can run the analysis using the following command:

  cmsRun $CMSSW_BASE/src/DemoAnalyzer/python/

Producing output file

It is helpful to inspect the new information added to the file after running a process. Add the following lines to your configuration file:

process.out = cms.OutputModule("PoolOutputModule",
       fileName = cms.untracked.string("test_output.root"),
       outputCommands = cms.untracked.vstring("drop *",
            "keep *_*_*_PROCESSTAG",
	compressionAlgorithm = cms.untracked.string('LZMA'),
	compressionLevel = cms.untracked.int32(4),
	dropMetaData = cms.untracked.string('ALL')
process.anal = cms.EndPath(process.out)	

-- MichaelPitt - 2021-05-09

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2022-01-22 - MichaelPitt
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback