Commit 7d3c171e authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Ported POOLIO Write and Read tests to ROOT

From: Marco Clemencic <marco.clemencic@cern.ch>


git-svn-id: svn+ssh://svn.cern.ch/reps/gaudi/Gaudi/branches/GAUDI/GAUDI_newpack@6734 53ecefc3-a64d-0410-9bdf-b8581fa3287e
parent 0496e70a
......@@ -13,6 +13,8 @@ use GaudiPython * -no_auto_imports
use GaudiGSL *
use RootHistCnv * -no_auto_imports
use RootCnv * -no_auto_imports
use Boost * LCG_Interfaces
use HepPDT * LCG_Interfaces
......
Package GaudiExamples
Package manager : Marco Clemencic
! 2011-12-08 - Marco Clemencic
- Ported POOLIO Write and Read tests to ROOT.
! 2011-12-05 - Marco Clemencic
- Removed the unused FastContainerSvc.
- Moved ParticlePropertySvc to a dedicated package and wrapped it in the
......
// $Id: POOLIORead.opts,v 1.8 2008/11/04 22:49:25 marcocle Exp $
// ============================================================================
/////////////////////////////////////////////////////////////////////
// Read a DST, distinguishing between events and file summary records
/////////////////////////////////////////////////////////////////////
ApplicationMgr.TopAlg = { "GaudiSequencer/EventAlgs",
"GaudiSequencer/FSRAlgs" };
EventAlgs.Members = { "ReadAlg" };
EventAlgs.VetoObjects = {"FSR"};
ReadAlg.OutputLevel = 1;
FSRAlgs.Members = { "ReadTES" };
FSRAlgs.RequireObjects = {"FSR"};
ReadTES.Locations = {"FSR"};
ApplicationMgr.HistogramPersistency = "NONE";
// Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
ApplicationMgr.EvtMax = -1;
EventSelector.OutputLevel = 2;
EventSelector.PrintFreq = 50;
EventSelector.FirstEvent = 1;
//--------------------------------------------------------------
//
// Setup for ROOT I/O System
//
#include "GaudiPoolDbRoot.opts"
PoolDbCacheSvc.OutputLevel = 4;
ChronoStatSvc.OutputLevel = 4;
ToolSvc.SequencerTimerTool.OutputLevel = 4;
//--------------------------------------------------------------
// Input File
//--------------------------------------------------------------
EventSelector.Input = { "DATAFILE='PFN:POOLIO.dst' TYP='POOL_ROOT' OPT='READ'" };
EventSelector.Input += { "DATAFILE='PFN:POOLIO.mdst' TYP='POOL_ROOT' OPT='READ'" };
FileCatalog.Catalogs += { "xmlcatalog_file:POOLIO.xml" } ;
ApplicationMgr.ExtSvc += { "FileRecordDataSvc" };
FileRecordDataSvc.IncidentName = "NEW_FILE_RECORD";
ReadAlg.IncidentName = @FileRecordDataSvc.IncidentName;
// ============================================================================
// The END
// ============================================================================
// $Id: POOLIOWrite.opts,v 1.10 2008/11/04 22:49:25 marcocle Exp $
// ============================================================================
////////////////////////////////////////////////////////////////
// Write a DST and a miniDST, including File Summary Records
////////////////////////////////////////////////////////////////
ApplicationMgr.OutStream += { "OutputStream/RootDst"};
ApplicationMgr.OutStream += { "OutputStream/RootMini" };
ApplicationMgr.TopAlg = { "WriteAlg", "ReadAlg" };
// Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
MessageSvc.OutputLevel = 1;
IncidentSvc.OutputLevel = 2;
//--------------------------------------------------------------
// Event related parameters
//--------------------------------------------------------------
ApplicationMgr.EvtMax = 1000;
ApplicationMgr.EvtSel = "NONE"; // do not use any event input
ApplicationMgr.HistogramPersistency = "NONE";
//--------------------------------------------------------------
// Output Stream Options
//--------------------------------------------------------------
//
// Setup for ROOT I/O System
//
#include "$GAUDIPOOLDBROOT/options/GaudiPoolDbRoot.opts"
//
RootDst.ItemList = { "/Event#1"
,"/Event/Collision_0#999"
,"/Event/Collision_2#1"
,"/Event/MyTracks#1"
};
RootDst.ItemList = { "/Event#999" } ;
RootDst.Output = "DATAFILE='PFN:POOLIO.dst' TYP='POOL_ROOTTREE' OPT='RECREATE'";
RootMini.ItemList = { "/Event#1" } ;
RootMini.Output = "DATAFILE='PFN:POOLIO.mdst' TYP='POOL_ROOTTREE' OPT='RECREATE'";
FileCatalog.Catalogs = { "xmlcatalog_file:POOLIO.xml" } ;
ApplicationMgr.OutStream += { "RecordStream/FileRecords" };
FileRecords.ItemList = { "/FileRecords#999" } ;
FileRecords.Output = @RootDst.Output;
FileRecords.EvtDataSvc = "FileRecordDataSvc";
FileRecords.EvtConversionSvc = "FileRecordPersistencySvc";
// ============================================================================
// The END
// ============================================================================
####################################################################
# Write a DST and a miniDST, including File Summary Records
####################################################################
from Gaudi.Configuration import *
from Configurables import Gaudi__RootCnvSvc as RootCnvSvc, GaudiPersistency
from Configurables import ReadAlg, ReadTES, FileRecordDataSvc
# I/O
GaudiPersistency()
FileRecordDataSvc(IncidentName="NEW_FILE_RECORD")
FileCatalog(Catalogs = [ "xmlcatalog_file:ROOTIO.xml" ])
esel = EventSelector(OutputLevel=DEBUG, PrintFreq=50, FirstEvent=1)
esel.Input = ["DATAFILE='PFN:ROOTIO.dst' SVC='Gaudi::RootEvtSelector' OPT='READ'",
"DATAFILE='PFN:ROOTIO.mdst' SVC='Gaudi::RootEvtSelector' OPT='READ'"]
# Algorithms
evtAlgs = GaudiSequencer("EventAlgs",
Members=[ReadAlg(OutputLevel=VERBOSE,
IncidentName=FileRecordDataSvc().IncidentName)],
VetoObjects=["FSR"])
fsrAlgs = GaudiSequencer("FSRAlgs",
Members=[ReadTES(Locations=["FSR"])],
RequireObjects=["FSR"])
# Application setup
app = ApplicationMgr()
# - Algorithms
app.TopAlg = [ evtAlgs, fsrAlgs ]
# - Events
app.EvtMax = -1
app.HistogramPersistency = "NONE"
RootCnvSvc(OutputLevel=INFO)
#ChronoStatSvc(OutputLevel=WARNING)
SequencerTimerTool(OutputLevel=WARNING)
####################################################################
# Write a DST and a miniDST, including File Summary Records
####################################################################
from Gaudi.Configuration import *
from Configurables import Gaudi__RootCnvSvc as RootCnvSvc, GaudiPersistency
# Output setup
# - DST
dst = OutputStream("RootDst")
# dst.ItemList = ["/Event#1",
# "/Event/Collision_0#999",
# "/Event/Collision_2#1",
# "/Event/MyTracks#1",
# ]
dst.ItemList = ["/Event#999"]
dst.Output = "DATAFILE='PFN:ROOTIO.dst' SVC='Gaudi::RootCnvSvc' OPT='RECREATE'"
# - MiniDST
mini = OutputStream("RootMini")
mini.ItemList = ["/Event#1"]
mini.Output = "DATAFILE='PFN:ROOTIO.mdst' SVC='Gaudi::RootCnvSvc' OPT='RECREATE'";
# - File Summary Record
fsr = RecordStream("FileRecords")
fsr.ItemList = [ "/FileRecords#999" ]
fsr.Output = dst.Output
fsr.EvtDataSvc = FileRecordDataSvc()
fsr.EvtConversionSvc = FileRecordPersistencySvc()
FileCatalog(Catalogs = [ "xmlcatalog_file:ROOTIO.xml" ])
# Output Levels
MessageSvc(OutputLevel=VERBOSE)
IncidentSvc(OutputLevel=DEBUG)
RootCnvSvc(OutputLevel=INFO)
GaudiPersistency()
# Application setup
app = ApplicationMgr()
# - I/O
app.OutStream += [ dst, mini, fsr ]
# - Algorithms
app.TopAlg = [ "WriteAlg", "ReadAlg" ]
# - Events
app.EvtMax = 1000
app.EvtSel = "NONE" # do not use any event input
app.HistogramPersistency = "NONE"
////////////////////////////////////////////////////////////////
// Example options file.
////////////////////////////////////////////////////////////////
// Include standard option files
#include "Common.opts"
//--------------------------------------------------------------
// Private Application Configuration options
//--------------------------------------------------------------
ApplicationMgr.ExtSvc += { "DbEventCnvSvc/RootEvtCnvSvc" };
ApplicationMgr.TopAlg = { "ReadAlg" };
ApplicationMgr.EvtMax = 20;
ApplicationMgr.HistogramPersistency = "HBOOK";
// Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
MessageSvc.OutputLevel = 2;
EventSelector.OutputLevel = 2;
EventSelector.PrintFreq = 1;
EventSelector.FirstEvent = 1;
//--------------------------------------------------------------
// Input File
//--------------------------------------------------------------
EventSelector.Input = {"DATAFILE='RootDst.root' TYP='ROOT' OPT='READ'" };
//--------------------------------------------------------------
// Histogram output file
//--------------------------------------------------------------
HistogramPersistencySvc.OutputFile = "histo.hbook";
//--------------------------------------------------------------
// Persistency service setup:
//--------------------------------------------------------------
EventPersistencySvc.CnvServices += { "RootEvtCnvSvc" };
//--------------------------------------------------------------
// Output Stream Options
//--------------------------------------------------------------
//
// Setup for ROOT I/O System
//
RootEvtCnvSvc.DbType = "ROOT";
////////////////////////////////////////////////////////////////
// Example options file.
////////////////////////////////////////////////////////////////
// Include standard option files
#include "Common.opts"
//--------------------------------------------------------------
// Private Application Configuration options
//--------------------------------------------------------------
ApplicationMgr.ExtSvc += { "DbEventCnvSvc/RootEvtCnvSvc" };
ApplicationMgr.OutStream = { "RootDst" };
ApplicationMgr.TopAlg = { "WriteAlg" };
// Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
MessageSvc.OutputLevel = 1;
//--------------------------------------------------------------
// Event related parameters
//--------------------------------------------------------------
ApplicationMgr.EvtMax = 10; // events to be processed (default is 10)
ApplicationMgr.EvtSel = "NONE"; // do not use any event input
ApplicationMgr.HistogramPersistency = "NONE";
//--------------------------------------------------------------
// Persistency service setup:
//--------------------------------------------------------------
EventPersistencySvc.CnvServices += { "RootEvtCnvSvc" };
//--------------------------------------------------------------
// Output Stream Options
//--------------------------------------------------------------
//
// Setup for ROOT I/O System
//
RootDst.ItemList = { "/Event#999" };
RootDst.Output = "DATAFILE='RootDst.root' TYP='ROOT' OPT='RECREATE'";
RootEvtCnvSvc.DbType = "ROOT";
<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="args"><set><text>$GAUDIEXAMPLESROOT/options/POOLIORead.opts</text></set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="reference"><text>../../home/POOLIORead.ref</text></argument>
<argument name="prerequisites"><set>
<tuple><text>gaudiexamples.pooliowrite</text><enumeral>PASS</enumeral></tuple>
</set></argument>
<argument name="program"><text>gaudirun.py</text></argument>
<argument name="args"><set>
<text>-v</text>
<text>$GAUDIEXAMPLESROOT/options/ROOT_IO/Read.py</text>
</set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="reference"><text>refs/ROOT_IO/Read.ref</text></argument>
<argument name="prerequisites"><set>
<tuple><text>gaudiexamples.root_io.write</text><enumeral>PASS</enumeral></tuple>
</set></argument>
</extension>
<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="args"><set><text>$GAUDIEXAMPLESROOT/options/POOLIOWrite.opts</text></set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="reference"><text>../../home/POOLIOWrite.ref</text></argument>
<argument name="program"><text>gaudirun.py</text></argument>
<argument name="args"><set>
<text>-v</text>
<text>$GAUDIEXAMPLESROOT/options/ROOT_IO/Write.py</text>
</set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="reference"><text>refs/ROOT_IO/Write.ref</text></argument>
</extension>
ApplicationMgr.ExtSvc = { "Gaudi::MultiFileCatalog/FileCatalog",
"Gaudi::IODataManager/IODataManager"};
#include "$ROOTCNVROOT/options/SetupIO.opts"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment