Пример #1
0
Stream1.OutputFile =   "SimplePoolFile.root"
# List of DO's to write out
Stream1.ItemList+=["CaloCellContainer#*"]
Stream1.ItemList+=["EventInfo#*"]

# Must make sure that no OutStream's have been declared
theApp.OutStream    = []; 

#--------------------------------------------------------------
# Event Collection Registration
#--------------------------------------------------------------
# Run OutputStream as an algorithm
from RegistrationServices.RegistrationServicesConf import RegistrationStream
RegStream1 = RegistrationStream( "RegStream1" )
RegStream1.CollectionType   = "ExplicitROOT" 
RegStream1.OutputCollection = "NewEventCollection" 
RegStream1.OutputLevel = INFO
# List of DO's to register
RegStream1.ItemList += [ "DataHeader#*" ]
# Key name of AthenaAttributeList used for the tag:
RegStream1.ItemList += [ "AthenaAttributeList#SimpleTag" ]
topSequence += RegStream1

#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
#--------------------------------------------------------------
svcMgr.MessageSvc.OutputLevel = INFO
svcMgr.MessageSvc.debugLimit  = 100000
svcMgr.ClassIDSvc.OutputLevel = INFO
svcMgr.AthenaSealSvc.OutputLevel = INFO
#AthenaPoolTestAttrWriter.OutputLevel = 2
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
Stream1 = AthenaPoolOutputStream("Stream1", "SimplePoolFromRaw.root", True)
Stream1.MetadataItemList += ["ByteStreamMetadataContainer#*"]

from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__WriteTag
topSequence += AthPoolEx__WriteTag("WriteTag")

from RegistrationServices.RegistrationServicesConf import RegistrationStreamTagTool
TagTool = RegistrationStreamTagTool("TagTool")

from RegistrationServices.RegistrationServicesConf import RegistrationStream
RegStream1 = RegistrationStream("RegStream1",
                                CollectionType="ExplicitROOT",
                                Tool=TagTool)
RegStream1.WriteInputDataHeader = False
RegStream1.OutputCollection = "SimpleRawCollection.root"
RegStream1.ItemList += ["DataHeader#Stream1"]
RegStream1.ItemList += ["TagAthenaAttributeList#RunEventTag"]
topSequence += RegStream1

#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
#--------------------------------------------------------------
svcMgr.MessageSvc.OutputLevel = 3
svcMgr.PoolSvc.OutputLevel = 2
svcMgr.AthenaPoolCnvSvc.OutputLevel = 2
svcMgr.MetaDataSvc.OutputLevel = 2
topSequence.ReadBs.OutputLevel = 2
topSequence.ReadData.OutputLevel = 2
Stream1.OutputLevel = 2
RegStream1.OutputLevel = 2
Stream3 = AthenaPoolOutputStream("Stream3", "EmptyPoolFile.root", True)
Stream3.RequireAlgs = ["PassNoneFilter"]

#--------------------------------------------------------------
# Event Collection Registration
#--------------------------------------------------------------
from RegistrationServices.RegistrationServicesConf import RegistrationStreamTagTool
TagTool = RegistrationStreamTagTool("TagTool")

from RegistrationServices.RegistrationServicesConf import RegistrationStream
RegStream1 = RegistrationStream("RegStream1",
                                CollectionType="ExplicitROOT",
                                Tool=TagTool)
RegStream1.WriteInputDataHeader = False
RegStream1.OutputCollection = "SimplePoolCollection1.root"
RegStream1.ItemList += ["DataHeader#Stream1"]
RegStream1.ItemList += ["TagAthenaAttributeList#" + MagicWriteTag.Key]
topSequence += RegStream1

RegStream2 = RegistrationStream("RegStream2",
                                CollectionType="ExplicitROOT",
                                Tool=TagTool)
RegStream2.WriteInputDataHeader = False
RegStream2.OutputCollection = "SimplePoolCollection2.root"
RegStream2.ItemList += ["DataHeader#Stream2"]
RegStream2.ItemList += ["TagAthenaAttributeList#RunEventTag"]
topSequence += RegStream2

RegStream3 = RegistrationStream("RegStream3",
                                CollectionType="ExplicitROOT",
Пример #4
0
ToolSvc += copyTool
svcMgr.MetaDataSvc.MetaDataTools += [copyTool]

# Add algorithm to add default collection metadata
DefaultCollMeta = RegistrationStreamDefMeta("DefaultCollMeta")
DefaultCollMeta.Project = "AthenaPoolMultiTest"
DefaultCollMeta.Stream = "CheckNull"
DefaultCollMeta.Pass = 2
DefaultCollMeta.ConfigTag = "ATN"
DefaultCollMeta.OutputLevel = DEBUG
topSequence+=DefaultCollMeta

# output a collection to test multi input metadata copy
FullColl = RegistrationStream("FullColl")
FullColl.WriteInputDataHeader = TRUE
FullColl.OutputCollection = "CheckNull.root"
FullColl.ItemList        += [ "DataHeader#*" ]
FullColl.ItemList        += [ "AthenaAttributeList#RunEventTag" ]
FullColl.ItemList        += [ "CollectionMetadataContainer#Default" ]
#FullColl.Tool = TagTool
FullColl.OutputLevel = DEBUG

athRegSeq += FullColl


#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
#--------------------------------------------------------------
svcMgr.MessageSvc.OutputLevel = 3
svcMgr.MessageSvc.defaultLimit = 100000
StreamerSvc = AthenaRootStreamerSvc()
StreamerSvc.Streamers += ["ExampleHitStreamer_p0"]
svcMgr += StreamerSvc

#--------------------------------------------------------------
# Event Collection Registration
#--------------------------------------------------------------
from RegistrationServices.RegistrationServicesConf import RegistrationStreamTagTool
TagTool = RegistrationStreamTagTool("TagTool")

from RegistrationServices.RegistrationServicesConf import RegistrationStream
RegStream1 = RegistrationStream("RegStream1",
                                CollectionType="ExplicitROOT",
                                Tool=TagTool)
RegStream1.WriteInputDataHeader = False
RegStream1.OutputCollection = "SimplePoolCollection3.root"
RegStream1.ItemList += ["DataHeader#Stream1"]
RegStream1.ItemList += ["TagAthenaAttributeList#" + MagicWriteTag.Key]
topSequence += RegStream1

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

svcMgr.EventSelector.OutputLevel = 2
svcMgr.AthenaPoolAddressProviderSvc.OutputLevel = 2
svcMgr.MetaDataSvc.OutputLevel = 2
svcMgr.PoolSvc.OutputLevel = 2
svcMgr.AthenaPoolCnvSvc.OutputLevel = 2
Пример #6
0
#--------------------------------------------------------------
# Event Collection Registration
#--------------------------------------------------------------
# Run OutputStream as an algorithm
from RegistrationServices.RegistrationServicesConf import RegistrationStream
from RegistrationServices.RegistrationServicesConf import RegistrationStreamLCGTool

TagTool = RegistrationStreamLCGTool("RegistrationStreamLCGTool")

RegStream1 = RegistrationStream( "RegStream1" )
RegStream1.WriteInputDataHeader = True
RegStream1.Tool = TagTool

# Full path name of output collection:
try:
  RegStream1.OutputCollection = Out
except:
  RegStream1.OutputCollection = "test.coll.root"

# Collection type (ExplicitROOT, ExplicitMySQL or ExplicitMySQLlt):
try:
  RegStream1.CollectionType = Type
except:
  RegStream1.CollectionType = "ExplicitROOT"

# Database connection string (Set to "" for ExplicitROOT collection):
try:
  RegStream1.Connection = Connect
except:
  RegStream1.Connection = ""
# Converters:
include("EventAthenaPool/EventAthenaPool_joboptions.py")

include("AthenaPoolTools/EventCount_jobOptions.py")

#--------------------------------------------------------------
# Event Collection Registration
#--------------------------------------------------------------
# Run OutputStream as an algorithm
from RegistrationServices.RegistrationServicesConf import RegistrationStream

RegStream1 = RegistrationStream("RegStream1")
RegStream1.OutputLevel = INFO
RegStream1.CollectionType = "ExplicitROOT"
RegStream1.WriteInputDataHeader = True
RegStream1.OutputCollection = "test.coll"
# The output file name
# List of DO's to register
RegStream1.ItemList += ["DataHeader#*"]
# Key name of AthenaAttributeList used for the tag:
RegStream1.ItemList += ["AthenaAttributeList#RunEventTag"]

topSequence += RegStream1

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

#==============================================================
# Event tag collection registration
#--------------------------------------------------------------
# Registration stream:
from RegistrationServices.RegistrationServicesConf import RegistrationStream

RegStream1 = RegistrationStream( "RegStream1" )

# List of data object references to be added to collection:
RegStream1.ItemList += [ "DataHeader#*" ]
RegStream1.ItemList +=  [ "AthenaAttributeList#SimpleTag" ]
# Output collection type:
RegStream1.CollectionType = "ExplicitROOT"
# Output collection database connection string:
RegStream1.Connection = ""
# Output collection name:
RegStream1.OutputCollection = "OutputCollection"
# Output collection open mode:
RegStream1.CollectionOpenMode = "CREATE_AND_OVERWRITE"
# Specifies whether collection references input or output data file:
RegStream1.WriteInputDataHeader = FALSE
# Reference to input file
RegStream1.WriteAllProv = False
# prov stage included
RegStream1.IncludeProvStages = []
RegStream1.IncludeProvStages = ['test']
# prov stage excluded
RegStream1.ExcludeProvStages = []
RegStream1.ExcludeProvStages = ['test0']
RegStream1.ExcludeProvStages += ['nottest']
# Persistency service
RegStream1.PersistencySvc = 'EventPersistencySvc'