diff --git a/Ex/IOExample/python/IOExample/Configuration.py b/Ex/IOExample/python/IOExample/Configuration.py index 64782c410eafa1c7a15f72d895ea0b783c349bc5..bfe4ba8acfab5e10217e29d48424eb208908c5de 100755 --- a/Ex/IOExample/python/IOExample/Configuration.py +++ b/Ex/IOExample/python/IOExample/Configuration.py @@ -13,9 +13,9 @@ Configurable for IO test applications """ __author__ = "Marco Cattaneo <Marco.Cattaneo@cern.ch>" -from PyConf.Algorithms import RecordStream, PrintHeader +from PyConf.Algorithms import RecordStream, PrintHeader, CopyInputStream from PyConf.control_flow import CompositeNode -from PyConf.application import configure_input, configure, root_copy_input_writer, create_or_reuse_rootIOAlg, make_odin +from PyConf.application import configure_input, configure, create_or_reuse_rootIOAlg, make_odin from PyConf.reading import get_mc_header, get_mc_particles, get_mc_vertices @@ -31,7 +31,12 @@ def runIOTest(options, DataContent="DST", LoadAll=False): algs = [] if options.output_file != '': - writer = root_copy_input_writer(options, options.output_file) + writer = CopyInputStream( + name='CopyInputStream', + InputFileLeavesLocation=create_or_reuse_rootIOAlg( + options).InputLeavesLocation, + Output="DATAFILE='{}' SVC='Gaudi::RootCnvSvc' OPT='RECREATE'". + format(options.output_file)) fsrWriter = RecordStream( name="FSRInputCopyStream", ItemList=["/FileRecords#999"], diff --git a/Kernel/FSRAlgs/options/merge-small-files-test.py b/Kernel/FSRAlgs/options/merge-small-files-test.py index e5d4bb10e530292a646b4b799225244bc000f2b8..b9064356e693d2d57aa2a738ec3b344cf6fac897 100644 --- a/Kernel/FSRAlgs/options/merge-small-files-test.py +++ b/Kernel/FSRAlgs/options/merge-small-files-test.py @@ -11,7 +11,7 @@ from Gaudi.Configuration import DEBUG from PyConf.control_flow import CompositeNode -from PyConf.application import ApplicationOptions, configure_input, configure, input_from_root_file, root_writer #root_copy_input_writer +from PyConf.application import ApplicationOptions, configure_input, configure, input_from_root_file, root_writer from PyConf.Algorithms import FSRCleaner, LumiMergeFSR, EventAccounting options = ApplicationOptions(_enabled=False) diff --git a/Kernel/LHCbAlgs/tests/options/fsr-only-file.py b/Kernel/LHCbAlgs/tests/options/fsr-only-file.py index bfbf080288ee06d7eccedb65276caaeacb1a4288..71f4d7e21dac7ea77e67c23b8ce39e4320359b48 100644 --- a/Kernel/LHCbAlgs/tests/options/fsr-only-file.py +++ b/Kernel/LHCbAlgs/tests/options/fsr-only-file.py @@ -8,8 +8,9 @@ # granted to it by virtue of its status as an Intergovernmental Organization # # or submit itself to any jurisdiction. # ############################################################################### -from PyConf.application import ApplicationOptions, configure_input, configure, input_from_root_file, root_copy_input_writer +from PyConf.application import ApplicationOptions, configure_input, configure, input_from_root_file, create_or_reuse_rootIOAlg from PyConf.control_flow import CompositeNode +from PyConf.Algorithms import CopyInputStream options = ApplicationOptions(_enabled=False) options.set_input_and_conds_from_testfiledb("2010_justFSR_EW") @@ -20,7 +21,11 @@ config = configure_input(options) reader = input_from_root_file( "/Event/DAQ/RawEvent", forced_type='LHCb::RawEvent') -writer = root_copy_input_writer(options, options.output_file) - +writer = CopyInputStream( + name='CopyInputStream', + InputFileLeavesLocation=create_or_reuse_rootIOAlg(options). + InputLeavesLocation, + Output="DATAFILE='{}' SVC='Gaudi::RootCnvSvc' OPT='RECREATE'".format( + options.output_file)) cf_node = CompositeNode('Seq', children=[reader, writer]) config.update(configure(options, cf_node)) diff --git a/Kernel/LHCbAlgs/tests/options/fsr-small-file.py b/Kernel/LHCbAlgs/tests/options/fsr-small-file.py index beb376fef20d72cba193aef261dd27f08b09b585..8f866175e4e6a8c351e74889222a21762255c13c 100644 --- a/Kernel/LHCbAlgs/tests/options/fsr-small-file.py +++ b/Kernel/LHCbAlgs/tests/options/fsr-small-file.py @@ -8,9 +8,10 @@ # granted to it by virtue of its status as an Intergovernmental Organization # # or submit itself to any jurisdiction. # ############################################################################### -from PyConf.application import ApplicationOptions, configure_input, configure, input_from_root_file, root_copy_input_writer +from PyConf.application import ApplicationOptions, configure_input, configure, input_from_root_file, create_or_reuse_rootIOAlg from PyConf.control_flow import CompositeNode from PRConfig.TestFileDB import test_file_db +from PyConf.Algorithms import CopyInputStream options = ApplicationOptions(_enabled=False) options.set_input_and_conds_from_testfiledb("R08S14_smallfiles") @@ -25,7 +26,12 @@ config = configure_input(options) reader = input_from_root_file( "/Event/DAQ/RawEvent", forced_type='LHCb::RawEvent') -writer = root_copy_input_writer(options, options.output_file) +writer = CopyInputStream( + name='CopyInputStream', + InputFileLeavesLocation=create_or_reuse_rootIOAlg(options). + InputLeavesLocation, + Output="DATAFILE='{}' SVC='Gaudi::RootCnvSvc' OPT='RECREATE'".format( + options.output_file)) cf_node = CompositeNode('Seq', children=[reader, writer]) config.update(configure(options, cf_node)) diff --git a/PyConf/python/PyConf/application.py b/PyConf/python/PyConf/application.py index bdbd23e1ac4f8a883c8ec36c8eb32baa57490c24..72f88fb90d1a13b1c48fab58bc18fdc354526278 100644 --- a/PyConf/python/PyConf/application.py +++ b/PyConf/python/PyConf/application.py @@ -41,7 +41,6 @@ from .Algorithms import ( createODIN, LHCb__MDFWriter, OutputStream, - CopyInputStream, LHCb__UnpackRawEvent, ) from Configurables import ( @@ -224,44 +223,6 @@ def root_writer(path, locations): ) -def root_copy_input_writer(options, - path, - locations=None, - tes_veto_locations=None): - """Return algorithm for writing ROOT/DST files. - - The writer will write not only the locations specified in `locations`, - but also the locations collected by RootIOAlg. - By scheduling the latter as the very first producer, one can copy all - input file locations to the output. - - Args: - path (str): Path the output file should be written to. - locations (list of str): TES locations to write. - tes_veto_locations (list of str): TES locations that should not - be propagated from the input. - - Returns: - The writer algorithm to typically be scheduled last. - - """ - locations = [format_output_location(l) for l in locations or []] - tes_veto_locations = [ - format_output_location(l, add_depth=False) - for l in tes_veto_locations or [] - ] - writer = CopyInputStream( - name='CopyInputStream', - InputFileLeavesLocation=create_or_reuse_rootIOAlg(options). - InputLeavesLocation, - OptItemList=locations, - TESVetoList=tes_veto_locations, - Output="DATAFILE='{}' SVC='Gaudi::RootCnvSvc' OPT='RECREATE'".format( - path), - ) - return writer - - _ApplicationOptions_locked = False _ApplicationOptions_lockedSlots = {}