CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ValidateTausOnQCD_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 import copy
4 
9 
10 kinematicSelectedTauValDenominatorQCD = cms.EDFilter(
11  "GenJetSelector", #"GenJetSelector"
12  src = cms.InputTag('ak4GenJets'),
13  cut = kinematicSelectedTauValDenominatorCut,#cms.string('pt > 5. && abs(eta) < 2.5'), #Defined: Validation.RecoTau.RecoTauValidation_cfi
14  filter = cms.bool(False)
15 )
16 
17 
18 procAttributes = dir(proc) #Takes a snapshot of what there in the process
19 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominator, 'QCD') #clones the sequence inside the process with QCD postfix
20 helpers.cloneProcessingSnippet( proc, proc.TauEfficiencies, 'QCD') #clones the sequence inside the process with QCD postfix
21 helpers.massSearchReplaceAnyInputTag(proc.TauValNumeratorAndDenominatorQCD, 'kinematicSelectedTauValDenominator', 'kinematicSelectedTauValDenominatorQCD') #sets the correct input tag
22 
23 #adds to TauValNumeratorAndDenominator modules in the sequence QCD to the extention name
24 zttLabeler = lambda module : SetValidationExtention(module, 'QCD')
25 zttModifier = ApplyFunctionToSequence(zttLabeler)
26 proc.TauValNumeratorAndDenominatorQCD.visit(zttModifier)
27 
28 #Set discriminators
29 discs_to_retain = ['ByDecayModeFinding', 'CombinedIsolationDBSumPtCorr3Hits', 'IsolationMVArun2v1DBoldDMwLT', 'IsolationMVArun2v1DBnewDMwLT']
30 proc.RunHPSValidationQCD.discriminators = cms.VPSet([p for p in proc.RunHPSValidationQCD.discriminators if any(disc in p.discriminator.value() for disc in discs_to_retain) ])
31 
32 #Sets the correct naming to efficiency histograms
33 proc.efficienciesQCD.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorQCD)
34 proc.efficienciesQCDSummary = cms.EDProducer("TauDQMHistEffProducer",
35  plots = cms.PSet(
36  Summary = cms.PSet(
37  denominator = cms.string('RecoTauV/hpsPFTauProducerQCD_Summary/#PAR#PlotDen'),
38  efficiency = cms.string('RecoTauV/hpsPFTauProducerQCD_Summary/#PAR#Plot'),
39  numerator = cms.string('RecoTauV/hpsPFTauProducerQCD_Summary/#PAR#PlotNum'),
40  parameter = cms.vstring('summary'),
41  stepByStep = cms.bool(True)
42  ),
43  )
44 )
45 
46 #checks what's new in the process (the cloned sequences and modules in them)
47 newProcAttributes = [x for x in dir(proc) if (x not in procAttributes) and (x.find('QCD') != -1)]
48 
49 #spawns a local variable with the same name as the proc attribute, needed for future process.load
50 for newAttr in newProcAttributes:
51  locals()[newAttr] = getattr(proc,newAttr)
52 
53 
54 produceDenominatorQCD = cms.Sequence(
55  kinematicSelectedTauValDenominatorQCD
56  )
57 
58 produceDenominator = cms.Sequence(produceDenominatorQCD)
59 
60 runTauValidationBatchMode = cms.Sequence(
61  produceDenominatorQCD
62  +TauValNumeratorAndDenominatorQCD
63  )
64 
65 runTauValidation = cms.Sequence(
66  runTauValidationBatchMode
67  +TauEfficienciesQCD
68  )
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
def cloneProcessingSnippet
Definition: helpers.py:257