Skeleton Code Generators

Complete: 3

Goal of this page

To introduce to the user scripts which generate basic code structure for the new EDM.

Introduction

When setting up code for the new EDM (such as creating a new EDProducer) there is a fair amount of 'boiler plate' code that you must write. To make writing such code easier, I have developed a series of scripts that will generate the necessary directory structure and files needed so that all you need to do is write your actual algorithms.

Available Generators

The following generators are available

  • mkedanlzr : makes a skeleton of a package containing an EDAnalyzer
  • mkedfltr : makes a skeleton of a package containing an EDFilter
  • mkedprod : makes a skeleton of a package containing an EDProducer
  • mkesprod : makes a skeleton of a package containing an ESProducer
  • mkrecord : makes a complete implementation of a Record used by the EventSetup

Using the Generator

The generators are available in your PATH after the scram runtime environment is setup (e.g., eval `scramv1 runtime -csh`).

mkedanlzr

How to makes a skeleton of a package containing an EDAnalyzer named <name>
  • go to the subsystem directory where you want the new package. (You can make a new subsystem just by doing mkdir <name> in the project's src directory)
  • mkedanlzr <name>. This will create a new directory named <name> which has the proper sub-structure.
  • edit the newly create <name>/src/<name>.cc file
How to get examples added to the skeleton
  • When running the mkedanlzr command add a - option when generating the skeleton
    • Example: mkedanlzr -track MyTrackAnalyzer
    • this will add the appropriate entries to the BuildFile, the necessary includes in the source file as well as a working example of how to use the data
    • to use the new module, add the following (your can change the track label to your preferred tarcks) in your configuration file:

process.demo = cms.EDAnalyzer('MyTrackAnalyzer',
         tracks = cms.untracked.InputTag('generalTracks')
   )
  • A list of the available examples can be obtained by doing
    • mkedanlzr -list
Additional examples can easily be added to the skeleton: see SWGuideEDMSkeletonCodeGeneratorAddingExamples

mkedfltr

How to makes a skeleton of a package containing an EDFilter named <name>
  • go to the subsystem directory where you want the new package. (You can make a new subsystem just by doing mkdir <name> in the project's src directory)
  • mkedfltr <name>. This will create a new directory named <name> which has the proper sub-structure.
  • edit the newly create <name>/src/<name>.cc file

mkedprod

How to makes a skeleton of a package containing an EDProducer named <name>
  • go to the subsystem directory where you want the new package. (You can make a new subsystem just by doing mkdir <name> in the project's src directory)
  • mkedprod <name>. This will create a new directory named <name> which has the proper sub-structure.
  • edit the newly create <name>/src/<name>.cc file

mkesprod

How to makes a skeleton of a package containing an ESProducer named <name> which produces the space separated list of data <data to create> that resides in the EventSetup Record <record>.
  • go to the subsystem directory where you want the new package. (You can make a new subsystem just by doing mkdir <name> in the project's src directory)
  • mkesprod <name> <record> <data to create>. This will create a new directory named <name> which has the proper sub-structure.
  • edit the newly create <name>/src/<name>.cc file

mkrecord

  • go the interface directory of the package you want the record to be kept in
  • mkrecord <name>
  • cp <name>.cc ../src

Review Status

Reviewer/Editor and Date (copy from screen) Comments
Main.chrjones - 28 Jul 2005 page author (Chris Jones)
JennyWilliams - 31 Jan 2007 editing to include in SWGuide
PedroParracho - 27 Oct 2008 Added links to definition of EDProducer, EDAnalyzer, EDFilter and EventSetup

Responsible: Main.chrjones
Last reviewed by: Sudhir Malik- 24 January 2009.

Edit | Attach | Watch | Print version | History: r16 < r15 < r14 < r13 < r12 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r14 - 2009-01-25 - SudhirMalik



 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

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