1 import FWCore.ParameterSet.Config
as cms
8 kinematicSelectedPFJets = cms.EDFilter(
10 src = cms.InputTag(
'ak4PFJets'),
11 cut = cms.string(
"pt > 15 & abs(eta) < 2.5"),
12 filter = cms.bool(
False)
15 PFJetsId = cms.EDFilter(
16 "TauValPFJetSelector",
17 src = cms.InputTag(
'kinematicSelectedPFJets'),
18 cut = cms.string(
"chargedHadronEnergyFraction > 0.0 & neutralHadronEnergyFraction < 0.99 & neutralHadronEnergyFraction < 0.99 & chargedEmEnergyFraction < 0.99 & chargedEmEnergyFraction < 0.99 & neutralEmEnergyFraction < 0.99 & chargedMultiplicity > 0 & nConstituents > 1"),
19 filter = cms.bool(
False)
22 CleanedPFJets = cms.EDProducer(
"TauValJetViewCleaner",
23 srcObject = cms.InputTag(
"kinematicSelectedPFJets" ),
24 srcObjectsToRemove = cms.VInputTag( cms.InputTag(
"muons"), cms.InputTag(
"gedGsfElectrons") ),
25 deltaRMin = cms.double(0.15)
28 procAttributes =
dir(proc)
31 helpers.massSearchReplaceAnyInputTag(proc.TauValNumeratorAndDenominatorRealData,
'kinematicSelectedTauValDenominator',
'CleanedPFJets')
35 zttModifier = ApplyFunctionToSequence(zttLabeler)
36 proc.TauValNumeratorAndDenominatorRealData.visit(zttModifier)
39 pt = cms.PSet( nbins = cms.int32(25), min = cms.double(0.), max = cms.double(250.) ),
40 eta = cms.PSet( nbins = cms.int32(4), min = cms.double(-3.), max = cms.double(3.) ),
41 phi = cms.PSet( nbins = cms.int32(4), min = cms.double(-180.), max = cms.double(180.) ),
42 pileup = cms.PSet( nbins = cms.int32(18), min = cms.double(0.), max = cms.double(72.) ),
44 zttModifier = ApplyFunctionToSequence(
lambda m:
setBinning(m,binning))
45 proc.TauValNumeratorAndDenominatorRealData.visit(zttModifier)
49 discs_to_retain = [
'ByDecayModeFinding',
'CombinedIsolationDBSumPtCorr3Hits',
'IsolationMVArun2v1DBoldDMwLT',
'IsolationMVArun2v1DBnewDMwLT']
50 proc.RunHPSValidationRealData.discriminators = cms.VPSet([p
for p
in proc.RunHPSValidationRealData.discriminators
if any(disc
in p.discriminator.value()
for disc
in discs_to_retain) ])
53 proc.efficienciesRealData.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorRealData)
54 proc.efficienciesRealDataSummary = cms.EDProducer(
"TauDQMHistEffProducer",
57 denominator = cms.string(
'RecoTauV/hpsPFTauProducerRealData_Summary/#PAR#PlotDen'),
58 efficiency = cms.string(
'RecoTauV/hpsPFTauProducerRealData_Summary/#PAR#Plot'),
59 numerator = cms.string(
'RecoTauV/hpsPFTauProducerRealData_Summary/#PAR#PlotNum'),
60 parameter = cms.vstring(
'summary'),
61 stepByStep = cms.bool(
True)
67 newProcAttributes = [x
for x
in dir(proc)
if (x
not in procAttributes)
and (x.find(
'RealData') != -1)]
70 for newAttr
in newProcAttributes:
71 locals()[newAttr] = getattr(proc,newAttr)
74 produceDenominatorRealData = cms.Sequence(
75 cms.ignore(kinematicSelectedPFJets) *
76 cms.ignore(PFJetsId) *
80 produceDenominator = cms.Sequence(produceDenominatorRealData)
82 runTauValidationBatchMode = cms.Sequence(
83 produceDenominatorRealData
84 +TauValNumeratorAndDenominatorRealData
87 runTauValidation = cms.Sequence(
88 runTauValidationBatchMode
89 +TauEfficienciesRealData
def cloneProcessingSnippet(process, sequence, postfix, removePostfix="", noClones=[], addToTask=False)
bool any(const std::vector< T > &v, const T &what)
def SetValidationExtention(module, extension)
def setBinning(module, pset)