CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Configuration/DataProcessing/python/Merge.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 """
00003 _Merge_
00004 
00005 Module that generates standard merge job configurations for use in any
00006 standard processing
00007 
00008 """
00009 
00010 
00011 from FWCore.ParameterSet.Config import Process, EndPath
00012 from FWCore.ParameterSet.Modules import OutputModule, Source
00013 import FWCore.ParameterSet.Types as CfgTypes
00014 
00015 
00016 def mergeProcess(*inputFiles, **options):
00017     """
00018     _mergeProcess_
00019 
00020     Creates and returns a merge process that will merge the provided
00021     filenames
00022 
00023     supported options:
00024 
00025     - process_name : name of the procee, defaults to Merge
00026     - output_file  : sets the output file name
00027     - output_lfn   : sets the output LFN
00028 
00029     """
00030     #  //
00031     # // process supported options
00032     #//
00033     processName = options.get("process_name", "Merge")
00034     outputFilename = options.get("output_file", "Merged.root")
00035     outputLFN = options.get("output_lfn", None)
00036 
00037     #  //
00038     # // build process
00039     #//
00040     process = Process(processName)
00041 
00042     #  //
00043     # // input source
00044     #// 
00045     process.source = Source("PoolSource")
00046     process.source.fileNames = CfgTypes.untracked(CfgTypes.vstring())
00047     for entry in inputFiles:
00048         process.source.fileNames.append(str(entry))
00049 
00050     #  //
00051     # // output module
00052     #//
00053     process.Merged = OutputModule("PoolOutputModule")
00054     process.Merged.fileName = CfgTypes.untracked(CfgTypes.string(
00055         outputFilename))
00056 
00057     if outputLFN != None:
00058         process.Merged.logicalFileName = CfgTypes.untracked(CfgTypes.string(
00059             outputLFN))
00060         
00061     
00062     process.outputPath = EndPath(process.Merged)
00063     return process