test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ZmumuStandaloneSelection_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
4 patMuonsForZmumuSelection = patMuons.clone()
5 patMuonsForZmumuSelection.addGenMatch = cms.bool(False)
6 patMuonsForZmumuSelection.embedCaloMETMuonCorrs = cms.bool(False)
7 patMuonsForZmumuSelection.embedTcMETMuonCorrs = cms.bool(False)
8 
9 goodVertex = cms.EDFilter("VertexSelector",
10  src = cms.InputTag("offlinePrimaryVertices"),
11  cut = cms.string("(!isFake) & ndof >= 4 & abs(z) < 24 & position.Rho < 2"),
12  filter = cms.bool(False)
13 )
14 
15 goodMuons = cms.EDFilter("PATMuonSelector",
16  src = cms.InputTag("patMuonsForZmumuSelection"),
17  cut = cms.string(
18  'pt > 8 && abs(eta) < 2.5 && isGlobalMuon && isPFMuon'
19  ' && track.hitPattern.trackerLayersWithMeasurement > 5 & innerTrack.hitPattern.numberOfValidPixelHits > 0'
20  ' && abs(dB) < 0.2 && globalTrack.normalizedChi2 < 10'
21  ' && globalTrack.hitPattern.numberOfValidMuonHits > 0 && numberOfMatchedStations > 1'
22  ),
23  filter = cms.bool(False)
24 )
25 
26 highestPtMuPlus = cms.EDFilter("UniquePATMuonSelector",
27  src = cms.VInputTag('goodMuons'),
28  cut = cms.string('charge > 0.5'),
29  rank = cms.string('pt'),
30  filter = cms.bool(False)
31 )
32 
33 highestPtMuMinus = cms.EDFilter("UniquePATMuonSelector",
34  src = cms.VInputTag('goodMuons'),
35  cut = cms.string('charge < -0.5'),
36  rank = cms.string('pt'),
37  filter = cms.bool(False)
38 )
39 
40 goodMuonsPFIso = cms.EDFilter("PATMuonSelector",
41  src = cms.InputTag("goodMuons"),
42  cut = cms.string('pfIsolationR04().sumChargedHadronPt < (0.1*pt)'),
43  filter = cms.bool(False)
44 )
45 
46 highestPtMuPlusPFIso = cms.EDFilter("UniquePATMuonSelector",
47  src = cms.VInputTag('goodMuonsPFIso'),
48  cut = cms.string('charge > 0.5'),
49  rank = cms.string('pt'),
50  filter = cms.bool(False)
51 )
52 
53 highestPtMuMinusPFIso = cms.EDFilter("UniquePATMuonSelector",
54  src = cms.VInputTag('goodMuonsPFIso'),
55  cut = cms.string('charge < -0.5'),
56  rank = cms.string('pt'),
57  filter = cms.bool(False)
58 )
59 
60 goldenZmumuCandidatesGe0IsoMuons = cms.EDProducer("CandViewShallowCloneCombiner",
61  checkCharge = cms.bool(True),
62  # require one of the muons with pT > 17 GeV, and an invariant mass > 20 GeV
63  cut = cms.string('charge = 0 & max(daughter(0).pt, daughter(1).pt) > 17 & mass > 20'),
64  decay = cms.string("highestPtMuPlus@+ highestPtMuMinus@-")
65 )
66 
67 goldenZmumuCandidatesGe1IsoMuonsComb1 = goldenZmumuCandidatesGe0IsoMuons.clone(
68  decay = cms.string("highestPtMuPlusPFIso@+ highestPtMuMinus@-") # mu+ passes isolation
69 )
70 goldenZmumuCandidatesGe1IsoMuonsComb2 = goldenZmumuCandidatesGe1IsoMuonsComb1.clone(
71  decay = cms.string("highestPtMuPlus@+ highestPtMuMinusPFIso@-") # mu- passes isolation
72 )
73 goldenZmumuCandidatesGe1IsoMuons = cms.EDFilter("UniqueCompositeCandidateSelector",
74  src = cms.VInputTag(
75  'goldenZmumuCandidatesGe1IsoMuonsComb1',
76  'goldenZmumuCandidatesGe1IsoMuonsComb2'
77  ),
78  rank = cms.string('daughter(0).pt*daughter(1).pt'),
79  filter = cms.bool(False)
80 )
81 
82 goldenZmumuCandidatesGe2IsoMuons = goldenZmumuCandidatesGe0IsoMuons.clone(
83  decay = cms.string("highestPtMuPlusPFIso@+ highestPtMuMinusPFIso@-")
84 )
85 
86 goldenZmumuFilter = cms.EDFilter("CandViewCountFilter",
87  src = cms.InputTag("goldenZmumuCandidatesGe0IsoMuons"), # loose selection
88  #src = cms.InputTag("goldenZmumuCandidatesGe1IsoMuons"), # medium-tight selection
89  #src = cms.InputTag("goldenZmumuCandidatesGe2IsoMuons"), # tight selection
90  minNumber = cms.uint32(1)
91 )
92 
93 goldenZmumuPreFilterHistos = cms.EDAnalyzer("AcceptanceHistoProducer",
94  dqmDir = cms.string('PreFilter'),
95  srcGenParticles = cms.InputTag("genParticles")
96 )
97 goldenZmumuPostFilterHistos = goldenZmumuPreFilterHistos.clone(
98  dqmDir = cms.string('PostFilter')
99 )
100 from DQMServices.Components.MEtoEDMConverter_cff import MEtoEDMConverter
101 MEtoEDMConverter.deleteAfterCopy = cms.untracked.bool(False)
102 
103 goldenZmumuSelectionSequence = cms.Sequence(
104  goodVertex
105  + patMuonsForZmumuSelection
106  + goodMuons
107  + highestPtMuPlus
108  + highestPtMuMinus
109  + goodMuonsPFIso
110  + highestPtMuPlusPFIso
111  + highestPtMuMinusPFIso
112  + goldenZmumuCandidatesGe0IsoMuons
113  + goldenZmumuCandidatesGe1IsoMuonsComb1
114  + goldenZmumuCandidatesGe1IsoMuonsComb2
115  + goldenZmumuCandidatesGe1IsoMuons
116  + goldenZmumuCandidatesGe2IsoMuons
117 )
118 
119 goldenZmumuFilterSequence = cms.Sequence(
120  goldenZmumuSelectionSequence
121  + goldenZmumuPreFilterHistos
122  + goldenZmumuFilter
123  + goldenZmumuPostFilterHistos
124  + MEtoEDMConverter
125 )
126 
127 goldenZmumuFilterSequenceData = cms.Sequence(
128  goldenZmumuSelectionSequence
129  + goldenZmumuFilter
130 )