1 import FWCore.ParameterSet.Config
as cms
8 MuPrimaryVertexFilter = cms.EDFilter(
10 src = cms.InputTag(
"offlinePrimaryVertices"),
11 cut = cms.string(
"!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"),
12 filter = cms.bool(
False)
15 MuBestPV = cms.EDProducer(
16 "HighestSumP4PrimaryVertexSelector",
17 src = cms.InputTag(
"MuPrimaryVertexFilter")
20 selectedMuons = cms.EDFilter(
22 src = cms.InputTag(
'muons'),
23 cut = cms.string(
"pt > 20.0 && abs(eta) < 2.1 && isGlobalMuon = 1 && isTrackerMuon = 1"),
24 filter = cms.bool(
False)
27 selectedMuonsIso = cms.EDFilter(
29 src = cms.InputTag(
'selectedMuons'),
30 cut = cms.string(
'(isolationR03().emEt + isolationR03().hadEt + isolationR03().sumPt)/pt < 0.15'),
31 filter = cms.bool(
False)
34 MuonsFromPV = cms.EDProducer(
36 srcMuon = cms.InputTag(
"selectedMuonsIso"),
37 srcVertex = cms.InputTag(
"MuBestPV"),
38 max_dxy = cms.double(0.01),
39 max_dz = cms.double(0.1)
44 MuGoodTracks = cms.EDFilter(
"TrackSelector",
45 src = cms.InputTag(
"generalTracks"),
46 cut = cms.string(
"pt > 5 && abs(eta) < 2.5"),
47 filter = cms.bool(
False)
50 MuIsoTracks = cms.EDProducer(
52 src = cms.InputTag(
"MuGoodTracks"),
53 radius = cms.double(0.3),
54 SumPtFraction = cms.double(0.5)
57 MuTrackFromPV = cms.EDProducer(
58 "TrackFromPVSelector",
59 srcTrack = cms.InputTag(
"MuIsoTracks"),
60 srcVertex = cms.InputTag(
"MuBestPV"),
61 max_dxy = cms.double(0.01),
62 max_dz = cms.double(0.1)
65 MuTrackCands = cms.EDProducer(
66 "ConcreteChargedCandidateProducer",
67 src = cms.InputTag(
"MuTrackFromPV"),
68 particleType = cms.string(
"mu+")
71 ZmmCandMuonTrack = cms.EDProducer(
72 "CandViewShallowCloneCombiner",
73 decay = cms.string(
"MuonsFromPV@+ MuTrackCands@-"),
74 cut = cms.string(
"80 < mass < 100")
77 BestZmm = cms.EDProducer(
"BestMassZArbitrationProducer",
78 ZCandidateCollection = cms.InputTag(
"ZmmCandMuonTrack")
81 MuZLegs = cms.EDProducer(
"CollectionFromZLegProducer",
82 ZCandidateCollection = cms.InputTag(
"BestZmm"),
85 procAttributes =
dir(proc)
88 helpers.massSearchReplaceAnyInputTag(proc.TauValNumeratorAndDenominatorRealMuonsData,
'kinematicSelectedTauValDenominator', cms.InputTag(
"MuZLegs",
"theProbeLeg"))
92 zttModifier = ApplyFunctionToSequence(zttLabeler)
93 proc.TauValNumeratorAndDenominatorRealMuonsData.visit(zttModifier)
96 pt = cms.PSet( nbins = cms.int32(10), min = cms.double(0.), max = cms.double(100.) ),
97 eta = cms.PSet( nbins = cms.int32(4), min = cms.double(-3.), max = cms.double(3.) ),
98 phi = cms.PSet( nbins = cms.int32(4), min = cms.double(-180.), max = cms.double(180.) ),
99 pileup = cms.PSet( nbins = cms.int32(18), min = cms.double(0.), max = cms.double(72.) ),
101 zttModifier = ApplyFunctionToSequence(
lambda m:
setBinning(m,binning))
102 proc.TauValNumeratorAndDenominatorRealMuonsData.visit(zttModifier)
106 discs_to_retain = [
'ByDecayModeFinding',
'MuonRejection']
107 proc.RunHPSValidationRealMuonsData.discriminators = cms.VPSet([p
for p
in proc.RunHPSValidationRealMuonsData.discriminators
if any(disc
in p.discriminator.value()
for disc
in discs_to_retain) ])
110 proc.efficienciesRealMuonsData.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorRealMuonsData)
111 proc.efficienciesRealMuonsDataSummary = cms.EDProducer(
"TauDQMHistEffProducer",
114 denominator = cms.string(
'RecoTauV/standardValidation/hpsPFTauProducerRealMuonsData_Summary/#PAR#PlotDen'),
115 efficiency = cms.string(
'RecoTauV/standardValidation/hpsPFTauProducerRealMuonsData_Summary/#PAR#Plot'),
116 numerator = cms.string(
'RecoTauV/standardValidation/hpsPFTauProducerRealMuonsData_Summary/#PAR#PlotNum'),
117 parameter = cms.vstring(
'summary'),
118 stepByStep = cms.bool(
True)
124 newProcAttributes = [x
for x
in dir(proc)
if (x
not in procAttributes)
and (x.find(
'RealMuonsData') != -1)]
127 for newAttr
in newProcAttributes:
128 locals()[newAttr] = getattr(proc,newAttr)
130 produceDenominatorRealMuonsData = cms.Sequence(
131 cms.ignore(MuPrimaryVertexFilter) * MuBestPV *
132 ( ( cms.ignore(selectedMuons) * cms.ignore(selectedMuonsIso) * MuonsFromPV ) +
133 ( cms.ignore(MuGoodTracks) * MuIsoTracks * MuTrackFromPV * MuTrackCands ) ) *
139 produceDenominator = cms.Sequence(produceDenominatorRealMuonsData)
141 runTauValidationBatchMode = cms.Sequence(
142 produceDenominatorRealMuonsData
143 +TauValNumeratorAndDenominatorRealMuonsData
146 runTauValidation = cms.Sequence(
147 runTauValidationBatchMode
148 +TauEfficienciesRealMuonsData
def cloneProcessingSnippet(process, sequence, postfix, removePostfix="", noClones=[], addToTask=False, verbose=False)
bool any(const std::vector< T > &v, const T &what)
def SetValidationExtention(module, extension)
def setBinning(module, pset)