ATLAS Offline Software
Functions
python.FTAG2 Namespace Reference

Functions

def FTAG2KernelCfg (flags, name='FTAG2Kernel', **kwargs)
 
def FTAG2Cfg (flags)
 

Function Documentation

◆ FTAG2Cfg()

def python.FTAG2.FTAG2Cfg (   flags)

Definition at line 80 of file FTAG2.py.

80 def FTAG2Cfg(flags):
81  acc = ComponentAccumulator()
82 
83  # Get the lists of triggers needed for trigger matching.
84  # This is needed at this scope (for the slimming) and further down in the config chain
85  # for actually configuring the matching, so we create it here and pass it down
86  # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
87  from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
88  FTAG2TriggerListsHelper = TriggerListsHelper(flags)
89 
90  # Common augmentations
91  acc.merge(FTAG2KernelCfg(flags, name="FTAG2Kernel", StreamName = 'StreamDAOD_FTAG2', TriggerListsHelper = FTAG2TriggerListsHelper))
92 
93  # ============================
94  # Define contents of the format
95  # =============================
96  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
97  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
98  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
99 
100  FTAG2SlimmingHelper = SlimmingHelper("FTAG2SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
101 
102  from DerivationFrameworkFlavourTag import FtagBaseContent
103 
104  FTAG2SlimmingHelper.SmartCollections = []
105  FtagBaseContent.add_baseline_slimming_smartcollections(FTAG2SlimmingHelper)
106 
107  FTAG2SlimmingHelper.AllVariables = []
108  FtagBaseContent.add_baseline_slimming_allvariables(FTAG2SlimmingHelper)
109 
110  # update AppendToDictionary
111  extra_AppendToDictionary = {} #only add those items specifically for FTAG2 here!
112  FtagBaseContent.update_AppendToDictionary_in_SlimmingHelper(FTAG2SlimmingHelper, flags, extra_AppendToDictionary)
113 
114  # Static content
115  extra_StaticContent = [] #only add those items specifically for FTAG2 here!
116  FtagBaseContent.add_static_content_to_SlimmingHelper(FTAG2SlimmingHelper, flags, extra_StaticContent)
117 
118  # Add truth containers
119  if flags.Input.isMC:
120  FtagBaseContent.add_truth_to_SlimmingHelper(FTAG2SlimmingHelper)
121  if flags.Trigger.EDMVersion == 3:
122  # Add truth labels to Run 3 trigger jets
123  from DerivationFrameworkFlavourTag.FtagDerivationConfig import HLTJetFTagDecorationCfg
124  acc.merge(HLTJetFTagDecorationCfg(flags))
125 
126  # Add ExtraVariables
127  FtagBaseContent.add_ExtraVariables_to_SlimmingHelper(FTAG2SlimmingHelper, flags)
128 
129  # Trigger content
130  FtagBaseContent.trigger_setup(FTAG2SlimmingHelper, 'FTAG2')
131  FtagBaseContent.trigger_matching(FTAG2SlimmingHelper, FTAG2TriggerListsHelper, flags)
132 
133  # Output stream
134  FTAG2ItemList = FTAG2SlimmingHelper.GetItemList()
135  acc.merge(OutputStreamCfg(flags, "DAOD_FTAG2", ItemList=FTAG2ItemList, AcceptAlgs=["FTAG2Kernel"]))
136  acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_FTAG2", AcceptAlgs=["FTAG2Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
137 
138  return acc
139 

◆ FTAG2KernelCfg()

def python.FTAG2.FTAG2KernelCfg (   flags,
  name = 'FTAG2Kernel',
**  kwargs 
)
Configure the derivation framework driving algorithm (kernel) for FTAG2

Definition at line 16 of file FTAG2.py.

16 def FTAG2KernelCfg(flags, name='FTAG2Kernel', **kwargs):
17  """Configure the derivation framework driving algorithm (kernel) for FTAG2"""
18  acc = ComponentAccumulator()
19 
20  # Common augmentations
21  from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
22  acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
23 
24  # Thinning tools...
25  from DerivationFrameworkInDet.InDetToolsConfig import JetTrackParticleThinningCfg, MuonTrackParticleThinningCfg
26 
27 
28  # filter leptons
29  # 2-leptons
30  lepton_skimming_expression = 'count( (Muons.pt > 18*GeV) && (0 == Muons.muonType || 1 == Muons.muonType || 4 == Muons.muonType) ) + count(( Electrons.pt > 18*GeV) && ((Electrons.Loose) || (Electrons.DFCommonElectronsLHLoose))) >= 2 && count( (Muons.pt > 25*GeV) && (0 == Muons.muonType || 1 == Muons.muonType || 4 == Muons.muonType) ) + count(( Electrons.pt > 25*GeV) && ((Electrons.Loose) || (Electrons.DFCommonElectronsLHLoose))) >= 1'
31  # 1-lepton + 1-tau
32  taul_skimming_expression = '(count( TauJets.pt >= 20*GeV && abs(TauJets.eta) < 2.5 && abs(TauJets.charge)==1.0 && (TauJets.nTracks == 1 || TauJets.nTracks == 3) && TauJets.DFTauLoose) >= 1) && (count( (Muons.pt > 25*GeV) && (0 == Muons.muonType || 1 == Muons.muonType || 4 == Muons.muonType) ) + count(( Electrons.pt > 25*GeV) && ((Electrons.Loose) || (Electrons.DFCommonElectronsLHLoose))) >= 1)'
33 
34  total_skimming_expression = '('+lepton_skimming_expression+') || ('+taul_skimming_expression+')'
35 
36  FTAG2LeptonSkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(
37  name = "FTAG2LeptonSkimmingTool",
38  expression = total_skimming_expression )
39  acc.addPublicTool(FTAG2LeptonSkimmingTool)
40 
41 
42  # TrackParticles associated with small-R jets
43  FTAG2Akt4PFlowJetTPThinningTool = acc.getPrimaryAndMerge(JetTrackParticleThinningCfg(flags,
44  name = "FTAG2Akt4PFlowJetTPThinningTool",
45  StreamName = kwargs['StreamName'],
46  JetKey = "AntiKt4EMPFlowJets",
47  SelectionString = 'AntiKt4EMPFlowJets.pt > 15*GeV',
48  InDetTrackParticlesKey = "InDetTrackParticles"))
49 
50  FTAG2AktVRJetTPThinningTool = acc.getPrimaryAndMerge(JetTrackParticleThinningCfg(flags,
51  name = "FTAG2AktVRJetTPThinningTool",
52  StreamName = kwargs['StreamName'],
53  JetKey = "AntiKtVR30Rmax4Rmin02PV0TrackJets",
54  SelectionString = 'AntiKtVR30Rmax4Rmin02PV0TrackJets.pt > 7*GeV',
55  InDetTrackParticlesKey = "InDetTrackParticles"))
56 
57  # Include inner detector tracks associated with muons
58  FTAG2MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
59  flags,
60  name = "FTAG2MuonTPThinningTool",
61  StreamName = kwargs['StreamName'],
62  MuonKey = "Muons",
63  InDetTrackParticlesKey = "InDetTrackParticles"))
64 
65  # Finally the kernel itself
66  thinningTools = [
67  FTAG2MuonTPThinningTool,
68  FTAG2Akt4PFlowJetTPThinningTool,
69  FTAG2AktVRJetTPThinningTool,
70  ]
71  skimmingTools = [
72  FTAG2LeptonSkimmingTool,
73  ]
74 
75  DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
76  acc.addEventAlgo(DerivationKernel(name, SkimmingTools = skimmingTools, ThinningTools = thinningTools))
77  return acc
78 
79 
python.FtagDerivationConfig.HLTJetFTagDecorationCfg
def HLTJetFTagDecorationCfg(cfgFlags)
Definition: FtagDerivationConfig.py:75
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
HION12.DerivationKernel
DerivationKernel
Definition: HION12.py:67
python.InDetToolsConfig.JetTrackParticleThinningCfg
def JetTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:526
python.InDetToolsConfig.MuonTrackParticleThinningCfg
def MuonTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:494
python.FTAG2.FTAG2KernelCfg
def FTAG2KernelCfg(flags, name='FTAG2Kernel', **kwargs)
Definition: FTAG2.py:16
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:216
SlimmingHelper
Definition: SlimmingHelper.py:1
python.FTAG2.FTAG2Cfg
def FTAG2Cfg(flags)
Definition: FTAG2.py:80