1 from __future__
import print_function
2 from PhysicsTools.HeppyCore.framework.analyzer
import Analyzer
6 """Skips events that are not in the toSelect list.
10 eventSelector = cfg.Analyzer(
19 it can also be used with (run,lumi,event) tuples:
21 eventSelector = cfg.Analyzer(
30 The process function of this analyzer returns False if the event number
31 is not in the toSelect list.
32 In this list, put actual CMS event numbers obtained by doing:
33 event.input.eventAuxiliary().id().event()
35 not event processing number
36 in this python framework.
38 This analyzer is typically inserted at the beginning of the analyzer
39 sequence to skip events you don't want.
40 We use it in conjonction with an
41 import pdb; pdb.set_trace()
42 statement in a subsequent analyzer, to debug a given event in the
45 This kind of procedure if you want to synchronize your selection
46 with an other person at the event level.
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:
55 print(
'Selecting', run, lumi, eId)