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 150 of file JETM4.py.

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

◆ JETM4ExtraContentCfg()

def python.JETM4.JETM4ExtraContentCfg (   flags)

Definition at line 130 of file JETM4.py.

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

◆ JETM4KernelCfg()

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

Definition at line 31 of file JETM4.py.

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

◆ JETM4SkimmingToolCfg()

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

Definition at line 12 of file JETM4.py.

12 def JETM4SkimmingToolCfg(flags):
13  """Configure the skimming tool"""
14  acc = ComponentAccumulator()
15 
16  from DerivationFrameworkJetEtMiss import TriggerLists
17  triggerlist = TriggerLists.single_photon_Trig(flags)
18  addRun3PhotonTriggers = ["HLT_g140_loose_L1EM22VHI","HLT_g300_etcut_L1EM22VHI"]
19  triggerlist = triggerlist+addRun3PhotonTriggers
20 
21  triggers = '||'.join(triggerlist)
22 
23  JETM4SkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "JETM4SkimmingTool",
24  expression = triggers)
25  acc.addPublicTool(JETM4SkimmingTool, primary = True)
26 
27  return(acc)
28 
29 
30 # Main algorithm config
TrigNavSlimmingMTConfig.AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
def AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(slimmingHelper)
Definition: TrigNavSlimmingMTConfig.py:98
python.JETM4.JETM4KernelCfg
def JETM4KernelCfg(flags, name='JETM4Kernel', **kwargs)
Definition: JETM4.py:31
python.PFlowCommonConfig.PFlowCommonCfg
def PFlowCommonCfg(ConfigFlags)
Definition: PFlowCommonConfig.py:6
python.JETM4.JETM4Cfg
def JETM4Cfg(flags)
Definition: JETM4.py:150
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:130
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:12
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