Skip to content

Commit

Permalink
Merge pull request cms-sw#23 from erc-asymow/WmassNanoProd_10_6_26
Browse files Browse the repository at this point in the history
"Rebasing" of PRs cms-sw#20 and 22
  • Loading branch information
kdlong committed Dec 16, 2022
2 parents 9a6c375 + ba1f5f4 commit f2472e3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PhysicsTools/NanoAOD/python/generalTracks_cff.py
Expand Up @@ -20,6 +20,9 @@
trackOriginalAlgo = Var('originalAlgo()', 'int', precision=-1, doc='Track original algo enum'),
qualityMask = Var('qualityMask()', 'int', precision=-1, doc='Quality mask of the track.'),
extraIdx = Var('extra().key()', 'int', precision=-1, doc='Index of the TrackExtra in the original collection'),
vx = Var('vx', 'float', precision=-1, doc='Track X position'),
vy = Var('vy', 'float', precision=-1, doc='Track Y position'),
vz = Var('vz', 'float', precision=-1, doc='Track Z position'),
),
)

Expand Down
4 changes: 4 additions & 0 deletions PhysicsTools/NanoAOD/python/muons_cff.py
Expand Up @@ -199,6 +199,9 @@
miniPFRelIso_all = Var("?hasUserFloat('miniIsoAll') ? userFloat('miniIsoAll')/pt : -1",float,doc="mini PF relative isolation, total (with scaled rho*EA PU corrections)"),
pfRelIso03_chg = Var("pfIsolationR03().sumChargedHadronPt/pt",float,doc="PF relative isolation dR=0.3, charged component"),
pfRelIso03_all = Var("(pfIsolationR03().sumChargedHadronPt + max(pfIsolationR03().sumNeutralHadronEt + pfIsolationR03().sumPhotonEt - pfIsolationR03().sumPUPt/2,0.0))/pt",float,doc="PF relative isolation dR=0.3, total (deltaBeta corrections)"),
pfRelIso04_chg = Var("pfIsolationR04().sumChargedHadronPt/pt",float,doc="PF relative isolation dR=0.4, charged component"),
pfRelIso04_neu = Var("pfIsolationR04().sumNeutralHadronEt/pt",float,doc="PF relative isolation dR=0.4, charged component"),
pfRelIso04_pho = Var("pfIsolationR04().sumPhotonEt/pt",float,doc="PF relative isolation dR=0.4, charged component"),
pfRelIso04_all = Var("(pfIsolationR04().sumChargedHadronPt + max(pfIsolationR04().sumNeutralHadronEt + pfIsolationR04().sumPhotonEt - pfIsolationR04().sumPUPt/2,0.0))/pt",float,doc="PF relative isolation dR=0.4, total (deltaBeta corrections)"),
jetRelIso = Var("?userCand('jetForLepJetVar').isNonnull()?(1./userFloat('ptRatio'))-1.:(pfIsolationR04().sumChargedHadronPt + max(pfIsolationR04().sumNeutralHadronEt + pfIsolationR04().sumPhotonEt - pfIsolationR04().sumPUPt/2,0.0))/pt",float,doc="Relative isolation in matched jet (1/ptRatio-1, pfRelIso04_all if no matched jet)",precision=8),
jetPtRelv2 = Var("?userCand('jetForLepJetVar').isNonnull()?userFloat('ptRel'):0",float,doc="Relative momentum of the lepton with respect to the closest jet after subtracting the lepton",precision=8),
Expand Down Expand Up @@ -229,6 +232,7 @@
standaloneEta = Var("? standAloneMuon().isNonnull() ? standAloneMuon().eta() : -99", float, doc = "eta of the standalone muon", precision=14),
standalonePhi = Var("? standAloneMuon().isNonnull() ? standAloneMuon().phi() : -99", float, doc = "phi of the standalone muon", precision=14),
standaloneCharge = Var("? standAloneMuon().isNonnull() ? standAloneMuon().charge() : -99", float, doc = "phi of the standalone muon", precision=14),
standaloneNumberOfValidHits = Var('? standAloneMuon().isNonnull() ? standAloneMuon().numberOfValidHits() : -1', 'int', precision=-1, doc='Number of valid hits in track (standalone chambers)'),
innerTrackAlgo = Var('? innerTrack().isNonnull() ? innerTrack().algo() : -99', 'int', precision=-1, doc='Track algo enum, check DataFormats/TrackReco/interface/TrackBase.h for details.'),
innerTrackOriginalAlgo = Var('? innerTrack().isNonnull() ? innerTrack().originalAlgo() : -99', 'int', precision=-1, doc='Track original algo enum'),
),
Expand Down
3 changes: 3 additions & 0 deletions PhysicsTools/NanoAOD/python/nanoTP_cff.py
Expand Up @@ -66,6 +66,9 @@ def customizeNANOTP(process):
muonTable.variables = cms.PSet(muonTable.variables,
standaloneExtraIdx = Var('? standAloneMuon().isNonnull() ? standAloneMuon().extra().key() : -99', 'int', precision=-1, doc='Index of the innerTrack TrackExtra in the original collection'),
innerTrackExtraIdx = Var('? innerTrack().isNonnull() ? innerTrack().extra().key() : -99', 'int', precision=-1, doc='Index of the innerTrack TrackExtra in the original collection'),
vx = Var('vx', 'float', precision=-1, doc='Muon X position'),
vy = Var('vy', 'float', precision=-1, doc='Muon Y position'),
vz = Var('vz', 'float', precision=-1, doc='Muon Z position'),
)
muonTable.externalVariables = cms.PSet(
isStandAloneUpdatedAtVtx = ExtVar(cms.InputTag("mergedStandAloneMuons:muonUpdatedAtVtx"),bool, doc="is standalone muon track updated at vertex"),
Expand Down
1 change: 1 addition & 0 deletions PhysicsTools/NanoAOD/python/nano_cff.py
Expand Up @@ -473,6 +473,7 @@ def nanoAOD_customizeMC(process):
###increasing the precision of selected GenParticles.
def nanoGenWmassCustomize(process):
pdgSelection="?(abs(pdgId) == 11|| abs(pdgId)==13 || abs(pdgId)==15 ||abs(pdgId)== 12 || abs(pdgId)== 14 || abs(pdgId)== 16|| abs(pdgId)== 6|| abs(pdgId)== 24|| pdgId== 23|| pdgId== 25)"

# Keep full precision for selected particles
ptPrecision="{}?{}:{}".format(pdgSelection, -1, genParticleTable.variables.pt.precision.value())
process.genParticleTable.variables.pt.precision=cms.string(ptPrecision)
Expand Down

0 comments on commit f2472e3

Please sign in to comment.