CMS 3D CMS Logo

Functions
Merge Namespace Reference

Functions

def mergeProcess (inputFiles, options)
 

Detailed Description

_Merge_

Module that generates standard merge job configurations for use in any
standard processing

Function Documentation

def Merge.mergeProcess (   inputFiles,
  options 
)
_mergeProcess_

Creates and returns a merge process that will merge the provided
filenames

supported options:

- process_name : name of the process, defaults to Merge
- outputmod_label : label of the output module, defaults to Merged
- newDQMIO : specifies if the new DQM format should be used to merge the files
- output_file : sets the output file name
- output_lfn : sets the output LFN

Definition at line 16 of file Merge.py.

References PFJetToCaloProducer_cfi.Source, and harvestTrackValidationPlots.str.

Referenced by Scenario.Scenario.merge().

16 def mergeProcess(*inputFiles, **options):
17  """
18  _mergeProcess_
19 
20  Creates and returns a merge process that will merge the provided
21  filenames
22 
23  supported options:
24 
25  - process_name : name of the process, defaults to Merge
26  - outputmod_label : label of the output module, defaults to Merged
27  - newDQMIO : specifies if the new DQM format should be used to merge the files
28  - output_file : sets the output file name
29  - output_lfn : sets the output LFN
30 
31  """
32  # //
33  # // process supported options
34  #//
35  processName = options.get("process_name", "Merge")
36  outputModLabel = options.get("outputmod_label", "Merged")
37  outputFilename = options.get("output_file", "Merged.root")
38  outputLFN = options.get("output_lfn", None)
39  dropDQM = options.get("drop_dqm", False)
40  newDQMIO = options.get("newDQMIO", False)
41  mergeNANO = options.get("mergeNANO", False)
42  # //
43  # // build process
44  #//
45  process = Process(processName)
46 
47  # //
48  # // input source
49  #//
50  if newDQMIO:
51  process.source = Source("DQMRootSource")
52  process.add_(Service("DQMStore"))
53  else:
54  process.source = Source("PoolSource")
55  if dropDQM:
56  process.source.inputCommands = CfgTypes.untracked.vstring('keep *','drop *_EDMtoMEConverter_*_*')
57  process.source.fileNames = CfgTypes.untracked(CfgTypes.vstring())
58  for entry in inputFiles:
59  process.source.fileNames.append(str(entry))
60 
61  # //
62  # // output module
63  #//
64  if newDQMIO:
65  outMod = OutputModule("DQMRootOutputModule")
66  elif mergeNANO:
68  outMod = OutputModule("NanoAODOutputModule",Configuration.EventContent.EventContent_cff.NANOAODEventContent.clone())
69  else:
70  outMod = OutputModule("PoolOutputModule")
71 
72  outMod.fileName = CfgTypes.untracked.string(outputFilename)
73  if outputLFN != None:
74  outMod.logicalFileName = CfgTypes.untracked.string(outputLFN)
75  setattr(process, outputModLabel, outMod)
76 
77  process.outputPath = EndPath(outMod)
78 
79  return process