ATLAS Offline Software
Functions
python.JETM4 Namespace Reference

Functions

def JETM4SkimmingToolCfg (flags)
 
def JETM4KernelCfg (flags, name='JETM4Kernel', **kwargs)
 
def JETM4ExtraContentCfg (flags)
 
def JETM4Cfg (flags)
 

Function Documentation

◆ JETM4Cfg()

def python.JETM4.JETM4Cfg (   flags)

Definition at line 149 of file JETM4.py.

149 def JETM4Cfg(flags):
150 
151  acc = ComponentAccumulator()
152 
153  # Get the lists of triggers needed for trigger matching.
154  # This is needed at this scope (for the slimming) and further down in the config chain
155  # for actually configuring the matching, so we create it here and pass it down
156  # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
157  from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
158  JETM4TriggerListsHelper = TriggerListsHelper(flags)
159 
160  # Skimming, thinning, augmentation, extra content
161  acc.merge(JETM4KernelCfg(flags, name="JETM4Kernel", StreamName = 'StreamDAOD_JETM4', TriggerListsHelper = JETM4TriggerListsHelper))
162 
163  # ============================
164  # Define contents of the format
165  # =============================
166  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
167  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
168  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
169 
170  JETM4SlimmingHelper = SlimmingHelper("JETM4SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
171 
172  JETM4SlimmingHelper.SmartCollections = ["EventInfo","InDetTrackParticles", "PrimaryVertices",
173  "Electrons", "Photons", "Muons", "TauJets",
174  "MET_Baseline_AntiKt4EMTopo","MET_Baseline_AntiKt4EMPFlow",
175  "AntiKt4EMPFlowJets","AntiKt4EMTopoJets","AntiKt4UFOCSSKLowPtJets",
176  "AntiKt10UFOCSSKJets",
177  "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
178  "AntiKtVR30Rmax4Rmin02PV0TrackJets",
179  "BTagging_AntiKt4EMPFlow",
180  "BTagging_AntiKtVR30Rmax4Rmin02Track"]
181 
182  JETM4SlimmingHelper.AllVariables = ["CHSGChargedParticleFlowObjects", "CHSGNeutralParticleFlowObjects",
183  "MuonSegments",
184  "Kt4EMTopoOriginEventShape","Kt4EMPFlowEventShape","Kt4EMPFlowPUSBEventShape","Kt4EMPFlowNeutEventShape"]
185 
186  JETM4SlimmingHelper.ExtraVariables = ["TauJets.truthJetLink.truthParticleLink.IsTruthMatched"]
187 
188  # Low-level variables
189  from DerivationFrameworkJetEtMiss.CommonJETMXContent import ClusterVariables, FlowElementVariables
190  JETM4SlimmingHelper.ExtraVariables += [".".join(["CaloCalTopoClusters"] + ClusterVariables)]
191  JETM4SlimmingHelper.ExtraVariables += [".".join(["GlobalChargedParticleFlowObjects"] + FlowElementVariables)]
192  JETM4SlimmingHelper.ExtraVariables += [".".join(["GlobalNeutralParticleFlowObjects"] + FlowElementVariables)]
193 
194  # Truth containers
195  if flags.Input.isMC:
196 
197  from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
198  addTruth3ContentToSlimmerTool(JETM4SlimmingHelper)
199 
200  JETM4SlimmingHelper.AppendToDictionary.update({'TruthParticles': 'xAOD::TruthParticleContainer',
201  'TruthParticlesAux': 'xAOD::TruthParticleAuxContainer'})
202 
203  JETM4SlimmingHelper.AllVariables += ["TruthParticles", "TruthEvents", "TruthVertices",
204  "MuonTruthParticles", "egammaTruthParticles",]
205  JETM4SlimmingHelper.SmartCollections += ["AntiKt4TruthJets","AntiKt10TruthJets",
206  "AntiKt10TruthSoftDropBeta100Zcut10Jets"]
207 
208  # Trigger content
209  JETM4SlimmingHelper.IncludeTriggerNavigation = False
210  JETM4SlimmingHelper.IncludeJetTriggerContent = False
211  JETM4SlimmingHelper.IncludeMuonTriggerContent = False
212  JETM4SlimmingHelper.IncludeEGammaTriggerContent = True
213  JETM4SlimmingHelper.IncludeTauTriggerContent = False
214  JETM4SlimmingHelper.IncludeEtMissTriggerContent = False
215  JETM4SlimmingHelper.IncludeBJetTriggerContent = False
216  JETM4SlimmingHelper.IncludeBPhysTriggerContent = False
217  JETM4SlimmingHelper.IncludeMinBiasTriggerContent = False
218 
219  # Trigger matching
220  # Run 2
221  if flags.Trigger.EDMVersion == 2:
222  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
223  AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = JETM4SlimmingHelper,
224  OutputContainerPrefix = "TrigMatch_",
225  TriggerList = JETM4TriggerListsHelper.Run2TriggerNamesTau)
226  AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = JETM4SlimmingHelper,
227  OutputContainerPrefix = "TrigMatch_",
228  TriggerList = JETM4TriggerListsHelper.Run2TriggerNamesNoTau)
229  # Run 3, or Run 2 with navigation conversion
230  if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
231  from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
233 
234  # Output stream
235  JETM4ItemList = JETM4SlimmingHelper.GetItemList()
236  acc.merge(OutputStreamCfg(flags, "DAOD_JETM4", ItemList=JETM4ItemList, AcceptAlgs=["JETM4Kernel"]))
237  acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_JETM4", AcceptAlgs=["JETM4Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
238 
239  return acc
240 

◆ JETM4ExtraContentCfg()

def python.JETM4.JETM4ExtraContentCfg (   flags)

Definition at line 129 of file JETM4.py.

129 def JETM4ExtraContentCfg(flags):
130 
131  acc = ComponentAccumulator()
132 
133  # PFlow augmentation tool
134  from DerivationFrameworkJetEtMiss.PFlowCommonConfig import PFlowCommonCfg
135  acc.merge(PFlowCommonCfg(flags))
136 
137  from JetRecConfig.JetRecConfig import JetRecCfg
138  from JetRecConfig.StandardSmallRJets import AntiKt4UFOCSSKLowPt
139  AntiKt4UFOCSSKLowPt_JETM4 = AntiKt4UFOCSSKLowPt.clone(
140  modifiers = AntiKt4UFOCSSKLowPt.modifiers+("NNJVT",)
141  )
142  jetList = [AntiKt4UFOCSSKLowPt_JETM4]
143  for jd in jetList:
144  acc.merge(JetRecCfg(flags,jd))
145 
146  return acc
147 
148 

◆ JETM4KernelCfg()

def python.JETM4.JETM4KernelCfg (   flags,
  name = 'JETM4Kernel',
**  kwargs 
)
Configure the derivation framework driving algorithm (kernel) for JETM4

Definition at line 30 of file JETM4.py.

30 def JETM4KernelCfg(flags, name='JETM4Kernel', **kwargs):
31  """Configure the derivation framework driving algorithm (kernel) for JETM4"""
32  acc = ComponentAccumulator()
33 
34  # Skimming
35  if not flags.Input.isMC:
36  skimmingTool = acc.getPrimaryAndMerge(JETM4SkimmingToolCfg(flags))
37 
38  # Common augmentations
39  from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
40  acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
41 
42  # Thinning tools...
43  from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, TauTrackParticleThinningCfg
44 
45  # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations
46  JETM4_thinning_expression = "( abs(InDetTrackParticles.d0) < 5*mm ) && ( abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5*mm )"
47  JETM4TrackParticleThinningTool = acc.getPrimaryAndMerge(TrackParticleThinningCfg(
48  flags,
49  name = "JETM4TrackParticleThinningTool",
50  StreamName = kwargs['StreamName'],
51  SelectionString = JETM4_thinning_expression,
52  InDetTrackParticlesKey = "InDetTrackParticles"))
53 
54  # Include inner detector tracks associated with muons
55  JETM4MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
56  flags,
57  name = "JETM4MuonTPThinningTool",
58  StreamName = kwargs['StreamName'],
59  MuonKey = "Muons",
60  InDetTrackParticlesKey = "InDetTrackParticles"))
61 
62  # Include inner detector tracks associated with electonrs
63  JETM4ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
64  flags,
65  name = "JETM4ElectronTPThinningTool",
66  StreamName = kwargs['StreamName'],
67  SGKey = "Electrons",
68  InDetTrackParticlesKey = "InDetTrackParticles"))
69 
70  # Include inner detector tracks associated with photons
71  JETM4PhotonTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
72  flags,
73  name = "JETM4PhotonTPThinningTool",
74  StreamName = kwargs['StreamName'],
75  SGKey = "Photons",
76  InDetTrackParticlesKey = "InDetTrackParticles",
77  GSFConversionVerticesKey = "GSFConversionVertices"))
78 
79  # Include inner detector tracks associated with taus
80  JETM4TauTPThinningTool = acc.getPrimaryAndMerge(TauTrackParticleThinningCfg(
81  flags,
82  name = "JETM4TauTPThinningTool",
83  StreamName = kwargs['StreamName'],
84  TauKey = "TauJets",
85  InDetTrackParticlesKey = "InDetTrackParticles",
86  DoTauTracksThinning = True,
87  TauTracksKey = "TauTracks"))
88 
89 
90  thinningTools = [JETM4TrackParticleThinningTool,
91  JETM4MuonTPThinningTool,
92  JETM4ElectronTPThinningTool,
93  JETM4PhotonTPThinningTool,
94  JETM4TauTPThinningTool]
95 
96  if flags.Input.isMC:
97  truth_cond_WZH = "((abs(TruthParticles.pdgId) >= 23) && (abs(TruthParticles.pdgId) <= 25))" # W, Z and Higgs
98  truth_cond_Lepton = "((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16) && (TruthParticles.barcode < 200000))" # Leptons
99  truth_cond_Quark = "((abs(TruthParticles.pdgId) <= 5 && (TruthParticles.pt > 10000.)) || (abs(TruthParticles.pdgId) == 6))" # Quarks
100  truth_cond_Gluon = "((abs(TruthParticles.pdgId) == 21) && (TruthParticles.pt > 10000.))" # Gluons
101  truth_cond_Photon = "((abs(TruthParticles.pdgId) == 22) && (TruthParticles.pt > 10000.) && (TruthParticles.barcode < 200000))" # Photon
102 
103  truth_expression = '('+truth_cond_WZH+' || '+truth_cond_Lepton +' || '+truth_cond_Quark+'||'+truth_cond_Gluon+' || '+truth_cond_Photon+')'
104 
105  preserveAllDescendants = False
106 
107  JETM4TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning ( name = "JETM4TruthThinningTool",
108  StreamName = kwargs['StreamName'],
109  ParticleSelectionString = truth_expression,
110  PreserveDescendants = preserveAllDescendants,
111  PreserveGeneratorDescendants = not preserveAllDescendants,
112  PreserveAncestors = True)
113 
114  acc.addPublicTool(JETM4TruthThinningTool)
115  thinningTools.append(JETM4TruthThinningTool)
116 
117  # Finally the kernel itself
118  DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
119  acc.addEventAlgo(DerivationKernel(name,
120  ThinningTools = thinningTools,
121  SkimmingTools = [skimmingTool] if not flags.Input.isMC else []))
122 
123  # Extra jet content:
124  acc.merge(JETM4ExtraContentCfg(flags))
125 
126  return acc
127 
128 

◆ JETM4SkimmingToolCfg()

def python.JETM4.JETM4SkimmingToolCfg (   flags)
Configure the skimming tool

Definition at line 11 of file JETM4.py.

11 def JETM4SkimmingToolCfg(flags):
12  """Configure the skimming tool"""
13  acc = ComponentAccumulator()
14 
15  from DerivationFrameworkJetEtMiss import TriggerLists
16  triggerlist = TriggerLists.single_photon_Trig(flags)
17  addRun3PhotonTriggers = ["HLT_g140_loose_L1EM22VHI","HLT_g300_etcut_L1EM22VHI"]
18  triggerlist = triggerlist+addRun3PhotonTriggers
19 
20  triggers = '||'.join(triggerlist)
21 
22  JETM4SkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "JETM4SkimmingTool",
23  expression = triggers)
24  acc.addPublicTool(JETM4SkimmingTool, primary = True)
25 
26  return(acc)
27 
28 
29 # Main algorithm config
TrigNavSlimmingMTConfig.AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
def AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(slimmingHelper)
Definition: TrigNavSlimmingMTConfig.py:98
python.JETM4.JETM4KernelCfg
def JETM4KernelCfg(flags, name='JETM4Kernel', **kwargs)
Definition: JETM4.py:30
python.PFlowCommonConfig.PFlowCommonCfg
def PFlowCommonCfg(ConfigFlags)
Definition: PFlowCommonConfig.py:6
python.JETM4.JETM4Cfg
def JETM4Cfg(flags)
Definition: JETM4.py:149
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
python.InDetToolsConfig.TrackParticleThinningCfg
def TrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:458
python.TriggerMatchingCommonConfig.AddRun2TriggerMatchingToSlimmingHelper
def AddRun2TriggerMatchingToSlimmingHelper(**kwargs)
Definition: TriggerMatchingCommonConfig.py:49
python.JETM4.JETM4ExtraContentCfg
def JETM4ExtraContentCfg(flags)
Definition: JETM4.py:129
python.JetRecConfig.JetRecCfg
def JetRecCfg(flags, jetdef, returnConfiguredDef=False)
Top level functions returning ComponentAccumulator out of JetDefinition.
Definition: JetRecConfig.py:36
python.JETM4.JETM4SkimmingToolCfg
def JETM4SkimmingToolCfg(flags)
Definition: JETM4.py:11
python.InDetToolsConfig.MuonTrackParticleThinningCfg
def MuonTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:528
python.InDetToolsConfig.TauTrackParticleThinningCfg
def TauTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:539
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.MCTruthCommonConfig.addTruth3ContentToSlimmerTool
def addTruth3ContentToSlimmerTool(slimmer)
Definition: MCTruthCommonConfig.py:462
python.InDetToolsConfig.EgammaTrackParticleThinningCfg
def EgammaTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:579
python.PhysCommonConfig.PhysCommonAugmentationsCfg
def PhysCommonAugmentationsCfg(flags, **kwargs)
Definition: PhysCommonConfig.py:14
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
SlimmingHelper
Definition: SlimmingHelper.py:1
python.HION12.DerivationKernel
DerivationKernel
Definition: HION12.py:66