CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
core.EventSelector.EventSelector Class Reference
Inheritance diagram for core.EventSelector.EventSelector:

Public Member Functions

def process
 

Detailed Description

Skips events that are not in the toSelect list.

Example:

eventSelector = cfg.Analyzer(
    'EventSelector',
    toSelect = [
        1239742, 
        38001,
        159832
    ]
)

it can also be used with (run,lumi,event) tuples:

eventSelector = cfg.Analyzer(
    'EventSelector',
    toSelect = [
        (1,40,1239742),
        (1,38,38001),
    ]
)


The process function of this analyzer returns False if the event number
is not in the toSelect list.
In this list, put actual CMS event numbers obtained by doing:
   event.input.eventAuxiliary().id().event()

not event processing number
in this python framework.

This analyzer is typically inserted at the beginning of the analyzer
sequence to skip events you don't want.
We use it in conjonction with an
  import pdb; pdb.set_trace()
statement in a subsequent analyzer, to debug a given event in the
toSelect list.

This kind of procedure if you want to synchronize your selection
with an other person at the event level. 

Definition at line 4 of file EventSelector.py.

Member Function Documentation

def core.EventSelector.EventSelector.process (   self,
  event 
)

Definition at line 48 of file EventSelector.py.

References DTTTrigCorrFirst.run.

Referenced by ConfigBuilder.ConfigBuilder.addExtraStream(), ConfigBuilder.ConfigBuilder.completeInputCommand(), ConfigBuilder.ConfigBuilder.doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules.leave(), ConfigBuilder.ConfigBuilder.prepare_HLT(), ConfigBuilder.ConfigBuilder.prepare_LHE(), ConfigBuilder.ConfigBuilder.prepare_PATFILTER(), ConfigBuilder.ConfigBuilder.prepare_VALIDATION(), ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder.renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

48 
49  def process(self, event):
50  run = event.input.eventAuxiliary().id().run()
51  lumi = event.input.eventAuxiliary().id().luminosityBlock()
52  eId = event.input.eventAuxiliary().id().event()
53  if eId in self.cfg_ana.toSelect or (run, lumi, eId) in self.cfg_ana.toSelect:
54  # raise ValueError('found')
55  print 'Selecting', run, lumi, eId
56  return True
57  else:
58  return False
Definition: event.py:1