Commit d7071cbc authored by Miha Muskinja's avatar Miha Muskinja
Browse files

Minimal necessary changes to run MC+MC overlay in AthenaMT with --threads > 1...

Minimal necessary changes to run MC+MC overlay in AthenaMT with --threads > 1 using the DoubleEventSelector.


Former-commit-id: 05b6acd3
parent 13ef619f
......@@ -57,6 +57,7 @@ atlas_add_component( AthenaPoolTest
src/TrkTrackFakeReader.cxx
src/TrkTrackFakeWriter.cxx
src/FakeTrackBuilder.cxx
src/RDOReaderDoubleSelector.cxx
src/components/*.cxx
INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaPoolTestData CaloDetDescrLib CaloEvent CaloIdentifier AthenaBaseComps AthenaKernel StoreGateLib SGtests AthenaPoolUtilities GeoPrimitives Identifier EventInfo GaudiKernel InDetIdentifier InDetReadoutGeometry InDetRawData InDetCompetingRIOsOnTrack InDetPrepRawData InDetRIO_OnTrack LArRecEvent TrkSurfaces TrkCompetingRIOsOnTrack TrkEventPrimitives TrkMaterialOnTrack TrkParameters TrkTrack TrkVertexOnTrack )
......@@ -85,18 +86,31 @@ function (athenapooltest_run_test testName jo pattern)
endfunction (athenapooltest_run_test)
# Write with DoubleEventSelector
athenapooltest_run_test( AthenaPoolTestWriteDoubleSelector AthenaPoolTestWriteDoubleSelector
"AthenaPoolTestReadDoubleSelector" )
athenapooltest_run_test( AthenaPoolTestReadDoubleSelector AthenaPoolTestReadDoubleSelector
"AthenaPoolTestReadDoubleSelector"
DEPENDS AthenaPoolTestWriteDoubleSelector )
# Write/read out some simple objects:
athenapooltest_run_test( AthenaPoolTestWrite AthenaPoolTestWrite
"^..AthenaPoolTestD" )
"^..AthenaPoolTestD"
DEPENDS AthenaPoolTestReadDoubleSelector)
athenapooltest_run_test( AthenaPoolTestRead AthenaPoolTestRead
"AthenaPoolTestD"
DEPENDS AthenaPoolTestWrite )
# Add on test of navigation still using simple objects:
# AthenaPoolTestWrite - Step2 - rewrite part in another file
# DoubleEventSelector
athenapooltest_run_test( AthenaPoolTestStep2WriteDoubleSelector AthenaPoolTestStep2WriteDoubleSelector
"AthenaPoolTestReadDoubleSelector"
DEPENDS AthenaPoolTestRead )
# normal EventSelector
athenapooltest_run_test( AthenaPoolTestStep2Write AthenaPoolTestStep2Write
"^..AthenaPoolTestD"
DEPENDS AthenaPoolTestRead )
DEPENDS AthenaPoolTestStep2WriteDoubleSelector )
# Copy the Step2 file
#athenapooltest_run_test( AthenaPoolTestCopy AthenaPoolTestCopy
......@@ -136,6 +150,20 @@ athenapooltest_run_test( LArCellContRead LArCellContReader_jobOptions
"LArCellContFake"
DEPENDS LArCellContWriter )
# Read two RDOs with the DoubleEventSelector
athenapooltest_run_test( ReadRDODoubleSelector ReadRDODoubleSelector
"ReadRDODoubleSelector"
DEPENDS LArCellContRead )
athenapooltest_run_test( ReadCombinedRDO ReadCombinedRDO
"ReadCombinedRDO"
DEPENDS ReadRDODoubleSelector )
# Test overlay with DoubleEventSelector
# TODO: need some upstream changes
# athenapooltest_run_test( DoubleEventSelectorOverlayTest DoubleEventSelectorOverlayTest
# "DoubleEventSelectorOverlayTest"
# DEPENDS ReadCombinedRDO )
# Test of explicit collection write/read
#athenapooltest_run_test( LArCellContWriteReg LArCellContWriter_jobOptionsReg
# "LArCellContFake" )
......
###############################################################
#
# Job options file
#
## @file AthenaPoolTestReadDoubleSelector.py
##
## @brief For Athena POOL test: read back AthenaPoolTest data objects
##
## @author Miha Muskinja <miha.muskinja@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
#--------------------------------------------------------------
# Load POOL support for DoubleEventSelector
#--------------------------------------------------------------
import AthenaPoolCnvSvc.ReadAthenaPoolDouble
#--------------------------------------------------------------
# Input options for DoubleEventSelector
#--------------------------------------------------------------
# Add in DoubleEventSelector
svcMgr.DoubleEventSelector.PrimaryInputCollections = [ "SimplePoolFile1.root" ]
svcMgr.DoubleEventSelector.SecondaryaryInputCollections = [ "SimplePoolFile2.root" ]
#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
theApp.EvtMax = 5
#--------------------------------------------------------------
# Application: AthenaPoolTest options
#--------------------------------------------------------------
# Load "user algorithm" top algorithms to be run, and the libraries that house them
from AthenaPoolTest.AthenaPoolTestConf import AthenaPoolTestDataReader
topSequence += AthenaPoolTestDataReader( "AthenaPoolTestDataReader" )
#--------------------------------------------------------------
# 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
AthenaPoolTestDataReader.OutputLevel = DEBUG
AthenaEventLoopMgr = Service( "AthenaEventLoopMgr" )
AthenaEventLoopMgr.OutputLevel = DEBUG
# Turn on the tree cache for the CollectionTree - tree cache only
# works for one tree. And set tree cache size - default is 10 MB (10 000 000)
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '100000'" ]
# Set number of events for learning before turning on cache - default is 5
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = '6'" ]
# Print out values - must have PoolSvc in info mode
svcMgr.PoolSvc.OutputLevel = INFO
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_LEARN_EVENTS = 'int'" ]
svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; TREE_CACHE_SIZE = 'int'" ]
# Print out for each event the number of bytes read and the number of
# read calls. With the tree cache, one should see jumps in the bytes
# read by the cache size, i.e. the bytes read should not change each
# event. However, the cache only works on one tree - the main event
# tree (CollectionTree) - and we read some things from other trees, so
# one does see a small increase event-by-event.
svcMgr.PoolSvc.OutputLevel = INFO
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; BYTES_READ = 'double'" ]
svcMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += [ "DatabaseName = '*'; READ_CALLS = 'int'" ]
# No stats printout
include( "AthenaPoolTest/NoStats_jobOptions.py" )
#==============================================================
#
# End of job options file
#
###############################################################
###############################################################
#
# Job options file
#
## @file AthenaPoolTestStep2WriteDoubleSelector.py
##
## @brief For Athena POOL test: write out AthenaPoolTest data objects
## in a second file to test navigation
##
## @author Miha Muskinja <miha.muskinja@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 ApplicationManager
from AthenaCommon.AppMgr import theApp
## get a handle to the ServiceManager
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
#--------------------------------------------------------------
# Load POOL support for DoubleEventSelector
#--------------------------------------------------------------
import AthenaPoolCnvSvc.ReadAthenaPoolDouble
import AthenaPoolCnvSvc.WriteAthenaPool
#--------------------------------------------------------------
# Define the input parameters
#--------------------------------------------------------------
# Add in DoubleEventSelector
svcMgr.DoubleEventSelector.PrimaryInputCollections = [ "SimplePoolFile1.root" ]
svcMgr.DoubleEventSelector.SecondaryaryInputCollections = [ "SimplePoolFile2.root" ]
#--------------------------------------------------------------
# JobOptions for the loading of the AthenaSealSvc
#--------------------------------------------------------------
# Check the dictionary in memory for completeness
svcMgr.AthenaSealSvc.CheckDictionary = True
#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
theApp.EvtMax = 5
#--------------------------------------------------------------
# Application: AthenaPoolTest options
#--------------------------------------------------------------
from AthenaPoolTest.AthenaPoolTestConf import AthenaPoolTestDataWriter
topSequence += AthenaPoolTestDataWriter( "AthenaPoolTestDataWriter" )
AthenaPoolTestDataWriter.PartialCreate = TRUE
AthenaPoolTestDataWriter.ReadOtherHalf = TRUE
#--------------------------------------------------------------
# Output options
#--------------------------------------------------------------
# ItemList:
include( "EventAthenaPool/EventAthenaPoolItemList_joboptions.py" )
include( "AthenaPoolTestAthenaPool/AthenaPoolTestAthenaPoolItemList_joboptions.py" )
print fullItemList
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
Stream3 = AthenaPoolOutputStream( "Stream3", noTag=True )
# Run OutputStream as an algorithm
topSequence += AthenaPoolOutputStream( "Stream3", noTag=True )
# Must make sure that no OutStream's have been declared
theApp.OutStream = [];
# Stream's output file
Stream3.WritingTool = "AthenaOutputStreamTool"
Stream3.OutputFile = "SimplePoolFile3.root"
# List of DO's to write out
#Stream1.ItemList += fullItemList
Stream3.ItemList += ["EventInfo#*"]
# Write out only a new set of cols 1,2,3, and matrix
Stream3.ItemList += ["IAthenaPoolTestCollection#AthenaPoolTestCollection_1"]
Stream3.ItemList += ["IAthenaPoolTestCollection#AthenaPoolTestCollection_2"]
Stream3.ItemList += ["IAthenaPoolTestCollection#AthenaPoolTestCollection_3"]
Stream3.ItemList += ["AthenaPoolTestMatrix#*"]
print Stream3.ItemList
#--------------------------------------------------------------
# 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
svcMgr.AthenaSealSvc.OutputLevel = WARNING
AthenaPoolTestDataWriter.OutputLevel = DEBUG
AthenaEventLoopMgr = Service( "AthenaEventLoopMgr" )
AthenaEventLoopMgr.OutputLevel = INFO
# No stats printout
include( "AthenaPoolTest/NoStats_jobOptions.py" )
#==============================================================
#
# End of job options file
#
###############################################################
###############################################################
#
# Job options file
#
## @file AthenaPoolTestWriteDoubleSelector.py
##
## @brief For Athena POOL test: write out AthenaPoolTest data objects
##
## @author Miha Muskinja <miha.muskinja@cern.ch>
#
#==============================================================
# MC Event Selector
## basic job configuration (for generator)
import AthenaCommon.AtlasUnixGeneratorJob
# Set handler for traceback
gbl.AthenaServices.SetFatalHandler(438)
## 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
#--------------------------------------------------------------
# Load POOL support
#--------------------------------------------------------------
import AthenaPoolCnvSvc.WriteAthenaPool
#--------------------------------------------------------------
# JobOptions for the loading of the AthenaSealSvc
#--------------------------------------------------------------
# Add in dictionary name:
# Check the dictionary in memory for completeness
svcMgr.AthenaSealSvc.CheckDictionary = True
#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
theApp.EvtMax = 5
#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
# Set the following when reading back to adjust the run/event numbers
# (don't forget ApplicationMgr.EvtMax)
svcMgr.EventSelector.RunNumber = 1
svcMgr.EventSelector.EventsPerRun = 0x10000000000
svcMgr.EventSelector.FirstEvent = 0x100000000
svcMgr.EventSelector.EventsPerLB = 1
svcMgr.EventSelector.FirstLB = 1
svcMgr.EventSelector.InitialTimeStamp = 0
svcMgr.EventSelector.TimeStampInterval = 5
theApp.EvtMax = 2
svcMgr.EventSelector.OutputLevel = DEBUG
#--------------------------------------------------------------
# Application: AthenaPoolTest options
#--------------------------------------------------------------
# Load "user algorithm" top algorithms to be run, and the libraries that house them
from AthenaPoolTest.AthenaPoolTestConf import AthenaPoolTestDataWriter
topSequence += AthenaPoolTestDataWriter( "AthenaPoolTestDataWriter" )
AthenaPoolTestDataWriter.OutputLevel = DEBUG
#--------------------------------------------------------------
# Output options
#--------------------------------------------------------------
# ItemList:
include( "EventAthenaPool/EventAthenaPoolItemList_joboptions.py" )
include( "AthenaPoolTestAthenaPool/AthenaPoolTestAthenaPoolItemList_joboptions.py" )
# Stream's output file
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
# Stream1
Stream1 = AthenaPoolOutputStream( "Stream1", noTag=True )
Stream1.OutputFile = "SimplePoolFile1.root"
# List of DO's to write out
Stream1.ItemList += fullItemList
# Stream2
Stream2 = AthenaPoolOutputStream( "Stream2", noTag=True )
Stream2.OutputFile = "SimplePoolFile2.root"
# List of DO's to write out
Stream2.ItemList += fullItemList
# Remove dumm_A from Stream1
Stream1.ItemList = [ o for o in Stream1.ItemList if not o in 'dummy_A#*' ]
Stream1.ItemList = [ o for o in Stream1.ItemList if not o in 'IAthenaPoolTestCollection#*' ]
# Remove dumm_E from Stream2
Stream2.ItemList = [ o for o in Stream2.ItemList if not o in 'dummy_E#*' ]
Stream2.ItemList = [ o for o in Stream2.ItemList if not o in 'AthenaPoolTestMatrix#*' ]
print "Stream1.ItemList ",Stream1.ItemList
print "Stream2.ItemList ",Stream2.ItemList
#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
#--------------------------------------------------------------
svcMgr.MessageSvc.OutputLevel = WARNING
svcMgr.MessageSvc.debugLimit = 100000
svcMgr.AthenaSealSvc.OutputLevel = WARNING
AthenaEventLoopMgr = Service( "AthenaEventLoopMgr" )
AthenaEventLoopMgr.OutputLevel = INFO
# No stats printout
include( "AthenaPoolTest/NoStats_jobOptions.py" )
#==============================================================
#
# End of job options file
#
###############################################################
###############################################################
#
# Job options file
#
## @file DoubleEventSelectorOverlayTest.py
##
## @brief For Athena POOL test: read an RDO and a HITS file, output a RDO file
##
## @author Miha Muskinja <miha.muskinja@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
#--------------------------------------------------------------
# Load POOL support for DoubleEventSelector
#--------------------------------------------------------------
import AthenaPoolCnvSvc.ReadAthenaPoolDouble
#--------------------------------------------------------------
# Set flags and load det descr
#--------------------------------------------------------------
from AthenaCommon.GlobalFlags import globalflags
from RecExConfig.RecFlags import rec
from OverlayCommonAlgs.OverlayFlags import overlayFlags
overlayFlags.isOverlayMT.set_Value_and_Lock(True)
# 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
#--------------------------------------------------------------
# TODO: both files need to be on cvmfs to make this a real test
svcMgr.DoubleEventSelector.PrimaryInputCollections = [ "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000765.pool.root.1" ]
svcMgr.DoubleEventSelector.SecondaryaryInputCollections = [ "/afs/cern.ch/work/t/tadej/public/overlay/PremixedRenamedRDO.pool" ]
svcMgr.DoubleEventSelector.OutputLevel = DEBUG
#--------------------------------------------------------------
# Remapping Service
#--------------------------------------------------------------
from SGComps import AddressRemappingSvc
AddressRemappingSvc.addInputRename("EventInfo","McEventInfo" ,"Sig_McEventInfo")
AddressRemappingSvc.addInputRename("McEventCollection","TruthEvent" ,"Sig_TruthEvent")
AddressRemappingSvc.addInputRename("RecoTimingObj","EVNTtoHITS_timings" ,"Sig_EVNTtoHITS_timings")
svcMgr.AddressRemappingSvc.OutputLevel = DEBUG
#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
theApp.EvtMax = 10
svcMgr.ProxyProviderSvc.OutputLevel = DEBUG
svcMgr.AthenaPoolAddressProviderSvcPrimary.OutputLevel = DEBUG
svcMgr.AthenaPoolAddressProviderSvcSecondary.OutputLevel = DEBUG
#--------------------------------------------------------------
# Algorithms
#--------------------------------------------------------------
from AthenaCommon import CfgGetter
topSequence += CfgGetter.getAlgorithm("CopyMcEventCollection")
topSequence += CfgGetter.getAlgorithm("CopyTimings")
#--------------------------------------------------------------
# Output options
#--------------------------------------------------------------
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
Stream1 = AthenaPoolOutputStream( "Stream1", asAlg=True )
Stream1.OutputLevel = DEBUG
Stream1.OutputFile = "OutputRDO.root"
# List of DO's to write out
Stream1.ItemList = []
Stream1.ItemList += ["McEventCollection#TruthEvent"]
Stream1.ItemList += ["RecoTimingObj#EVNTtoHITS_timings"]
# Stream1.TransientItems += ["McEventCollection#TruthEvent"]
# Stream1.TransientItems += ["RecoTimingObj#EVNTtoHITS_timings"]
#--------------------------------------------------------------
# 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
AthenaEventLoopMgr = Service( "AthenaEventLoopMgr" )
AthenaEventLoopMgr.OutputLevel = INFO
# No stats printout
include( "AthenaPoolTest/NoStats_jobOptions.py" )
# Service Manager
print svcMgr
# Master sequence
from AthenaCommon.AlgSequence import dumpMasterSequence
dumpMasterSequence()
#==============================================================
#
# End of job options file
#
###############################################################
###############################################################
###############################################################
#
# Job options file
#
......@@ -58,7 +58,7 @@ conddb.setGlobalTag("OFLCOND-SDR-BS7T-04-00")
# Input options
#--------------------------------------------------------------
svcMgr.EventSelector.InputCollections = [ "SimplePoolFile.root" ]
svcMgr.EventSelector.InputCollections = [ "InDetRDO.root" ]
#--------------------------------------------------------------
# Event related parameters
......
###############################################################
###############################################################
#
# Job options file
#
......@@ -84,7 +84,7 @@ svcMgr.AthenaSealSvc.CheckDictionary = True
# Stream's output file
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
Stream1 = AthenaPoolOutputStream( "Stream1", noTag=True )
Stream1.OutputFile = "SimplePoolFile.root"
Stream1.OutputFile = "InDetRDO.root"
# List of DO's to write out
Stream1.ItemList+=["PixelRDO_Container#*"]
Stream1.ItemList+=["SCT_RDO_Container#*"]
......
###############################################################
###############################################################
#
# Job options file
#
......@@ -58,7 +58,7 @@ conddb.setGlobalTag("OFLCOND-SDR-BS7T-04-00")
# Define input
#--------------------------------------------------------------
svcMgr.EventSelector.InputCollections = [ "SimplePoolFile.root" ]
svcMgr.EventSelector.InputCollections = [ "LArRDO.root" ]
#--------------------------------------------------------------
# Event related parameters
......
###############################################################
###############################################################
#
# Job options file
#
......@@ -80,7 +80,7 @@ svcMgr.AthenaSealSvc.CheckDictionary = True
# Stream's output file
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
Stream1 = AthenaPoolOutputStream( "Stream1", noTag=True )
Stream1.OutputFile = "SimplePoolFile.root"
Stream1.OutputFile = "LArRDO.root"
# List of DO's to write out
Stream1.ItemList+=["CaloCellContainer#*"]
Stream1.ItemList+=["EventInfo#*"]
......
###############################################################
#
# Job options file
#
## @file ReadCombinedRDO.py