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

◆ mergeProcess()

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
- mergeNANO : to merge NanoAOD
- bypassVersionCheck : to bypass version check in case merging happened in lower version of CMSSW (i.e. UL HLT case). This will be FALSE by default.

Definition at line 16 of file Merge.py.

References CollectionTags_cfi.Source, and 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  - mergeNANO : to merge NanoAOD
31  - bypassVersionCheck : to bypass version check in case merging happened in lower version of CMSSW (i.e. UL HLT case). This will be FALSE by default.
32 
33  """
34  # //
35  # // process supported options
36  #//
37  processName = options.get("process_name", "Merge")
38  outputModLabel = options.get("outputmod_label", "Merged")
39  outputFilename = options.get("output_file", "Merged.root")
40  outputLFN = options.get("output_lfn", None)
41  dropDQM = options.get("drop_dqm", False)
42  newDQMIO = options.get("newDQMIO", False)
43  mergeNANO = options.get("mergeNANO", False)
44  bypassVersionCheck = options.get("bypassVersionCheck", False)
45  # //
46  # // build process
47  #//
48  process = Process(processName)
49 
50  # //
51  # // input source
52  #//
53  if newDQMIO:
54  process.source = Source("DQMRootSource", reScope = CfgTypes.untracked.string(""))
55  process.add_(Service("DQMStore"))
56  else:
57  process.source = Source("PoolSource")
58  if bypassVersionCheck:
59  process.source.bypassVersionCheck = CfgTypes.untracked.bool(True)
60  if dropDQM:
61  process.source.inputCommands = CfgTypes.untracked.vstring('keep *','drop *_EDMtoMEConverter_*_*')
62  if not mergeNANO:
63  process.source.noRunLumiSort = CfgTypes.untracked.bool(True)
64  process.source.fileNames = CfgTypes.untracked(CfgTypes.vstring())
65  for entry in inputFiles:
66  process.source.fileNames.append(str(entry))
67 
68  # //
69  # // output module
70  #//
71  if newDQMIO:
72  outMod = OutputModule("DQMRootOutputModule")
73  elif mergeNANO:
75  outMod = OutputModule("NanoAODOutputModule",Configuration.EventContent.EventContent_cff.NANOAODEventContent.clone())
76  process.add_(Service("InitRootHandlers", EnableIMT = CfgTypes.untracked.bool(False)))
77  else:
78  outMod = OutputModule("PoolOutputModule")
79  outMod.mergeJob = CfgTypes.untracked.bool(True)
80  outMod.eventAuxiliaryBasketSize = CfgTypes.untracked.int32(2*1024*1024)
81 
82  outMod.fileName = CfgTypes.untracked.string(outputFilename)
83  if outputLFN != None:
84  outMod.logicalFileName = CfgTypes.untracked.string(outputLFN)
85  setattr(process, outputModLabel, outMod)
86 
87  process.outputPath = EndPath(outMod)
88 
89  return process
90 
def mergeProcess(inputFiles, options)
Definition: Merge.py:16
#define str(s)