CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
Merge Namespace Reference

Functions

def mergeProcess
 

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
- 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 popcon_last_value_cfg.Source, and str.

Referenced by Scenario.Scenario.merge().

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