ATLAS Offline Software
Functions
egammaMonitoringConfig Namespace Reference

Functions

def egammaMonitoringConfig (flags)
 
def egammaMonitoringCfg (flags, particleType='electron', outputFileName='Nightly-monitoring.hist', addFwd=False)
 

Function Documentation

◆ egammaMonitoringCfg()

def egammaMonitoringConfig.egammaMonitoringCfg (   flags,
  particleType = 'electron',
  outputFileName = 'Nightly-monitoring.hist',
  addFwd = False 
)

Definition at line 6 of file egammaValidation/python/egammaMonitoringConfig.py.

6 def egammaMonitoringCfg(flags, particleType = 'electron',
7  outputFileName = 'Nightly-monitoring.hist',
8  addFwd = False):
9 
10  acc = ComponentAccumulator()
11 
12  # Preparing selection tools (ID and iso)
13  from ROOT import LikeEnum
14  from ElectronPhotonSelectorTools.EgammaPIDdefs import egammaPID
15 
16  eidWP = { 'Loose' : LikeEnum.Loose, 'Medium' : LikeEnum.Medium, 'Tight' : LikeEnum.Tight }
17  gidWP = { 'Loose' : egammaPID.PhotonIDLoose, 'Tight' : egammaPID.PhotonIDTight }
18  gisoWP = [ 'FixedCutTight', 'FixedCutLoose', 'TightCaloOnly' ]
19 
20  kwarg = {}
21 
22  if particleType == 'electron' or particleType == 'dataZ':
23  kwarg['ElectronsKey'] = 'Electrons'
24  kwarg['GSFTrackParticlesKey'] = 'GSFTrackParticles'
25 
26  if particleType == 'electron':
27  from ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig import (
28  AsgElectronLikelihoodToolCfg)
29  for k,w in eidWP.items():
30  t = AsgElectronLikelihoodToolCfg(flags, k+'LHSelector', w)
31  kwarg[k+'_Ele'] = t.popPrivateTools()
32  acc.merge(t)
33  if addFwd:
34  kwarg['FwdElectronsKey'] = 'ForwardElectrons'
35  from ElectronPhotonSelectorTools.AsgForwardElectronLikelihoodToolConfig import (
36  AsgForwardElectronLikelihoodToolCfg)
37  for k in eidWP.keys():
38  # do not use the WP name as mapping points to a corrupted ID (in main, 24/05/24)
39  # anyway, not appropriate for ITk but least corrupted within rel21.2/Run2
40  configFile = f'dev/ElectronPhotonSelectorTools/offline/mc16_20190729/FwdLH{k}Conf.conf'
41  t = AsgForwardElectronLikelihoodToolCfg(flags,k+'FwdSelector',
42  ConfigFile = configFile)
43  kwarg[k+'_FwdEle'] = t.popPrivateTools()
44  acc.merge(t)
45 
46  if particleType == 'gamma':
47  from ElectronPhotonSelectorTools.AsgPhotonIsEMSelectorsConfig import (
48  AsgPhotonIsEMSelectorCfg)
49  for k,w in gidWP.items():
50  t = AsgPhotonIsEMSelectorCfg(flags, k+'_Photon', w)
51  kwarg[k+'_Photon'] = t.popPrivateTools()
52  acc.merge(t)
53 
54  from IsolationSelection.IsolationSelectionConfig import IsolationSelectionToolCfg
55  for k in gisoWP:
56  t = IsolationSelectionToolCfg(flags, 'PhIso'+k, PhotonWP=k)
57  name = f'Iso{k}'
58  kwarg[name] = t.popPrivateTools()
59  acc.merge(t)
60  kwarg['PhotonsKey'] = 'Photons'
61 
62  # a Truth classifier
63  if particleType != 'dataZ':
64  from MCTruthClassifier.MCTruthClassifierConfig import MCTruthClassifierCfg
65  MCClassifier = acc.popToolsAndMerge(MCTruthClassifierCfg(flags))
66  kwarg['egammaTruthParticlesKey'] = 'egammaTruthParticles'
67  kwarg['truthParticlesKey'] = 'TruthParticles'
68  else:
69  MCClassifier = None
70 
71  from AthenaConfiguration.Enums import LHCPeriod
72  if flags.GeoModel.Run > LHCPeriod.Run3:
73  kwarg['hasTRT'] = False
74 
75  # The monitoring alg
76  egMon = CompFactory.EgammaMonitoring(
77  name = 'egammaMonitoringAlg',
78  sampleType = particleType,
79  MCTruthClassifier = MCClassifier,
80  **kwarg)
81  acc.addEventAlgo(egMon)
82 
83  # Add the histogram service
84  svc = CompFactory.THistSvc(name="THistSvc")
85  svc.Output = [f"MONITORING DATAFILE='{outputFileName}.root' OPT='RECREATE'"]
86  acc.addService(svc)
87 
88  return acc

◆ egammaMonitoringConfig()

def egammaMonitoringConfig.egammaMonitoringConfig (   flags)

Definition at line 5 of file egammaPerformance/python/egammaMonitoringConfig.py.

5 def egammaMonitoringConfig(flags):
6  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7  result = ComponentAccumulator()
8 
9  # don't run in RAW -> ESD
10  if flags.DQ.Environment in ('tier0', 'tier0ESD','online', 'AOD'):
11  from egammaPerformance.SetupEgammaMonitoring import MonitorElectronConfig, MonitorPhotonConfig, MonitorTnPConfig, MonitorForwardElectronConfig
12 
13  result.merge(MonitorElectronConfig(flags))
14  result.merge(MonitorPhotonConfig(flags))
15  result.merge(MonitorTnPConfig(flags))
16  if flags.Egamma.doForward:
17  result.merge(MonitorForwardElectronConfig(flags))
18 
19  return result
MCTruthClassifierConfig.MCTruthClassifierCfg
def MCTruthClassifierCfg(flags, **kwargs)
Definition: MCTruthClassifier/python/MCTruthClassifierConfig.py:8
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
SetupEgammaMonitoring.MonitorPhotonConfig
def MonitorPhotonConfig(inputFlags)
Definition: SetupEgammaMonitoring.py:687
SetupEgammaMonitoring.MonitorTnPConfig
def MonitorTnPConfig(inputFlags)
Definition: SetupEgammaMonitoring.py:751
python.AsgElectronLikelihoodToolsConfig.AsgElectronLikelihoodToolCfg
def AsgElectronLikelihoodToolCfg(flag, name, quality, menu=electronLHmenu.offlineMC21)
Definition: AsgElectronLikelihoodToolsConfig.py:13
python.AsgForwardElectronLikelihoodToolConfig.AsgForwardElectronLikelihoodToolCfg
def AsgForwardElectronLikelihoodToolCfg(ConfigFlags, name, **kwargs)
Definition: AsgForwardElectronLikelihoodToolConfig.py:6
egammaMonitoringConfig.egammaMonitoringConfig
def egammaMonitoringConfig(flags)
Definition: egammaPerformance/python/egammaMonitoringConfig.py:5
python.AsgPhotonIsEMSelectorsConfig.AsgPhotonIsEMSelectorCfg
def AsgPhotonIsEMSelectorCfg(flags, name, quality, menu=photonPIDmenu.menuCurrentCuts, trigger=False)
Definition: AsgPhotonIsEMSelectorsConfig.py:15
IsolationSelectionConfig.IsolationSelectionToolCfg
def IsolationSelectionToolCfg(flags, name="IsolationSelectionTool", **kwargs)
Definition: IsolationSelectionConfig.py:6
SetupEgammaMonitoring.MonitorElectronConfig
def MonitorElectronConfig(inputFlags)
Definition: SetupEgammaMonitoring.py:574
egammaMonitoringConfig.egammaMonitoringCfg
def egammaMonitoringCfg(flags, particleType='electron', outputFileName='Nightly-monitoring.hist', addFwd=False)
Definition: egammaValidation/python/egammaMonitoringConfig.py:6
SetupEgammaMonitoring.MonitorForwardElectronConfig
def MonitorForwardElectronConfig(inputFlags)
Definition: SetupEgammaMonitoring.py:823