CMSSW General Tools Tutorial

CMSSW Full Framework

Automatic ED Scripts

To have access to the FW Skeleton makers, do:

addpkg FWCore/Skeletons

Having a look in that directory, do

 ls FWCore/Skeletons/scripts/

We see the output is

CVS/       mkedanlzr*   mkedlpr*   mkesprod*  mkrecord*  mkTemplates/*
mkdatapkg*  mkedfltr*   mkedprod*  mkevhyp*   mkskel*    mktsel*

The ones you will be using the most are mkedanlz (make EDAnalyzer), mkedprod (make EDProducer), and mkedfltr (make EDFilter). So let's pick one as an example. We'll make an EDAnalyzer with the following commands:

mkdir Analysis
cd Analysis/
../FWCore/Skeletons/scripts/mkedanlzr MuonAnalyzer

The output of this is:

  I: using skeleton: ../FWCore/Skeletons/scripts/mkTemplates/EDAnalyzer/BuildFile.temp 
  I: authors name is: "Salvatore Rappoccio", determined by the output finger cmnd 
  I: creating file: MuonAnalyzer/BuildFile 
  I: using skeleton: ../FWCore/Skeletons/scripts/mkTemplates/EDAnalyzer/ 
  I: authors name is: "Salvatore Rappoccio", determined by command line 
  I: creating file: MuonAnalyzer/src/ 
  I: using skeleton: ../FWCore/Skeletons/scripts/mkTemplates/EDAnalyzer/CfiFile.cfi 
  I: authors name is: "Salvatore Rappoccio", determined by command line 
  I: creating file: MuonAnalyzer/data/muonanalyzer.cfi 
  I: using skeleton: ../FWCore/Skeletons/scripts/mkTemplates/EDAnalyzer/ConfFile.cfg 
  I: authors name is: "Salvatore Rappoccio", determined by command line 
  I: creating file:  MuonAnalyzer/muonanalyzer.cfg 

Now we do

cd MuonAnalyzer/
ls *

And the output is

cmslpc07:> ls *
BuildFile  muonanalyzer.cfg






The file muonanalyzer.cfg is the driver for the example, and looks like this:

process Demo =  {
source = PoolSource 
     # replace 'myfile.root' with the source file you want to use
     untracked vstring fileNames = {"file:myfile.root"} 

#keep the logging output to a nice level
service = MessageLogger {}

module demo = MuonAnalyzer { 

path p = {demo} 


This will input something from PoolSource, and will create a skeleton for your analyzer module MuonAnalyzer. You can fill things in here as you go along.

The cc file looks like:

// -*- C++ -*-
// Package:    MuonAnalyzer
// Class:      MuonAnalyzer
/**\class MuonAnalyzer Analysis/MuonAnalyzer/src/

 Description: <one line class summary>

     <Notes on implementation>
// Original Author:  "Salvatore Rappoccio"
//         Created:  Thu Jun 19 10:26:23 CDT 2008
// $Id: SalvatoreRappoccioCMSSWTutorialJune08.txt,v 1.4 2008/06/19 20:44:55 SalvatoreRRappoccio Exp $

// system include files
#include <memory>

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"
// class decleration

class MuonAnalyzer : public edm::EDAnalyzer {
      explicit MuonAnalyzer(const edm::ParameterSet&);

      virtual void beginJob(const edm::EventSetup&) ;
      virtual void analyze(const edm::Event&, const edm::EventSetup&);
      virtual void endJob() ;

      // ----------member data ---------------------------

// constants, enums and typedefs

// static data member definitions

// constructors and destructor
MuonAnalyzer::MuonAnalyzer(const edm::ParameterSet& iConfig)

   //now do what ever initialization is needed


   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)


// member functions

// ------------ method called to for each event  ------------
MuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
   using namespace edm;

   Handle<ExampleData> pIn;
   ESHandle<SetupData> pSetup;

// ------------ method called once each job just before starting event loop  ------------
MuonAnalyzer::beginJob(const edm::EventSetup&)

// ------------ method called once each job just after ending the event loop  ------------
MuonAnalyzer::endJob() {

//define this as a plug-in

Your code will go into the "analyze" method, and you can do whatever you'd like in there, but you cannot write any output.

We'll be looking at some specific examples of the various flavors you'll be using now.




Candidate Utilities


DBS Browser


CVS Browser




Full doucmentation is here but it is a bit old:

The command line documentation is good:

<> scram help
SCRAM HELP ------------- Recognised Commands

         scram version
         scram arch
         scram runtime
         scram list
         scram db
         scram urlget
         scram project
         scram setup
         scram tool
         scram build
         scram install
         scram remove

Help on individual commands is available through

        scram <command> --help

--help                       : Show this help page.                             
--verbose <class>            : Activate the verbose function on the specified class or list of classes.
--debug                      : Activate the verbose function on all SCRAM classes.

--arch <architecture>        : Set the architecture ID to that specified.       
--noreturn                   : Pause after command execution rather than just exiting.

<> scram project --help
SCRAM HELP ------------ project

        Set up a new project development area or update an existing one. A new area will appear in the
        current working directory by default.

        scram project [-l] [-d <area>] [-n <dir>] [-f <tools.conf>] <projecturl> [<projectversion>]

        scram project --update [<projectversion>]


        The URL of a SCRAM bootstrap file.

        Only for use with a database label.

-d <area>:
        Indicate a project installation area into which the new
        project area should appear. Default is the current working

-n <dir>:
        Specify the name of the SCRAM development area you wish to

Currently supported URL types are:

database label  Labels can be assigned to installed releases of projects for easy
access (See "scram install" command). If you specify a label you must also specify
a project version. This command is normally used to create cloned developer areas.

-b <file>       A bootstrap file on an accessible file system. This command would
be used to create a project area from scratch on a laptop.

** Examples **

        scram project XX XX_9_0

        scram project -b ~/myprojects/projecta/config/boot

Use the "-f" flag followed by a valid filename (which MUST end in ".conf") to
allow auto setup to proceed without reading files from a repository (STANDALONE mode).

Use "-l" to see the detail log message when creating a dev area.

An existing developer area for a project can be updated to a more recent version of
the SAME project by running "scram project -update <VERSION>" in the developer area.
If no VERSION is given, the command is considered like a query and will return a list
of project versions which are compatible with the configuration of the current area.

A subsequent invocation of the command with a valid VERSION will then update the area
to that version.

Shahzad gave a useful talk listing new features in the 2_X series of releases:

One of the new features is particularly useful at FNAL. Since developer areas can become full of temporary binary files that you don't need daily backups of there is a way to redirect those areas to your user_data area. You can do this by using the "-s" option. Combined with the following scram configuration file from your home area:

<> cat ~sexton/.scramrc/symlinks

<> scram project -s CMSSW CMSSW_2_1_0_pre5
<> cd CMSSW_2_1_0_pre5/
<> ls -la
total 480
drwxr-xr-x  12 sexton us_cms 2048 Jun 19 11:39 .
drwxr-xr-x  37 sexton us_cms 8192 Jun 19 11:39 ..
lrwxrwxrwx   1 sexton us_cms   57 Jun 19 11:39 bin -> /uscms_data/d1/sexton/CMSSW/CMSSW_2_1_0_pre5/bin.ONKk9cuL
drwxr-xr-x   4 sexton us_cms 2048 Jun 19 11:39 config
drwxr-xr-x   2 sexton us_cms 2048 Jun 19 11:39 doc
drwxr-xr-x   3 sexton us_cms 2048 Jun 19 11:39 include
lrwxrwxrwx   1 sexton us_cms   57 Jun 19 11:39 lib -> /uscms_data/d1/sexton/CMSSW/CMSSW_2_1_0_pre5/lib.7acl5XIg
drwxr-xr-x   3 sexton us_cms 2048 Jun 19 11:39 logs
drwxr-xr-x   3 sexton us_cms 2048 Jun 19 11:39 module
drwxr-xr-x   2 sexton us_cms 2048 Jun 19 11:39 python
drwxr-xr-x   5 sexton us_cms 2048 Jun 19 11:39 .SCRAM
drwxr-xr-x   5 sexton us_cms 2048 Jun 19 11:39 share
drwxr-xr-x   2 sexton us_cms 2048 Jun 19 11:39 src
drwxr-xr-x   3 sexton us_cms 2048 Jun 19 11:39 test
lrwxrwxrwx   1 sexton us_cms   57 Jun 19 11:39 tmp -> /uscms_data/d1/sexton/CMSSW/CMSSW_2_1_0_pre5/tmp.XpnS1euF

106 lxplus223> cat ~lsexton/.scramrc/symlinks


Other random useful commands:

scram build USER_CXXFLAGS=-g

cmsenv: aliased to eval `scramv1 runtime -csh`

addpkg <SubSystem/Package>


totalview: aliased to /afs/fnal/ups/totalview/v8_4/toolworks/totalview.8.4.0-0/bin/totalview

Provenance Dumping

edmProvDump CompositeKitSkim.root

-- SalvatoreRRappoccio - 19 Jun 2008

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2008-06-19 - SalvatoreRRappoccio
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main 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