1 / 8

CMSSW Configuration Using python

CMSSW Configuration Using python. Rick Wilkinson. Python configurations. Your cfg, cfi, and cffs will not be supported in CMSSW_2_1_0. They’ll be replaced by python equivalents Most of the cfis and cffs have been translated, committed, and published to CMSSW_2_1_X My “day job”. Why python?.

van
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 Rick Wilkinson

  2. Python configurations • Your cfg, cfi, and cffs will not be supported in CMSSW_2_1_0. • They’ll be replaced by python equivalents • Most of the cfis and cffs have been translated, committed, and published to CMSSW_2_1_X • My “day job”

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

  4. 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.

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

  6. 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)

  7. Translation Tools • Tools exists that will translate your file, and automatically translate any files you include. > python FWCore/ParameterSet/python/cfg2py.py your.cfg dumps python-language output > python FWCore/ParameterSet/python/translate.py Sub/Package/data/your.cff creates a file, Sub/Package/python/your_cff.py, overwriting what was there. > python FWCore/ParameterSet/python/comments.py Sub/Package/data/your.cff transfers the comments in your cff to the appropriate cff.py

  8. Other Documentation • Wiki page: • https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideAboutPythonConfigFile • Benedikt’s Tutorial: • http://indico.cern.ch/conferenceDisplay.py?confId=28445

More Related