Presentation is loading. Please wait.

Presentation is loading. Please wait.

CMSSW Configuration Using python JTERM II Tutorial Rick Wilkinson.

Similar presentations


Presentation on theme: "CMSSW Configuration Using python JTERM II Tutorial Rick Wilkinson."— Presentation transcript:

1 CMSSW Configuration Using python JTERM II Tutorial Rick Wilkinson

2 Why python? Nice, readable syntax Easy to learn Popular Interfaces easily to C++ Through boost::python

3 Why change? Job configurations are getting big and complex Need to easily edit configurations, both by users and by scripts in GRID jobs In old system, every “replace” functionality had to be coded by hand Some still missing, such as random access to vectors We’ve already had to write two systems to convert configurations to python and back.

4 Downsides? It doesn’t yet have all the “security features” the old system had, which prevented: Modifying a variable more than once Modifying uncloned modules

5 How are we going to change? CMSSW_1_9_0 is a closed release All cfi’s, cff’s, and cfg’s in CVS will be translated to python Then, during the 2_0_0 cycle, users can switch over

6 How different is the syntax? Not very different. It’s based on the old system process DIGI = { process DIGI = { hcalDigis = HcalDigiProducer { hcalDigis = HcalDigiProducer { bool doNoise = true bool doNoise = true } … Import FWCore.ParameterSet.Config as cms Process = cms.Process(“DIGI”) Process.hcalDigis = cms.EDProducer(“HcalDigiProducer”, doNoise = cms.bool(True) doNoise = cms.bool(True) )

7 Translation Tools A tool exists that will translate your file, and automatically translate any files you include.

8 Sample The process is the basic object representing the configuration. import FWCore.ParameterSet.Config as cms process = cms.Process(“SIM”) # Input source process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring('file:gen.root') fileNames = cms.untracked.vstring('file:gen.root')) # Modules process.load(“Configuration.StandardSequences.VtxSmearedGauss_cff”) process.load(“SimG4Core.Application.g4SimHits_cfi”) process.g4SimHits.UseMagneticField = False # Output process.load(“Configuration.EventContent.EventContent_cff”) process.FEVT = cms.OutputModule("PoolOutputModule", process.FEVTSIMEventContent, process.FEVTSIMEventContent, fileName = cms.untracked.string('sim.root') fileName = cms.untracked.string('sim.root')) # Execution paths process.p1 = cms.Path(process.VtxSmeared+process.g4SimHits)

9 Modules è Cms.EDFilter, cms.EDProducer, cms.EDAnalyzer, cms.ESSource, cms.Service, cms.ESProducer

10 Execution Paths è Cms.Sequence, cms.Path, cms.Endpath, cms.Schedule

11 Including python files A bit awkward here. Files are included differently, depending on whether you’re in a final configuration file, or a file to be included by others In your final configuration file, the file that defines the process, other files are included by saying: process.load(“FWCore.MessageService.MessageLogger_cfi”) In _cfi.py and _cff.py files, you need to say: from FWCore.MessageService.MessageLogger_cfi import *


Download ppt "CMSSW Configuration Using python JTERM II Tutorial Rick Wilkinson."

Similar presentations


Ads by Google