ATLAS Offline Software
Loading...
Searching...
No Matches
AsgPhotonIsEMSelectorsConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3__doc__ = """Configure the AsgPhotonIsEMSelector with the quality cuts
4 and allow for (re-)setting of all provided cuts."""
5
6from ElectronPhotonSelectorTools.PhotonIsEMSelectorMapping import (
7 PhotonIsEMMap, photonPIDmenu)
8from TriggerMenuMT.HLT.Photon.TriggerPhotonIsEMSelectorMapping import (
9 TriggerPhotonIsEMMap, triggerPhotonPIDmenu)
10from AthenaCommon.Logging import logging
11from AthenaConfiguration.ComponentFactory import CompFactory
12from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
13
14
16 name,
17 quality,
18 menu=photonPIDmenu.offlineMC20,
19 trigger = False):
20
21 mlog = logging.getLogger('AsgPhotonIsEMSelector')
22 mlog.debug('Start configuration')
23 acc = ComponentAccumulator()
24 AsgPhotonIsEMSelector = CompFactory.AsgPhotonIsEMSelector
25
26 try:
27 if trigger:
28 menu = triggerPhotonPIDmenu.menuCurrentCuts
29 ntuple = TriggerPhotonIsEMMap(quality, menu)
30 else:
31 ntuple = PhotonIsEMMap(quality, menu)
32 mlog.debug('ntuple: %s', ntuple)
33 except KeyError:
34 mlog.error("Photon quality not found."
35 "Please use an egammaIDQuality"
36 "(ElectronPhotonSelectorTools/egammaPIDdefs.h)."
37 "This function only supports standard photon IDs,"
38 "and not electron IDs or forward IDs")
39 raise
40
41 # Create and instance of the tool
42 tool = AsgPhotonIsEMSelector(name)
43
44 # # Call the function and configure it with the standard configuration
45 ntuple[1](tool)
46 tool.isEMMask = ntuple[0]
47
48 mlog.debug('isEMMask: %x', tool.isEMMask)
49
50 acc.setPrivateTools(tool)
51 return acc
52
Photon isEM selector.
AsgPhotonIsEMSelectorCfg(flags, name, quality, menu=photonPIDmenu.offlineMC20, trigger=False)