test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ZmumuStandalonSelectionLegacy_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 
6 patMuons.addGenMatch = cms.bool(False)
7 patMuons.embedHighLevelSelection = cms.bool(True)
8 patMuons.usePV = cms.bool(False)
9 
10 patMuons.embedCaloMETMuonCorrs = cms.bool(False) # avoid crash
11 patMuons.embedTcMETMuonCorrs = cms.bool(False)
12 # No need to swich off following
13 #patMuons.embedTpfmsMuon = cms.bool(True),
14 # embedPFCandidate = cms.bool(True),
15 # embedStandAloneMuon = cms.bool(True),
16 # embedCombinedMuon = cms.bool(True),
17 # embedPickyMuon = cms.bool(True)
18 
19 
20 goodVertex = cms.EDFilter("VertexSelector",
21  src = cms.InputTag("offlinePrimaryVertices"),
22  cut = cms.string("(!isFake) & ndof > 3 & abs(z) < 15 & position.Rho < 2"),
23  filter = cms.bool(True)
24 )
25 
26 
27 muonsWithPFIso = cms.EDProducer("MuonWithPFIsoProducerCopy",
28  MuonTag = cms.untracked.InputTag("muons")
29  , PfTag = cms.untracked.InputTag("pfNoPileUp")
30  , UsePfMuonsOnly = cms.untracked.bool(False)
31  , TrackIsoVeto = cms.untracked.double(0.01)
32  , GammaIsoVeto = cms.untracked.double(0.07)
33  , NeutralHadronIsoVeto = cms.untracked.double(0.1)
34 )
35 
36 patMuons.muonSource = cms.InputTag("muonsWithPFIso")
37 
38 goodMuons = cms.EDFilter("PATMuonSelector",
39  src = cms.InputTag("patMuons"),
40  cut = cms.string(
41  'pt > 10 & abs(eta) < 2.5 & isGlobalMuon & isTrackerMuon ' \
42  + ' & innerTrack.hitPattern.numberOfValidTrackerHits > 10 & innerTrack.hitPattern.numberOfValidPixelHits > 0' \
43  + ' & abs(dB)<0.2 & globalTrack.normalizedChi2 < 10' \
44  + ' & globalTrack.hitPattern.numberOfValidMuonHits > 0 & numberOfMatches > 1'
45  ),
46  filter = cms.bool(True)
47 )
48 
49 
50 
51 goodMuonsPFIso =cms.EDFilter("PATMuonSelector",
52  src = cms.InputTag("goodMuons"),
53  #cut = cms.string("iso03.sumPt/pt < 0.1 " ),
54  cut = cms.string("trackIso() < 0.1*pt " ),
55  #cut = cms.string("trackIso() < 11110.1*pt " ),
56  filter = cms.bool(False)
57 )
58 
59 
60 
61 goldenZmumuCandidatesGe0IsoMuons = cms.EDProducer("CandViewShallowCloneCombiner",
62  checkCharge = cms.bool(True),
63  # require one of the muons with pT > 20
64  cut = cms.string('charge = 0 & max(daughter(0).pt,daughter(1).pt)>20'),
65  decay = cms.string("goodMuons@+ goodMuons@-")
66 )
67 
68 
69 goldenZmumuCandidatesGe1IsoMuons = goldenZmumuCandidatesGe0IsoMuons.clone()
70 goldenZmumuCandidatesGe1IsoMuons.decay = cms.string("goodMuons@+ goodMuonsPFIso@-")
71 
72 goldenZmumuCandidatesGe2IsoMuons = goldenZmumuCandidatesGe0IsoMuons.clone()
73 goldenZmumuCandidatesGe2IsoMuons.decay = cms.string("goodMuonsPFIso@+ goodMuonsPFIso@-")
74 
75 
76 goldenZmumuFilter = cms.EDFilter("CandViewCountFilter",
77  #src = cms.InputTag("goldenZmumuCandidatesGe0IsoMuons"), # loose selection
78  src = cms.InputTag("goldenZmumuCandidatesGe1IsoMuons"), # tight selection
79  minNumber = cms.uint32(1)
80 )
81 
82 print "Zmumu skim will use: ", goldenZmumuFilter.src
83 
84 
85 
86 goldenZmumuSelectionSequence = cms.Sequence(
87  goodVertex
88  * pfNoPileUpSequence
89  * muonsWithPFIso
90  * patMuons
91  * goodMuons
92  * goodMuonsPFIso
93  * goldenZmumuCandidatesGe0IsoMuons
94  * goldenZmumuCandidatesGe1IsoMuons
95  * goldenZmumuCandidatesGe2IsoMuons
96  * goldenZmumuFilter
97 )