CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
RecoTauValidation_cfi Namespace Reference

Classes

class  ApplyFunctionToSequence
 The plotting of HPS Efficiencies. More...
 

Functions

def ConvertDrawJobToLegacyCompare
 
def MakeLabeler
 
def RemoveComparisonPlotCommands
 
def SetBaseDirectory
 
def setBinning
 
def SetCompareToLegacyProductNames
 
def SetLogScale
 
def SetPlotDirectory
 
def SetPlotOnlyStepByStep
 
def SetReferenceFileToPlot
 
def SetSmartLogScale
 
def SetTestAndReferenceLabels
 
def SetTestFileToPlot
 
def setTrigger
 
def SetValidationExtention
 
def SetYmodulesToLog
 
def TranslateToLegacyProdNames
 

Variables

tuple denominator = cms.InputTag("kinematicSelectedTauValDenominator")
 
tuple discriminators
 
list 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]]]
 
tuple drawOptStuff
 
tuple ExtensionName = cms.string("")
 
 GenericTriggerSelection = GenericTriggerSelectionParameters,
 
tuple GenericTriggerSelectionParameters
 
tuple kinematicSelectedTauValDenominatorCut = cms.string('pt > 5. && abs(eta) < 2.5')
 
list legModifiers = [['efficiency',['posY','sizeY'],[0.72,0.17]],['efficiency_overlay',['posY','sizeY'],[0.66,0.23]]]
 
tuple legStuff
 
tuple loadTau
 
tuple plotNamesToNormalize = cms.vstring('*_pTRatio_*','*_Size_*','*_SumPt_*','*_dRTauRefJet*')
 Normalizes All the histograms. More...
 
tuple plotPset = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominator)
 
 plots = plotPset
 
tuple proc = cms.Process('helper')
 
tuple reference = cms.string('*_pTRatio_allHadronic')
 
tuple standardCompareTestAndReference
 
tuple standardDrawingStuff
 
tuple StandardMatchingParameters
 
tuple TauProducer = cms.InputTag('')
 
tuple xAxisStuff
 
list xModifiers = [['pt',['xAxisTitle'],['P_{T} / GeV']],['eta',['xAxisTitle'],['#eta']],['phi',['xAxisTitle'],['#phi']],['pileup',['xAxisTitle'],['# of Reco Vertices']]]
 
tuple yAxisStuff
 
list yModifiers = [['efficiency',['yScale','yAxisTitle'],['linear','#varepsilon']],['fakeRate',['yScale','yAxisTitle'],['log','Fake rate']]]
 

Function Documentation

def RecoTauValidation_cfi.ConvertDrawJobToLegacyCompare (   input)
Converts a draw job defined to compare 31X named PFTau validtion efficiencies
    to comapre a 31X to a 22X named validation 

Definition at line 447 of file RecoTauValidation_cfi.py.

References TranslateToLegacyProdNames().

449  """ Converts a draw job defined to compare 31X named PFTau validtion efficiencies
450  to comapre a 31X to a 22X named validation """
451  # get the list of drawjobs { name : copyOfPSet }
452  if not hasattr(input, "drawJobs"):
453  return
454  myDrawJobs = input.drawJobs.parameters_()
455  for drawJobName, drawJobData in myDrawJobs.iteritems():
456  print drawJobData
457  if not drawJobData.plots.pythonTypeName() == "cms.PSet":
458  continue
459  pSetToInsert = cms.PSet(
460  standardEfficiencyParameters,
461  plots = cms.VPSet(
462  # test plot w/ modern names
463  cms.PSet(
464  dqmMonitorElements = drawJobData.plots.dqmMonitorElements,
465  process = cms.string('test'),
466  drawOptionEntry = cms.string('eff_overlay01'),
467  legendEntry = cms.string(input.processes.test.legendEntry.value())
468  ),
469  # ref plot w/ vintage name
470  cms.PSet(
471  # translate the name
472  dqmMonitorElements = cms.vstring(TranslateToLegacyProdNames(drawJobData.plots.dqmMonitorElements.value()[0])),
473  process = cms.string('reference'),
474  drawOptionEntry = cms.string('eff_overlay02'),
475  legendEntry = cms.string(input.processes.reference.legendEntry.value())
476  )
477  )
478  )
479  input.drawJobs.__setattr__(drawJobName, pSetToInsert)
def RecoTauValidation_cfi.MakeLabeler (   TestLabel,
  ReferenceLabel 
)

Definition at line 480 of file RecoTauValidation_cfi.py.

Referenced by SetTestAndReferenceLabels().

481 def MakeLabeler(TestLabel, ReferenceLabel):
482  def labeler(module):
483  if hasattr(module, 'processes'):
484  if module.processes.hasParameter(['test', 'legendEntry']) and module.processes.hasParameter([ 'reference', 'legendEntry']):
485  module.processes.test.legendEntry = TestLabel
486  module.processes.reference.legendEntry = ReferenceLabel
487  print "Set test label to %s and reference label to %s for plot producer %s" % (TestLabel, ReferenceLabel, module.label())
488  else:
489  print "ERROR in RecoTauValidation_cfi::MakeLabeler - trying to set test/reference label but %s does not have processes.(test/reference).legendEntry parameters!" % module.label()
490  return labeler
def RecoTauValidation_cfi.RemoveComparisonPlotCommands (   module)

Definition at line 526 of file RecoTauValidation_cfi.py.

527 def RemoveComparisonPlotCommands(module):
528  if hasattr(module, 'drawJobs'):
529  #get draw job parameter names
530  drawJobs = module.drawJobs.parameterNames_()
531  for drawJob in drawJobs:
532  if drawJob != "TauIdEffStepByStep":
533  module.drawJobs.__delattr__(drawJob)
534  print "Removing comparison plot", drawJob
def RecoTauValidation_cfi.SetBaseDirectory (   Directory)

Definition at line 513 of file RecoTauValidation_cfi.py.

Referenced by SetPlotDirectory().

514 def SetBaseDirectory(Directory):
515  def BaseDirectorizer(module):
516  newPath = Directory
517  #if module.hasParameter("outputFilePath"):
518  if hasattr(module, "outputFilePath"):
519  oldPath = module.outputFilePath.value()
520  newPath = os.path.join(newPath, oldPath)
521  if not os.path.exists(newPath):
522  os.makedirs(newPath)
523  print newPath
524  module.outputFilePath = cms.string("%s" % newPath)
525  return BaseDirectorizer
def RecoTauValidation_cfi.setBinning (   module,
  pset 
)

Definition at line 571 of file RecoTauValidation_cfi.py.

572 def setBinning(module,pset):
573  if module._TypedParameterizable__type == 'TauTagValidation':
574  module.histoSettings = pset
def RecoTauValidation_cfi.SetCompareToLegacyProductNames (   myPlottingSequence)

Definition at line 543 of file RecoTauValidation_cfi.py.

544 def SetCompareToLegacyProductNames(myPlottingSequence):
545  myFunctor = ApplyFunctionToSequence(ConvertDrawJobToLegacyCompare)
546  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetLogScale (   myPlottingSequence)

Definition at line 556 of file RecoTauValidation_cfi.py.

References SetYmodulesToLog().

557 def SetLogScale(myPlottingSequence):
559  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetPlotDirectory (   myPlottingSequence,
  directory 
)

Definition at line 535 of file RecoTauValidation_cfi.py.

References SetBaseDirectory().

536 def SetPlotDirectory(myPlottingSequence, directory):
537  myFunctor = ApplyFunctionToSequence(SetBaseDirectory(directory))
538  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetPlotOnlyStepByStep (   myPlottingSequence)

Definition at line 564 of file RecoTauValidation_cfi.py.

565 def SetPlotOnlyStepByStep(myPlottingSequence):
566  myFunctor = ApplyFunctionToSequence(RemoveComparisonPlotCommands)
567  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetReferenceFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 550 of file RecoTauValidation_cfi.py.

551 def SetReferenceFileToPlot(myProcess, FileLoc):
552  if FileLoc == None:
553  del myProcess.loadTau.reference
554  else:
555  myProcess.loadTau.reference.inputFileNames = cms.vstring(FileLoc)
def RecoTauValidation_cfi.SetSmartLogScale (   myPlottingSequence)

Definition at line 560 of file RecoTauValidation_cfi.py.

References SetYmodulesToLog().

561 def SetSmartLogScale(myPlottingSequence):
562  myFunctor = ApplyFunctionToSequence(SetYmodulesToLog(['Electron', 'Muon', 'Isolation', 'TaNC']))
563  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetTestAndReferenceLabels (   myPlottingSequence,
  TestLabel,
  ReferenceLabel 
)

Definition at line 539 of file RecoTauValidation_cfi.py.

References MakeLabeler().

540 def SetTestAndReferenceLabels(myPlottingSequence, TestLabel, ReferenceLabel):
541  myFunctor = ApplyFunctionToSequence(MakeLabeler(TestLabel, ReferenceLabel))
542  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetTestFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 547 of file RecoTauValidation_cfi.py.

548 def SetTestFileToPlot(myProcess, FileLoc):
549  myProcess.loadTau.test.inputFileNames = cms.vstring(FileLoc)
def RecoTauValidation_cfi.setTrigger (   module,
  pset 
)

Definition at line 575 of file RecoTauValidation_cfi.py.

576 def setTrigger(module,pset):
577  if hasattr(module,'_TypedParameterizable__type') and module._TypedParameterizable__type == 'TauTagValidation':
578  setattr(module,'turnOnTrigger',cms.bool(True)) #Turns on trigger (in case is off)
579  for item in pset.parameters_().items():
580  setattr(module.GenericTriggerSelection,item[0],item[1])
def RecoTauValidation_cfi.SetValidationExtention (   module,
  extension 
)

Definition at line 568 of file RecoTauValidation_cfi.py.

569 def SetValidationExtention(module, extension):
570  module.ExtensionName = module.ExtensionName.value()+extension
def RecoTauValidation_cfi.SetYmodulesToLog (   matchingNames = [])
set all modules whose name contains one of the matching names to log y scale

Definition at line 491 of file RecoTauValidation_cfi.py.

References dir, and python.multivaluedict.map().

Referenced by SetLogScale(), and SetSmartLogScale().

492 def SetYmodulesToLog(matchingNames = []):
493  ''' set all modules whose name contains one of the matching names to log y scale'''
494  def yLogger(module):
495  ''' set a module to use log scaling in the yAxis'''
496  if hasattr(module, 'drawJobs'):
497  print "EK DEBUG"
498  drawJobParamGetter = lambda subName : getattr(module.drawJobs, subName)
499  #for subModule in [getattr(module.drawJobs, subModuleName) for subModuleName in dir(module.drawJobs)]:
500  attrNames = dir(module.drawJobs)
501  for subModuleName, subModule in zip(attrNames, map(drawJobParamGetter, attrNames)):
502  matchedNames = [name for name in matchingNames if subModuleName.find( name) > -1] # matching sub strings
503  if len(matchingNames) == 0:
504  matchedNames = ['take','everything','and','dont','bother']
505  if hasattr(subModule, "yAxis") and len(matchedNames):
506  print "Setting drawJob: ", subModuleName, " to log scale."
507  subModule.yAxis = cms.string('fakeRate') #'fakeRate' configuration specifies the log scaling
508  if len(matchingNames) == 0:
509  module.yAxes.efficiency.maxY_log = 40
510  module.yAxes.fakeRate.maxY_log = 40
511  return yLogger
512 
dbl *** dir
Definition: mlp_gen.cc:35
def RecoTauValidation_cfi.TranslateToLegacyProdNames (   input)

Definition at line 436 of file RecoTauValidation_cfi.py.

Referenced by ConvertDrawJobToLegacyCompare().

437 def TranslateToLegacyProdNames(input):
438  input = re.sub('fixedConePFTauProducer', 'pfRecoTauProducer', input)
439  #fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination( \w* )')
440  fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination(\w*)')
441  input = fixedDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1', input)
442  input = re.sub('shrinkingConePFTauProducer', 'pfRecoTauProducerHighEfficiency', input)
443  shrinkingDiscriminationRegex = re.compile('shrinkingConePFTauDiscrimination(\w*)')
444  input = shrinkingDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1HighEfficiency', input)
445  return input
446 

Variable Documentation

tuple RecoTauValidation_cfi.denominator = cms.InputTag("kinematicSelectedTauValDenominator")

Definition at line 74 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.discriminators
Initial value:
1 = cms.VPSet(
2  )

Definition at line 120 of file RecoTauValidation_cfi.py.

list RecoTauValidation_cfi.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]]]

Definition at line 294 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.drawOptStuff
Initial value:
1 = cms.PSet(
2  markerColor = cms.int32(1),
3  markerSize = cms.double(1.),
4  markerStyle = cms.int32(20),
5  lineColor = cms.int32(1),
6  lineStyle = cms.int32(1),
7  lineWidth = cms.int32(2),
8  drawOption = cms.string('ex0'),
9  drawOptionLegend = cms.string('p')
10 )

Definition at line 284 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.ExtensionName = cms.string("")

Definition at line 118 of file RecoTauValidation_cfi.py.

RecoTauValidation_cfi.GenericTriggerSelection = GenericTriggerSelectionParameters,

Definition at line 117 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.GenericTriggerSelectionParameters
Initial value:
1 = cms.PSet(
2  andOr = cms.bool( False ),#specifies the logical combination of the single filters' (L1, HLT and DCS) decisions at top level (True=OR)
3  dbLabel = cms.string("PFTauDQMTrigger"),#specifies the label under which the DB payload is available from the ESSource or Global Tag
4  andOrHlt = cms.bool(True),#specifies the logical combination of the single HLT paths' decisions (True=OR)
5  hltInputTag = cms.InputTag("TriggerResults::HLT"),
6  #hltDBKey = cms.string('jetmet_highptjet'),#Tag of the record in the database, where IOV-based HLT paths are found. This record overwrites the configuration parameter hltPaths
7  hltPaths = cms.vstring('HLT_IsoMu*_eta*_LooseIsoPFTau*_v*','HLT_DoubleIsoPFTau*_Trk*_eta*_v*'),#Lists logical expressions of HLT paths, which should have accepted the event (fallback in case DB unaccessible)
8  errorReplyHlt = cms.bool(False),#specifies the desired return value of the HLT filter and the single HLT path filter in case of certain errors
9  verbosityLevel = cms.uint32(0) #0: complete silence (default), needed for T0 processing;
10 )

Definition at line 103 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.kinematicSelectedTauValDenominatorCut = cms.string('pt > 5. && abs(eta) < 2.5')

Definition at line 73 of file RecoTauValidation_cfi.py.

list RecoTauValidation_cfi.legModifiers = [['efficiency',['posY','sizeY'],[0.72,0.17]],['efficiency_overlay',['posY','sizeY'],[0.66,0.23]]]

Definition at line 282 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.legStuff
Initial value:
1 = cms.PSet(
2  posX = cms.double(0.50),
3  posY = cms.double(0.72),
4  sizeX = cms.double(0.39),
5  sizeY = cms.double(0.17),
6  header = cms.string(''),
7  option = cms.string('brNDC'),
8  borderSize = cms.int32(0),
9  fillColor = cms.int32(0)
10 )

Definition at line 272 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.loadTau
Initial value:
1 = cms.EDAnalyzer("TauDQMFileLoader",
2  test = cms.PSet(
3  #inputFileNames = cms.vstring('/afs/cern.ch/user/f/friis/scratch0/MyValidationArea/310pre6NewTags/src/Validation/RecoTau/test/CMSSW_3_1_0_pre6_ZTT_0505Fixes.root'),
4  inputFileNames = cms.vstring('/opt/sbg/cms/ui4_data1/dbodin/CMSSW_3_5_1/src/TauID/QCD_recoFiles/TauVal_CMSSW_3_6_0_QCD.root'),
5  scaleFactor = cms.double(1.),
6  dqmDirectory_store = cms.string('test')
7  ),
8  reference = cms.PSet(
9  inputFileNames = cms.vstring('/opt/sbg/cms/ui4_data1/dbodin/CMSSW_3_5_1/src/TauID/QCD_recoFiles/TauVal_CMSSW_3_6_0_QCD.root'),
10  scaleFactor = cms.double(1.),
11  dqmDirectory_store = cms.string('reference')
12  )
13 )

Definition at line 236 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.plotNamesToNormalize = cms.vstring('*_pTRatio_*','*_Size_*','*_SumPt_*','*_dRTauRefJet*')

Normalizes All the histograms.

Definition at line 218 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.plotPset = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominator)

Definition at line 203 of file RecoTauValidation_cfi.py.

Referenced by ConfigurableAnalysis.ConfigurableAnalysis(), and PlottingDevice.PlottingDevice().

RecoTauValidation_cfi.plots = plotPset

Definition at line 206 of file RecoTauValidation_cfi.py.

Referenced by PatTrackAnalyzer.analyze(), PatBJetTagAnalyzer.beginJob(), PatTrackAnalyzer.beginJob(), PatBJetTrackAnalyzer.beginJob(), PatBJetVertexAnalyzer.beginJob(), L1TEfficiency_Harvesting.L1TEfficiency_Harvesting(), FastTimerService.preStreamBeginRun(), FastTimerService::StreamData.reset(), TauDQMHistEffProducer.TauDQMHistEffProducer(), and TauDQMHistPlotter.TauDQMHistPlotter().

tuple RecoTauValidation_cfi.proc = cms.Process('helper')

Definition at line 88 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.reference = cms.string('*_pTRatio_allHadronic')

Definition at line 219 of file RecoTauValidation_cfi.py.

Referenced by NoiseTask.book(), HDQMInspector.createTrend(), MuonAlignmentFromReference.initialize(), HDQMInspector.InitializeIOVList(), writeCalibTxt(), and writeCMSSWCoeff().

tuple RecoTauValidation_cfi.standardCompareTestAndReference
Initial value:
1 = cms.PSet(
2  processes = cms.PSet(
3  test = cms.PSet(
4  dqmDirectory = cms.string('test'),
5  legendEntry = cms.string('no test label'),
6  type = cms.string('smMC') # Data/smMC/bsmMC/smSumMC
7  ),
8  reference = cms.PSet(
9  dqmDirectory = cms.string('reference'),
10  legendEntry = cms.string('no ref label'),
11  type = cms.string('smMC') # Data/smMC/bsmMC/smSumMC
12  )
13  ),
14 )

Definition at line 356 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.standardDrawingStuff

Definition at line 296 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.StandardMatchingParameters
Initial value:
1 = cms.PSet(
2  DataType = cms.string('Leptons'),
3  MatchDeltaR_Leptons = cms.double(0.15),
4  MatchDeltaR_Jets = cms.double(0.3),
5  SaveOutputHistograms = cms.bool(False), #TRUE FOR TEST ONLY
6  #RefCollection = cms.InputTag("TauGenJetProducer","selectedGenTauDecaysToHadronsPt5Cumulative"),
7  RefCollection = denominator,
8  TauPtCut = cms.double(0.), #almost deprecated, since recoCuts provides more flexibility
9  recoCuts = cms.string(''), #filter reconstructed candidates. leave this empty to select all. or use sth like: pt > 20 & abs(eta) < 2.3
10  genCuts = cms.string(''), #filter generated candidates. leave this empty to select all. or use sth like: pt > 20 & abs(eta) < 2.3
11  chainCuts = cms.bool(False) #Decide whether to chain discriminators or not
12 )

Definition at line 90 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.TauProducer = cms.InputTag('')

Definition at line 119 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.xAxisStuff
Initial value:
1 = cms.PSet(
2  xAxisTitle = cms.string('P_{T} / GeV'),
3  xAxisTitleOffset = cms.double(0.9),
4  xAxisTitleSize = cms.double(0.05)
5 )

Definition at line 253 of file RecoTauValidation_cfi.py.

list RecoTauValidation_cfi.xModifiers = [['pt',['xAxisTitle'],['P_{T} / GeV']],['eta',['xAxisTitle'],['#eta']],['phi',['xAxisTitle'],['#phi']],['pileup',['xAxisTitle'],['# of Reco Vertices']]]

Definition at line 258 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.yAxisStuff
Initial value:
1 = cms.PSet(
2  yScale = cms.string('linear'), # linear/log
3  minY_linear = cms.double(0.),
4  maxY_linear = cms.double(1.6),
5  minY_log = cms.double(0.001),
6  maxY_log = cms.double(1.8),
7  yAxisTitle = cms.string('#varepsilon'),
8  yAxisTitleOffset = cms.double(1.1),
9  yAxisTitleSize = cms.double(0.05)
10 )

Definition at line 260 of file RecoTauValidation_cfi.py.

list RecoTauValidation_cfi.yModifiers = [['efficiency',['yScale','yAxisTitle'],['linear','#varepsilon']],['fakeRate',['yScale','yAxisTitle'],['log','Fake rate']]]

Definition at line 270 of file RecoTauValidation_cfi.py.