ATLAS Offline Software
Functions
python.JETM3 Namespace Reference

Functions

def JETM3SkimmingToolCfg (flags)
 
def JETM3KernelCfg (flags, name='JETM3Kernel', **kwargs)
 
def JETM3ExtraContentCfg (flags)
 
def JETM3Cfg (flags)
 

Function Documentation

◆ JETM3Cfg()

def python.JETM3.JETM3Cfg (   flags)

Definition at line 221 of file JETM3.py.

221 def JETM3Cfg(flags):
222 
223  acc = ComponentAccumulator()
224 
225  # Get the lists of triggers needed for trigger matching.
226  # This is needed at this scope (for the slimming) and further down in the config chain
227  # for actually configuring the matching, so we create it here and pass it down
228  # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
229  from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
230  JETM3TriggerListsHelper = TriggerListsHelper(flags)
231 
232  # Skimming, thinning, augmentation, extra content
233  acc.merge(JETM3KernelCfg(flags, name="JETM3Kernel", StreamName = 'StreamDAOD_JETM3', TriggerListsHelper = JETM3TriggerListsHelper))
234 
235  # ============================
236  # Define contents of the format
237  # =============================
238  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
239  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
240  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
241 
242  JETM3SlimmingHelper = SlimmingHelper("JETM3SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
243 
244  JETM3SlimmingHelper.SmartCollections = ["EventInfo","InDetTrackParticles", "PrimaryVertices",
245  "Electrons", "Photons", "Muons", "TauJets",
246  "MET_Baseline_AntiKt4EMTopo","MET_Baseline_AntiKt4EMPFlow",
247  "AntiKt4EMPFlowJets","AntiKt4EMTopoJets",
248  "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
249  "BTagging_AntiKt4EMPFlow"]
250 
251  JETM3SlimmingHelper.AllVariables = ["CHSGChargedParticleFlowObjects", "CHSGNeutralParticleFlowObjects",
252  "MuonSegments","LVL1JetRoIs",
253  "Kt4EMTopoOriginEventShape","Kt4EMPFlowEventShape","Kt4EMPFlowPUSBEventShape","Kt4EMPFlowNeutEventShape"]
254 
255  JETM3SlimmingHelper.ExtraVariables = ["AntiKt4EMPFlowJets.passOnlyBJVT.DFCommonJets_bJvt.isJvtHS.isJvtPU",
256  "Muons.energyLossType.EnergyLoss.ParamEnergyLoss.MeasEnergyLoss.EnergyLossSigma.MeasEnergyLossSigma.ParamEnergyLossSigmaPlus.ParamEnergyLossSigmaMinus"]
257 
258  # Low-level variables
259  from DerivationFrameworkJetEtMiss.CommonJETMXContent import ClusterVariables, FlowElementVariables
260  JETM3SlimmingHelper.ExtraVariables += [".".join(["CaloCalTopoClusters"] + ClusterVariables)]
261  JETM3SlimmingHelper.ExtraVariables += [".".join(["GlobalChargedParticleFlowObjects"] + FlowElementVariables)]
262  JETM3SlimmingHelper.ExtraVariables += [".".join(["GlobalNeutralParticleFlowObjects"] + FlowElementVariables)]
263 
264  # Truth containers
265  if flags.Input.isMC:
266 
267  from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
268  addTruth3ContentToSlimmerTool(JETM3SlimmingHelper)
269 
270  JETM3SlimmingHelper.AppendToDictionary.update({'TruthParticles': 'xAOD::TruthParticleContainer',
271  'TruthParticlesAux': 'xAOD::TruthParticleAuxContainer'})
272 
273  JETM3SlimmingHelper.AllVariables += ["AntiKt4TruthJets", "InTimeAntiKt4TruthJets", "OutOfTimeAntiKt4TruthJets",
274  "TruthParticles", "TruthEvents", "TruthVertices",
275  "MuonTruthParticles", "egammaTruthParticles",]
276  JETM3SlimmingHelper.SmartCollections += ["AntiKt4TruthWZJets","AntiKt4TruthJets","AntiKt10TruthJets",
277  "AntiKt10TruthTrimmedPtFrac5SmallR20Jets",
278  "AntiKt10TruthSoftDropBeta100Zcut10Jets"]
279 
280  # Trigger content
281  JETM3SlimmingHelper.IncludeTriggerNavigation = False
282  JETM3SlimmingHelper.IncludeJetTriggerContent = True
283  JETM3SlimmingHelper.IncludeMuonTriggerContent = True
284  JETM3SlimmingHelper.IncludeEGammaTriggerContent = True
285  JETM3SlimmingHelper.IncludeTauTriggerContent = False
286  JETM3SlimmingHelper.IncludeEtMissTriggerContent = False
287  JETM3SlimmingHelper.IncludeBJetTriggerContent = False
288  JETM3SlimmingHelper.IncludeBPhysTriggerContent = False
289  JETM3SlimmingHelper.IncludeMinBiasTriggerContent = False
290 
291  # Trigger matching
292  # Run 2
293  if flags.Trigger.EDMVersion == 2:
294  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
295  AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = JETM3SlimmingHelper,
296  OutputContainerPrefix = "TrigMatch_",
297  TriggerList = JETM3TriggerListsHelper.Run2TriggerNamesTau)
298  AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = JETM3SlimmingHelper,
299  OutputContainerPrefix = "TrigMatch_",
300  TriggerList = JETM3TriggerListsHelper.Run2TriggerNamesNoTau)
301  # Run 3, or Run 2 with navigation conversion
302  if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
303  from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
305 
306  jetOutputList = ["AntiKt4EMPFlowLowPtJets","AntiKt4EMTopoLowPtJets", "AntiKt4UFOCSSKLowPtJets"]
307  from DerivationFrameworkJetEtMiss.JetCommonConfig import addJetsToSlimmingTool
308  addJetsToSlimmingTool(JETM3SlimmingHelper, jetOutputList, JETM3SlimmingHelper.SmartCollections)
309 
310  # Output stream
311  JETM3ItemList = JETM3SlimmingHelper.GetItemList()
312  acc.merge(OutputStreamCfg(flags, "DAOD_JETM3", ItemList=JETM3ItemList, AcceptAlgs=["JETM3Kernel"]))
313  acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_JETM3", AcceptAlgs=["JETM3Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
314 
315  return acc
316 

◆ JETM3ExtraContentCfg()

def python.JETM3.JETM3ExtraContentCfg (   flags)

Definition at line 169 of file JETM3.py.

169 def JETM3ExtraContentCfg(flags):
170 
171  acc = ComponentAccumulator()
172 
173  from JetRecConfig.JetRecConfig import JetRecCfg, getModifier
174  from JetRecConfig.StandardJetMods import stdJetModifiers
175  from JetRecConfig.StandardSmallRJets import AntiKt4EMPFlow, AntiKt4EMPFlowLowPt, AntiKt4EMTopoLowPt, AntiKt4UFOCSSKLowPt
176 
177  #=======================================
178  # Schedule additional jet decorations
179  #=======================================
180  bJVTTool = getModifier(AntiKt4EMPFlow, stdJetModifiers['bJVT'], stdJetModifiers['bJVT'].modspec, flags=flags)
181  acc.addEventAlgo(CompFactory.JetDecorationAlg(name='bJVTAlg',
182  JetContainer='AntiKt4EMPFlowJets',
183  Decorators=[bJVTTool]))
184 
185  #=======================================
186  # Low pT cut containers
187  #=======================================
188  AntiKt4UFOCSSKLowPt_JETM3 = AntiKt4UFOCSSKLowPt.clone(
189  modifiers = AntiKt4UFOCSSKLowPt.modifiers+("NNJVT",)
190  )
191  jetList = [AntiKt4EMPFlowLowPt, AntiKt4EMTopoLowPt, AntiKt4UFOCSSKLowPt_JETM3]
192 
193 
194  for jd in jetList:
195  acc.merge(JetRecCfg(flags,jd))
196 
197 
198  # PFlow augmentation tool
199  from DerivationFrameworkJetEtMiss.PFlowCommonConfig import PFlowCommonCfg
200  acc.merge(PFlowCommonCfg(flags))
201 
202  #=======================================
203  # Add Run-2 jet trigger collections
204  # Only needed for Run-2 due to different aux container type (JetTrigAuxContainer) which required special wrapper for conversion to AuxContainerBase
205  # In Run-3, the aux. container type is directly JetAuxContainer (no conversion needed)
206  #=======================================
207 
208  if flags.Trigger.EDMVersion == 2:
209  triggerNames = ["JetContainer_a4tcemsubjesFS", "JetContainer_a4tcemsubjesISFS", "JetContainer_a10tclcwsubjesFS", "JetContainer_GSCJet"]
210 
211  for trigger in triggerNames:
212  wrapperName = trigger+'AuxWrapper'
213  auxContainerName = 'HLT_xAOD__'+trigger+'Aux'
214 
215  acc.addEventAlgo(CompFactory.xAODMaker.AuxStoreWrapper( wrapperName, SGKeys = [ auxContainerName+"." ] ))
216 
217 
218  return acc
219 
220 

◆ JETM3KernelCfg()

def python.JETM3.JETM3KernelCfg (   flags,
  name = 'JETM3Kernel',
**  kwargs 
)
Configure the derivation framework driving algorithm (kernel) for JETM3

Definition at line 70 of file JETM3.py.

70 def JETM3KernelCfg(flags, name='JETM3Kernel', **kwargs):
71  """Configure the derivation framework driving algorithm (kernel) for JETM3"""
72  acc = ComponentAccumulator()
73 
74  # Skimming
75  skimmingTool = acc.getPrimaryAndMerge(JETM3SkimmingToolCfg(flags))
76 
77  # Common augmentations
78  from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
79  acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
80 
81  # Thinning tools...
82  from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, TauTrackParticleThinningCfg
83 
84  # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations
85  JETM3_thinning_expression = "( abs(InDetTrackParticles.d0) < 5*mm ) && ( abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5*mm )"
86  JETM3TrackParticleThinningTool = acc.getPrimaryAndMerge(TrackParticleThinningCfg(
87  flags,
88  name = "JETM3TrackParticleThinningTool",
89  StreamName = kwargs['StreamName'],
90  SelectionString = JETM3_thinning_expression,
91  InDetTrackParticlesKey = "InDetTrackParticles"))
92 
93  # Include inner detector tracks associated with muons
94  JETM3MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
95  flags,
96  name = "JETM3MuonTPThinningTool",
97  StreamName = kwargs['StreamName'],
98  MuonKey = "Muons",
99  InDetTrackParticlesKey = "InDetTrackParticles"))
100 
101  # Include inner detector tracks associated with electonrs
102  JETM3ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
103  flags,
104  name = "JETM3ElectronTPThinningTool",
105  StreamName = kwargs['StreamName'],
106  SGKey = "Electrons",
107  InDetTrackParticlesKey = "InDetTrackParticles"))
108 
109  # Include inner detector tracks associated with photons
110  JETM3PhotonTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
111  flags,
112  name = "JETM3PhotonTPThinningTool",
113  StreamName = kwargs['StreamName'],
114  SGKey = "Photons",
115  InDetTrackParticlesKey = "InDetTrackParticles",
116  GSFConversionVerticesKey = "GSFConversionVertices"))
117 
118  # Include inner detector tracks associated with taus
119  JETM3TauTPThinningTool = acc.getPrimaryAndMerge(TauTrackParticleThinningCfg(
120  flags,
121  name = "JETM3TauTPThinningTool",
122  StreamName = kwargs['StreamName'],
123  TauKey = "TauJets",
124  InDetTrackParticlesKey = "InDetTrackParticles",
125  DoTauTracksThinning = True,
126  TauTracksKey = "TauTracks"))
127 
128 
129  thinningTools = [JETM3TrackParticleThinningTool,
130  JETM3MuonTPThinningTool,
131  JETM3ElectronTPThinningTool,
132  JETM3PhotonTPThinningTool,
133  JETM3TauTPThinningTool]
134 
135  if flags.Input.isMC:
136  truth_cond_WZH = "((abs(TruthParticles.pdgId) >= 23) && (abs(TruthParticles.pdgId) <= 25))" # W, Z and Higgs
137  truth_cond_Lepton = "((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16) && (TruthParticles.barcode < 200000))" # Leptons
138  truth_cond_Quark = "((abs(TruthParticles.pdgId) <= 5 && (TruthParticles.pt > 10000.)) || (abs(TruthParticles.pdgId) == 6))" # Quarks
139  truth_cond_Gluon = "((abs(TruthParticles.pdgId) == 21) && (TruthParticles.pt > 10000.))" # Gluons
140  truth_cond_Photon = "((abs(TruthParticles.pdgId) == 22) && (TruthParticles.pt > 10000.) && (TruthParticles.barcode < 200000))" # Photon
141 
142  truth_expression = '('+truth_cond_WZH+' || '+truth_cond_Lepton +' || '+truth_cond_Quark+'||'+truth_cond_Gluon+' || '+truth_cond_Photon+')'
143 
144  preserveAllDescendants = False
145 
146  JETM3TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning ( name = "JETM3TruthThinningTool",
147  StreamName = kwargs['StreamName'],
148  ParticleSelectionString = truth_expression,
149  PreserveDescendants = preserveAllDescendants,
150  PreserveGeneratorDescendants = not preserveAllDescendants,
151  PreserveAncestors = True)
152 
153  acc.addPublicTool(JETM3TruthThinningTool)
154  thinningTools.append(JETM3TruthThinningTool)
155 
156  # Finally the kernel itself
157  DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
158  acc.addEventAlgo(DerivationKernel(name,
159  ThinningTools = thinningTools,
160  SkimmingTools = [skimmingTool]))
161 
162 
163  # Extra jet content:
164  acc.merge(JETM3ExtraContentCfg(flags))
165 
166  return acc
167 
168 

◆ JETM3SkimmingToolCfg()

def python.JETM3.JETM3SkimmingToolCfg (   flags)
Configure the skimming tool

Definition at line 11 of file JETM3.py.

11 def JETM3SkimmingToolCfg(flags):
12  """Configure the skimming tool"""
13  acc = ComponentAccumulator()
14 
15  from DerivationFrameworkJetEtMiss import TriggerLists
16  electronTriggers = TriggerLists.single_el_Trig(flags)
17  muonTriggers = TriggerLists.single_mu_Trig(flags)
18 
19  addRun3ElectronTriggers = ["HLT_e17_lhvloose_L1EM15VHI","HLT_e20_lhvloose_L1EM15VH", "HLT_e250_etcut_L1EM22VHI",
20  "HLT_e26_lhtight_ivarloose_L1EM22VHI","HLT_e26_lhtight_ivarloose_L1eEM26M",
21  "HLT_e60_lhmedium_L1EM22VHI","HLT_e60_lhmedium_L1eEM26M",
22  "HLT_e140_lhloose_L1EM22VHI","HLT_e140_lhloose_L1eEM26M",
23  "HLT_e300_etcut_L1EM22VHI","HLT_e300_etcut_L1eEM26M",
24  "HLT_e140_lhloose_noringer_L1EM22VHI","HLT_e140_lhloose_noringer_L1eEM26M"]
25 
26  addRund3MuonTriggers = ["HLT_mu24_ivarmedium_L1MU14FCH","HLT_mu50_L1MU14FCH","HLT_mu60_0eta105_msonly_L1MU14FCH","HLT_mu60_L1MU14FCH","HLT_mu80_msonly_3layersEC_L1MU14FCH"]
27 
28  electronTriggers = electronTriggers+addRun3ElectronTriggers
29  muonTriggers = muonTriggers+addRund3MuonTriggers
30 
31  elofflinesel = '(count((Electrons.pt > 20*GeV) && (Electrons.DFCommonElectronsLHMedium)) >= 2)'
32  muofflinesel = '(count((Muons.pt > 20*GeV) && (Muons.DFCommonMuonPassPreselection)) >= 2)'
33 
34  # TrigDecisionTool not used in skimming via xAODStringSkimmingTool here but with dedicated TriggerSkimmingTool
35  # Explicitely set to "" here to be able to run over HL-LHC samples
36  JETM3OfflineSkimmingTool_ele = CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "JETM3OfflineSkimmingTool_ele",
37  expression = elofflinesel,
38  TrigDecisionTool="")
39  JETM3OfflineSkimmingTool_mu = CompFactory.DerivationFramework.xAODStringSkimmingTool( name = "JETM3OfflineSkimmingTool_mu",
40  expression = muofflinesel,
41  TrigDecisionTool="")
42 
43  acc.addPublicTool(JETM3OfflineSkimmingTool_ele)
44  acc.addPublicTool(JETM3OfflineSkimmingTool_mu)
45 
46  if not flags.Input.isMC:
47 
48  JETM3TriggerSkimmingTool_ele = CompFactory.DerivationFramework.TriggerSkimmingTool(name = "JETM3TriggerSkimmingTool_ele", TriggerListOR = electronTriggers)
49  acc.addPublicTool(JETM3TriggerSkimmingTool_ele)
50  JETM3TriggerSkimmingTool_mu = CompFactory.DerivationFramework.TriggerSkimmingTool(name = "JETM3TriggerSkimmingTool_mu", TriggerListOR = muonTriggers)
51  acc.addPublicTool(JETM3TriggerSkimmingTool_mu)
52 
53  JETM3SkimmingTool_ele = CompFactory.DerivationFramework.FilterCombinationAND(name="JETM3SkimmingTool_ele", FilterList=[JETM3OfflineSkimmingTool_ele, JETM3TriggerSkimmingTool_ele] )
54  JETM3SkimmingTool_mu = CompFactory.DerivationFramework.FilterCombinationAND(name="JETM3SkimmingTool_mu", FilterList=[JETM3OfflineSkimmingTool_mu, JETM3TriggerSkimmingTool_mu] )
55  acc.addPublicTool(JETM3SkimmingTool_ele)
56  acc.addPublicTool(JETM3SkimmingTool_mu)
57 
58  # Combine electron and muon channel
59  JETM3SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(name="JETM3SkimmingTool", FilterList=[JETM3SkimmingTool_ele, JETM3SkimmingTool_mu])
60  acc.addPublicTool(JETM3SkimmingTool, primary = True)
61  else:
62 
63  JETM3SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(name="JETM3SkimmingTool", FilterList=[JETM3OfflineSkimmingTool_ele, JETM3OfflineSkimmingTool_mu])
64  acc.addPublicTool(JETM3SkimmingTool, primary = True)
65 
66  return(acc)
67 
68 
69 # Main algorithm config
TrigNavSlimmingMTConfig.AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
def AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(slimmingHelper)
Definition: TrigNavSlimmingMTConfig.py:98
python.PFlowCommonConfig.PFlowCommonCfg
def PFlowCommonCfg(ConfigFlags)
Definition: PFlowCommonConfig.py:6
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.JETM3.JETM3SkimmingToolCfg
def JETM3SkimmingToolCfg(flags)
Definition: JETM3.py:11
python.JetRecConfig.getModifier
def getModifier(jetdef, moddef, modspec, flags=None)
Definition: JetRecConfig.py:658
python.InDetToolsConfig.TrackParticleThinningCfg
def TrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:458
python.TriggerMatchingCommonConfig.AddRun2TriggerMatchingToSlimmingHelper
def AddRun2TriggerMatchingToSlimmingHelper(**kwargs)
Definition: TriggerMatchingCommonConfig.py:49
python.JETM3.JETM3ExtraContentCfg
def JETM3ExtraContentCfg(flags)
Definition: JETM3.py:169
python.JETM3.JETM3Cfg
def JETM3Cfg(flags)
Definition: JETM3.py:221
python.JETM3.JETM3KernelCfg
def JETM3KernelCfg(flags, name='JETM3Kernel', **kwargs)
Definition: JETM3.py:70
python.JetRecConfig.JetRecCfg
def JetRecCfg(flags, jetdef, returnConfiguredDef=False)
Top level functions returning ComponentAccumulator out of JetDefinition.
Definition: JetRecConfig.py:36
python.JetCommonConfig.addJetsToSlimmingTool
def addJetsToSlimmingTool(slimhelper, contentlist, smartlist=[])
Definition: JetCommonConfig.py:262
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