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/

Modifying an existing package

check for the latest release and setup CMSSW

scram list CMSSW
cmsrel CMSSW_12_6_X_2022-11-15-2300

Check out the package you need:

git cms-init
git cms-addpkg /Geometry/VeryForwardGeometryBuilder

Create a new branch:

git checkout -b FixTokenTransition_error

Modify the package and commit the changes to our repository

scram build code-format # to update the code following code-format
git add Geometry/VeryForwardGeometryBuilder/plugins/
git commit -m "Fix the mismatch in transition ID for idealGeo"
git push my-cmssw FixTokenTransition_error

Backport to older release

cmsrel CMSSW_10_6_30_patch1
cd CMSSW_10_6_30_patch1/src
git remote add mine
Synchronize your fork (10_6_X in that case)
git checkout CMSSW_10_6_X
Modify the package and commit the changes to our repository
git add files
git commit -m "some text"
git push mine CMSSW_10_6_X

Modifying an existing package in git (no CMSSW)

check for the package and switch to your own repository

git clone genproductions
cd genproductions
 git remote add mine

Create a new branch:

git checkout -b BranchName

Modify the package and commit the changes to our repository

python bin/MadGraph5_aMCatNLO/Utilities/parsing_code/ bin/MadGraph5_aMCatNLO/cards/production/13TeV/GGToTauTau_Inclusive_M_50GeV_TuneCP5_madgraphLO_reweight/GGToTauTau_Inclusive_M_50GeV_TuneCP5_madgraphLO_reweight
git add files
git commit -m "some text"
git push mine BranchName

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: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r10 - 2023-01-02 - 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-2023 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