ATLAS Offline Software
Loading...
Searching...
No Matches
FourLeptonVertexing.py
Go to the documentation of this file.
1# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2
3
4from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5from AthenaConfiguration.ComponentFactory import CompFactory
6
7
8
9def FourLeptonVertexerCfg(flags, name="FourLeptonVertexAlg", **kwargs):
10 result = ComponentAccumulator()
11
12 from MuonSelectorTools.MuonSelectorToolsConfig import MuonSelectionToolCfg
13 kwargs.setdefault("MuonSelectionTool", result.popToolsAndMerge(MuonSelectionToolCfg(flags,
14 MaxEta=2.7,
15 DisablePtCuts=True,
16 MuQuality=2,
17 )) )
18
19
20 from ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig import AsgElectronLikelihoodToolCfg
21 from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import electronLHmenu
22 from ElectronPhotonSelectorTools.LikelihoodEnums import LikeEnum
23 from AthenaConfiguration.Enums import LHCPeriod
24 kwargs.setdefault("ElectronSelectionTool", result.popToolsAndMerge(AsgElectronLikelihoodToolCfg(flags,
25 name= "ElectronSelTool",
26 quality = LikeEnum.VeryLoose,
27 menu=electronLHmenu.offlineMC21 if flags.GeoModel.Run >= LHCPeriod.Run3 else electronLHmenu.offlineMC20)))
28
29 from TrkConfig.TrkVKalVrtFitterConfig import TrkVKalVrtFitterCfg
30 kwargs.setdefault("VertexFitter", result.popToolsAndMerge(
31 TrkVKalVrtFitterCfg(flags, FirstMeasuredPoint = False)))
32 kwargs.setdefault("MinMuonPt", 4000)
33 kwargs.setdefault("MinElecPt", 6000)
34 vtx_tool = CompFactory.DerivationFramework.FourLeptonVertexingAlgorithm(name , **kwargs)
35 result.addEventAlgo(vtx_tool, primary = True)
36 return result
37
38if __name__ == "__main__":
39 from AthenaConfiguration.AllConfigFlags import initConfigFlags
40 flags = initConfigFlags()
41 args = flags.fillFromArgs()
42
43 flags.Input.Files = args.input
44 flags.Concurrency.NumThreads=args.threads
45 flags.Concurrency.NumConcurrentEvents=args.threads
46
47 flags.lock()
48 flags.dump()
49
50 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
51 cfg = MainServicesCfg(flags)
52 msgService = cfg.getService('MessageSvc')
53 msgService.Format = "S:%s E:%e % F%128W%S%7W%R%T %0W%M"
54
55 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
56 cfg.merge(PoolReadCfg(flags))
57 cfg.merge(FourLeptonVertexerCfg(flags))
58
59 sc = cfg.run(flags.Exec.MaxEvents)
60 if not sc.isSuccess():
61 exit(1)
62
63
64
65
FourLeptonVertexerCfg(flags, name="FourLeptonVertexAlg", **kwargs)