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 222 of file JETM3.py.

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

◆ JETM3ExtraContentCfg()

def python.JETM3.JETM3ExtraContentCfg (   flags)

Definition at line 170 of file JETM3.py.

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

◆ JETM3KernelCfg()

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

Definition at line 71 of file JETM3.py.

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

◆ JETM3SkimmingToolCfg()

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

Definition at line 12 of file JETM3.py.

12 def JETM3SkimmingToolCfg(flags):
13  """Configure the skimming tool"""
14  acc = ComponentAccumulator()
15 
16  from DerivationFrameworkJetEtMiss import TriggerLists
17  electronTriggers = TriggerLists.single_el_Trig(flags)
18  muonTriggers = TriggerLists.single_mu_Trig(flags)
19 
20  addRun3ElectronTriggers = ["HLT_e17_lhvloose_L1EM15VHI","HLT_e20_lhvloose_L1EM15VH", "HLT_e250_etcut_L1EM22VHI",
21  "HLT_e26_lhtight_ivarloose_L1EM22VHI","HLT_e26_lhtight_ivarloose_L1eEM26M",
22  "HLT_e60_lhmedium_L1EM22VHI","HLT_e60_lhmedium_L1eEM26M",
23  "HLT_e140_lhloose_L1EM22VHI","HLT_e140_lhloose_L1eEM26M",
24  "HLT_e300_etcut_L1EM22VHI","HLT_e300_etcut_L1eEM26M",
25  "HLT_e140_lhloose_noringer_L1EM22VHI","HLT_e140_lhloose_noringer_L1eEM26M"]
26 
27  addRund3MuonTriggers = ["HLT_mu24_ivarmedium_L1MU14FCH","HLT_mu50_L1MU14FCH","HLT_mu60_0eta105_msonly_L1MU14FCH","HLT_mu60_L1MU14FCH","HLT_mu80_msonly_3layersEC_L1MU14FCH"]
28 
29  electronTriggers = electronTriggers+addRun3ElectronTriggers
30  muonTriggers = muonTriggers+addRund3MuonTriggers
31 
32  elofflinesel = '(count((Electrons.pt > 20*GeV) && (Electrons.DFCommonElectronsLHMedium)) >= 2)'
33  muofflinesel = '(count((Muons.pt > 20*GeV) && (Muons.DFCommonMuonPassPreselection)) >= 2)'
34 
35  # TrigDecisionTool not used in skimming via xAODStringSkimmingTool here but with dedicated TriggerSkimmingTool
36  # Explicitely set to "" here to be able to run over HL-LHC samples
37  JETM3OfflineSkimmingTool_ele = CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "JETM3OfflineSkimmingTool_ele",
38  expression = elofflinesel,
39  TrigDecisionTool="")
40  JETM3OfflineSkimmingTool_mu = CompFactory.DerivationFramework.xAODStringSkimmingTool( name = "JETM3OfflineSkimmingTool_mu",
41  expression = muofflinesel,
42  TrigDecisionTool="")
43 
44  acc.addPublicTool(JETM3OfflineSkimmingTool_ele)
45  acc.addPublicTool(JETM3OfflineSkimmingTool_mu)
46 
47  if not flags.Input.isMC:
48 
49  JETM3TriggerSkimmingTool_ele = CompFactory.DerivationFramework.TriggerSkimmingTool(name = "JETM3TriggerSkimmingTool_ele", TriggerListOR = electronTriggers)
50  acc.addPublicTool(JETM3TriggerSkimmingTool_ele)
51  JETM3TriggerSkimmingTool_mu = CompFactory.DerivationFramework.TriggerSkimmingTool(name = "JETM3TriggerSkimmingTool_mu", TriggerListOR = muonTriggers)
52  acc.addPublicTool(JETM3TriggerSkimmingTool_mu)
53 
54  JETM3SkimmingTool_ele = CompFactory.DerivationFramework.FilterCombinationAND(name="JETM3SkimmingTool_ele", FilterList=[JETM3OfflineSkimmingTool_ele, JETM3TriggerSkimmingTool_ele] )
55  JETM3SkimmingTool_mu = CompFactory.DerivationFramework.FilterCombinationAND(name="JETM3SkimmingTool_mu", FilterList=[JETM3OfflineSkimmingTool_mu, JETM3TriggerSkimmingTool_mu] )
56  acc.addPublicTool(JETM3SkimmingTool_ele)
57  acc.addPublicTool(JETM3SkimmingTool_mu)
58 
59  # Combine electron and muon channel
60  JETM3SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(name="JETM3SkimmingTool", FilterList=[JETM3SkimmingTool_ele, JETM3SkimmingTool_mu])
61  acc.addPublicTool(JETM3SkimmingTool, primary = True)
62  else:
63 
64  JETM3SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(name="JETM3SkimmingTool", FilterList=[JETM3OfflineSkimmingTool_ele, JETM3OfflineSkimmingTool_mu])
65  acc.addPublicTool(JETM3SkimmingTool, primary = True)
66 
67  return(acc)
68 
69 
70 # 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:12
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:170
python.JETM3.JETM3Cfg
def JETM3Cfg(flags)
Definition: JETM3.py:222
python.JETM3.JETM3KernelCfg
def JETM3KernelCfg(flags, name='JETM3Kernel', **kwargs)
Definition: JETM3.py:71
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:249
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:219
SlimmingHelper
Definition: SlimmingHelper.py:1
python.HION12.DerivationKernel
DerivationKernel
Definition: HION12.py:67