ATLAS Offline Software
DoubleEventSelectorOverlayTest.py
Go to the documentation of this file.
1 
12 
13 # basic job configuration
14 import AthenaCommon.AtlasUnixStandardJob
15 
16 # get a handle to the default top-level algorithm sequence
17 from AthenaCommon.AlgSequence import AlgSequence
18 topSequence = AlgSequence()
19 
20 # get a handle to the ServiceManager
21 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
22 
23 # get a handle to the ApplicationManager
24 from AthenaCommon.AppMgr import theApp
25 
26 # Set that we are running MC+MC overlay in MT mode
27 from OverlayCommonAlgs.OverlayFlags import overlayFlags
28 overlayFlags.isDataOverlay.set_Value_and_Lock(False)
29 overlayFlags.isOverlayMT.set_Value_and_Lock(True)
30 
31 #--------------------------------------------------------------
32 # Load POOL support for DoubleEventSelector
33 #--------------------------------------------------------------
34 import AthenaPoolCnvSvc.ReadAthenaPoolDouble
35 
36 #--------------------------------------------------------------
37 # Set flags and load det descr
38 #--------------------------------------------------------------
39 from RecExConfig.RecFlags import rec
40 from OverlayCommonAlgs.OverlayFlags import overlayFlags
41 
42 overlayFlags.isOverlayMT.set_Value_and_Lock(True)
43 
44 # For general flags
45 rec.doAOD = False
46 rec.doTrigger = False
47 rec.doWriteTAG = False
48 DetDescrVersion = "ATLAS-R2-2016-01-00-01"
49 
50 #--------------------------------------------------------------
51 # Input options
52 #--------------------------------------------------------------
53 import os
54 data_dir = os.environ.get ('ATLAS_REFERENCE_DATA', '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art')
55 svcMgr.EventSelector.InputCollections = [ data_dir + "/OverlayTests/PresampledPileUp/22.0/RDO.merged-pileup-MT.unittest.pool.root" ]
56 svcMgr.EventSelector.OutputLevel = DEBUG
57 svcMgr.SecondaryEventSelector.InputCollections = [ data_dir + "/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1" ]
58 svcMgr.SecondaryEventSelector.OutputLevel = DEBUG
59 
60 #--------------------------------------------------------------
61 # Remapping Service
62 #--------------------------------------------------------------
63 from SGComps import AddressRemappingSvc
64 AddressRemappingSvc.addInputRename("EventInfo","McEventInfo" ,"Sig_McEventInfo")
65 AddressRemappingSvc.addInputRename("McEventCollection","TruthEvent" ,"Sig_TruthEvent")
66 svcMgr.AddressRemappingSvc.OutputLevel = DEBUG
67 
68 #--------------------------------------------------------------
69 # Event related parameters
70 #--------------------------------------------------------------
71 theApp.EvtMax = 10
72 
73 #--------------------------------------------------------------
74 # Algorithms
75 #--------------------------------------------------------------
76 from AthenaCommon import CfgGetter
77 topSequence += CfgGetter.getAlgorithm("CopyMcEventCollection")
78 
79 #--------------------------------------------------------------
80 # Athena EventLoop Manager
81 #--------------------------------------------------------------
82 from AthenaCommon.ConcurrencyFlags import jobproperties as jp
83 nThreads = jp.ConcurrencyFlags.NumThreads()
84 from AthenaServices import AthenaServicesConf
85 if nThreads > 0:
86  EventLoop = AthenaServicesConf.AthenaHiveEventLoopMgr()
87 else:
88  EventLoop = AthenaServicesConf.AthenaEventLoopMgr()
89 EventLoop.RequireInputAttributeList = True
90 EventLoop.UseSecondaryEventNumber = True
91 EventLoop.OutputLevel = INFO
92 svcMgr += EventLoop
93 
94 #--------------------------------------------------------------
95 # DEBUG messaging
96 #--------------------------------------------------------------
97 svcMgr.ProxyProviderSvc.OutputLevel = DEBUG
98 svcMgr.AthenaPoolAddressProviderSvcPrimary.OutputLevel = DEBUG
99 svcMgr.AthenaPoolAddressProviderSvcSecondary.OutputLevel = DEBUG
100 svcMgr.EventSelector.OutputLevel = DEBUG
101 
102 #--------------------------------------------------------------
103 # Output options
104 #--------------------------------------------------------------
105 from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
106 # TODO: noTag=True to avoid warning, needs EventInfo overlay implemented
107 Stream1 = AthenaPoolOutputStream( "Stream1", asAlg=True, noTag=True )
108 Stream1.OutputLevel = INFO
109 
110 Stream1.OutputFile = locals().get("outputFile", "OverlayRDO.root")
111 # List of DO's to write out
112 Stream1.ItemList = []
113 Stream1.ItemList += ["McEventCollection#TruthEvent"]
114 
115 #--------------------------------------------------------------
116 # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
117 #--------------------------------------------------------------
118 svcMgr.MessageSvc.debugLimit = 100000
119 
120 # No stats printout
121 include( "AthenaPoolTest/NoStats_jobOptions.py" )
122 
123 #==============================================================
124 #
125 # End of job options file
126 #
127 
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
python.Include.include
include
Definition: Include.py:319
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
python.CreateOutputStreams.AthenaPoolOutputStream
def AthenaPoolOutputStream
backward compat
Definition: CreateOutputStreams.py:144