ATLAS Offline Software
Loading...
Searching...
No Matches
runInDetSecVtxFinder.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2# Define method to construct configures Sec Vtx Finder alg
3# attempted by N Ribaric (@LancasterUNI) neza.ribaric@cern.ch
4
5if __name__ == "__main__":
6 import AthenaCommon.Constants as Lvl
7
8 # import the flags and set them
9 from AthenaConfiguration.AllConfigFlags import initConfigFlags
10 flags = initConfigFlags()
11
12 flags.Exec.MaxEvents = 50
13
14 # use one of the predefined files
15 from AthenaConfiguration.TestDefaults import defaultTestFiles
16 flags.Input.Files = defaultTestFiles.AOD_RUN3_MC
17
18 # lock the flags
19 flags.lock()
20
21 # create basic infrastructure
22 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
23 acc = MainServicesCfg(flags)
24
25 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
26 acc.merge(PoolReadCfg(flags))
27
28 # add the algorithm to the configuration
29 from InDetConfig.InDetSecVtxFinderConfig import InDetSecVtxFinderAlgCfg
30 acc.merge(InDetSecVtxFinderAlgCfg(flags, OutputLevel = Lvl.INFO))
31
32 # Contents
33 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
34 TRUTH0SlimmingHelper = SlimmingHelper("TRUTH0SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
35 TRUTH0SlimmingHelper.AppendToDictionary = {'EventInfo':'xAOD::EventInfo','EventInfoAux':'xAOD::EventAuxInfo',
36 'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer',
37 'TruthVertices':'xAOD::TruthVertexContainer','TruthVerticesAux':'xAOD::TruthVertexAuxContainer',
38 'TruthParticles':'xAOD::TruthParticleContainer','TruthParticlesAux':'xAOD::TruthParticleAuxContainer'}
39
40 TRUTH0SlimmingHelper.AllVariables = [ 'EventInfo',
41 'TruthEvents',
42 'TruthVertices',
43 'TruthParticles']
44
45 # Metadata
46 TRUTH0MetaDataItems = [ "xAOD::TruthMetaDataContainer#TruthMetaData", "xAOD::TruthMetaDataAuxContainer#TruthMetaDataAux." ]
47
48 # Create output stream
49 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
50 TRUTH0ItemList = TRUTH0SlimmingHelper.GetItemList()
51 TRUTH0ItemList+=["xAOD::VertexContainer#RecoSecVtx","xAOD::VertexContainer#RecoSecVtxAux."]
52 acc.merge(OutputStreamCfg(flags, "SecondayVertexOutput", ItemList=TRUTH0ItemList))
53
54 # debug printout
55 acc.printConfig(withDetails=True, summariseProps=True)
56
57 # run the job
58 status = acc.run()
59
60 # report the execution status (0 ok, else error)
61 import sys
62 sys.exit(not status.isSuccess())