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 MuonLoosenedNonCalibratedSelectionToolCfg
13 kwargs.setdefault("MuonSelectionTool", result.popToolsAndMerge(MuonLoosenedNonCalibratedSelectionToolCfg(flags,
14 MaxEta=2.7,
15 MuQuality=2,
16 )) )
17
18
19 from ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig import AsgElectronLikelihoodToolCfg
20 from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import electronLHmenu
21 from ElectronPhotonSelectorTools.LikelihoodEnums import LikeEnum
22 from AthenaConfiguration.Enums import LHCPeriod
23 kwargs.setdefault("ElectronSelectionTool", result.popToolsAndMerge(AsgElectronLikelihoodToolCfg(flags,
24 name= "ElectronSelTool",
25 quality = LikeEnum.VeryLoose,
26 menu=electronLHmenu.offlineMC21 if flags.GeoModel.Run >= LHCPeriod.Run3 else electronLHmenu.offlineMC20)))
27
28 from TrkConfig.TrkVKalVrtFitterConfig import TrkVKalVrtFitterCfg
29 kwargs.setdefault("VertexFitter", result.popToolsAndMerge(
30 TrkVKalVrtFitterCfg(flags, FirstMeasuredPoint = False)))
31 kwargs.setdefault("MinMuonPt", 4000)
32 kwargs.setdefault("MinElecPt", 6000)
33 vtx_tool = CompFactory.DerivationFramework.FourLeptonVertexingAlgorithm(name , **kwargs)
34 result.addEventAlgo(vtx_tool, primary = True)
35 return result
36
37if __name__ == "__main__":
38 from AthenaConfiguration.AllConfigFlags import initConfigFlags
39 flags = initConfigFlags()
40 args = flags.fillFromArgs()
41
42 flags.Input.Files = args.input
43 flags.Concurrency.NumThreads=args.threads
44 flags.Concurrency.NumConcurrentEvents=args.threads
45
46 flags.lock()
47 flags.dump()
48
49 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
50 cfg = MainServicesCfg(flags)
51 msgService = cfg.getService('MessageSvc')
52 msgService.Format = "S:%s E:%e % F%128W%S%7W%R%T %0W%M"
53
54 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
55 cfg.merge(PoolReadCfg(flags))
56 cfg.merge(FourLeptonVertexerCfg(flags))
57
58 sc = cfg.run(flags.Exec.MaxEvents)
59 if not sc.isSuccess():
60 exit(1)
61
62
63
64
FourLeptonVertexerCfg(flags, name="FourLeptonVertexAlg", **kwargs)