CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PDWG_MuonPOGSkim_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # Pick branches you want to keep
4 MuonPOG_EventContent = cms.PSet(
5  outputCommands = cms.untracked.vstring(
6  'drop *',
7  'keep *_TriggerResults_*_*',
8  'keep *_gmtStage2Digis_Muon_*',
9  'keep *_offlineSlimmedPrimaryVertices_*_*',
10  'keep *_offlineBeamSpot_*_*',
11  'keep *_slimmedMETs_*_*',
12  'keep *Muons*_slimmedMuons_*_*',
13  'keep *_isolatedTracks_*_*',
14  'keep *_slimmedPatTrigger_*_*',
15  'keep *_slimmedJets_*_*',
16  )
17 )
18 
19 
20 import copy
22 
23 MuonPOGSkimHLTFilter = copy.deepcopy(hltHighLevel)
24 MuonPOGSkimHLTFilter.throw = cms.bool(False)
25 MuonPOGSkimHLTFilter.HLTPaths = ["HLT_Mu*","HLT_IsoMu*"]
26 
27 
28 MuonPOGJPsiSkimHLTFilter = copy.deepcopy(hltHighLevel)
29 MuonPOGJPsiSkimHLTFilter.throw = cms.bool(False)
30 MuonPOGJPsiSkimHLTFilter.HLTPaths = ["HLT_Mu*_Track*_Jpsi*","HLT_Mu*_L2Mu*_Jpsi*"]
31 
32 
33 TAGMUON_CUT = '(pt > 25) && (abs(eta)<2.4) && (isPFMuon>0) && (isGlobalMuon = 1) && (globalTrack().normalizedChi2() < 10) && (globalTrack().hitPattern().numberOfValidMuonHits()>0)&& (numberOfMatchedStations() > 1)&& (innerTrack().hitPattern().numberOfValidPixelHits() > 0)&& (innerTrack().hitPattern().trackerLayersWithMeasurement() > 5) && (((pfIsolationR04.sumChargedHadronPt + max(0., pfIsolationR04.sumNeutralHadronEt + pfIsolationR04.sumPhotonEt - 0.5 * pfIsolationR04.sumPUPt) ) / pt)<0.2)'
34 TAGMUON_JPSI_CUT = '(isGlobalMuon || numberOfMatchedStations > 1) && pt > 5'
35 
36 PROBETRACK_CUT = 'pt > 10 && abs(eta)<2.4 && (charge!=0)'
37 PROBETRACK_JPSI_CUT = 'pt > 2 && abs(eta)<2.4 && (charge!=0)'
38 
39 PROBESTA_CUT = 'pt > 10 && abs(eta)<2.4 && isStandAloneMuon == 1'
40 PROBESTA_JPSI_CUT = 'pt > 2 && abs(eta)<2.4 && isStandAloneMuon == 1'
41 
42 DIMUON = 'mass > 40 || ((daughter(0).isStandAloneMuon) && ( ?daughter(0).masterClone.isStandAloneMuon?({dg0}.p+{dg1}.p)*({dg0}.p+{dg1}.p)-({dg0}.px+{dg1}.px)*({dg0}.px+{dg1}.px)-({dg0}.py+{dg1}.py)*({dg0}.py+{dg1}.py)-({dg0}.pz+{dg1}.pz)*({dg0}.pz+{dg1}.pz):2000) > 1600)'
43 
44 DIMUON = DIMUON.format(dg0 = "daughter(0).masterClone.standAloneMuon()", dg1="daughter(1)")
45 
46 
47 # Tag and probe for Z#to#mu#mu
48 GoodTagMuons = cms.EDFilter("PATMuonRefSelector",
49  src = cms.InputTag("slimmedMuons"),
50  cut = cms.string(TAGMUON_CUT)
51  )
52 
53 
54 GoodProbeTrackMuons = cms.EDFilter("IsoTrackSelector",
55  src = cms.InputTag("isolatedTracks"),
56  cut = cms.string(PROBETRACK_CUT),
57  filter = cms.bool(True)
58  )
59 
60 GoodProbeStaMuons = cms.EDFilter("PATMuonRefSelector",
61  src = cms.InputTag("slimmedMuons"),
62  cut = cms.string(PROBESTA_CUT),
63  )
64 
65 GoodProbeStaMuonsCount = cms.EDFilter("MuonRefPatCount",
66  src = cms.InputTag("slimmedMuons"),
67  cut = cms.string(PROBESTA_CUT),
68  minNumber = cms.uint32(2)
69  )
70 
71 
72 # build Z-> MuMu candidates (with track probes)
73 DiMuonTrackPOGSkim = cms.EDProducer("CandViewShallowCloneCombiner",
74  checkCharge = cms.bool(False),
75  cut = cms.string(DIMUON),
76  decay = cms.string("GoodTagMuons GoodProbeTrackMuons")
77  )
78 
79 DiMuonTrackPOGFilterSkim = cms.EDFilter("CandViewCountFilter",
80  src = cms.InputTag("DiMuonTrackPOGSkim"),
81  minNumber = cms.uint32(1)
82  )
83 
84 # build Z-> MuMu candidates (with standalone probes)
85 DiMuonSTAPOGSkim = cms.EDProducer("CandViewShallowCloneCombiner",
86  checkCharge = cms.bool(False),
87  cut = cms.string(DIMUON),
88  decay = cms.string("GoodTagMuons GoodProbeStaMuons")
89  )
90 
91 DiMuonSTAPOGFilterSkim = cms.EDFilter("CandViewCountFilter",
92  src = cms.InputTag("DiMuonSTAPOGSkim"),
93  minNumber = cms.uint32(1)
94  )
95 
96 
97 
98 # all the sequences
99 
100 MuonPOGSkimTrackSequence = cms.Sequence(
101  MuonPOGSkimHLTFilter *
102  GoodTagMuons *
103  GoodProbeTrackMuons *
104  DiMuonTrackPOGSkim *
105  DiMuonTrackPOGFilterSkim
106  )
107 
108 MuonPOGSkimSTASequence = cms.Sequence(
109  MuonPOGSkimHLTFilter *
110  GoodTagMuons *
111  GoodProbeStaMuons *
112  GoodProbeStaMuonsCount *
113  DiMuonSTAPOGSkim *
114  DiMuonSTAPOGFilterSkim
115  )
116 
117 
118 
119 
120 
121 
122 # Tag and probe for J/Psi #to #mu#mu
123 GoodJPsiTagMuons = cms.EDFilter("PATMuonRefSelector",
124  src = cms.InputTag("slimmedMuons"),
125  cut = cms.string(TAGMUON_JPSI_CUT)
126  )
127 
128 
129 
130 
131 
132 
133 
134 GoodJPsiProbeTracksMuons = cms.EDFilter("IsoTrackSelector",
135  src = cms.InputTag("isolatedTracks"),
136  cut = cms.string(PROBETRACK_JPSI_CUT),
137  filter = cms.bool(True)
138 )
139 
140 GoodJPsiProbeStaMuons = cms.EDFilter("MuonRefPatCount",
141  src = cms.InputTag("slimmedMuons"),
142  cut = cms.string(PROBESTA_JPSI_CUT)
143  )
144 
145 
146 
147 GoodJPsiProbeStaMuonsCount = cms.EDFilter("MuonRefPatCount",
148  src = cms.InputTag("slimmedMuons"),
149  cut = cms.string(PROBESTA_JPSI_CUT),
150  minNumber = cms.uint32(2)
151  )
152 
153 
154 
155 MuonPOGJPsiSkimTrackSequence = cms.Sequence(
156  MuonPOGJPsiSkimHLTFilter *
157  GoodJPsiTagMuons *
158  GoodJPsiProbeTracksMuons
159  )
160 
161 MuonPOGJPsiSkimSTASequence = cms.Sequence(
162  MuonPOGJPsiSkimHLTFilter *
163  GoodJPsiTagMuons *
164  GoodJPsiProbeStaMuons *
165  GoodJPsiProbeStaMuonsCount
166  )