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 456 of file RecoTauValidation_cfi.py.

References TranslateToLegacyProdNames().

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

Definition at line 489 of file RecoTauValidation_cfi.py.

Referenced by SetTestAndReferenceLabels().

490 def MakeLabeler(TestLabel, ReferenceLabel):
491  def labeler(module):
492  if hasattr(module, 'processes'):
493  if module.processes.hasParameter(['test', 'legendEntry']) and module.processes.hasParameter([ 'reference', 'legendEntry']):
494  module.processes.test.legendEntry = TestLabel
495  module.processes.reference.legendEntry = ReferenceLabel
496  print "Set test label to %s and reference label to %s for plot producer %s" % (TestLabel, ReferenceLabel, module.label())
497  else:
498  print "ERROR in RecoTauValidation_cfi::MakeLabeler - trying to set test/reference label but %s does not have processes.(test/reference).legendEntry parameters!" % module.label()
499  return labeler
def RecoTauValidation_cfi.RemoveComparisonPlotCommands (   module)

Definition at line 535 of file RecoTauValidation_cfi.py.

536 def RemoveComparisonPlotCommands(module):
537  if hasattr(module, 'drawJobs'):
538  #get draw job parameter names
539  drawJobs = module.drawJobs.parameterNames_()
540  for drawJob in drawJobs:
541  if drawJob != "TauIdEffStepByStep":
542  module.drawJobs.__delattr__(drawJob)
543  print "Removing comparison plot", drawJob
def RecoTauValidation_cfi.SetBaseDirectory (   Directory)

Definition at line 522 of file RecoTauValidation_cfi.py.

Referenced by SetPlotDirectory().

523 def SetBaseDirectory(Directory):
524  def BaseDirectorizer(module):
525  newPath = Directory
526  #if module.hasParameter("outputFilePath"):
527  if hasattr(module, "outputFilePath"):
528  oldPath = module.outputFilePath.value()
529  newPath = os.path.join(newPath, oldPath)
530  if not os.path.exists(newPath):
531  os.makedirs(newPath)
532  print newPath
533  module.outputFilePath = cms.string("%s" % newPath)
534  return BaseDirectorizer
def RecoTauValidation_cfi.setBinning (   module,
  pset 
)

Definition at line 580 of file RecoTauValidation_cfi.py.

581 def setBinning(module,pset):
582  if module._TypedParameterizable__type == 'TauTagValidation':
583  module.histoSettings = pset
def RecoTauValidation_cfi.SetCompareToLegacyProductNames (   myPlottingSequence)

Definition at line 552 of file RecoTauValidation_cfi.py.

553 def SetCompareToLegacyProductNames(myPlottingSequence):
554  myFunctor = ApplyFunctionToSequence(ConvertDrawJobToLegacyCompare)
555  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetLogScale (   myPlottingSequence)

Definition at line 565 of file RecoTauValidation_cfi.py.

References SetYmodulesToLog().

566 def SetLogScale(myPlottingSequence):
568  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetPlotDirectory (   myPlottingSequence,
  directory 
)

Definition at line 544 of file RecoTauValidation_cfi.py.

References SetBaseDirectory().

545 def SetPlotDirectory(myPlottingSequence, directory):
546  myFunctor = ApplyFunctionToSequence(SetBaseDirectory(directory))
547  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetPlotOnlyStepByStep (   myPlottingSequence)

Definition at line 573 of file RecoTauValidation_cfi.py.

574 def SetPlotOnlyStepByStep(myPlottingSequence):
575  myFunctor = ApplyFunctionToSequence(RemoveComparisonPlotCommands)
576  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetReferenceFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 559 of file RecoTauValidation_cfi.py.

560 def SetReferenceFileToPlot(myProcess, FileLoc):
561  if FileLoc == None:
562  del myProcess.loadTau.reference
563  else:
564  myProcess.loadTau.reference.inputFileNames = cms.vstring(FileLoc)
def RecoTauValidation_cfi.SetSmartLogScale (   myPlottingSequence)

Definition at line 569 of file RecoTauValidation_cfi.py.

References SetYmodulesToLog().

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

Definition at line 548 of file RecoTauValidation_cfi.py.

References MakeLabeler().

549 def SetTestAndReferenceLabels(myPlottingSequence, TestLabel, ReferenceLabel):
550  myFunctor = ApplyFunctionToSequence(MakeLabeler(TestLabel, ReferenceLabel))
551  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetTestFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 556 of file RecoTauValidation_cfi.py.

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

Definition at line 584 of file RecoTauValidation_cfi.py.

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

Definition at line 577 of file RecoTauValidation_cfi.py.

578 def SetValidationExtention(module, extension):
579  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 500 of file RecoTauValidation_cfi.py.

References dir.

Referenced by SetLogScale(), and SetSmartLogScale().

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

Definition at line 445 of file RecoTauValidation_cfi.py.

Referenced by ConvertDrawJobToLegacyCompare().

446 def TranslateToLegacyProdNames(input):
447  input = re.sub('fixedConePFTauProducer', 'pfRecoTauProducer', input)
448  #fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination( \w* )')
449  fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination(\w*)')
450  input = fixedDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1', input)
451  input = re.sub('shrinkingConePFTauProducer', 'pfRecoTauProducerHighEfficiency', input)
452  shrinkingDiscriminationRegex = re.compile('shrinkingConePFTauDiscrimination(\w*)')
453  input = shrinkingDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1HighEfficiency', input)
454  return input
455 

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 303 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 293 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 291 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 281 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 245 of file RecoTauValidation_cfi.py.

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

Normalizes All the histograms.

Definition at line 227 of file RecoTauValidation_cfi.py.

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

Definition at line 212 of file RecoTauValidation_cfi.py.

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

RecoTauValidation_cfi.plots = plotPset

Definition at line 215 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 228 of file RecoTauValidation_cfi.py.

Referenced by NoiseTask.book(), MuonAlignmentFromReference.initialize(), 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 365 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.standardDrawingStuff

Definition at line 305 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 262 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 267 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 269 of file RecoTauValidation_cfi.py.

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

Definition at line 279 of file RecoTauValidation_cfi.py.