Skip to content

Commit af06969

Browse files
authored
Merge pull request #49205 from srimanob/160_MoveMiniCustomizeToEventContent
Remove miniAOD_customizeOutput, and define miniaod file parameter directly in EventContent
2 parents 33ac3dc + dca978e commit af06969

File tree

5 files changed

+69
-12
lines changed

5 files changed

+69
-12
lines changed

Configuration/Applications/python/ConfigBuilder.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -712,11 +712,6 @@ def _addOutputUsingTier(self):
712712
output = self._createOutputModuleInAddOutput(tier=tier, streamType=streamType, eventContent=theEventContent, fileName = theFileName, filterName = theFilterName, ignoreNano = False)
713713
self._updateOutputSelectEvents(output, streamType)
714714

715-
if "MINIAOD" in streamType:
716-
## we should definitely get rid of this customization by now
717-
from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeOutput
718-
miniAOD_customizeOutput(output)
719-
720715
outputModuleName=streamType+streamQualifier+'output'
721716
outputModule = self._addOutputModuleAndPathToProcess(output, outputModuleName)
722717

Configuration/DataProcessing/test/BuildFile.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<test name="TestConfigDP_1" command="run_CfgTest_1.sh"/>
22
<test name="TestConfigDP_2" command="run_CfgTest_2.sh"/>
33
<test name="TestConfigDP_3" command="run_CfgTest_3.sh"/>
4+
<test name="TestConfigDP_4" command="run_CfgTest_4.sh"/>
45
<test name="TestConfigDP_5" command="run_CfgTest_5.sh"/>
56
<test name="TestConfigDP_6" command="run_CfgTest_6.sh"/>
67
<test name="TestConfigDP_7" command="run_CfgTest_7.sh"/>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import pickle
2+
3+
f=open('RunPromptRecoCfg.pkl','rb')
4+
process = pickle.load(f)
5+
fout=open("config_dump.py", "w")
6+
fout.write(process.dumpPython())
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# Test suite for miniaod from prompt
4+
5+
# Pass in name and status
6+
declare -a arr=("ppEra_Run3_2025")
7+
for scenario in "${arr[@]}"
8+
do
9+
rm -rf RunPromptRecoCfg.pkl
10+
python3 ${SCRAM_TEST_PATH}/RunPromptReco.py --scenario $scenario --miniaod --global-tag GLOBALTAG --lfn=/store/whatever
11+
if [ ! -f "RunPromptRecoCfg.pkl" ]; then
12+
echo "Can't dump RunPromptRecoCfg.pkl"
13+
exit 1;
14+
fi
15+
16+
python3 <<EOF
17+
import sys, pickle
18+
f=open('RunPromptRecoCfg.pkl','rb')
19+
process = pickle.load(f);
20+
if not hasattr(process, "write_MINIAOD"):
21+
sys.exit(1)
22+
23+
mod = process.write_MINIAOD
24+
if not hasattr(mod, "overrideBranchesSplitLevel"):
25+
sys.exit(1)
26+
EOF
27+
28+
rc=$?
29+
if [ $rc -ne 0 ]; then
30+
echo "check process.write_MINIAOD"
31+
exit 1;
32+
fi
33+
34+
echo '>>>> Done! <<<<'
35+
done

Configuration/EventContent/python/EventContent_cff.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import FWCore.ParameterSet.Config as cms
2-
2+
import copy
33
#
44
# Event Content definition
55
#
@@ -946,12 +946,18 @@ def SwapKeepAndDrop(l):
946946
# ROOT automatically determine when to flush is a surprisingly big overhead.
947947
#
948948
from PhysicsTools.PatAlgos.slimming.slimming_cff import MicroEventContent,MicroEventContentMC,MicroEventContentGEN
949+
from PhysicsTools.PatAlgos.slimming.MicroEventContent_cff import MiniAODOverrideBranchesSplitLevel
949950

950951
MINIAODEventContent= cms.PSet(
951952
outputCommands = cms.untracked.vstring('drop *'),
952953
eventAutoFlushCompressedSize=cms.untracked.int32(-900),
953954
compressionAlgorithm=cms.untracked.string("LZMA"),
954-
compressionLevel=cms.untracked.int32(4)
955+
compressionLevel=cms.untracked.int32(4),
956+
overrideBranchesSplitLevel=copy.deepcopy(MiniAODOverrideBranchesSplitLevel),
957+
splitLevel=cms.untracked.int32(0),
958+
dropMetaData=cms.untracked.string('ALL'),
959+
fastCloning=cms.untracked.bool(False),
960+
overrideInputFileSplitLevels=cms.untracked.bool(True)
955961
)
956962
MINIAODEventContent.outputCommands.extend(MicroEventContent.outputCommands)
957963
MINIAODEventContent.outputCommands.extend(HLTriggerMINIAOD.outputCommands)
@@ -960,7 +966,12 @@ def SwapKeepAndDrop(l):
960966
outputCommands = cms.untracked.vstring('drop *'),
961967
eventAutoFlushCompressedSize=cms.untracked.int32(-900),
962968
compressionAlgorithm=cms.untracked.string("LZMA"),
963-
compressionLevel=cms.untracked.int32(4)
969+
compressionLevel=cms.untracked.int32(4),
970+
overrideBranchesSplitLevel=copy.deepcopy(MiniAODOverrideBranchesSplitLevel),
971+
splitLevel=cms.untracked.int32(0),
972+
dropMetaData=cms.untracked.string('ALL'),
973+
fastCloning=cms.untracked.bool(False),
974+
overrideInputFileSplitLevels=cms.untracked.bool(True)
964975
)
965976
MINIAODSIMEventContent.outputCommands.extend(MicroEventContentMC.outputCommands)
966977
MINIAODSIMEventContent.outputCommands.extend(HLTriggerMINIAODSIM.outputCommands)
@@ -979,7 +990,12 @@ def SwapKeepAndDrop(l):
979990
outputCommands = cms.untracked.vstring('drop *'),
980991
eventAutoFlushCompressedSize=cms.untracked.int32(20*1024*1024),
981992
compressionAlgorithm=cms.untracked.string("LZMA"),
982-
compressionLevel=cms.untracked.int32(4)
993+
compressionLevel=cms.untracked.int32(4),
994+
overrideBranchesSplitLevel=copy.deepcopy(MiniAODOverrideBranchesSplitLevel),
995+
splitLevel=cms.untracked.int32(0),
996+
dropMetaData=cms.untracked.string('ALL'),
997+
fastCloning=cms.untracked.bool(False),
998+
overrideInputFileSplitLevels=cms.untracked.bool(True)
983999
)
9841000
RAWMINIAODEventContent.outputCommands.extend(MicroEventContent.outputCommands)
9851001
RAWMINIAODEventContent.outputCommands.extend(L1TriggerRAW.outputCommands)
@@ -992,7 +1008,12 @@ def SwapKeepAndDrop(l):
9921008
outputCommands = cms.untracked.vstring('drop *'),
9931009
eventAutoFlushCompressedSize=cms.untracked.int32(20*1024*1024),
9941010
compressionAlgorithm=cms.untracked.string("LZMA"),
995-
compressionLevel=cms.untracked.int32(4)
1011+
compressionLevel=cms.untracked.int32(4),
1012+
overrideBranchesSplitLevel=copy.deepcopy(MiniAODOverrideBranchesSplitLevel),
1013+
splitLevel=cms.untracked.int32(0),
1014+
dropMetaData=cms.untracked.string('ALL'),
1015+
fastCloning=cms.untracked.bool(False),
1016+
overrideInputFileSplitLevels=cms.untracked.bool(True)
9961017
)
9971018
RAWMINIAODSIMEventContent.outputCommands.extend(RAWMINIAODEventContent.outputCommands)
9981019
RAWMINIAODSIMEventContent.outputCommands.extend(MicroEventContentMC.outputCommands)
@@ -1047,10 +1068,9 @@ def SwapKeepAndDrop(l):
10471068
TauEmbeddingSimRecoEventContent = RAWRECOSIMHLTEventContent.clone()
10481069
TauEmbeddingSimRecoEventContent.outputCommands.extend(TauEmbSimReco.outputCommands)
10491070

1050-
# needs to have MINIAOD in its name to be recognized by cmsDriver as a MINIAOD output so that miniAOD_customizeOutput is applied
10511071
TauEmbeddingMergeMINIAODEventContent = MINIAODSIMEventContent.clone()
10521072
TauEmbeddingMergeMINIAODEventContent.outputCommands.extend(TauEmbMerge.outputCommands)
10531073

10541074
# needs to have NANOAOD in its name to be recognized by cmsDriver as a NANOAOD output so that NanoAODOutputModule is used
10551075
TauEmbeddingNANOAODEventContent = NANOAODSIMEventContent.clone()
1056-
TauEmbeddingNANOAODEventContent.outputCommands.extend(TauEmbNano.outputCommands)
1076+
TauEmbeddingNANOAODEventContent.outputCommands.extend(TauEmbNano.outputCommands)

0 commit comments

Comments
 (0)