Using EDFilters for Analysis

Complete: 3

Introduction

EDFilter modules are useful to filter the event sample according to user-defined criteria. The event processing stops afther the filter module if the event does not match the specified criteria.

Data samples can be skimmed, selecting only the desired event subset from a data sample, and saving to the output only the specified event data products.

Writing an EDFilter

EDFilter modules are similar to EDProducers, since they can add new products into the Event, but in addition return a boolean flag that reports to the Framework if the Event passed the filter condition specified by the user. The method signature is the following:

    bool filter( edm::Event & , const edm::EventSetup & );

Implementing the method filter(...) it is possible to specify any possible filter condition.

Predefined EDFilters and Generic Filters

It is possible to apply simple filtering conditions using predefined EDFilter modules. For instance, to filter events containing at least two tracks with pt of 5 GeV/c or more, the following configuration can be used:

module trackFilter = PtMinTrackCountFilter {
  uint32 minNumber = 2
  double ptMin = 5.0
}

Predefined configurable filters are available for some of the simplest and most commonly used filter conditions in the directory:

A generic filtering toolkit allows to define easily filter module that select events that contain:

  • at least N objects passing a simple selection based on a combination of cuts on some of the object variables
  • at lest N object pairs whose combination passes a specified set of cuts

The number of objects/pairs and the specific cuts are configurable parameters. More details on generic filter modules can be found in the following Workbook section:

Selecting Filtered Events for Output

It is possible to save to file only the events that passed a specified filtering path. More details on how to write selective output can be found in the following EDM documentation page:

Review Status

Reviewer/Editor and Date (copy from screen) Comments
LucaLista - 02 Feb 2007 page author
JennyWilliams - 05 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 - 2015-06-13 - ColinBaus



 
    • 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