Skip to content

Commit 09fa4cd

Browse files
committed
Use RNTuple output module for NanoAOD
1 parent 5c35891 commit 09fa4cd

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Configuration/Applications/python/ConfigBuilder.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -732,14 +732,16 @@ def _createOutputModuleInAddOutput(self, tier, streamType, eventContent, fileNam
732732
CppType='PoolOutputModule'
733733
if self._options.timeoutOutput:
734734
CppType='TimeoutPoolOutputModule'
735-
if streamType=='DQM' and tier=='DQMIO':
735+
elif streamType=='DQM' and tier=='DQMIO':
736736
CppType='DQMRootOutputModule'
737-
fileName = fileName.replace('.rntpl', '.root')
738-
if not ignoreNano and "NANOAOD" in streamType : CppType='NanoAODOutputModule'
739-
if self._options.rntuple_out and CppType == 'PoolOutputModule':
737+
elif not ignoreNano and "NANOAOD" in streamType:
738+
CppType='NanoAODRNTupleOutputModule' if self._options.rntuple_out else 'NanoAODOutputModule'
739+
elif self._options.rntuple_out:
740740
CppType='RNTupleOutputModule'
741-
if len(fileName) > 5 and fileName[-5:] == '.root':
742-
fileName = fileName.replace('.root', '.rntpl')
741+
if 'RNTuple' in CppType:
742+
fileName = fileName.replace('.root', '.rntpl')
743+
else:
744+
fileName = fileName.replace('.rntpl', '.root')
743745
output = cms.OutputModule(CppType,
744746
eventContent.clone(),
745747
fileName = cms.untracked.string(fileName),

Configuration/Applications/test/ConfigBuilderTest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def testOutputFormatWithEventContent(self):
215215
options.datatier= "NANOAOD"
216216
options.eventcontent="NANOEDMAOD"
217217
_test_addOutput(self, options, process, [OutStats('NANOEDMAODoutput', 'PoolOutputModule', 'NANOAOD', 'output.root', outputCommands_)])
218-
#NANOAOD & rntuple (no change)
218+
#NANOAOD & rntuple
219219
process = cms.Process("TEST")
220220
outputCommands_ = cms.untracked.vstring('drop *', 'keep foo')
221221
process.NANOAODEventContent = cms.PSet( outputCommands = outputCommands_)
@@ -224,7 +224,7 @@ def testOutputFormatWithEventContent(self):
224224
options.datatier= "NANOAOD"
225225
options.eventcontent="NANOAOD"
226226
options.rntuple_out = True
227-
_test_addOutput(self, options, process, [OutStats('NANOAODoutput','NanoAODOutputModule','NANOAOD','output.root',outputCommands_)])
227+
_test_addOutput(self, options, process, [OutStats('NANOAODoutput','NanoAODRNTupleOutputModule','NANOAOD','output.rntpl',outputCommands_)])
228228
#NANOEDMAOD & rntuple
229229
process = cms.Process("TEST")
230230
outputCommands_ = cms.untracked.vstring('drop *', 'keep foo')

0 commit comments

Comments
 (0)