ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
AthenaPOOL
AthenaPoolExample
AthenaPoolExampleAlgorithms
python
AthenaPoolExample_WriteMeta.py
Go to the documentation of this file.
1
#!/env/python
2
3
# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4
5
13
14
import
os
15
os.system (
'rm -f Catalog2.xml'
)
16
17
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
18
from
AthenaConfiguration.ComponentFactory
import
CompFactory
19
from
AthenaCommon.Constants
import
DEBUG
20
21
outputFileName =
"SimplePoolFile5.root"
22
outputStreamName =
"ExampleMeta"
23
noTag =
True
24
25
# Setup flags
26
flags = initConfigFlags()
27
flags.Input.Files = []
28
flags.addFlag(f
"Output.{outputStreamName}FileName"
, outputFileName)
29
flags.Exec.MaxEvents = 10
30
flags.Common.MsgSuppression =
False
31
flags.Exec.DebugMessageComponents = [
"PoolSvc"
,
"AthenaPoolCnvSvc"
,
"AthenaPoolAddressProviderSvc"
,
"MetaDataSvc"
]
32
flags.lock()
33
34
# Main services
35
from
AthenaConfiguration.MainServicesConfig
import
MainServicesCfg
36
acc = MainServicesCfg( flags )
37
38
from
xAODEventInfoCnv.xAODEventInfoCnvConfig
import
EventInfoCnvAlgCfg
39
acc.merge( EventInfoCnvAlgCfg( flags, disableBeamSpot=
True
) )
40
41
from
AthenaPoolExampleAlgorithms.AthenaPoolExampleConfig
import
AthenaPoolExampleWriteCfg
42
acc.merge( AthenaPoolExampleWriteCfg( flags, outputStreamName,
43
writeCatalog =
"file:Catalog2.xml"
,
44
disableEventTag = noTag ) )
45
46
# Creata and attach the algorithms
47
acc.addEventAlgo( CompFactory.AthPoolEx.WriteData(
"WriteData"
, OutputLevel = DEBUG) )
48
acc.addEventAlgo( CompFactory.AthPoolEx.WriteCond(
"WriteCond"
,
49
DetStore = acc.getService(
"MetaDataStore"
),
50
ConditionName =
"PedestalWriteData"
,
51
OutputLevel = DEBUG) )
52
53
from
OutputStreamAthenaPool.OutputStreamConfig
import
OutputStreamCfg
54
acc.merge( OutputStreamCfg( flags, outputStreamName, disableEventTag = noTag,
55
ItemList = [
"EventInfo#*"
,
"ExampleHitContainer#MyHits"
],
56
MetadataItemList = [
"ExampleHitContainer#PedestalWriteData"
],
57
) )
58
59
# Run
60
import
sys
61
sc = acc.run(flags.Exec.MaxEvents)
62
sys.exit(sc.isFailure())
63
64
65
66
67
68
Constants
Generated on
for ATLAS Offline Software by
1.17.0