7 from AthenaConfiguration.ComponentAccumulator 
import ComponentAccumulator
 
    8 from AthenaConfiguration.ComponentFactory 
import CompFactory
 
   11 BPHYDerivationName = 
"BPHY24" 
   12 streamName = 
"StreamDAOD_BPHY24" 
   23     thinPassFlagsList = [] 
 
   24     finalCandidateList = []
 
   26     from AthenaServices.PartPropSvcConfig 
import PartPropSvcCfg
 
   27     from DerivationFrameworkBPhys.commonBPHYMethodsCfg 
import (BPHY_V0ToolCfg,  BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
 
   28     from JpsiUpsilonTools.JpsiUpsilonToolsConfig 
import PrimaryVertexRefittingToolCfg
 
   31     isSimulation = flags.Input.isMC
 
   32     V0Tools = acc.popToolsAndMerge(
BPHY_V0ToolCfg(flags, BPHYDerivationName))
 
   34     acc.addPublicTool(vkalvrt)
 
   35     acc.addPublicTool(V0Tools)
 
   37     acc.addPublicTool(trackselect)
 
   39     acc.addPublicTool(vpest)
 
   41     acc.addPublicTool(PVrefit)
 
   44     BPHY24_AugOriginalCounts = CompFactory.DerivationFramework.AugOriginalCounts(
 
   45                         name = 
"BPHY24_AugOriginalCounts",
 
   46                         VertexContainer = 
"PrimaryVertices",
 
   47                         TrackContainer = 
"InDetTrackParticles" )
 
   49     bSkim = 
"(count(BPHY24JpsimmKshortCascadeSV1.Bd_mass) + count(BPHY24JpsieeKshortCascadeSV1.Bd_mass)) > 0" 
   51     BPHY24_Skim_Bcandidates = CompFactory.DerivationFramework.xAODStringSkimmingTool( name  = 
"BPHY24_Skim_Bcandidates",
 
   53     skimList += [ BPHY24_Skim_Bcandidates ]
 
   54     augsList += [ BPHY24_AugOriginalCounts ]
 
   57     from DerivationFrameworkInDet.InDetToolsConfig 
import InDetLRTMergeCfg
 
   60     mainIDInput = 
"InDetWithLRTTrackParticles" 
   61     originalTrackCond = [
"InDetTrackParticles", 
"InDetLargeD0TrackParticles",
"GSFTrackParticles"]
 
   62     BPHY24_Finder_DiMuon = CompFactory.Analysis.JpsiFinder( name    = 
"BPHY24_Finder_DiMuon",
 
   65                                              TrackAndTrack               = 
False,
 
   67                                              muonThresholdPt             = 3000.,
 
   72                                              oppChargesOnly              = 
False,
 
   73                                              allChargeCombinations       = 
True,
 
   74                                              atLeastOneComb              = 
True,
 
   75                                              useCombinedMeasurement      = 
False, 
 
   76                                              muonCollectionKey           = 
"Muons",
 
   77                                              TrackParticleCollection     = 
"InDetTrackParticles",
 
   78                                              V0VertexFitterTool          = 
None,
 
   80                                              TrkVertexFitterTool         = vkalvrt,
 
   81                                              TrackSelectorTool           = trackselect,
 
   82                                              VertexPointEstimator        = vpest,
 
   86     BPHY24_SelectAndWrite_DiMuon = CompFactory.DerivationFramework.Reco_mumu( name   = 
"BPHY24_SelectAndWrite_DiMuon",
 
   87                                         JpsiFinder               = BPHY24_Finder_DiMuon,
 
   90                                         OutputVtxContainerName   = 
"BPHY24_DiMuon_Candidates",
 
   91                                         PVContainerName          = 
"PrimaryVertices",
 
   92                                         RefPVContainerName       = 
"SHOULDNOTBEUSED", 
 
   95     augsList += [ BPHY24_SelectAndWrite_DiMuon ]
 
   97     thinTrkVtxList    += [ 
"BPHY24_DiMuon_Candidates" ]
 
   98     outVtxList        += [ 
"BPHY24_DiMuon_Candidates" ]
 
   99     thinPassFlagsList += [ 
"passed_Jpsi" ] 
 
  101     BPHY24_Select_DiMuons = CompFactory.DerivationFramework.Select_onia2mumu( name    = 
"BPHY24_Select_DiMuons",
 
  102                                            HypothesisName        = 
"Jpsi",
 
  103                                            InputVtxContainerName = 
"BPHY24_DiMuon_Candidates",
 
  105                                            VtxMassHypo           = 3096.916, 
 
  111     augsList += [ BPHY24_Select_DiMuons ]
 
  113     ElectronLHSelectorLHvloose = CompFactory.AsgElectronLikelihoodTool(
"ElectronLHSelectorLHvloose",
 
  114             primaryVertexContainer = 
"PrimaryVertices",
 
  115             ConfigFile=
"ElectronPhotonSelectorTools/offline/mc20_20210514/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth.conf")
 
  119     ElectronLHSelectorLHvloose_nod0 = CompFactory.AsgElectronLikelihoodTool(
"ElectronLHSelectorLHvloosenod0", primaryVertexContainer = 
"PrimaryVertices",
 
  120             ConfigFile=
"ElectronPhotonSelectorTools/offline/mc16_20190328_nod0/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth_nod0.conf")   
 
  124     ElectronPassLHvloose = CompFactory.DerivationFramework.EGElectronLikelihoodToolWrapper(name = 
"ElectronPassLHvloose",
 
  125                                             EGammaElectronLikelihoodTool = ElectronLHSelectorLHvloose,
 
  126                                             EGammaFudgeMCTool = 
"",
 
  128                                             StoreGateEntryName = 
"DFCommonElectronsLHVeryLoose",
 
  129                                             ContainerName = 
"Electrons",
 
  132     ElectronPassLHvloosenod0 = CompFactory.DerivationFramework.EGElectronLikelihoodToolWrapper(name = 
"ElectronPassLHvloosenod0",
 
  133                                             EGammaElectronLikelihoodTool = ElectronLHSelectorLHvloose_nod0,
 
  134                                             EGammaFudgeMCTool = 
"",
 
  136                                             StoreGateEntryName = 
"DFCommonElectronsLHVeryLoosenod0",
 
  137                                             ContainerName = 
"Electrons",
 
  139     augsList += [ElectronPassLHvloose, ElectronPassLHvloosenod0]
 
  141     BPHY24DiElectronFinder = CompFactory.Analysis.JpsiFinder_ee(
 
  142         name                        = 
"BPHY24DiElectronFinder",
 
  145         TrackAndTrack               = 
False,
 
  146         assumeDiElectrons           = 
True,
 
  147         elThresholdPt               = 4000.0,
 
  148         invMassUpper                = 7000.0,
 
  149         invMassLower                = 200.0,
 
  151         oppChargesOnly              = 
False,
 
  152         allChargeCombinations       = 
True,
 
  153         useElectronTrackMeasurement = 
True,
 
  154         electronCollectionKey       = 
"Electrons",
 
  155         TrackParticleCollection     = 
"GSFTrackParticles",
 
  156         useEgammaCuts               = 
True,
 
  157         V0VertexFitterTool          = 
None,
 
  159         TrkVertexFitterTool         = vkalvrt,
 
  160         TrackSelectorTool           = trackselect,
 
  161         VertexPointEstimator        = vpest,
 
  162         ElectronSelection             = 
"d0_or_nod0",
 
  163         PartPropSvc = PartPropSvcName
 
  166     BPHY24_SelectAndWrite_DiElectron = CompFactory.DerivationFramework.Reco_mumu(
 
  167             name                   = 
"BPHY24_SelectAndWrite_DiElectron",
 
  168             JpsiFinder             = BPHY24DiElectronFinder,
 
  170             PVRefitter             = PVrefit,
 
  171             OutputVtxContainerName = 
"BPHY24_DiElectron_Candidates",
 
  172             PVContainerName        = 
"PrimaryVertices",
 
  173             RefPVContainerName     = 
"SHOULDNOTBEUSED",
 
  177     augsList += [ BPHY24_SelectAndWrite_DiElectron ]
 
  179     BPHY24_Select_DiElectrons = CompFactory.DerivationFramework.Select_onia2mumu(
 
  180             name                  = 
"BPHY24_Select_DiElectrons",
 
  181             HypothesisName        = 
"Jpsi",
 
  182             InputVtxContainerName = 
"BPHY24_DiElectron_Candidates",
 
  184             VtxMassHypo           = 3096.916,
 
  191     thinTrkVtxList    += [ 
"BPHY24_DiElectron_Candidates" ]
 
  192     outVtxList        += [ 
"BPHY24_DiElectron_Candidates" ]
 
  194     augsList += [ BPHY24_Select_DiElectrons ]
 
  196     V0ContainerName = 
"BPHY24RecoV0Candidates" 
  197     KshortContainerName = 
"BPHY24RecoKshortCandidates" 
  198     LambdaContainerName = 
"BPHY24RecoLambdaCandidates" 
  199     LambdabarContainerName = 
"BPHY24RecoLambdabarCandidates" 
  201     from DerivationFrameworkBPhys.V0ToolConfig 
import (
 
  202         BPHY_InDetV0FinderToolCfg, BPHY_Reco_V0FinderCfg)
 
  205         flags, BPHYDerivationName,
 
  206         TrackParticleCollection     = mainIDInput,
 
  207         V0ContainerName             = V0ContainerName,
 
  208         KshortContainerName         = KshortContainerName,
 
  209         LambdaContainerName         = LambdaContainerName,
 
  210         LambdabarContainerName      = LambdabarContainerName,
 
  211         RelinkTracks                = originalTrackCond,
 
  212         use_innerPixHits            = 
True,
 
  226         minConstrVertProb           = 0.000001,
 
  229         use_TrackSelector           = 
False))
 
  232         flags, derivation = BPHYDerivationName,
 
  233         V0ContainerName = V0ContainerName,
 
  234         KshortContainerName = KshortContainerName,
 
  235         LambdaContainerName = LambdaContainerName,
 
  236         LambdabarContainerName = LambdabarContainerName,
 
  237         VxPrimaryCandidateName      = 
"BPHY24_DiMuon_Candidates",
 
  238         CheckVertexContainers = [
'BPHY24_DiMuon_Candidates',
 
  239                                  'BPHY24_DiElectron_Candidates'],
 
  240         V0FinderTool = BPHY24_V0FinderTool))
 
  242     augsList += [BPHY24_Reco_V0Finder]
 
  243     outVtxList += [
'BPHY24RecoKshortCandidates']
 
  244     outVtxList += [
"BPHY24RecoV0Candidates"]
 
  245     thinTrkVtxList += [
'BPHY24RecoKshortCandidates']
 
  246     thinPassFlagsList += [ 
"" ] 
 
  247     finalCandidateList += [
"BPHY24RecoKshortCandidates"]
 
  248     finalCandidateList += [
"BPHY24RecoV0Candidates"]
 
  249     from TrkConfig.TrkVKalVrtFitterConfig 
import JpsiV0VertexFitCfg
 
  251     acc.addPublicTool(JpsiV0VertexFit)
 
  253     BPHY24JpsimmKshort          = CompFactory.DerivationFramework.JpsiPlusV0Cascade(
 
  254         name                    = 
"BPHY24mmKshort",
 
  256         HypothesisName          = 
"Bd",
 
  257         TrkVertexFitterTool     = JpsiV0VertexFit,
 
  260         JpsiMassLowerCut        = 1.,
 
  261         JpsiMassUpperCut        = 7000.,
 
  262         ApplyJpsiMassConstraint = 
False,
 
  263         V0MassLowerCut          = 400.,
 
  264         V0MassUpperCut          = 600.,
 
  265         MassLowerCut            = 4300.,
 
  266         MassUpperCut            = 6300.,
 
  268         RefPVContainerName      = 
"BPHY24RefittedPrimaryVertices_mm",
 
  269         JpsiVertices            = 
"BPHY24_DiMuon_Candidates",
 
  270         CascadeVertexCollections= [
"BPHY24JpsimmKshortCascadeSV2", 
"BPHY24JpsimmKshortCascadeSV1"],
 
  271         V0Vertices              = 
"BPHY24RecoV0Candidates",
 
  272         V0TrackContainerName    = mainIDInput,
 
  273         RelinkTracks = originalTrackCond)
 
  275     augsList += [BPHY24JpsimmKshort]
 
  276     outVtxList += BPHY24JpsimmKshort.CascadeVertexCollections
 
  277     outVtxList += [
"BPHY24RefittedPrimaryVertices_mm"]
 
  278     thinTrkVtxList += BPHY24JpsimmKshort.CascadeVertexCollections
 
  279     finalCandidateList += BPHY24JpsimmKshort.CascadeVertexCollections
 
  281     BPHY24JpsieeKshort          = CompFactory.DerivationFramework.JpsiPlusV0Cascade(
 
  282         name                    = 
"BPHY24eeKshort",
 
  284         HypothesisName          = 
"Bd",
 
  285         TrkVertexFitterTool     = JpsiV0VertexFit,
 
  288         JpsiMassLowerCut        = 100.,
 
  289         JpsiMassUpperCut        = 7000.,
 
  290         ApplyJpsiMassConstraint = 
False,
 
  291         V0MassLowerCut          = 400.,
 
  292         V0MassUpperCut          = 600.,
 
  293         MassLowerCut            = 4300.,
 
  294         MassUpperCut            = 6300.,
 
  296         JpsiTrackContainerName  = 
"GSFTrackParticles",
 
  298         RefPVContainerName      = 
"BPHY24RefittedPrimaryVertices_ee",
 
  299         JpsiVertices            = 
"BPHY24_DiElectron_Candidates",
 
  300         CascadeVertexCollections= [
"BPHY24JpsieeKshortCascadeSV2", 
"BPHY24JpsieeKshortCascadeSV1"],
 
  301         V0Vertices              = 
"BPHY24RecoV0Candidates",
 
  302         V0TrackContainerName    = mainIDInput,
 
  303         RelinkTracks = originalTrackCond)
 
  305     augsList += [BPHY24JpsieeKshort]
 
  306     finalCandidateList += BPHY24JpsieeKshort.CascadeVertexCollections
 
  307     outVtxList += BPHY24JpsieeKshort.CascadeVertexCollections
 
  308     outVtxList += [
"BPHY24RefittedPrimaryVertices_ee"]
 
  309     thinTrkVtxList += BPHY24JpsieeKshort.CascadeVertexCollections
 
  311     from TrackVertexAssociationTool.TrackVertexAssociationToolConfig 
import isoTTVAToolCfg
 
  313                                                   WorkingPoint = 
"Custom",
 
  317                                                   doUsedInFit = 
False))
 
  318     acc.addPublicTool(TTVATool)
 
  320     from InDetConfig.InDetTrackSelectionToolConfig 
import isoTrackSelectionToolCfg
 
  325     acc.addPublicTool(TrackSelTool)
 
  327     from IsolationAlgs.IsoToolsConfig 
import TrackIsolationToolCfg
 
  329                                                               TrackSelectionTool = TrackSelTool,
 
  330                                                               TTVATool = TTVATool))
 
  331     acc.addPublicTool(TrackIsoTool)
 
  332     BPHY24TrackIsolationDecoratorBtoKee = CompFactory.DerivationFramework.VertexTrackIsolation(
 
  333       name                            = 
"BPHY24TrackIsolationDecoratorBtoKee",
 
  334       TrackIsoTool                    = TrackIsoTool,
 
  335       TrackContainer                  = 
"InDetTrackParticles",
 
  336       InputVertexContainer            = 
"BPHY24JpsieeKshortCascadeSV1",
 
  337       FixElecExclusion                = 
True,
 
  339     BPHY24TrackIsolationDecoratorBtoKmumu = CompFactory.DerivationFramework.VertexTrackIsolation(
 
  340       name                            = 
"BPHY24TrackIsolationDecoratorBtoKmumu ",
 
  341       TrackIsoTool                    = TrackIsoTool,
 
  342       TrackContainer                  = 
"InDetTrackParticles",
 
  343       InputVertexContainer            = 
"BPHY24JpsimmKshortCascadeSV1",
 
  344       FixElecExclusion                = 
False,
 
  347     BPHY24TrackIsolationDecoratorJpsiee = CompFactory.DerivationFramework.VertexTrackIsolation(
 
  348       name                            = 
"BPHY24TrackIsolationDecoratorJpsiee",
 
  349       TrackIsoTool                    = TrackIsoTool,
 
  350       TrackContainer                  = 
"InDetTrackParticles",
 
  351       InputVertexContainer            = 
"BPHY24_DiElectron_Candidates",
 
  352       FixElecExclusion                = 
True,
 
  355     BPHY24TrackIsolationDecoratorJpsimumu = CompFactory.DerivationFramework.VertexTrackIsolation(
 
  356       name                            = 
"BPHY24TrackIsolationDecoratorJpsimumu",
 
  357       TrackIsoTool                    = TrackIsoTool,
 
  358       TrackContainer                  = 
"InDetTrackParticles",
 
  359       InputVertexContainer            = 
"BPHY24_DiMuon_Candidates",
 
  360       FixElecExclusion                = 
False,
 
  363     augsList += [ BPHY24TrackIsolationDecoratorBtoKee,
 
  364               BPHY24TrackIsolationDecoratorBtoKmumu,
 
  365               BPHY24TrackIsolationDecoratorJpsiee,
 
  366               BPHY24TrackIsolationDecoratorJpsimumu]
 
  369     "HLT_mu11_mu6_bDimu",
 
  370     "HLT_mu11_mu6_bDimu2700",
 
  371     "HLT_mu11_mu6_bDimu_L1LFV-MU11",
 
  372     "HLT_mu11_mu6_bDimu2700_L1LFV-MU11",
 
  373     "HLT_mu11_mu6_bBmumuxv2",
 
  374     "HLT_mu10_mu6_bBmumuxv2",
 
  375     "HLT_mu10_mu6_bBmumuxv2_delayed",
 
  376     "HLT_2mu6_bBmumuxv2",
 
  377     "HLT_2mu6_bBmumuxv2_delayed",
 
  378     "HLT_2mu6_bBmumuxv2_L1LFV-MU6",
 
  379     "HLT_mu6_mu4_bBmumuxv2",
 
  380     "HLT_mu6_mu4_bBmumuxv2_delayed",
 
  381     "HLT_2mu4_bBmumuxv2",
 
  382     "HLT_mu11_mu6_bJpsimumu",
 
  383     "HLT_2mu10_bJpsimumu",
 
  384     "HLT_mu11_mu6_bJpsimumu_L1LFV-MU11",
 
  385     "HLT_2mu6_bJpsimumu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6",
 
  386     "HLT_2mu6_bJpsimumu_delayed_L1BPH-2M9-2MU6_BPH-2DR15-2MU6",
 
  387     "HLT_2mu10_bJpsimumu_noL2",
 
  388     "HLT_mu10_mu6_bJpsimumu",
 
  389     "HLT_mu10_mu6_bJpsimumu_delayed",
 
  390     "HLT_2mu6_bJpsimumu",
 
  391     "HLT_2mu6_bJpsimumu_delayed",
 
  392     "HLT_mu6_mu4_bJpsimumu",
 
  393     "HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4",
 
  394     "HLT_2mu4_bJpsimumu",
 
  395     "HLT_mu6_2mu4_bJpsi",
 
  396     "HLT_mu6_2mu4_bJpsi_delayed",
 
  400     "HLT_2e5_lhvloose_nod0_bBeexM6000t",  
 
  401     "HLT_e5_lhvloose_nod0_bBeexM6000t",  
 
  402     "HLT_e5_lhvloose_nod0_bBeexM6000t_2mu4_nomucomb_L1BPH-0DR3-EM7J15_2MU4",   
 
  403     "HLT_e5_lhvloose_nod0_bBeexM6000t_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6",   
 
  404     "HLT_e5_lhvloose_nod0_bBeexM6000_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6",   
 
  405     "HLT_e9_lhloose_bBeexM2700_2mu4_nomucomb_L1BPH-0DR3-EM7J15_2MU4",   
 
  406     "HLT_e9_lhloose_bBeexM2700_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6",   
 
  407     "HLT_e9_lhloose_bBeexM6000_2mu4_nomucomb_L1BPH-0DR3-EM7J15_2MU4",   
 
  408     "HLT_e9_lhloose_bBeexM6000_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6",   
 
  409     "HLT_e9_lhloose_e5_lhloose_bBeexM2700_2mu4_nomucomb_L1BPH-0M9-EM7-EM5_2MU4",   
 
  410     "HLT_e9_lhloose_e5_lhloose_bBeexM2700_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6",   
 
  411     "HLT_e9_lhloose_e5_lhloose_bBeexM6000_2mu4_nomucomb_L1BPH-0M9-EM7-EM5_2MU4",   
 
  412     "HLT_e9_lhloose_e5_lhloose_bBeexM6000_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6",   
 
  413     "HLT_e9_lhvloose_nod0_e5_lhvloose_nod0_bBeexM6000t_2mu4_nomucomb_L1BPH-0M9-EM7-EM5_2MU4",   
 
  414     "HLT_e9_lhvloose_nod0_e5_lhvloose_nod0_bBeexM6000t_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6",   
 
  415     "HLT_e9_lhvloose_nod0_e5_lhvloose_nod0_bBeexM6000_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6",   
 
  418     BPHY24TrigSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool(   name     = 
"BPHY24TrigSkimmingTool",
 
  419                                                                 TriggerListOR               = trigger_list,
 
  420                                                                 TriggerListORHLTOnly        = [
"HLT_2e5_lhvloose_nod0_bBeexM6000t",
"HLT_e5_lhvloose_nod0_bBeexM6000t"] )
 
  421     acc.addPublicTool(BPHY24TrigSkimmingTool)
 
  422     skimList += [BPHY24TrigSkimmingTool]
 
  425     BPHY24_Thin_VtxTracks = CompFactory.DerivationFramework.Thin_vtxTrk( name     = 
"BPHY24_Thin_VtxTracks",
 
  426                                                                 StreamName = streamName,
 
  427                                                                 TrackParticleContainerName = 
"InDetTrackParticles",
 
  428                                                                 VertexContainerNames       = finalCandidateList,
 
  431     thinList += [ BPHY24_Thin_VtxTracks ]
 
  434     BPHY24_Thin_VtxTracks_LRT = CompFactory.DerivationFramework.Thin_vtxTrk( name     = 
"BPHY24_Thin_VtxTracks_LRT",
 
  435                                                                 StreamName = streamName,
 
  436                                                                 TrackParticleContainerName = 
"InDetLargeD0TrackParticles",
 
  437                                                                 VertexContainerNames       = finalCandidateList,
 
  440     thinList += [ BPHY24_Thin_VtxTracks_LRT ]
 
  443     BPHY24_Thin_VtxTracks_GSF = CompFactory.DerivationFramework.Thin_vtxTrk( name    = 
"BPHY24_Thin_VtxTracks_GSF",
 
  444                                                                 StreamName = streamName,
 
  445                                                                 TrackParticleContainerName = 
"GSFTrackParticles",
 
  446                                                                 VertexContainerNames       = finalCandidateList,
 
  448     thinList += [ BPHY24_Thin_VtxTracks_GSF ]
 
  451     BPHY24_Thin_Muons = CompFactory.DerivationFramework.MuonTrackParticleThinning( name   = 
"BPHY24_Thin_Muons",
 
  453                                                                           StreamName = streamName,
 
  454                                                                           InDetTrackParticlesKey = 
"InDetTrackParticles" )
 
  455     thinList += [ BPHY24_Thin_Muons ]
 
  458     BPHY24_Thin_Egamma = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
 
  459           name                   = 
"BPHY24_Thin_Egamma",
 
  461           StreamName = streamName,
 
  462           InDetTrackParticlesKey = mainIDInput)
 
  463     thinList += [BPHY24_Thin_Egamma]
 
  466     BPHY24_Thin_PV = CompFactory.DerivationFramework.BPhysPVThinningTool( name                 = 
"BPHY24_Thin_PV",
 
  467                                                                  CandidateCollections = finalCandidateList,
 
  468                                                                  StreamName = streamName,
 
  469                                                                  KeepPVTracks         = 
True )
 
  470     thinList += [ BPHY24_Thin_PV ]
 
  475       from InDetPhysValMonitoring.InDetPhysValDecorationConfig 
import InDetPhysValTruthDecoratorAlgCfg
 
  479       keepParticles = (
'abs(TruthParticles.pdgId) == 11 || '  
  480                        'abs(TruthParticles.pdgId) == 13')    
 
  483       keepParticles += (
' || ' 
  484                           'abs(TruthParticles.pdgId) == 511 || '  
  485                           'abs(TruthParticles.pdgId) == 513 || '  
  486                           'abs(TruthParticles.pdgId) == 515')    
 
  489       BPHY24_Thin_TruthHadrons = CompFactory.DerivationFramework.GenericTruthThinning( name                    = 
"BPHY24_Thin_TruthHadrons",
 
  490                                                                           ParticleSelectionString = keepParticles,
 
  491                                                                           PreserveDescendants     = 
True,
 
  492                                                                           StreamName = streamName,
 
  493                                                                           PreserveAncestors       = 
True)
 
  494       thinList += [ BPHY24_Thin_TruthHadrons ]
 
  497       BPHY24_Thin_TruthQuarks = CompFactory.DerivationFramework.GenericTruthThinning( name                    = 
"BPHY24_Thin_TruthQuarks",
 
  498                                                                          ParticleSelectionString = (
'abs(TruthParticles.pdgId) ==  5 || ' 
  499                                                                                                     'abs(TruthParticles.pdgId) == 12 || abs(TruthParticles.pdgId) == 14' ),
 
  500                                                                          PreserveDescendants     = 
False,
 
  501                                                                          StreamName = streamName,
 
  502                                                                          PreserveAncestors       = 
False)
 
  503       thinList += [ BPHY24_Thin_TruthQuarks ]
 
  505     for t 
in  augsList + skimList + thinList: acc.addPublicTool(t)
 
  506     acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY24Kernel",
 
  507                                                      AugmentationTools = augsList,
 
  510                                                      SkimmingTools     = skimList,
 
  511                                                      ThinningTools     = thinList))
 
  514     from DerivationFrameworkCore.SlimmingHelper 
import SlimmingHelper
 
  515     from OutputStreamAthenaPool.OutputStreamConfig 
import OutputStreamCfg
 
  516     BPHY24SlimmingHelper = 
SlimmingHelper(
"BPHY24SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
 
  517     from xAODMetaDataCnv.InfileMetaDataConfig 
import SetupMetaDataForStreamCfg
 
  518     from AthenaConfiguration.Enums 
import MetadataCategory
 
  519     from DerivationFrameworkBPhys.commonBPHYMethodsCfg 
import getDefaultAllVariables
 
  527     BPHY24SlimmingHelper.SmartCollections = [ 
"Electrons", 
"Muons", 
"InDetTrackParticles", 
"InDetLargeD0TrackParticles" ]
 
  530     AllVariables += [
"InDetLargeD0TrackParticles"]
 
  531     AllVariables += [ 
"CombinedMuonTrackParticles" ]
 
  532     AllVariables += [ 
"ExtrapolatedMuonTrackParticles" ]
 
  533     ExtraVariables += [ 
"Muons.etaLayer1Hits.etaLayer2Hits.etaLayer3Hits.etaLayer4Hits.phiLayer1Hits.phiLayer2Hits.phiLayer3Hits.phiLayer4Hits",
 
  534                     "Muons.numberOfTriggerEtaLayers.numberOfPhiLayers",
 
  535                     "InDetTrackParticles.numberOfTRTHits.numberOfTRTHighThresholdHits.vx.vy.vz",
 
  536                     "InDetLargeD0TrackParticles.numberOfTRTHits.numberOfTRTHighThresholdHits.vx.vy.vz",
 
  537                     "PrimaryVertices.chiSquared.covariance", 
"Electrons.deltaEta1.DFCommonElectronsLHVeryLoosenod0",
 
  538                     "egammaClusters.calE.calEta.calPhi.e_sampl.eta_sampl.etaCalo.phiCalo.ETACALOFRAME.PHICALOFRAME",
 
  539                     "HLT_xAOD__ElectronContainer_egamma_ElectronsAuxDyn.charge" ]
 
  544     BPHY24SlimmingHelper.IncludeMuonTriggerContent  = 
True 
  545     BPHY24SlimmingHelper.IncludeEgammaTriggerContent  = 
True 
  546     BPHY24SlimmingHelper.IncludeBPhysTriggerContent = 
True 
  549     AllVariables  += [ 
"PrimaryVertices" ]
 
  550     print(
"BPHY24: List of refitted-PV output: ", outRePVList)
 
  551     for i 
in outRePVList:
 
  552       StaticContent += [ 
"xAOD::VertexContainer#%s"        % i ]
 
  553       StaticContent += [ 
"xAOD::VertexAuxContainer#%sAux." % i ]
 
  556     print(
"BPHY24: List of B-vertexing output: ", outVtxList)
 
  558       StaticContent += [ 
"xAOD::VertexContainer#%s"                        % i ]
 
  559       StaticContent += [ 
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % i ]
 
  561     print(
"BPHY24: Full list of B-augmentation: ", StaticContent)
 
  565       AllVariables += [ 
"TruthEvents",
 
  568                         "MuonTruthParticles" ]
 
  569     AllVariables = 
list(
set(AllVariables)) 
 
  571     BPHY24SlimmingHelper.AllVariables = AllVariables
 
  572     BPHY24SlimmingHelper.StaticContent = StaticContent
 
  573     BPHY24SlimmingHelper.ExtraVariables = ExtraVariables
 
  574     BPHY24ItemList = BPHY24SlimmingHelper.GetItemList()
 
  575     acc.merge(
OutputStreamCfg(flags, 
"DAOD_BPHY24", ItemList=BPHY24ItemList, AcceptAlgs=[
"BPHY24Kernel"]))
 
  576     acc.merge(
SetupMetaDataForStreamCfg(flags, 
"DAOD_BPHY24", AcceptAlgs=[
"BPHY24Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
 
  577     acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True)