forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
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 cms-sw#5 from kdlong/WmassNanoProd_106X
Fix secondary files, Nano for Tag and Probe
- Loading branch information
Showing
5 changed files
with
85 additions
and
3 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
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,21 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
from PhysicsTools.NanoAOD.common_cff import * | ||
|
||
generalTrackTable = cms.EDProducer("SimpleTrackFlatTableProducer", | ||
src = cms.InputTag("generalTracks"), | ||
cut = cms.string("pt > 15"), # filtered already above | ||
name = cms.string("Track"), | ||
doc = cms.string("General tracks with pt > 15 GeV"), | ||
singleton = cms.bool(False), # the number of entries is variable | ||
extension = cms.bool(False), # this is the main table for the muons | ||
variables = cms.PSet(P3Vars, | ||
dz = Var("dz",float,doc="dz (with sign) wrt first PV, in cm",precision=10), | ||
dxy = Var("dxy",float,doc="dxy (with sign) wrt first PV, in cm",precision=10), | ||
charge = Var("charge", int, doc="electric charge"), | ||
normChiSq = Var("normalizedChi2", float, precision=14, doc="Chi^2/ndof"), | ||
numberOfValidHits = Var('numberOfValidHits()', 'int', precision=-1, doc='Number of valid hits in track'), | ||
numberOfLostHits = Var('numberOfLostHits()', 'int', precision=-1, doc='Number of lost hits in track'), | ||
), | ||
) | ||
|
||
|
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,57 @@ | ||
from __future__ import print_function | ||
import FWCore.ParameterSet.Config as cms | ||
from PhysicsTools.NanoAOD.common_cff import * | ||
from PhysicsTools.NanoAOD.globals_cff import * | ||
from PhysicsTools.NanoAOD.muons_cff import * | ||
from PhysicsTools.NanoAOD.electrons_cff import * | ||
from PhysicsTools.NanoAOD.genparticles_cff import * | ||
from PhysicsTools.NanoAOD.particlelevel_cff import * | ||
from PhysicsTools.NanoAOD.genWeightsTable_cfi import * | ||
from PhysicsTools.NanoAOD.genVertex_cff import * | ||
from PhysicsTools.NanoAOD.vertices_cff import * | ||
from PhysicsTools.NanoAOD.met_cff import * | ||
from PhysicsTools.NanoAOD.triggerObjects_cff import * | ||
from PhysicsTools.NanoAOD.isotracks_cff import * | ||
from PhysicsTools.NanoAOD.generalTracks_cff import * | ||
from PhysicsTools.NanoAOD.NanoAODEDMEventContent_cff import * | ||
from PhysicsTools.PatAlgos.slimming.miniAOD_tools import * | ||
|
||
nanoMetadata = cms.EDProducer("UniqueStringProducer", | ||
strings = cms.PSet( | ||
tag = cms.string("untagged"), | ||
) | ||
) | ||
|
||
l1bits=cms.EDProducer("L1TriggerResultsConverter", src=cms.InputTag("gtStage2Digis"), legacyL1=cms.bool(False), | ||
storeUnprefireableBit=cms.bool(True), src_ext=cms.InputTag("gtStage2Digis")) | ||
|
||
finalIsolatedTracks.finalLeptons = ["finalLooseMuons"] | ||
|
||
finalMuons.src = "slimmedMuonsUpdated" | ||
finalLooseMuons.src = "slimmedMuonsUpdated" | ||
muonTable.src = "finalMuons" | ||
muonTable.externalVariables = cms.PSet() | ||
muonTable.variables = cms.PSet(muonTable.variables, | ||
standalonePt = Var("? standAloneMuon().isNonnull() ? standAloneMuon().pt() : -1", float, doc = "pt of the standalone muon", precision=14), | ||
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), | ||
) | ||
|
||
muonSimpleSequence= cms.Sequence(slimmedMuonsUpdated+isoForMu + finalMuons + finalLooseMuons ) | ||
|
||
nanotpSequence = cms.Sequence( | ||
nanoMetadata + triggerObjectTables + l1bits + | ||
genParticleSequence + genParticleTables + genWeightsTable + genVertexTables + | ||
muonSequence + vertexSequence+ | ||
isoTrackSequence + # must be after all the leptons | ||
puTable + genTable + | ||
muonMC + muonTable + vertexTables+ isoTrackTables + generalTrackTable | ||
) | ||
|
||
def customizeMuonPassThrough(process): | ||
passStandalone = "(standAloneMuon().isNonnull() && standAloneMuon().pt() > 15)" | ||
process.selectedPatMuons.cut = cms.string("||".join([passStandalone, process.selectedPatMuons.cut.value()])) | ||
process.finalMuons.cut = cms.string("||".join([passStandalone, process.finalMuons.cut.value()])) | ||
return process | ||
|