ATLAS Offline Software
Functions
python.EGammaLRTConfig Namespace Reference

Functions

def EGammaLRTCfg (flags)
 

Function Documentation

◆ EGammaLRTCfg()

def python.EGammaLRTConfig.EGammaLRTCfg (   flags)
Main config method for LRT e-gamma decorations

Definition at line 15 of file EGammaLRTConfig.py.

15 def EGammaLRTCfg(flags):
16  """Main config method for LRT e-gamma decorations"""
17 
18  acc = ComponentAccumulator()
19 
20  # ====================================================================
21  # DISPLACED ELECTRON LH SELECTORS
22  # see Reconstruction/egamma/egammaTools/python/EMPIDBuilderBase.py
23  # on how to configure the selectors
24  # ====================================================================
25  # Setting conf file not supported. These are currently setup in the
26  # LLP1.py config TODO: implement common ID in egamma tools
27 
28  # ====================================================================
29  # ELECTRON CHARGE SELECTION
30  # ====================================================================
31  if not hasattr(acc, "ElectronChargeIDSelectorLoose"):
32  if flags.Derivation.Egamma.addECIDS:
33  from ElectronPhotonSelectorTools.AsgElectronChargeIDSelectorToolConfig import (
34  AsgElectronChargeIDSelectorToolCfg,
35  )
36 
37  ElectronChargeIDSelector = acc.popToolsAndMerge(
39  flags, name="ElectronChargeIDSelectorLoose"
40  )
41  )
42  ElectronChargeIDSelector.primaryVertexContainer = "PrimaryVertices"
43  ElectronChargeIDSelector.TrainingFile = (
44  "ElectronPhotonSelectorTools/ChargeID/"
45  + "ECIDS_20180731rel21Summer2018.root"
46  )
47  acc.addPublicTool(ElectronChargeIDSelector)
48 
49  # ====================================================================
50  # AUGMENTATION TOOLS
51  # ====================================================================
52  from DerivationFrameworkEGamma.EGammaToolsConfig import (
53  EGElectronLikelihoodToolWrapperCfg,
54  )
55 
56  # decorate electrons with the output of LH very loose
57  # TODO same as above, update with central ID
58 
59  # decorate electrons with the output of ECIDS
60  if flags.Derivation.Egamma.addECIDS:
61  LRTElectronPassECIDS = acc.addPublicTool(acc.popToolsAndMerge(
63  flags,
64  name="LRTElectronPassECIDS",
65  EGammaElectronLikelihoodTool=ElectronChargeIDSelector,
66  EGammaFudgeMCTool="",
67  CutType="",
68  StoreGateEntryName="DFCommonElectronsECIDS",
69  ContainerName="LRTElectrons",
70  StoreTResult=True,
71  )
72  ))
73 
74  # decorate some electrons with an additional ambiguity flag
75  # against internal and early material conversion
76  from DerivationFrameworkEGamma.EGammaToolsConfig import EGElectronAmbiguityToolCfg
77 
78  LRTElectronAmbiguity = acc.addPublicTool(acc.popToolsAndMerge(
80  flags,
81  name="LRTElectronAdditionnalAmbiguity",
82  idCut="DFCommonElectronsLHLooseNoPix",
83  ContainerName="LRTElectrons",
84  isMC=flags.Input.isMC,
85  )
86  ))
87 
88  # list of all the decorators so far
89  LRTEGAugmentationTools = [LRTElectronAmbiguity]
90  if flags.Derivation.Egamma.addECIDS:
91  LRTEGAugmentationTools.extend([LRTElectronPassECIDS])
92 
93  # ==================================================
94  # Truth Related tools
95  if flags.Input.isMC:
96  # Decorate Electron with bkg electron type/origin
97  from DerivationFrameworkEGamma.EGammaToolsConfig import (
98  BkgElectronClassificationCfg,
99  )
100 
101  BkgLRTElectronClassificationTool = acc.addPublicTool(acc.popToolsAndMerge(
103  flags,
104  name="BkgLRTElectronClassificationTool",
105  ElectronContainerName="LRTElectrons"
106  )
107  ))
108  LRTEGAugmentationTools.append(BkgLRTElectronClassificationTool)
109 
110  # =======================================
111  # CREATE THE DERIVATION KERNEL ALGORITHM
112  # =======================================
113 
114  acc.addEventAlgo(
115  CompFactory.DerivationFramework.CommonAugmentation(
116  "EGammaLRTKernel", AugmentationTools=LRTEGAugmentationTools
117  )
118  )
119 
120  # =======================================
121  # ADD TOOLS : custom electron, photon and muon track isolation
122  # =======================================
123  from IsolationAlgs.DerivationTrackIsoConfig import DerivationTrackIsoCfg
124 
125  acc.merge(
127  flags, object_types=("Electrons", "Muons"), postfix="LRT"
128  )
129  )
130 
131  if not hasattr(acc, "LRTElectronCaloIsolationBuilder"):
132  from IsolationAlgs.IsolationSteeringDerivConfig import (
133  LRTElectronIsolationSteeringDerivCfg,
134  )
135 
136  acc.merge(LRTElectronIsolationSteeringDerivCfg(flags))
137 
138  from IsolationAlgs.IsolationBuilderConfig import egIsolationCfg
139 
140  acc.merge(
142  flags,
143  name="electronIsolationLRT",
144  # Avoid overlap with the previously-configured IsolationBuilder.
145  noCalo=True,
146  ElectronCollectionContainerName="LRTElectrons",
147  )
148  )
149 
150  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:342
python.EGammaLRTConfig.EGammaLRTCfg
def EGammaLRTCfg(flags)
Definition: EGammaLRTConfig.py:15
python.AsgElectronChargeIDSelectorToolConfig.AsgElectronChargeIDSelectorToolCfg
def AsgElectronChargeIDSelectorToolCfg(flags, name, **kwargs)
Definition: AsgElectronChargeIDSelectorToolConfig.py:6
python.EGammaToolsConfig.EGElectronAmbiguityToolCfg
def EGElectronAmbiguityToolCfg(flags, name, **kwargs)
Definition: EGammaToolsConfig.py:70
IsolationSteeringDerivConfig.LRTElectronIsolationSteeringDerivCfg
def LRTElectronIsolationSteeringDerivCfg(flags, name='LRTElectronCaloIsolationSteeringDeriv')
Definition: IsolationSteeringDerivConfig.py:61
IsolationBuilderConfig.egIsolationCfg
def egIsolationCfg(flags, name='egIsolation', noCalo=False, **kwargs)
Definition: IsolationBuilderConfig.py:9
python.EGammaToolsConfig.EGElectronLikelihoodToolWrapperCfg
def EGElectronLikelihoodToolWrapperCfg(flags, name, **kwargs)
Definition: EGammaToolsConfig.py:34
python.EGammaToolsConfig.BkgElectronClassificationCfg
def BkgElectronClassificationCfg(flags, name, **kwargs)
Definition: EGammaToolsConfig.py:79
DerivationTrackIsoConfig.DerivationTrackIsoCfg
def DerivationTrackIsoCfg(flags, **jwarg)
Definition: DerivationTrackIsoConfig.py:10