Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-13 02:58:35

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 """
0004 runs the Phase2 HLT validation on a given input file. Note it just reads the trigger event and gen info 
0005 so all the GTs, services, eras are either mostly irrelavent and probably just should be removed
0006 """
0007 
0008 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0009 
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 options = VarParsing.VarParsing ('analysis') 
0012 options.register('hltProcessName', 'HLT', VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "HLT process name to validate")
0013 options.register('sampleLabel', '', VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "label for the sample (used in legend normally)")
0014 options.parseArguments()
0015 
0016 
0017 process = cms.Process('HLTVal',Phase2C17I13M9)
0018 
0019 # import of standard configurations
0020 process.load('Configuration.StandardSequences.Services_cff')
0021 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0022 process.load('FWCore.MessageService.MessageLogger_cfi')
0023 process.load('Configuration.EventContent.EventContent_cff')
0024 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0025 process.load('Configuration.Geometry.GeometryExtended2026D98Reco_cff')
0026 process.load('Configuration.StandardSequences.MagneticField_cff')
0027 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0028 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0029 process.load("DQMServices.Core.DQM_cfg")
0030 process.load("DQMServices.Core.DQMStore_cfg")
0031 process.load("DQMServices.Components.DQMEnvironment_cfi")
0032 process.load("DQMServices.Components.MEtoEDMConverter_cff")
0033 process.MessageLogger.cerr.FwkReport = cms.untracked.PSet(
0034     reportEvery = cms.untracked.int32(1000),
0035     limit = cms.untracked.int32(10000000)
0036 )
0037 process.maxEvents = cms.untracked.PSet(
0038     input = cms.untracked.int32(-1),
0039     output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
0040 )
0041 
0042 # Input source
0043 process.source = cms.Source("PoolSource",
0044     dropDescendantsOfDroppedBranches = cms.untracked.bool(False),
0045     fileNames = cms.untracked.vstring('file:ZPrime_RAW.root'),
0046     inputCommands = cms.untracked.vstring(),
0047     secondaryFileNames = cms.untracked.vstring()
0048 )
0049 import subprocess
0050 import json
0051 process.source.fileNames = cms.untracked.vstring()
0052 for filename in options.inputFiles:
0053     if filename.startswith("dbs:"):
0054         dataset = filename.replace("dbs:","")
0055         out,err = subprocess.Popen(["dasgoclient","--query",f"file dataset={dataset}","--json"],stdout=subprocess.PIPE,stderr=subprocess.PIPE,universal_newlines=True).communicate()
0056         if err:
0057             print(err)
0058         else:
0059             out_json = json.loads(out)        
0060             for f in out_json:
0061                 process.source.fileNames.append(f["file"][0]["name"])
0062     else:
0063         process.source.fileNames.append(filename)
0064 
0065 
0066 process.options = cms.untracked.PSet(
0067     IgnoreCompletely = cms.untracked.vstring(),
0068     Rethrow = cms.untracked.vstring(),
0069     TryToContinue = cms.untracked.vstring(),
0070     accelerators = cms.untracked.vstring('*'),
0071     allowUnscheduled = cms.obsolete.untracked.bool,
0072     canDeleteEarly = cms.untracked.vstring(),
0073     deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
0074     dumpOptions = cms.untracked.bool(False),
0075     emptyRunLumiMode = cms.obsolete.untracked.string,
0076     eventSetup = cms.untracked.PSet(
0077         forceNumberOfConcurrentIOVs = cms.untracked.PSet(
0078             allowAnyLabel_=cms.required.untracked.uint32
0079         ),
0080         numberOfConcurrentIOVs = cms.untracked.uint32(0)
0081     ),
0082     fileMode = cms.untracked.string('FULLMERGE'),
0083     forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
0084     holdsReferencesToDeleteEarly = cms.untracked.VPSet(),
0085     makeTriggerResults = cms.obsolete.untracked.bool,
0086     modulesToCallForTryToContinue = cms.untracked.vstring(),
0087     modulesToIgnoreForDeleteEarly = cms.untracked.vstring(),
0088     numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
0089     numberOfConcurrentRuns = cms.untracked.uint32(1),
0090     numberOfStreams = cms.untracked.uint32(0),
0091     numberOfThreads = cms.untracked.uint32(1),
0092     printDependencies = cms.untracked.bool(False),
0093     sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
0094     throwIfIllegalParameter = cms.untracked.bool(True),
0095     wantSummary = cms.untracked.bool(False)
0096 )
0097 
0098 # Output definition
0099 
0100 from Configuration.AlCa.GlobalTag import GlobalTag
0101 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T25', '')
0102 #Setup FWK for multithreaded
0103 process.options.numberOfThreads = 1
0104 process.options.numberOfStreams = 0
0105 
0106 # customisation of the process.
0107 
0108 # Automatic addition of the customisation function from SLHCUpgradeSimulations.Configuration.aging
0109 from SLHCUpgradeSimulations.Configuration.aging import customise_aging_1000 
0110 
0111 #call to customisation function customise_aging_1000 imported from SLHCUpgradeSimulations.Configuration.aging
0112 process = customise_aging_1000(process)
0113 process.schedule = cms.Schedule()
0114 
0115 import Validation.HLTrigger.hltvalcust as hltvalcust
0116 process = hltvalcust.add_hlt_validation_phaseII(process,options.hltProcessName,options.sampleLabel)
0117 
0118 process.DQMoutput = cms.OutputModule("DQMRootOutputModule",
0119     dataset = cms.untracked.PSet(
0120         dataTier = cms.untracked.string('DQMIO'),
0121         filterName = cms.untracked.string('')
0122     ),
0123     fileName = cms.untracked.string(options.outputFile),
0124     outputCommands = process.DQMEventContent.outputCommands,
0125     splitLevel = cms.untracked.int32(0)
0126 )
0127 
0128 process.DQMoutput_step = cms.EndPath(process.DQMoutput)
0129 process.schedule.extend([process.DQMoutput_step])
0130