1 / 11

CMSSW Configuration Using python

CMSSW Configuration Using python. JTERM II Tutorial Rick Wilkinson. Why python?. Nice, readable syntax Easy to learn Popular Interfaces easily to C++ Through boost::python. Why change?. Job configurations are getting big and complex

quigleym
Download Presentation

CMSSW Configuration Using python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 = { • hcalDigis = HcalDigiProducer { • bool doNoise = true • } • … • Import FWCore.ParameterSet.Config as cms • Process = cms.Process(“DIGI”) • Process.hcalDigis = cms.EDProducer(“HcalDigiProducer”, • 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') • ) • # 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, • 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 *

More Related