Skim Examples

Complete: 3

Introduction - skimming

It may be useful for analysis to apply a preselection to your data sample in order reduce the number of events and possibly to reduce the event content. The format of the events saved in output may be different from the one in input, allowing data reduction. Such process is called skimming.

Write RECO and AOD out of Full Event Samples

  1. Check out the following directory:
    • >  cvs co -r Configuration/EventContent
  2. Go to the directory test, and edit the script makeRECOSIM.cfg or makeAODSIM.cfg, specifying:
    • the name of the input data files (one or more) you want to skim with the parameter fileNames in the PoolSource module By default, you will skilm 50 events of type b-bbar.
    • the name of the output RECOSIM/AODSIM file you want to produce with the parameter fileName of the module PoolOutputModule
  3. Run the skimming with:
   > cmsRun makeRECOSIM.cfg
or:
   > cmsRun makeAODSIM.cfg

Filter Data to Preselect your Sample

The selection criteria has to be specified with a Filter module. A number of filter modules for the simplest selection is provided in the package CMS.PhysicsTools/RecoAlgos. If more are needed, a Generic Selector toolkit allows to simply create new selectors.

First of all, you have to choose the filter you want to apply. For instance, if you want to select events with at least two jets with Et > 20 GeV, you can use the following piece of configuration:

  module etMinJetCountFilter = EtMinCaloJetCountFilter {
    InputTag src = iterativeCone5CMS.CaloJets
    uint32 minNumber = 2
    double etMin = 20.0
  }

Other filters have very similar configuration.

The filter has to be inserted in a filter path:

  path jetFilter = { etMinJetCountFilter }

Now, you have to specify that on output you want to save only the events that pass the filter path jetFilter. This can be done specifying the parameter SelectEvents in the PoolOutputModule, as in the following configuration:

  module skimOut = PoolOutputModule {
    untracked string fileName = "skim.root"
    using AODSIMOutput
    untracked PSet SelectEvents = {
      vstring SelectEvents = { "jetFilter" }
    }
  }

If you want a summary report printed at the end of the job, you can enable it with the following directives:

  untracked PSet options = {
    untracked bool wantSummary = true
  }

The output of the report may look like the following:

TrigReport ---------- Event  Summary ------------
TrigReport Events total = 50 passed = 28 failed = 22

TrigReport ---------- Path   Summary ------------
TrigReport  Trig Bit#        Run     Passed     Failed      Error Name
TrigReport     1    0         50         28         22          0 jetFilter

TrigReport -------End-Path   Summary ------------
TrigReport  Trig Bit#        Run     Passed     Failed      Error Name
TrigReport     0    0         50         50          0          0 out

TrigReport ---------- Modules in Path: jetFilter ------------
TrigReport  Trig Bit#    Visited     Passed     Failed      Error Name
TrigReport     1    0         50         28         22          0 etMinJetCountFilter

TrigReport ------ Modules in End-Path: out ------------
TrigReport  Trig Bit#    Visited     Passed     Failed      Error Name
TrigReport     0    0         50         50          0          0 skimOut
TrigReport     0    0         50         50          0          0 printEventNumber

TrigReport ---------- Module Summary ------------
TrigReport    Visited        Run     Passed     Failed      Error Name
TrigReport         50         50         50          0          0 skimOut
TrigReport         50         50         28         22          0 etMinJetCountFilter
TrigReport         50         50         50          0          0 TriggerResults
TrigReport         50         50         50          0          0 printEventNumber

CMS.TimeReport ---------- Event  Summary ---[sec]----
CMS.TimeReport CPU/event = 0.260400 Real/event = 0.301244

CMS.TimeReport ---------- Path   Summary ---[sec]----
CMS.TimeReport  CPU/event Real/event Name
CMS.TimeReport   0.004800   0.004488 jetFilter

CMS.TimeReport -------End-Path   Summary ---[sec]----
CMS.TimeReport  CPU/event Real/event Name
CMS.TimeReport   0.255600   0.296653 out

CMS.TimeReport ---------- Modules in Path: jetFilter ---[sec]----
CMS.TimeReport  CPU/event Real/event Name
CMS.TimeReport   0.004800   0.004482 etMinJetCountFilter

CMS.TimeReport ------ Modules in End-Path: out ---[sec]----

The complete example is contained in the package:

in the script:

References

More details ca be found in the following pages:

Review Status

Reviewer/Editor and Date (copy from screen) Comments
LucaLista - 31 Oct 2006 page created
BenediktHegner - 31 Jan 2007 page content last edited
JennyWilliams - 07 Feb 2007 editing to include in SWGuide

Responsible: LucaLista
Last reviewed by: Reviewer

Edit | Attach | Watch | Print version | History: r13 < r12 < r11 < r10 < r9 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r13 - 2010-10-13 - JStJohn



 
    • 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