Skip to content

Commit

Permalink
Merge pull request #43060 from nurfikri89/from133X_202310181100_nano_…
Browse files Browse the repository at this point in the history
…Addpthatmax

[NanoAOD] Add pthatmax variable
  • Loading branch information
cmsbuild authored Oct 27, 2023
2 parents 0d6cd59 + 9eb9e52 commit 3c7ac38
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PhysicsTools/NanoAOD/plugins/NPUTablesProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class NPUTablesProducer : public edm::global::EDProducer<> {
out.addColumnValue<float>("pudensity", pudensity, "PU vertices / mm");
out.addColumnValue<float>("gpudensity", gpudensity, "Generator-level PU vertices / mm");
if (savePtHatMax_) {
out.addColumnValue<float>("pthatmax", pthatmax, "Maximum pt-hat");
out.addColumnValue<float>("pthatmax", pthatmax, "Maximum pt-hat", 10);
}
}

Expand Down
6 changes: 5 additions & 1 deletion PhysicsTools/NanoAOD/python/globals_cff.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import FWCore.ParameterSet.Config as cms
from PhysicsTools.NanoAOD.common_cff import *
from PhysicsTools.NanoAOD.nano_eras_cff import *
from PhysicsTools.NanoAOD.globalVariablesTableProducer_cfi import globalVariablesTableProducer
from PhysicsTools.NanoAOD.simpleBeamspotFlatTableProducer_cfi import simpleBeamspotFlatTableProducer
from PhysicsTools.NanoAOD.simpleGenEventFlatTableProducer_cfi import simpleGenEventFlatTableProducer
Expand Down Expand Up @@ -34,7 +35,10 @@
src = cms.InputTag("slimmedAddPileupInfo"),
pvsrc = cms.InputTag("offlineSlimmedPrimaryVertices"),
zbins = cms.vdouble( [0.0,1.7,2.6,3.0,3.5,4.2,5.2,6.0,7.5,9.0,12.0] ),
savePtHatMax = cms.bool(False),
savePtHatMax = cms.bool(True),
)
(run2_nanoAOD_ANY | run3_nanoAOD_122 | run3_nanoAOD_124).toModify(
puTable, savePtHatMax=False
)

genTable = simpleGenEventFlatTableProducer.clone(
Expand Down
11 changes: 11 additions & 0 deletions PhysicsTools/NanoAOD/python/nanoDQM_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ def _match(name):
plots = _SubJet_EarlyRun3_plots
)


_Pileup_pre13X_plots = cms.VPSet()
for plot in nanoDQM.vplots.Pileup.plots:
if 'pthatmax' not in plot.name.value():
_Pileup_pre13X_plots.append(plot)

(run2_nanoAOD_ANY | run3_nanoAOD_122 | run3_nanoAOD_124).toModify(
nanoDQM.vplots.Pileup,
plots = _Pileup_pre13X_plots
)

## MC
nanoDQMMC = nanoDQM.clone()
nanoDQMMC.vplots.Electron.sels.Prompt = cms.string("genPartFlav == 1")
Expand Down
1 change: 1 addition & 0 deletions PhysicsTools/NanoAOD/python/nanoDQM_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@
Plot1D('pudensity', 'pudensity', 5, -0.5, 4.5, 'PU vertices / mm'),
Plot1D('sumEOOT', 'sumEOOT', 20, 0, 800, 'number of early out of time pileup'),
Plot1D('sumLOOT', 'sumLOOT', 20, 0, 300, 'number of late out of time pileup'),
Plot1D('pthatmax','pthatmax',20, 0, 400, 'Maximum pt-hat'),
)
),
PuppiMET = cms.PSet(
Expand Down

0 comments on commit 3c7ac38

Please sign in to comment.