Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add HLTFilter template HLTL1TMatchedJetsVBFFilter #42543

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

missirol
Copy link
Contributor

@missirol missirol commented Aug 11, 2023

PR description:

This PR adds new HLTFilters which are meant to be used for an update of the VBF-parking triggers of the current HLT pp menu.

The new HLTFilters are instantiations of the plugin template HLTL1TMatchedJetsVBFFilter, which serves as an improved version of the EDProducer template L1TJetsMatching.

For further details, see CMSHLT-2887.

Attn: @portalesHEP

PR validation:

Compared the results of the latest GRun menu before and after customising the relevant Paths with the introduction of instances of HLTL1TMatchedPFJetsVBFFilter. The trigger results [2] of the manual tests in [1] are as expected.

[1]

#!/bin/bash

jobLabel=hlt1
if [ ! -f "${jobLabel}".py ]; then
  hltGetConfiguration \
   /dev/CMSSW_13_0_0/GRun \
   --paths HLT_VBF_DiPFJet*,-HLT_VBF_DiPFJet*Detajj*,HLTriggerFinalPath \
   --max-events 1000 \
   --output minimal --no-prescale \
   --mc --globaltag 126X_mcRun3_2023_forPU65_v5 \
   --input /store/mc/Run3Winter23Digi/VBFHHto2B2Tau_CV-1_C2V-2_C3-1_TuneCP5_13p6TeV_madgraph-pythia8/GEN-SIM-RAW/126X_mcRun3_2023_forPU65_v1-v2/40000/a94d16bb-8df9-4eab-8c89-a5594aef6a48.root \
   --eras Run3 --l1-emulator FullMC --l1 L1Menu_Collisions2023_v1_3_0_xml \
   > "${jobLabel}".py
  cat <<EOF >> "${jobLabel}".py
process.options.numberOfThreads = 1
process.options.numberOfStreams = 0
EOF
  echo -e "\n=== ${jobLabel} ==="
  edmConfigDump "${jobLabel}".py > "${jobLabel}"_dump.py && \
   cmsRun "${jobLabel}".py &> "${jobLabel}".log && \
   mv output.root "${jobLabel}".root && \
   grep TrigRepor "${jobLabel}".log | head -20
else
  echo "Skipping ${jobLabel}"
fi

# customise using the new filter without changing the cuts in any HLT Paths (expect same exact trigger results)
jobLabel=hlt2
if [ ! -f "${jobLabel}".py ]; then
  cp hlt1.py "${jobLabel}".py
  cat <<EOF >> "${jobLabel}".py
from HLTrigger.JetMET.hltL1TMatchedPFJetsVBFFilter_cfi import hltL1TMatchedPFJetsVBFFilter as _hltL1TMatchedPFJetsVBFFilter

def _redefineLastFilterOfVBFParkingPaths(process, producerLabel, filterLabels):

    mod_p = getattr(process, producerLabel)

    for filterLabel in filterLabels:
        mod_f = getattr(process, filterLabel)

        setattr(process, filterLabel, _hltL1TMatchedPFJetsVBFFilter.clone(
            src = mod_p.JetSrc,
            maxJetDeltaR = mod_p.matchingR,
            l1tJetRefs = mod_p.L1JetTrigger,
            algorithm = mod_p.matchingMode,
            minPt1 = mod_p.pt1Min,
            minPt2 = mod_p.pt2Min,
            minPt3 = mod_p.pt3Min,
            minInvMass = mod_p.mjjMin,
            minNJets = mod_f.MinN,
            maxNJets = mod_f.MinN
        ))

    delattr(process, producerLabel)

    return process

_fooDict = {
    'hltL1PFJetsMatchingVBFinclMedium1050': ['hltL1PFJetCategoriesVBFinclMedium1050', 'hltL1PFJetCategoriesVBFinclMedium1050TripleJet'],
    'hltL1PFJetsMatchingVBFinclTight1050': ['hltL1PFJetCategoriesVBFinclTight1050', 'hltL1PFJetCategoriesVBFinclTight1050TripleJet'],
    'hltL1TPFJetsMatchingVBFDijetTight650': ['hltL1PFJetCategoriesVBFdijetTightQuadjet650', 'hltL1PFJetCategoriesVBFdijetTightFivejet650', 'hltL1PFJetCategoriesVBFdijetTightSixjet650'],
    'hltL1PFJetsMatchingVBFMETTight550': ['hltL1PFJetCategoriesVBFMETTight550', 'hltL1PFJetCategoriesVBFMETTight550Triplejet'],
    'hltL1PFJetsMatchingVBFMuTight650': ['hltL1PFJetCategoriesVBFMuTight650', 'hltL1PFJetCategoriesVBFMuTight650Triplejet'],
}

for key,val in _fooDict.items():
    process = _redefineLastFilterOfVBFParkingPaths(process, key, val)
EOF
  echo -e "\n=== ${jobLabel} ==="
  edmConfigDump "${jobLabel}".py > "${jobLabel}"_dump.py && \
   cmsRun "${jobLabel}".py &> "${jobLabel}".log && \
   mv output.root "${jobLabel}".root && \
   grep TrigRepor "${jobLabel}".log | head -20
else
  echo "Skipping ${jobLabel}"
fi

# customise fully (new filter, "merge" paths using maxNJets=-1),
# expect remaining Paths to the logical OR of the old ones (hlt1)
jobLabel=hlt3
if [ ! -f "${jobLabel}".py ]; then
  cp hlt1.py "${jobLabel}".py
  cat <<EOF >> "${jobLabel}".py
from HLTrigger.JetMET.hltL1TMatchedPFJetsVBFFilter_cfi import hltL1TMatchedPFJetsVBFFilter as _hltL1TMatchedPFJetsVBFFilter

def _redefineLastFilterOfVBFParkingPaths(process, producerLabel, filterLabels):

    mod_p = getattr(process, producerLabel)

    for filterLabel in filterLabels:
        mod_f = getattr(process, filterLabel)

        setattr(process, filterLabel, _hltL1TMatchedPFJetsVBFFilter.clone(
            src = mod_p.JetSrc,
            maxJetDeltaR = mod_p.matchingR,
            l1tJetRefs = mod_p.L1JetTrigger,
            algorithm = mod_p.matchingMode,
            minPt1 = mod_p.pt1Min,
            minPt2 = mod_p.pt2Min,
            minPt3 = mod_p.pt3Min,
            minInvMass = mod_p.mjjMin,
            minNJets = mod_f.MinN,
            maxNJets = -1
        ))

    delattr(process, producerLabel)

    return process

_fooDict = {
    'hltL1PFJetsMatchingVBFinclMedium1050': ['hltL1PFJetCategoriesVBFinclMedium1050'],
    'hltL1PFJetsMatchingVBFinclTight1050': ['hltL1PFJetCategoriesVBFinclTight1050'],
    'hltL1TPFJetsMatchingVBFDijetTight650': ['hltL1PFJetCategoriesVBFdijetTightQuadjet650'],
    'hltL1PFJetsMatchingVBFMETTight550': ['hltL1PFJetCategoriesVBFMETTight550'],
    'hltL1PFJetsMatchingVBFMuTight650': ['hltL1PFJetCategoriesVBFMuTight650'],
}

for key,val in _fooDict.items():
    process = _redefineLastFilterOfVBFParkingPaths(process, key, val)

for foo in [foo for foo in process.paths_() if '_TriplePFJet_v' in foo or 'FiveJet_v' in foo or 'SixJet_v' in foo]:
    delattr(process, foo)
EOF
  echo -e "\n=== ${jobLabel} ==="
  edmConfigDump "${jobLabel}".py > "${jobLabel}"_dump.py && \
   cmsRun "${jobLabel}".py &> "${jobLabel}".log && \
   mv output.root "${jobLabel}".root && \
   grep TrigRepor "${jobLabel}".log | head -20
else
  echo "Skipping ${jobLabel}"
fi

[2]

=== hlt1 ===
TrigReport ---------- Event  Summary ------------
TrigReport Events total = 1000 passed = 607 failed = 393
TrigReport ---------- Path   Summary ------------
TrigReport  Trig Bit#   Executed     Passed     Failed      Error Name
TrigReport     1    0       1000        318        682          0 HLT_VBF_DiPFJet110_40_Mjj1050_v1
TrigReport     1    1       1000         62        938          0 HLT_VBF_DiPFJet110_40_Mjj1050_TriplePFJet_v1
TrigReport     1    2       1000        289        711          0 HLT_VBF_DiPFJet125_45_Mjj1050_v1
TrigReport     1    3       1000         69        931          0 HLT_VBF_DiPFJet125_45_Mjj1050_TriplePFJet_v1
TrigReport     1    4       1000        379        621          0 HLT_VBF_DiPFJet75_45_Mjj650_DiPFJet60_JetMatchingQuadJet_v1
TrigReport     1    5       1000          0       1000          0 HLT_VBF_DiPFJet75_45_Mjj650_DiPFJet60_JetMatchingFiveJet_v1
TrigReport     1    6       1000          2        998          0 HLT_VBF_DiPFJet75_45_Mjj650_DiPFJet60_JetMatchingSixJet_v1
TrigReport     1    7       1000        341        659          0 HLT_VBF_DiPFJet80_45_Mjj550_PFMETNoMu85_v1
TrigReport     1    8       1000         25        975          0 HLT_VBF_DiPFJet80_45_Mjj550_PFMETNoMu85_TriplePFJet_v1
TrigReport     1    9       1000        172        828          0 HLT_VBF_DiPFJet95_45_Mjj650_Mu3_TrkIsoVVL_v1
TrigReport     1   10       1000         16        984          0 HLT_VBF_DiPFJet95_45_Mjj650_Mu3_TrkIsoVVL_TriplePFJet_v1
TrigReport     1   11       1000        264        736          0 HLT_VBF_DiPFJet45_Mjj550_MediumDeepTauPFTauHPS45_L2NN_eta2p1_v1
TrigReport     1   12       1000        183        817          0 HLT_VBF_DiPFJet50_Mjj550_Photon22_v1
TrigReport     1   13       1000         83        917          0 HLT_VBF_DiPFJet50_Mjj500_Ele22_eta2p1_WPTight_Gsf_v1
TrigReport     1   14       1000          0       1000          0 HLTriggerFinalPath
TrigReport -------End-Path   Summary ------------

=== hlt2 ===
TrigReport ---------- Event  Summary ------------
TrigReport Events total = 1000 passed = 607 failed = 393
TrigReport ---------- Path   Summary ------------
TrigReport  Trig Bit#   Executed     Passed     Failed      Error Name
TrigReport     1    0       1000        318        682          0 HLT_VBF_DiPFJet110_40_Mjj1050_v1
TrigReport     1    1       1000         62        938          0 HLT_VBF_DiPFJet110_40_Mjj1050_TriplePFJet_v1
TrigReport     1    2       1000        289        711          0 HLT_VBF_DiPFJet125_45_Mjj1050_v1
TrigReport     1    3       1000         69        931          0 HLT_VBF_DiPFJet125_45_Mjj1050_TriplePFJet_v1
TrigReport     1    4       1000        379        621          0 HLT_VBF_DiPFJet75_45_Mjj650_DiPFJet60_JetMatchingQuadJet_v1
TrigReport     1    5       1000          0       1000          0 HLT_VBF_DiPFJet75_45_Mjj650_DiPFJet60_JetMatchingFiveJet_v1
TrigReport     1    6       1000          2        998          0 HLT_VBF_DiPFJet75_45_Mjj650_DiPFJet60_JetMatchingSixJet_v1
TrigReport     1    7       1000        341        659          0 HLT_VBF_DiPFJet80_45_Mjj550_PFMETNoMu85_v1
TrigReport     1    8       1000         25        975          0 HLT_VBF_DiPFJet80_45_Mjj550_PFMETNoMu85_TriplePFJet_v1
TrigReport     1    9       1000        172        828          0 HLT_VBF_DiPFJet95_45_Mjj650_Mu3_TrkIsoVVL_v1
TrigReport     1   10       1000         16        984          0 HLT_VBF_DiPFJet95_45_Mjj650_Mu3_TrkIsoVVL_TriplePFJet_v1
TrigReport     1   11       1000        264        736          0 HLT_VBF_DiPFJet45_Mjj550_MediumDeepTauPFTauHPS45_L2NN_eta2p1_v1
TrigReport     1   12       1000        183        817          0 HLT_VBF_DiPFJet50_Mjj550_Photon22_v1
TrigReport     1   13       1000         83        917          0 HLT_VBF_DiPFJet50_Mjj500_Ele22_eta2p1_WPTight_Gsf_v1
TrigReport     1   14       1000          0       1000          0 HLTriggerFinalPath
TrigReport -------End-Path   Summary ------------

=== hlt3 ===
TrigReport ---------- Event  Summary ------------
TrigReport Events total = 1000 passed = 607 failed = 393
TrigReport ---------- Path   Summary ------------
TrigReport  Trig Bit#   Executed     Passed     Failed      Error Name
TrigReport     1    0       1000        380        620          0 HLT_VBF_DiPFJet110_40_Mjj1050_v1
TrigReport     1    1       1000        358        642          0 HLT_VBF_DiPFJet125_45_Mjj1050_v1
TrigReport     1    2       1000        381        619          0 HLT_VBF_DiPFJet75_45_Mjj650_DiPFJet60_JetMatchingQuadJet_v1
TrigReport     1    3       1000        366        634          0 HLT_VBF_DiPFJet80_45_Mjj550_PFMETNoMu85_v1
TrigReport     1    4       1000        188        812          0 HLT_VBF_DiPFJet95_45_Mjj650_Mu3_TrkIsoVVL_v1
TrigReport     1    5       1000        264        736          0 HLT_VBF_DiPFJet45_Mjj550_MediumDeepTauPFTauHPS45_L2NN_eta2p1_v1
TrigReport     1    6       1000        183        817          0 HLT_VBF_DiPFJet50_Mjj550_Photon22_v1
TrigReport     1    7       1000         83        917          0 HLT_VBF_DiPFJet50_Mjj500_Ele22_eta2p1_WPTight_Gsf_v1
TrigReport     1    8       1000          0       1000          0 HLTriggerFinalPath
TrigReport -------End-Path   Summary ------------
TrigReport  Trig Bit#   Executed     Passed     Failed      Error Name
TrigReport     0    0       1000       1000          0          0 @finalPath
TrigReport ---------- Modules in Path: HLT_VBF_DiPFJet110_40_Mjj1050_v1 ------------
TrigReport  Trig Bit#    Visited     Passed     Failed      Error Name
TrigReport     1    0       1000       1000          0          0 hltTriggerType
TrigReport     1    1       1000       1000          0          0 hltGtStage2Digis

If this PR is a backport, please specify the original PR and why you need to backport that PR. If this PR will be backported, please specify to which release cycle the backport is meant for:

CMSSW_13_2_X

Not needed for ppRef nor HIon, but useful to start the cleanup of the HLT pp menu ahead of 2024.

@cmsbuild cmsbuild added this to the CMSSW_13_3_X milestone Aug 11, 2023
@missirol missirol changed the title add HLTFilter template HLTL1TMatchedPFJetsVBFFilter add HLTFilter template HLTL1TMatchedJetsVBFFilter Aug 11, 2023
@missirol missirol force-pushed the devel_hltL1TMatchedPFJetsVBFFilter branch from 21aa99c to 9b288f5 Compare August 11, 2023 10:14
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-42543/36557

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @missirol (Marino Missiroli) for master.

It involves the following packages:

  • HLTrigger/JetMET (hlt)

@cmsbuild, @missirol, @Martin-Grunewald can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @silviodonato this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@missirol
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1f1596/34228/summary.html
COMMIT: 9b288f5
CMSSW: CMSSW_13_3_X_2023-08-10-2300/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/42543/34228/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 11 lines from the logs
  • Reco comparison results: 6 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3150947
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3150922
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 207 log files, 159 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-42543/36566

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

Pull request #42543 was updated. @cmsbuild, @missirol, @Martin-Grunewald can you please check and sign again.

@missirol
Copy link
Contributor Author

please test

Minor technical changes in the last push. This should be the final version.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1f1596/34243/summary.html
COMMIT: d5cdd00
CMSSW: CMSSW_13_3_X_2023-08-11-1100/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/42543/34243/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 16 lines from the logs
  • Reco comparison results: 10 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3150947
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3150919
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 207 log files, 159 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@missirol
Copy link
Contributor Author

+hlt

Addition of HLTFilters not used yet in any central workflow, and validated privately (see description).

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

+1

int i2 = -1;
double m2jj_max = -1;

for (unsigned int i = 0; i < jetIndices.size() - 1; i++) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of size() - 1 here is a bug, missed during the integration of this PR, spotted in #43300 (comment), and fixed in #43324 (14_0_X), #43325 (13_3_X) and #43326 (13_2_X)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants