diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgElectronIsEMSelectorsConfig.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgElectronIsEMSelectorsConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..0263ac6a9edbe79115a7dc8b548539ce664dfbe9 --- /dev/null +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgElectronIsEMSelectorsConfig.py @@ -0,0 +1,36 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +__doc__ = "Configure the AsgElectronIsEMSelector with the quality cuts and allow for (re-)setting of all provided cuts." + +import logging +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +# Import the needed stuff specific to the ElectronPhotonSelectorTools +from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import AsgElectronIsEMSelector +from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import ElectronIsEMMap, electronPIDmenu + + +def AsgElectronIsEMSelectorsCfg(flags, name, quality, menu=electronPIDmenu.menuDC14): + + acc = ComponentAccumulator() + + mlog = logging.getLogger('AsgElectronIsEMSelectorsCfg') + + try: + ntuple = ElectronIsEMMap(quality, menu) + mlog.debug('ntuple: %s', ntuple) + except KeyError: + mlog.error('Electron quality not found. Please use an egammaIDQuality (ElectronPhotonSelectorTools/egammaPIDdefs.h).This function only supports standard electron IDs, and not photon or forward IDs') + raise + + # Create and instance of the tool + tool = AsgElectronIsEMSelector(name) + + # Call the function and configure it with the standard configuration + ntuple[1](tool) + tool.isEMMask = ntuple[0] + + mlog.debug('isEMMask: %x', tool.isEMMask) + + acc.setPrivateTools(tool) + return acc diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgElectronLikelihoodToolsConfig.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgElectronLikelihoodToolsConfig.py new file mode 100755 index 0000000000000000000000000000000000000000..2c6e71f375bdeb68200b4478bdb19c5351081c68 --- /dev/null +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgElectronLikelihoodToolsConfig.py @@ -0,0 +1,33 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +__doc__ = " Configure the AsgElectronLikelihoodTool with the quality cuts and allow for (re-)setting of all provided cuts." + +import logging +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +# Import the needed stuff specific to the ElectronPhotonSelectorTools +from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import AsgElectronLikelihoodTool +from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import ElectronLikelihoodMap, electronLHmenu + + +def AsgElectronLikelihoodToolCfg(flag, name, quality, menu=electronLHmenu.offlineMC16): + + acc = ComponentAccumulator() + + mlog = logging.getLogger('AsgElectronLikelihoodToolCfg') + + try: + ntuple = ElectronLikelihoodMap(quality, menu) + mlog.debug('ntuple: %s', ntuple) + except KeyError: + mlog.error("ElectronLH quality not found. Please use an egammaIDQuality (ElectronPhotonSelectorTools/egammaPIDdefs.h). This function only supports standard electronLH IDs, and not standard electron IDs or photon or forward IDs") + raise + + # Create an instance of the tool + tool = AsgElectronLikelihoodTool(name) + + # Call the function and configure it with the standard configuration + ntuple[1](tool) + + acc.setPrivateTools(tool) + return acc diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgForwardElectronIsEMSelectorsConfig.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgForwardElectronIsEMSelectorsConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..b1e6c456769806f88068f48358294ba0c9dd7cc0 --- /dev/null +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgForwardElectronIsEMSelectorsConfig.py @@ -0,0 +1,36 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +__doc__ = "Configure the AsgForwardElectronIsEMSelector with the quality cuts and allow for (re-)setting of all provided cuts." + +import logging +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +# Import the needed stuff specific to the ElectronPhotonSelectorTools +from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import AsgForwardElectronIsEMSelector +from ElectronPhotonSelectorTools.ForwardElectronIsEMSelectorMapping import ForwardElectronIsEMMap, forwardelectronPIDmenu + + +def AsgForwardElectronIsEMSelectorCfg(flags, name, quality, menu=forwardelectronPIDmenu.menuMC15): + + acc = ComponentAccumulator() + + mlog = logging.getLogger('AsgForwardElectronIsEMSelectorCfg') + + try: + ntuple = ForwardElectronIsEMMap(quality, menu) + mlog.debug('ntuple: %s', ntuple) + except KeyError: + mlog.error("Fwd Electron quality not found. Please use an egammaIDQuality (ElectronPhotonSelectorTools/egammaPIDdefs.h). This function only supports forward IDs, and not photon or standard electron IDs") + raise + + # Create and instance of the tool + tool = AsgForwardElectronIsEMSelector(name) + + # Call the function and configure it with the standard configuration + ntuple[1](tool) + tool.isEMMask = ntuple[0] + + mlog.debug('isEMMask: %x', tool.isEMMask) + + acc.setPrivateTools(tool) + return acc diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgPhotonIsEMSelectorsConfig.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgPhotonIsEMSelectorsConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..1a9b3a234fc9bd2ff80704ce3e5cf4c471c4b11c --- /dev/null +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/AsgPhotonIsEMSelectorsConfig.py @@ -0,0 +1,36 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +__doc__ = "Configure the AsgPhotonIsEMSelector with the quality cuts and allow for (re-)setting of all provided cuts." + +import logging +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +# Import the needed stuff specific to the PhotonPhotonSelectorTools +from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import AsgPhotonIsEMSelector +from ElectronPhotonSelectorTools.PhotonIsEMSelectorMapping import PhotonIsEMMap, photonPIDmenu + + +def AsgPhotonIsEMSelectorCfg(flags, name, quality, menu=photonPIDmenu.menuDC14): + + acc = ComponentAccumulator() + + mlog = logging.getLogger('AsgPhotonIsEMSelectorCfg') + + try: + ntuple = PhotonIsEMMap(quality, menu) + mlog.debug('ntuple: %s', ntuple) + except KeyError: + mlog.error("Photon quality not found. Please use an egammaIDQuality (ElectronPhotonSelectorTools/egammaPIDdefs.h). This function only supports standard photon IDs, and not electron IDs or forward IDs") + raise + + # Create and instance of the tool + tool = AsgPhotonIsEMSelector(name) + + # # Call the function and configure it with the standard configuration + ntuple[1](tool) + tool.isEMMask = ntuple[0] + + mlog.debug('isEMMask: %x', tool.isEMMask) + + acc.setPrivateTools(tool) + return acc