EventInfoOverlayTest.py 4.28 KB
Newer Older
1
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#########################################################################
#
## @file EventInfoOverlayLegacyTest.py
##
## @brief xAOD::EventInfo overlay event loop test:
## read an RDO and a HITS file, output a RDO file
## Test legacy HITS with the old EventInfo
##
## @author Tadej Novak <tadej.novak@cern.ch>
#
#==============================================================

# basic job configuration
import AthenaCommon.AtlasUnixStandardJob

# get a handle to the default top-level algorithm sequence
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()

# get a handle to the ServiceManager
from AthenaCommon.AppMgr import ServiceMgr as svcMgr

# get a handle to the ApplicationManager
from AthenaCommon.AppMgr import theApp

#--------------------------------------------------------------
# Set flags and load det descr
#--------------------------------------------------------------
from AthenaCommon.GlobalFlags  import globalflags
from RecExConfig.RecFlags      import rec
from OverlayCommonAlgs.OverlayFlags import overlayFlags

# Set that we are running MC+MC overlay in MT mode
globalflags.isOverlay.set_Value_and_Lock(True)
overlayFlags.isDataOverlay.set_Value_and_Lock(False)
overlayFlags.isOverlayMT.set_Value_and_Lock(True)

Tadej Novak's avatar
Tadej Novak committed
39
40
41
42
43
#--------------------------------------------------------------
# Load POOL support for DoubleEventSelector
#--------------------------------------------------------------
import AthenaPoolCnvSvc.ReadAthenaPoolDouble

44
45
46
47
48
49
50
51
52
53
54
55
56
# For general flags
rec.doAOD       = False
rec.doTrigger   = False
rec.doWriteTAG  = False
DetDescrVersion = "ATLAS-R2-2016-01-00-01"

# the correct tag should be specified
from IOVDbSvc.CondDB import conddb
conddb.setGlobalTag("OFLCOND-SDR-BS7T-04-00")

#--------------------------------------------------------------
# Input options
#--------------------------------------------------------------
57
58
svcMgr.DoubleEventSelector.InputCollections = [ "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root" ]
svcMgr.SecondaryEventSelector.InputCollections  = [ "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/TestCase_xAODEventInfo.root" ]
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

#--------------------------------------------------------------
# Remapping Service
#--------------------------------------------------------------
from SGComps import AddressRemappingSvc
AddressRemappingSvc.addInputRename("xAOD::EventInfo", "EventInfo", "Sig_EventInfo")
AddressRemappingSvc.addInputRename("xAOD::EventAuxInfo", "EventInfoAux.", "Sig_EventInfoAux.")

#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
theApp.EvtMax = 100

#--------------------------------------------------------------
# Algorithms
#--------------------------------------------------------------
# Run the overlay
from AthenaCommon import CfgGetter
EventInfoOverlay = CfgGetter.getAlgorithm("EventInfoOverlay")
EventInfoOverlay.OutputLevel = DEBUG
topSequence += EventInfoOverlay

Tadej Novak's avatar
Tadej Novak committed
81
82
83
84
85
86
87
88
89
90
91
92
#--------------------------------------------------------------
# EventLoop
#--------------------------------------------------------------
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
nThreads = jp.ConcurrencyFlags.NumThreads()
if nThreads > 0:
    EventLoop = Service("AthenaHiveEventLoopMgr")
else:
    EventLoop = Service("AthenaEventLoopMgr")
EventLoop.UseSecondaryEventNumber = True
svcMgr += EventLoop

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#--------------------------------------------------------------
# Output options
#--------------------------------------------------------------
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
Stream = AthenaPoolOutputStream( "Stream" )
Stream.OutputFile  = "OutputRDO.root"
Stream.ItemList =  [ 'xAOD::EventInfo#EventInfo', 'xAOD::EventAuxInfo#EventInfoAux.' ]

#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
#--------------------------------------------------------------
svcMgr.MessageSvc = Service( "MessageSvc" )
svcMgr.MessageSvc.OutputLevel = WARNING
svcMgr.MessageSvc.debugLimit  = 100000

# No stats printout
include( "AthenaPoolTest/NoStats_jobOptions.py" )