7 from AthenaConfiguration.ComponentAccumulator 
import ComponentAccumulator
 
    8 from AthenaConfiguration.ComponentFactory 
import CompFactory
 
    9 from AthenaConfiguration.Enums 
import MetadataCategory
 
   13     """Configure the skimming tool""" 
   16     TRIG10MetTrigSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool( name           = 
"TRIG10MetTrigSkimmingTool1",
 
   17                                                                                   TriggerListOR     = [
"HLT_noalg_L1XE.*",
"HLT_noalg_L1jXE.*",
"HLT.*ZeroBias",
"HLT.*zb.*",
"HLT.*_eb_.*",
"HLT.*noPS.*",
"HLT_noalg_L1RD3.*",
"HLT_j70_j50a_j0_DJMASS1000j50dphi200x400deta.*"] )
 
   18     acc.addPublicTool(TRIG10MetTrigSkimmingTool, primary = 
True)
 
   23     """Configure the trigger skimming tool""" 
   26     from TriggerMenuMT.TriggerAPI.TriggerAPI 
import TriggerAPI
 
   27     from TriggerMenuMT.TriggerAPI.TriggerEnums 
import TriggerPeriod, TriggerType
 
   28     TriggerAPI.setConfigFlags(flags)
 
   29     singleMuTriggers = TriggerAPI.getLowestUnprescaled(TriggerPeriod.y2015, TriggerType.mu_single) + TriggerAPI.getLowestUnprescaled(TriggerPeriod.y2016, TriggerType.mu_single) + TriggerAPI.getLowestUnprescaled(TriggerPeriod.y2017, TriggerType.mu_single) + TriggerAPI.getLowestUnprescaled(TriggerPeriod.y2018, TriggerType.mu_single) + TriggerAPI.getLowestUnprescaled(TriggerPeriod.future, TriggerType.mu_single)
 
   30     singleElTriggers = TriggerAPI.getLowestUnprescaled(TriggerPeriod.y2015, TriggerType.el_single) + TriggerAPI.getLowestUnprescaled(TriggerPeriod.y2016, TriggerType.el_single) + TriggerAPI.getLowestUnprescaled(TriggerPeriod.y2017, TriggerType.el_single) + TriggerAPI.getLowestUnprescaled(TriggerPeriod.y2018, TriggerType.el_single) + TriggerAPI.getLowestUnprescaled(TriggerPeriod.future, TriggerType.el_single)
 
   34     TRIG10LepTrigSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool( name         = 
"TRIG10LepTrigSkimmingTool1",
 
   35                                                                                   TriggerListOR  = singleMuTriggers+singleElTriggers)
 
   37     acc.addPublicTool(TRIG10LepTrigSkimmingTool, primary = 
True)
 
   42     """Configure the string skimming tool""" 
   46     cutExpression = 
"(count(Electrons.DFCommonElectronsLHLoose && Electrons.pt > (24 * GeV) && abs(Electrons.eta) < 2.47) + count(Muons.DFCommonMuonPassPreselection && Muons.pt > (24*GeV) && abs(Muons.eta) < 2.47) ) >= 1" 
   48     TRIG10StringSkimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name       = 
"TRIG10StringSkimmingTool",
 
   49                                                                                       expression = cutExpression)
 
   51     acc.addPublicTool(TRIG10StringSkimmingTool, primary = 
True)
 
   58     """Configure the derivation framework driving algorithm (kernel) for TRIG10""" 
   66     TRIG10LepTrigStringSkimmingTool = CompFactory.DerivationFramework.FilterCombinationAND(name=
"TRIG10LepTrigStringSkimmingTool", FilterList=[TRIG10LepTrigSkimmingTool,   TRIG10StringSkimmingTool] )
 
   67     acc.addPublicTool(TRIG10LepTrigStringSkimmingTool)
 
   68     TRIG10SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(name=
"TRIG10SkimmingTool",
 
   69                         FilterList=[TRIG10LepTrigStringSkimmingTool, TRIG10MetTrigSkimmingTool])
 
   70     acc.addPublicTool(TRIG10SkimmingTool, primary = 
True)
 
   73     from DerivationFrameworkPhys.PhysCommonConfig 
import PhysCommonAugmentationsCfg
 
   76     from DerivationFrameworkInDet.InDetToolsConfig 
import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, TauTrackParticleThinningCfg
 
   80       name                    = kwargs[
'StreamName']+
"MuonTPThinningTool",
 
   81       StreamName              = kwargs[
'StreamName'],
 
   83       InDetTrackParticlesKey  = 
"InDetTrackParticles"))
 
   87       name                    = kwargs[
'StreamName']+
"ElectronTPThinningTool",
 
   88       StreamName              = kwargs[
'StreamName'],
 
   90       InDetTrackParticlesKey  = 
"InDetTrackParticles"))
 
   94       name                     = kwargs[
'StreamName']+
"PhotonTPThinningTool",
 
   95       StreamName               = kwargs[
'StreamName'],
 
   97       InDetTrackParticlesKey   = 
"InDetTrackParticles",
 
   98       GSFConversionVerticesKey = 
"GSFConversionVertices"))
 
  102       name                   = kwargs[
'StreamName']+
"TauTPThinningTool",
 
  103       StreamName             = kwargs[
'StreamName'],
 
  105       InDetTrackParticlesKey = 
"InDetTrackParticles",
 
  106       DoTauTracksThinning    = 
True,
 
  107       TauTracksKey           = 
"TauTracks"))
 
  109     thinningTools = [muonTPThinningTool,
 
  110                     electronTPThinningTool,
 
  111                     photonTPThinningTool,
 
  115     DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
 
  117                                      ThinningTools = thinningTools,
 
  118                                      SkimmingTools = [TRIG10SkimmingTool]))
 
  131     from DerivationFrameworkPhys.TriggerListsHelper 
import TriggerListsHelper
 
  132     TRIG10TriggerListsHelper = TriggerListsHelper(flags)
 
  135     acc.merge(
TRIG10KernelCfg(flags, name=
"TRIG10Kernel", StreamName = 
'StreamDAOD_TRIG10', TriggerListsHelper = TRIG10TriggerListsHelper))
 
  140     from OutputStreamAthenaPool.OutputStreamConfig 
import OutputStreamCfg
 
  141     from xAODMetaDataCnv.InfileMetaDataConfig 
import SetupMetaDataForStreamCfg
 
  142     from DerivationFrameworkCore.SlimmingHelper 
import SlimmingHelper
 
  144     TRIG10SlimmingHelper = 
SlimmingHelper(
"TRIG10SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
 
  147     TRIG10SlimmingHelper.SmartCollections = [
"Electrons", 
"Muons", 
"Photons", 
"TauJets", 
"PrimaryVertices", 
"EventInfo",
 
  148                                        "AntiKt4EMTopoJets", 
"AntiKt4EMPFlowJets", 
"BTagging_AntiKt4EMPFlow",
 
  149                                        "MET_Baseline_AntiKt4EMTopo",
"MET_Baseline_AntiKt4EMPFlow",
"InDetTrackParticles"]
 
  152     TRIG10SlimmingHelper.AllVariables = [
"HLT_xAOD__TrigMissingETContainer_TrigEFMissingET",
 
  153                                    "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht",
 
  154                                    "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PS",
 
  155                                    "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC",
 
  156                                    "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl",
 
  160                                    "MET_Core_AntiKt4EMTopo", 
"MET_Core_AntiKt4EMPFlow",
 
  161                                    "METAssoc_AntiKt4EMTopo", 
"METAssoc_AntiKt4EMPFlow"]
 
  163     TRIG10SlimmingHelper.ExtraVariables = [
"AntiKt4EMTopoJets.Timing", 
"AntiKt4EMPFlowJets.Timing",
 
  164                                      "InDetTrackParticles.DFMETTrigNominalTVA"]
 
  167     TRIG10SlimmingHelper.IncludeTriggerNavigation = 
False 
  168     TRIG10SlimmingHelper.IncludeJetTriggerContent = 
False 
  169     TRIG10SlimmingHelper.IncludeMuonTriggerContent = 
False 
  170     TRIG10SlimmingHelper.IncludeEGammaTriggerContent = 
False 
  171     TRIG10SlimmingHelper.IncludeTauTriggerContent = 
False 
  172     TRIG10SlimmingHelper.IncludeEtMissTriggerContent = 
False 
  173     TRIG10SlimmingHelper.IncludeBJetTriggerContent = 
False 
  174     TRIG10SlimmingHelper.IncludeBPhysTriggerContent = 
False 
  175     TRIG10SlimmingHelper.IncludeMinBiasTriggerContent = 
False 
  177     TRIG10SlimmingHelper.AllVariables += [
'HLT_MET_tcpufit',
'HLT_MET_cell',
'HLT_MET_trkmht',
'HLT_MET_cvfpufit',
'HLT_MET_pfopufit',
'HLT_MET_mhtpufit_em',
'HLT_MET_mhtpufit_pf',
'HLT_MET_pfsum',
'HLT_MET_pfsum_vssk',
'HLT_MET_pfsum_cssk',
'HLT_MET_nn',
'L1_jFexMETRoI',
'L1_jFexMETxRoI',
'L1_gMETComponentsJwoj',
'L1_gMETComponentsRms',
'L1_gMETComponentsNoiseCut']
 
  180     TRIG10ItemList = TRIG10SlimmingHelper.GetItemList()
 
  181     acc.merge(
OutputStreamCfg(flags, 
"DAOD_TRIG10", ItemList=TRIG10ItemList, AcceptAlgs=[
"TRIG10Kernel"]))
 
  182     acc.merge(
SetupMetaDataForStreamCfg(flags, 
"DAOD_TRIG10", AcceptAlgs=[
"TRIG10Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))