1 from __future__
import print_function
2 import FWCore.ParameterSet.Config
as cms
3 import Validation.RecoTau.ValidationUtils
as Utils
14 RecoTauValidation_cfi.py 16 Contains the standard tau validation parameters. It is organized into 17 the following sections. 21 Set common kinematic cuts (pt > 5 and eta < 2.5) on the denominator source. 22 Note that the denominator depends on the type of test (signal/background/e etc) 24 The denominator kinematic cutter requires that 28 Produce numerator and denominator histgorams used to produce 32 TauValNumeratorAndDenominator 34 tauValSelectedDenominator (filtered GenJet collection) 38 Using numerator and denominators, calculate and store 44 TauValNumeratorAndDenominator 48 Plot curves calculated in efficiency, in both an overlay mode 49 showing overall performance for a release, and the indvidual 50 discriminator efficiency compared to a given release 55 loadAndPlotTauValidation 58 TauEfficiencies, external root file to compare to 60 Plotting must be executed in a separate cmsRun job! 64 Various scripts to automate things... 75 kinematicSelectedTauValDenominatorCut = cms.string(
'pt > 5. && abs(eta) < 2.5')
76 denominator = cms.InputTag(
"kinematicSelectedTauValDenominator")
82 Plot the pt/eta/energy/phi spectrum of PFTaus that pass 83 a series of PFTauDiscriminator cuts. 85 These will be used as the numerator/denominators of the 86 efficiency calculations 90 proc = cms.Process(
'helper')
92 StandardMatchingParameters = cms.PSet(
93 DataType = cms.string(
'Leptons'),
94 MatchDeltaR_Leptons = cms.double(0.15),
95 MatchDeltaR_Jets = cms.double(0.3),
96 SaveOutputHistograms = cms.bool(
False),
98 RefCollection = denominator,
99 TauPtCut = cms.double(0.),
100 recoCuts = cms.string(
''),
101 genCuts = cms.string(
''),
102 chainCuts = cms.bool(
False)
105 GenericTriggerSelectionParameters = cms.PSet(
106 andOr = cms.bool(
False ),
107 dbLabel = cms.string(
"PFTauDQMTrigger"),
108 andOrHlt = cms.bool(
True),
109 hltInputTag = cms.InputTag(
"TriggerResults::HLT"),
111 hltPaths = cms.vstring(
'HLT_IsoMu*_eta*_LooseIsoPFTau*_v*',
'HLT_DoubleIsoPFTau*_Trk*_eta*_v*'),
112 errorReplyHlt = cms.bool(
False),
113 verbosityLevel = cms.uint32(0)
116 from DQMServices.Core.DQMEDAnalyzer
import DQMEDAnalyzer
119 StandardMatchingParameters,
120 GenericTriggerSelection = GenericTriggerSelectionParameters,
121 ExtensionName = cms.string(
""),
122 TauProducer = cms.InputTag(
''),
123 discriminators = cms.VPSet(
128 proc.RunHPSValidation = proc.templateAnalyzer.clone()
131 from Configuration.Eras.Modifier_fastSim_cff
import fastSim
133 proc.RunHPSValidation,
134 hltInputTag = cms.InputTag(
""),
135 GenericTriggerSelection=
dict(hltInputTag = cms.InputTag(
""))
138 proc.RunHPSValidation.ExtensionName =
"" 140 proc.RunHPSValidation.TauProducer = cms.InputTag(
'hpsPFTauProducer')
141 proc.RunHPSValidation.discriminators = cms.VPSet(
142 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByDecayModeFinding"),selectionCut = cms.double(0.5),plotStep = cms.bool(
True)),
143 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByDecayModeFindingNewDMs"),selectionCut = cms.double(0.5),plotStep = cms.bool(
True)),
144 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByDecayModeFindingOldDMs"),selectionCut = cms.double(0.5),plotStep = cms.bool(
True)),
148 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits"),selectionCut = cms.double(0.5),plotStep = cms.bool(
True)),
149 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"),selectionCut = cms.double(0.5),plotStep = cms.bool(
True)),
150 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"),selectionCut = cms.double(0.5),plotStep = cms.bool(
True)),
159 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByLooseMuonRejection3"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
160 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByTightMuonRejection3"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
164 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMVA6VLooseElectronRejection"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
165 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMVA6LooseElectronRejection"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
166 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMVA6MediumElectronRejection"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
167 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMVA6TightElectronRejection"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
168 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMVA6VTightElectronRejection"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
169 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
170 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
171 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
172 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
173 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
174 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
175 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVLooseIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
176 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByLooseIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
177 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMediumIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
178 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByTightIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
179 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVTightIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
180 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVVTightIsolationMVArun2v1DBnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
181 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVLooseIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
182 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByLooseIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
183 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMediumIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
184 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByTightIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
185 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVTightIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
186 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVVTightIsolationMVArun2v1PWoldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
187 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVLooseIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
188 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByLooseIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
189 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMediumIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
190 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByTightIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
191 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVTightIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
192 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVVTightIsolationMVArun2v1PWnewDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
193 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3HitsdR03"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
194 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3HitsdR03"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
195 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3HitsdR03"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
196 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVLooseIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
197 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByLooseIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
198 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMediumIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
199 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByTightIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
200 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVTightIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
201 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVVTightIsolationMVArun2v1DBdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
202 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVLooseIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
203 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByLooseIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
204 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByMediumIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
205 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByTightIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
206 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVTightIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False)),
207 cms.PSet( discriminator = cms.string(
"hpsPFTauDiscriminationByVVTightIsolationMVArun2v1PWdR03oldDMwLT"),selectionCut = cms.double(0.5),plotStep = cms.bool(
False))
210 proc.TauValNumeratorAndDenominator = cms.Sequence(
211 proc.RunHPSValidation
218 Tau efficiency calculations 220 Define the Efficiency curves to produce. Each 221 efficiency producer takes the numberator and denominator 222 histograms and the dependent variables. 225 plotPset = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominator)
226 from DQMServices.Core.DQMEDHarvester
import DQMEDHarvester
228 "TauDQMHistEffProducer",
239 proc.normalizePlots = cms.EDAnalyzer(
241 plotNamesToNormalize = cms.vstring(
'*_pTRatio_*',
'*_Size_*',
'*_SumPt_*',
'*_dRTauRefJet*'),
242 reference = cms.string(
'*_pTRatio_allHadronic')
245 proc.TauEfficiencies = cms.Sequence(
254 loadTau: load two separate TauVal root files into the DQM 255 so the plotter can access them 262 inputFileNames = cms.vstring(
'/opt/sbg/cms/ui4_data1/dbodin/CMSSW_3_5_1/src/TauID/QCD_recoFiles/TauVal_CMSSW_3_6_0_QCD.root'),
263 scaleFactor = cms.double(1.),
264 dqmDirectory_store = cms.string(
'test')
266 reference = cms.PSet(
267 inputFileNames = cms.vstring(
'/opt/sbg/cms/ui4_data1/dbodin/CMSSW_3_5_1/src/TauID/QCD_recoFiles/TauVal_CMSSW_3_6_0_QCD.root'),
268 scaleFactor = cms.double(1.),
269 dqmDirectory_store = cms.string(
'reference')
276 xAxisStuff = cms.PSet(
277 xAxisTitle = cms.string(
'P_{T} / GeV'),
278 xAxisTitleOffset = cms.double(0.9),
279 xAxisTitleSize = cms.double(0.05)
281 xModifiers = [[
'pt',[
'xAxisTitle'],[
'P_{T} / GeV']],[
'eta',[
'xAxisTitle'],[
'#eta']],[
'phi',[
'xAxisTitle'],[
'#phi']],[
'pileup',[
'xAxisTitle'],[
'# of Reco Vertices']]]
283 yAxisStuff =cms.PSet(
284 yScale = cms.string(
'linear'),
285 minY_linear = cms.double(0.),
286 maxY_linear = cms.double(1.6),
287 minY_log = cms.double(0.001),
288 maxY_log = cms.double(1.8),
289 yAxisTitle = cms.string(
'#varepsilon'),
290 yAxisTitleOffset = cms.double(1.1),
291 yAxisTitleSize = cms.double(0.05)
293 yModifiers = [[
'efficiency',[
'yScale',
'yAxisTitle'],[
'linear',
'#varepsilon']],[
'fakeRate',[
'yScale',
'yAxisTitle'],[
'log',
'Fake rate']]]
296 posX = cms.double(0.50),
297 posY = cms.double(0.72),
298 sizeX = cms.double(0.39),
299 sizeY = cms.double(0.17),
300 header = cms.string(
''),
301 option = cms.string(
'brNDC'),
302 borderSize = cms.int32(0),
303 fillColor = cms.int32(0)
305 legModifiers = [[
'efficiency',[
'posY',
'sizeY'],[0.72,0.17]],[
'efficiency_overlay',[
'posY',
'sizeY'],[0.66,0.23]]]
307 drawOptStuff = cms.PSet(
308 markerColor = cms.int32(1),
309 markerSize = cms.double(1.),
310 markerStyle = cms.int32(20),
311 lineColor = cms.int32(1),
312 lineStyle = cms.int32(1),
313 lineWidth = cms.int32(2),
314 drawOption = cms.string(
'ex0'),
315 drawOptionLegend = cms.string(
'p')
317 drawOptModifiers = [[
'eff_overlay01',[
'markerColor',
'lineColor'],[1,1]],[
'eff_overlay02',[
'markerColor',
'lineColor'],[2,2]],[
'eff_overlay03',[
'markerColor',
'lineColor'],[3,3]],[
'eff_overlay04',[
'markerColor',
'lineColor'],[4,4]],[
'eff_overlay05',[
'markerColor',
'lineColor'],[6,6]],[
'eff_overlay06',[
'markerColor',
'lineColor'],[5,5]],[
'eff_overlay07',[
'markerColor',
'lineColor'],[7,7]],[
'eff_overlay08',[
'markerColor',
'lineColor'],[28,28]],[
'eff_overlay09',[
'markerColor',
'lineColor',
'markerStyle'],[2,2,29]],[
'eff_overlay010',[
'markerColor',
'lineColor',
'markerStyle'],[4,4,29]],[
'eff_overlay011',[
'markerColor',
'lineColor',
'markerStyle'],[6,6,29]]]
319 standardDrawingStuff = cms.PSet(
320 canvasSizeX = cms.int32(640),
321 canvasSizeY = cms.int32(640),
322 indOutputFileName = cms.string(
'#PLOT#.png'),
323 xAxes = Utils.SpawnPSet(xModifiers,xAxisStuff),
324 yAxes = Utils.SpawnPSet(yModifiers,yAxisStuff),
325 legends = Utils.SpawnPSet(legModifiers,legStuff),
328 posX = cms.double(0.19),
329 posY = cms.double(0.77),
330 sizeX = cms.double(0.12),
331 sizeY = cms.double(0.04),
332 option = cms.string(
'brNDC'),
333 borderSize = cms.int32(0),
334 fillColor = cms.int32(0),
335 textColor = cms.int32(1),
336 textSize = cms.double(0.04),
337 textAlign = cms.int32(22),
338 text = cms.vstring(
'P_{T} > 5 GeV')
341 posX = cms.double(0.19),
342 posY = cms.double(0.83),
343 sizeX = cms.double(0.12),
344 sizeY = cms.double(0.04),
345 option = cms.string(
'brNDC'),
346 borderSize = cms.int32(0),
347 fillColor = cms.int32(0),
348 textColor = cms.int32(1),
349 textSize = cms.double(0.04),
350 textAlign = cms.int32(22),
351 text = cms.vstring(
'-2.5 < #eta < +2.5')
354 drawOptionSets = cms.PSet(
355 efficiency = cms.PSet(
357 markerColor = cms.int32(4),
358 markerSize = cms.double(1.),
359 markerStyle = cms.int32(20),
360 lineColor = cms.int32(1),
361 lineStyle = cms.int32(1),
362 lineWidth = cms.int32(1),
363 drawOption = cms.string(
'ep'),
364 drawOptionLegend = cms.string(
'p')
366 reference = cms.PSet(
367 lineColor = cms.int32(1),
368 lineStyle = cms.int32(1),
369 lineWidth = cms.int32(1),
370 fillColor = cms.int32(41),
371 drawOption = cms.string(
'eBand'),
372 drawOptionLegend = cms.string(
'l')
376 drawOptionEntries = Utils.SpawnPSet(drawOptModifiers,drawOptStuff)
379 standardCompareTestAndReference = cms.PSet(
380 processes = cms.PSet(
382 dqmDirectory = cms.string(
'test'),
383 legendEntry = cms.string(
'no test label'),
384 type = cms.string(
'smMC')
386 reference = cms.PSet(
387 dqmDirectory = cms.string(
'reference'),
388 legendEntry = cms.string(
'no ref label'),
389 type = cms.string(
'smMC')
450 """ Helper class that applies a given function to all modules 460 input = re.sub(
'fixedConePFTauProducer',
'pfRecoTauProducer', input)
462 fixedDiscriminationRegex = re.compile(
'fixedConePFTauDiscrimination(\w*)')
463 input = fixedDiscriminationRegex.sub(
r'pfRecoTauDiscrimination\1', input)
464 input = re.sub(
'shrinkingConePFTauProducer',
'pfRecoTauProducerHighEfficiency', input)
465 shrinkingDiscriminationRegex = re.compile(
'shrinkingConePFTauDiscrimination(\w*)')
466 input = shrinkingDiscriminationRegex.sub(
r'pfRecoTauDiscrimination\1HighEfficiency', input)
471 """ Converts a draw job defined to compare 31X named PFTau validtion efficiencies 472 to comapre a 31X to a 22X named validation """ 474 if not hasattr(input,
"drawJobs"):
476 myDrawJobs = input.drawJobs.parameters_()
477 for drawJobName, drawJobData
in six.iteritems(myDrawJobs):
479 if not drawJobData.plots.pythonTypeName() ==
"cms.PSet":
481 pSetToInsert = cms.PSet(
482 standardEfficiencyParameters,
486 dqmMonitorElements = drawJobData.plots.dqmMonitorElements,
487 process = cms.string(
'test'),
488 drawOptionEntry = cms.string(
'eff_overlay01'),
489 legendEntry = cms.string(input.processes.test.legendEntry.value())
495 process = cms.string(
'reference'),
496 drawOptionEntry = cms.string(
'eff_overlay02'),
497 legendEntry = cms.string(input.processes.reference.legendEntry.value())
501 input.drawJobs.__setattr__(drawJobName, pSetToInsert)
505 if hasattr(module,
'processes'):
506 if module.processes.hasParameter([
'test',
'legendEntry'])
and module.processes.hasParameter([
'reference',
'legendEntry']):
507 module.processes.test.legendEntry = TestLabel
508 module.processes.reference.legendEntry = ReferenceLabel
509 print(
"Set test label to %s and reference label to %s for plot producer %s" % (TestLabel, ReferenceLabel, module.label()))
511 print(
"ERROR in RecoTauValidation_cfi::MakeLabeler - trying to set test/reference label but %s does not have processes.(test/reference).legendEntry parameters!" % module.label())
515 ''' set all modules whose name contains one of the matching names to log y scale''' 517 ''' set a module to use log scaling in the yAxis''' 518 if hasattr(module,
'drawJobs'):
520 drawJobParamGetter =
lambda subName : getattr(module.drawJobs, subName)
522 attrNames =
dir(module.drawJobs)
523 for subModuleName, subModule
in zip(attrNames,
map(drawJobParamGetter, attrNames)):
524 matchedNames = [name
for name
in matchingNames
if subModuleName.find( name) > -1]
525 if len(matchingNames) == 0:
526 matchedNames = [
'take',
'everything',
'and',
'dont',
'bother']
527 if hasattr(subModule,
"yAxis")
and len(matchedNames):
528 print(
"Setting drawJob: ", subModuleName,
" to log scale.")
529 subModule.yAxis = cms.string(
'fakeRate')
530 if len(matchingNames) == 0:
531 module.yAxes.efficiency.maxY_log = 40
532 module.yAxes.fakeRate.maxY_log = 40
537 def BaseDirectorizer(module):
540 if hasattr(module,
"outputFilePath"):
541 oldPath = module.outputFilePath.value()
542 newPath = os.path.join(newPath, oldPath)
543 if not os.path.exists(newPath):
546 module.outputFilePath = cms.string(
"%s" % newPath)
547 return BaseDirectorizer
550 if hasattr(module,
'drawJobs'):
552 drawJobs = module.drawJobs.parameterNames_()
553 for drawJob
in drawJobs:
554 if drawJob !=
"TauIdEffStepByStep":
555 module.drawJobs.__delattr__(drawJob)
556 print(
"Removing comparison plot", drawJob)
560 myPlottingSequence.visit(myFunctor)
564 myPlottingSequence.visit(myFunctor)
568 myPlottingSequence.visit(myFunctor)
571 myProcess.loadTau.test.inputFileNames = cms.vstring(FileLoc)
575 del myProcess.loadTau.reference
577 myProcess.loadTau.reference.inputFileNames = cms.vstring(FileLoc)
581 myPlottingSequence.visit(myFunctor)
585 myPlottingSequence.visit(myFunctor)
589 myPlottingSequence.visit(myFunctor)
592 module.ExtensionName = module.ExtensionName.value()+extension
595 if module._TypedParameterizable__type ==
'TauTagValidation':
596 module.histoSettings = pset
599 if hasattr(module,
'_TypedParameterizable__type')
and module._TypedParameterizable__type ==
'TauTagValidation':
600 setattr(module,
'turnOnTrigger',cms.bool(
True))
601 for item
in pset.parameters_().
items():
602 setattr(module.GenericTriggerSelection,item[0],item[1])
def SetPlotOnlyStepByStep(myPlottingSequence)
def SetLogScale(myPlottingSequence)
def SetCompareToLegacyProductNames(myPlottingSequence)
def TranslateToLegacyProdNames(input)
def SetPlotDirectory(myPlottingSequence, directory)
def SetReferenceFileToPlot(myProcess, FileLoc)
S & print(S &os, JobReport::InputFile const &f)
def setTrigger(module, pset)
def SetTestFileToPlot(myProcess, FileLoc)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def ConvertDrawJobToLegacyCompare(input)
def SetValidationExtention(module, extension)
The plotting of HPS Efficiencies.
def setBinning(module, pset)
def SetSmartLogScale(myPlottingSequence)
def MakeLabeler(TestLabel, ReferenceLabel)
def SetBaseDirectory(Directory)
def RemoveComparisonPlotCommands(module)
def SetTestAndReferenceLabels(myPlottingSequence, TestLabel, ReferenceLabel)
def SetYmodulesToLog(matchingNames=[])
def __init__(self, function)