-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40536 from missirol/devel_dqmHLTFiltersDQMonitor_…
…126X remove access to bare ROOT objects in `HLTFiltersDQMonitor` [`12_6_X`]
- Loading branch information
Showing
16 changed files
with
627 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/ServiceRegistry"/> | ||
<use name="CommonTools/CandUtils"/> | ||
<use name="CommonTools/Egamma"/> | ||
<use name="CommonTools/TriggerUtils"/> | ||
<use name="CommonTools/Utils"/> | ||
<use name="DQMOffline/Trigger"/> | ||
<use name="DQMServices/Core"/> | ||
<use name="DataFormats/BTauReco"/> | ||
<use name="DataFormats/Common"/> | ||
<use name="DataFormats/EgammaCandidates"/> | ||
<use name="DataFormats/HLTReco"/> | ||
<use name="DataFormats/JetReco"/> | ||
<use name="DataFormats/METReco"/> | ||
<use name="DataFormats/MuonReco"/> | ||
<use name="DataFormats/EgammaCandidates"/> | ||
<use name="DataFormats/TrackReco"/> | ||
<use name="DataFormats/BTauReco"/> | ||
<use name="DataFormats/TauReco"/> | ||
<use name="DataFormats/METReco"/> | ||
<use name="DataFormats/JetReco"/> | ||
<use name="CommonTools/Egamma"/> | ||
<use name="RecoVertex/KalmanVertexFit"/> | ||
<use name="HLTrigger/HLTcore"/> | ||
<use name="DQMServices/Core"/> | ||
<use name="CommonTools/CandUtils"/> | ||
<use name="CommonTools/Utils"/> | ||
<use name="CommonTools/TriggerUtils"/> | ||
<use name="DataFormats/TrackReco"/> | ||
<use name="DataFormats/VertexReco"/> | ||
<use name="DQMOffline/Trigger"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/MessageLogger"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/ServiceRegistry"/> | ||
<use name="FWCore/Utilities"/> | ||
<use name="HLTrigger/HLTcore"/> | ||
<use name="RecoVertex/KalmanVertexFit"/> | ||
<use name="TrackingTools/TransientTrack"/> | ||
<use name="root"/> | ||
<use name="roofit"/> | ||
<use name="boost"/> | ||
<use name="roofit"/> | ||
<use name="root"/> | ||
<library file="*.cc" name="DQMOfflineTriggerPlugins"> | ||
<flags EDM_PLUGIN="1"/> | ||
</library> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from DQMOffline.Trigger.hltFiltersDQMonitor_cfi import * | ||
hltFiltersDQMonitor.triggerSummaryAOD = 'hltTriggerSummaryAOD::HLT' | ||
hltFiltersDQMonitor.triggerResults = 'TriggerResults::HLT' | ||
from DQMOffline.Trigger.dqmHLTFiltersDQMonitor_cfi import * | ||
dqmHLTFiltersDQMonitor.triggerEvent = 'hltTriggerSummaryAOD::HLT' | ||
dqmHLTFiltersDQMonitor.triggerResults = 'TriggerResults::HLT' | ||
|
||
from DQMOffline.Trigger.HLTEventInfoClient_cfi import * | ||
|
||
hltDqmOffline = cms.Sequence(hltFiltersDQMonitor*hltEventInfoClient) | ||
hltDqmOffline = cms.Sequence( dqmHLTFiltersDQMonitor * hltEventInfoClient ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
## CLI parser | ||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser( | ||
prog = 'cmsRun '+sys.argv[0]+' --', | ||
description = 'Configuration file to run the DQMFileSaver on DQMIO input files.', | ||
formatter_class = argparse.ArgumentDefaultsHelpFormatter | ||
) | ||
|
||
parser.add_argument('-t', '--nThreads', type = int, help = 'Number of threads', | ||
default = 4) | ||
|
||
parser.add_argument('-s', '--nStreams', type = int, help = 'Number of EDM streams', | ||
default = 0) | ||
|
||
parser.add_argument('-i', '--inputFiles', nargs = '+', help = 'List of DQMIO input files', | ||
default = ['file:DQMIO.root']) | ||
|
||
argv = sys.argv[:] | ||
if '--' in argv: | ||
argv.remove('--') | ||
args, unknown = parser.parse_known_args(argv) | ||
|
||
# Process | ||
process = cms.Process('HARVESTING') | ||
|
||
process.options.numberOfThreads = args.nThreads | ||
process.options.numberOfStreams = args.nStreams | ||
process.options.numberOfConcurrentLuminosityBlocks = 1 | ||
|
||
# Source (DQM input) | ||
process.source = cms.Source('DQMRootSource', | ||
fileNames = cms.untracked.vstring(args.inputFiles) | ||
) | ||
|
||
# DQMStore (Service) | ||
process.load('DQMServices.Core.DQMStore_cfi') | ||
|
||
# MessageLogger (Service) | ||
process.load('FWCore.MessageLogger.MessageLogger_cfi') | ||
|
||
# Output module (file in ROOT format) | ||
from DQMServices.Components.DQMFileSaver_cfi import dqmSaver as _dqmSaver | ||
process.dqmSaver = _dqmSaver.clone( | ||
workflow = '/DQMOffline/Trigger/'+process.name_() | ||
) | ||
|
||
# EndPath | ||
process.endp = cms.EndPath( | ||
process.dqmSaver | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Unit test: `testHLTFiltersDQMonitor` | ||
------------------------------------ | ||
|
||
Test of the DQM plugin `HLTFiltersDQMonitor`. | ||
|
||
- To run the test via `scram` | ||
```sh | ||
scram build runtests_testHLTFiltersDQMonitor | ||
``` | ||
|
||
- To run the test without `scram` | ||
```sh | ||
LOCALTOP="${CMSSW_BASE}" "${CMSSW_BASE}"/src/DQMOffline/Trigger/test/testHLTFiltersDQMonitor.sh | ||
``` | ||
|
||
- To show info on command-line arguments of `testHLTFiltersDQMonitor_cfg.py` | ||
```sh | ||
python3 "${CMSSW_BASE}"/src/DQMOffline/Trigger/test/testHLTFiltersDQMonitor_cfg.py -h | ||
``` | ||
|
||
- To execute cmsRun with `testHLTFiltersDQMonitor_cfg.py` (example) | ||
```sh | ||
cmsRun "${CMSSW_BASE}"/src/DQMOffline/Trigger/test/testHLTFiltersDQMonitor_cfg.py -- -t 4 -s 0 -o tmp.root -n 100 | ||
``` | ||
|
||
- To create a bare ROOT file from the DQMIO output of `testHLTFiltersDQMonitor_cfg.py`, | ||
run the harvesting step as follows | ||
```sh | ||
cmsRun "${CMSSW_BASE}"/src/DQMOffline/Trigger/test/harvesting_cfg.py -- -i file:tmp.root | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# Pass in name and status | ||
function die { | ||
printf "\n%s: status %s\n" "$1" "$2" | ||
exit $2 | ||
} | ||
|
||
# run test job | ||
TESTDIR="${LOCALTOP}"/src/DQMOffline/Trigger/test | ||
|
||
cmsRun "${TESTDIR}"/testHLTFiltersDQMonitor_cfg.py -- -t 4 -n 128 \ | ||
|| die "Failure running testHLTFiltersDQMonitor_cfg.py" $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
## CLI parser | ||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser( | ||
prog = 'cmsRun '+sys.argv[0]+' --', | ||
description = 'Configuration file to test of the HLTFiltersDQMonitor plugin.', | ||
formatter_class = argparse.ArgumentDefaultsHelpFormatter | ||
) | ||
|
||
parser.add_argument('-t', '--nThreads', type = int, help = 'Number of threads', | ||
default = 4) | ||
|
||
parser.add_argument('-s', '--nStreams', type = int, help = 'Number of EDM streams', | ||
default = 0) | ||
|
||
parser.add_argument('-i', '--inputFiles', nargs = '+', help = 'List of EDM input files', | ||
default = ['/store/relval/CMSSW_12_6_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/125X_mcRun3_2022_realistic_v3-v1/2580000/2d96539c-b321-401f-b7b2-51884a5d421f.root']) | ||
|
||
parser.add_argument('-n', '--maxEvents', type = int, help = 'Number of input events', | ||
default = 100) | ||
|
||
parser.add_argument('-o', '--outputFile', type = str, help = 'Path to output file in DQMIO format', | ||
default = 'DQMIO.root') | ||
|
||
parser.add_argument('--wantSummary', action = 'store_true', help = 'Value of process.options.wantSummary', | ||
default = False) | ||
|
||
parser.add_argument('-d', '--debugMode', action = 'store_true', help = 'Enable debug info (requires recompiling first with \'USER_CXXFLAGS="-DEDM_ML_DEBUG" scram b\')', | ||
default = False) | ||
|
||
argv = sys.argv[:] | ||
if '--' in argv: | ||
argv.remove('--') | ||
args, unknown = parser.parse_known_args(argv) | ||
|
||
## Process | ||
process = cms.Process('TEST') | ||
|
||
process.options.numberOfThreads = args.nThreads | ||
process.options.numberOfStreams = args.nStreams | ||
process.options.wantSummary = args.wantSummary | ||
process.maxEvents.input = args.maxEvents | ||
|
||
## Source | ||
process.source = cms.Source('PoolSource', | ||
fileNames = cms.untracked.vstring(args.inputFiles), | ||
inputCommands = cms.untracked.vstring( | ||
'drop *', | ||
'keep edmTriggerResults_*_*_*', | ||
'keep triggerTriggerEvent_*_*_*', | ||
'keep triggerTriggerEventWithRefs_*_*_*' | ||
) | ||
) | ||
|
||
## MessageLogger (Service) | ||
process.load('FWCore.MessageLogger.MessageLogger_cfi') | ||
process.MessageLogger.cerr.FwkReport.reportEvery = 1 # only report every Nth event start | ||
process.MessageLogger.cerr.FwkReport.limit = -1 # max number of reported messages (all if -1) | ||
process.MessageLogger.cerr.enableStatistics = False # enable "MessageLogger Summary" message | ||
|
||
## DQMStore (Service) | ||
process.load('DQMServices.Core.DQMStore_cfi') | ||
|
||
## FastTimerService (Service) | ||
from HLTrigger.Timer.FastTimerService_cfi import FastTimerService as _FastTimerService | ||
process.FastTimerService = _FastTimerService.clone( | ||
enableDQM = False, | ||
printEventSummary = False, | ||
printJobSummary = True, | ||
printRunSummary = False, | ||
writeJSONSummary = False | ||
) | ||
process.MessageLogger.FastReport = dict() | ||
|
||
## EventData Modules | ||
from DQMOffline.Trigger.dqmHLTFiltersDQMonitor_cfi import dqmHLTFiltersDQMonitor as _dqmHLTFiltersDQMonitor | ||
process.dqmHLTFiltersDQMonitor = _dqmHLTFiltersDQMonitor.clone( | ||
folderName = 'HLT/Filters', | ||
efficPlotNamePrefix = 'effic_', | ||
triggerResults = 'TriggerResults::HLT', | ||
triggerEvent = 'hltTriggerSummaryAOD::HLT', | ||
triggerEventWithRefs = 'hltTriggerSummaryRAW::HLT' | ||
) | ||
process.MessageLogger.HLTFiltersDQMonitor = dict() | ||
if args.debugMode: | ||
process.MessageLogger.cerr.threshold = 'DEBUG' | ||
process.MessageLogger.debugModules = ['dqmHLTFiltersDQMonitor'] | ||
|
||
## Output Modules | ||
process.dqmOutput = cms.OutputModule('DQMRootOutputModule', | ||
fileName = cms.untracked.string(args.outputFile) | ||
) | ||
|
||
## Path | ||
process.testPath = cms.Path( | ||
process.dqmHLTFiltersDQMonitor | ||
) | ||
|
||
## EndPath | ||
process.testEndPath = cms.EndPath( | ||
process.dqmOutput | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.