ATLAS Offline Software
McEventSelectorConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 
5 def McEventSelectorCfg(flags, **kwargs):
7 
8  service = CompFactory.McCnvSvc()
9  cfg.addService(service)
10  cfg.addService(CompFactory.EvtPersistencySvc("EventPersistencySvc",
11  CnvServices=[service.getFullJobOptName()]))
12 
13  if flags.Input.RunNumbers:
14  kwargs.setdefault("RunNumber", flags.Input.RunNumbers[0])
15  if flags.Input.TimeStamps:
16  kwargs.setdefault("InitialTimeStamp", flags.Input.TimeStamps[0])
17 
18  if flags.Exec.FirstEvent <= 0:
19  raise ValueError("FirstEvent must be a positive, non-zero integer")
20 
21  kwargs.setdefault("FirstEvent", flags.Exec.FirstEvent)
22 
23  # we use 64-bit numbers by default now
24  kwargs.setdefault("EventsPerRun", int(2**63 - 1)) # sys.maxint on a 64-bit machine
25 
26  evSel = CompFactory.McEventSelector("EventSelector", **kwargs)
27  cfg.addService(evSel)
28  cfg.setAppProperty("EvtSel", evSel.getFullJobOptName())
29 
30  return cfg
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.McEventSelectorConfig.McEventSelectorCfg
def McEventSelectorCfg(flags, **kwargs)
Definition: McEventSelectorConfig.py:5