diff --git a/Configuration/DataProcessing/python/Repack.py b/Configuration/DataProcessing/python/Repack.py index a8c9f319ffbe2..2112e184e255b 100644 --- a/Configuration/DataProcessing/python/Repack.py +++ b/Configuration/DataProcessing/python/Repack.py @@ -21,6 +21,8 @@ def repackProcess(**args): """ from Configuration.EventContent.EventContent_cff import RAWEventContent + from Configuration.EventContent.EventContent_cff import HLTSCOUTEventContent + from Configuration.EventContent.EventContent_cff import L1SCOUTEventContent process = cms.Process("REPACK") process.load("FWCore.MessageLogger.MessageLogger_cfi") @@ -42,6 +44,16 @@ def repackProcess(**args): fileNames = cms.untracked.vstring() ) + defaultDataTier = "RAW" + + # Should we default to something if dataTier arg isn't provided? + dataTier = args.get('dataTier', defaultDataTier) + eventContent = RAWEventContent + if dataTier == "HLTSCOUT": + eventContent = HLTSCOUTEventContent + elif dataTier == "L1SCOUT": + eventContent = L1SCOUTEventContent + outputs = args.get('outputs', []) if len(outputs) > 0: @@ -55,12 +67,13 @@ def repackProcess(**args): outputModule = cms.OutputModule( "PoolOutputModule", - compressionAlgorithm=copy.copy(RAWEventContent.compressionAlgorithm), - compressionLevel=copy.copy(RAWEventContent.compressionLevel), + compressionAlgorithm=copy.copy(eventContent.compressionAlgorithm), + compressionLevel=copy.copy(eventContent.compressionLevel), fileName = cms.untracked.string("%s.root" % moduleLabel) ) - outputModule.dataset = cms.untracked.PSet(dataTier = cms.untracked.string("RAW")) + + outputModule.dataset = cms.untracked.PSet(dataTier = cms.untracked.string(dataTier)) if maxSize != None: outputModule.maxSize = cms.untracked.int32(maxSize) @@ -75,3 +88,6 @@ def repackProcess(**args): process.outputPath += outputModule return process + + + diff --git a/Configuration/DataProcessing/test/RunRepack.py b/Configuration/DataProcessing/test/RunRepack.py index 2004cea83e88e..dac4c8c725a86 100644 --- a/Configuration/DataProcessing/test/RunRepack.py +++ b/Configuration/DataProcessing/test/RunRepack.py @@ -18,21 +18,28 @@ class RunRepack: def __init__(self): self.selectEvents = None self.inputLFN = None + self.dataTier = None def __call__(self): if self.inputLFN == None: msg = "No --lfn specified" raise RuntimeError(msg) + allowedDataTiers = ["RAW", "HLTSCOUT", "L1SCOUT"] + if self.dataTier == None: + self.dataTier = "RAW" + elif self.dataTier not in allowedDataTiers: + msg = f"{self.dataTier} isn't an allowed datatier for repacking. Allowed data tiers: {allowedDataTiers}" + raise RuntimeError(msg) outputs = [] - outputs.append( { 'moduleLabel' : "write_PrimDS1_RAW" } ) - outputs.append( { 'moduleLabel' : "write_PrimDS2_RAW" } ) + outputs.append( { 'moduleLabel' : f"write_PrimDS1_{self.dataTier}" } ) + outputs.append( { 'moduleLabel' : f"write_PrimDS2_{self.dataTier}" } ) if self.selectEvents != None: outputs[0]['selectEvents'] = self.selectEvents.split(',') outputs[1]['selectEvents'] = self.selectEvents.split(',') try: - process = repackProcess(outputs = outputs) + process = repackProcess(outputs = outputs, dataTier = self.dataTier) except Exception as ex: msg = "Error creating process for Repack:\n" msg += str(ex) @@ -54,7 +61,7 @@ def __call__(self): if __name__ == '__main__': - valid = ["select-events=", "lfn="] + valid = ["select-events=", "lfn=", "data-tier="] usage = \ """ @@ -63,9 +70,10 @@ def __call__(self): Where options are: --select-events (option, event selection based on trigger paths) --lfn=/store/input/lfn + --data-tier=RAW|HLTSCOUT|L1SCOUT Example: -python RunRepack.py --select-events HLT:path1,HLT:path2 --lfn /store/whatever +python RunRepack.py --select-events HLT:path1,HLT:path2 --lfn /store/whatever --data-tier RAW|HLTSCOUT|L1SCOUT """ try: @@ -83,5 +91,9 @@ def __call__(self): repackinator.selectEvents = arg if opt == "--lfn" : repackinator.inputLFN = arg + if opt == "--data-tier" : + repackinator.dataTier = arg repackinator() + + diff --git a/Configuration/EventContent/python/EventContent_cff.py b/Configuration/EventContent/python/EventContent_cff.py index 6412b106d654f..2724637e1fe24 100644 --- a/Configuration/EventContent/python/EventContent_cff.py +++ b/Configuration/EventContent/python/EventContent_cff.py @@ -184,6 +184,30 @@ def SwapKeepAndDrop(l): 'keep DetIds_hltSiStripRawToDigi_*_*' ]) +# +# HLTSCOUT Data Tier definition +# +# +HLTSCOUTEventContent = cms.PSet( + outputCommands = cms.untracked.vstring('drop *'), + splitLevel = cms.untracked.int32(0), + compressionAlgorithm=cms.untracked.string("LZMA"), + compressionLevel=cms.untracked.int32(4) +) +HLTSCOUTEventContent.outputCommands.extend(HLTriggerRAW.outputCommands) + +# +# L1SCOUT Data Tier definition +# +# +L1SCOUTEventContent = cms.PSet( + outputCommands = cms.untracked.vstring('drop *'), + splitLevel = cms.untracked.int32(0), + compressionAlgorithm=cms.untracked.string("LZMA"), + compressionLevel=cms.untracked.int32(4) +) +L1SCOUTEventContent.outputCommands.extend(L1TriggerRAW.outputCommands) + # # # HLTONLY Data Tier definition @@ -945,3 +969,4 @@ def SwapKeepAndDrop(l): fastSim.toModify(_entry, outputCommands = _entry.outputCommands + fastSimEC.dropSimDigis) for _entry in [MINIAODEventContent, MINIAODSIMEventContent]: fastSim.toModify(_entry, outputCommands = _entry.outputCommands + fastSimEC.dropPatTrigger) +