File indexing completed on 2024-04-06 12:31:46
0001
0002 """
0003 _Merge_
0004
0005 Module that generates standard merge job configurations for use in any
0006 standard processing
0007
0008 """
0009
0010
0011 from FWCore.ParameterSet.Config import Process, EndPath
0012 from FWCore.ParameterSet.Modules import OutputModule, Source
0013 import FWCore.ParameterSet.Types as CfgTypes
0014 import FWCore.ParameterSet.Config as cms
0015
0016 options = {}
0017
0018 """
0019 _mergeProcess_
0020
0021 Creates and returns a merge process that will merge the provided
0022 filenames
0023
0024 supported options:
0025
0026 - process_name : name of the procee, defaults to Merge
0027 - output_file : sets the output file name
0028 - output_lfn : sets the output LFN
0029
0030 """
0031
0032
0033
0034 processName = options.get("process_name", "Merge")
0035 outputFilename = options.get("output_file", "Merged.root")
0036 outputLFN = options.get("output_lfn", None)
0037 dropDQM = options.get("drop_dqm", False)
0038
0039
0040
0041
0042 process = Process(processName)
0043
0044
0045
0046
0047 process.source = Source("PoolSource",
0048 fileNames = cms.untracked.vstring()
0049 )
0050 inputFiles = ["lstore://cms-lstore.vampre/test/file2.root", "lstore://cms-lstore.vampire/test/file1.root"]
0051 for entry in inputFiles:
0052 process.source.fileNames.append(str(entry))
0053 if dropDQM:
0054 process.source.inputCommands = CfgTypes.untracked.vstring('keep *','drop *_EDMtoMEConverter_*_*')
0055
0056
0057
0058
0059 process.Merged = OutputModule("PoolOutputModule")
0060 process.Merged.fileName = CfgTypes.untracked(CfgTypes.string(
0061 outputFilename))
0062
0063 if outputLFN != None:
0064 process.Merged.logicalFileName = CfgTypes.untracked(CfgTypes.string(
0065 outputLFN))
0066
0067
0068 process.outputPath = EndPath(process.Merged)
0069