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
 

Functions

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

Variables

tuple CaloTausBothProngs
 
tuple kinematicSelectedTauValDenominator
 
tuple loadAndPlotTauValidation
 
tuple loadTau
 
tuple PFTausBothProngs
 
tuple PFTausHighEfficiencyBothProngs
 
tuple PFTausHighEfficiencyLeadingPionBothProngs
 
tuple plotCaloTauEfficiencies
 The plotting of all the CaloTau ID efficiencies. More...
 
tuple plotHPSEfficiencies
 The plotting of HPS Efficiencies. More...
 
tuple plotPFTauEfficiencies
 The plotting of all the PFTau ID efficiencies. More...
 
tuple plotPFTauHighEfficiencyEfficiencies
 The plotting of all the PFTauHighEfficiencies ID efficiencies. More...
 
tuple plotPFTauHighEfficiencyEfficienciesLeadingPion
 The plotting of all the PFTauHighEfficiencyUsingLeadingPion ID efficiencies. More...
 
tuple plotTancValidation
 Plot Tanc performance. More...
 
tuple plotTauValidation
 
tuple RunHPSValidation = copy.deepcopy(PFTausHighEfficiencyBothProngs)
 
tuple RunTancValidation = copy.deepcopy(PFTausHighEfficiencyBothProngs)
 
tuple standardCompareTestAndReference
 
tuple standardDrawingStuff
 
tuple standardEfficiencyOverlay
 
tuple standardEfficiencyParameters
 
tuple StandardMatchingParameters
 
tuple TauEfficiencies
 
tuple TauValNumeratorAndDenominator
 

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

References TranslateToLegacyProdNames().

1333  """ Converts a draw job defined to compare 31X named PFTau validtion efficiencies
1334  to comapre a 31X to a 22X named validation """
1335  # get the list of drawjobs { name : copyOfPSet }
1336  if not hasattr(input, "drawJobs"):
1337  return
1338  myDrawJobs = input.drawJobs.parameters_()
1339  for drawJobName, drawJobData in myDrawJobs.iteritems():
1340  print drawJobData
1341  if not drawJobData.plots.pythonTypeName() == "cms.PSet":
1342  continue
1343  pSetToInsert = cms.PSet(
1344  standardEfficiencyParameters,
1345  plots = cms.VPSet(
1346  # test plot w/ modern names
1347  cms.PSet(
1348  dqmMonitorElements = drawJobData.plots.dqmMonitorElements,
1349  process = cms.string('test'),
1350  drawOptionEntry = cms.string('eff_overlay01'),
1351  legendEntry = cms.string(input.processes.test.legendEntry.value())
1352  ),
1353  # ref plot w/ vintage name
1354  cms.PSet(
1355  # translate the name
1356  dqmMonitorElements = cms.vstring(TranslateToLegacyProdNames(drawJobData.plots.dqmMonitorElements.value()[0])),
1357  process = cms.string('reference'),
1358  drawOptionEntry = cms.string('eff_overlay02'),
1359  legendEntry = cms.string(input.processes.reference.legendEntry.value())
1360  )
1361  )
1362  )
1363  input.drawJobs.__setattr__(drawJobName, pSetToInsert)
def RecoTauValidation_cfi.MakeLabeler (   TestLabel,
  ReferenceLabel 
)

Definition at line 1364 of file RecoTauValidation_cfi.py.

Referenced by SetTestAndReferenceLabels().

1365 def MakeLabeler(TestLabel, ReferenceLabel):
1366  def labeler(module):
1367  if hasattr(module, 'processes'):
1368  if module.processes.hasParameter(['test', 'legendEntry']) and module.processes.hasParameter([ 'reference', 'legendEntry']):
1369  module.processes.test.legendEntry = TestLabel
1370  module.processes.reference.legendEntry = ReferenceLabel
1371  print "Set test label to %s and reference label to %s for plot producer %s" % (TestLabel, ReferenceLabel, module.label())
1372  else:
1373  print "ERROR in RecoTauValidation_cfi::MakeLabeler - trying to set test/reference label but %s does not have processes.(test/reference).legendEntry parameters!" % module.label()
1374  return labeler
def RecoTauValidation_cfi.RemoveComparisonPlotCommands (   module)

Definition at line 1405 of file RecoTauValidation_cfi.py.

1406 def RemoveComparisonPlotCommands(module):
1407  if hasattr(module, 'drawJobs'):
1408  #get draw job parameter names
1409  drawJobs = module.drawJobs.parameterNames_()
1410  for drawJob in drawJobs:
1411  if drawJob != "TauIdEffStepByStep":
1412  module.drawJobs.__delattr__(drawJob)
1413  print "Removing comparison plot", drawJob
def RecoTauValidation_cfi.SetBaseDirectory (   Directory)

Definition at line 1392 of file RecoTauValidation_cfi.py.

Referenced by SetPlotDirectory().

1393 def SetBaseDirectory(Directory):
1394  def BaseDirectorizer(module):
1395  newPath = Directory
1396  #if module.hasParameter("outputFilePath"):
1397  if hasattr(module, "outputFilePath"):
1398  oldPath = module.outputFilePath.value()
1399  newPath = os.path.join(newPath, oldPath)
1400  if not os.path.exists(newPath):
1401  os.makedirs(newPath)
1402  print newPath
1403  module.outputFilePath = cms.string("%s" % newPath)
1404  return BaseDirectorizer
def RecoTauValidation_cfi.SetCompareToLegacyProductNames (   myPlottingSequence)

Definition at line 1422 of file RecoTauValidation_cfi.py.

1423 def SetCompareToLegacyProductNames(myPlottingSequence):
1424  myFunctor = ApplyFunctionToSequence(ConvertDrawJobToLegacyCompare)
1425  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetLogScale (   myPlottingSequence)

Definition at line 1435 of file RecoTauValidation_cfi.py.

References SetYmodulesToLog().

1436 def SetLogScale(myPlottingSequence):
1438  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetPlotDirectory (   myPlottingSequence,
  directory 
)

Definition at line 1414 of file RecoTauValidation_cfi.py.

References SetBaseDirectory().

1415 def SetPlotDirectory(myPlottingSequence, directory):
1416  myFunctor = ApplyFunctionToSequence(SetBaseDirectory(directory))
1417  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetPlotOnlyStepByStep (   myPlottingSequence)

Definition at line 1443 of file RecoTauValidation_cfi.py.

1444 def SetPlotOnlyStepByStep(myPlottingSequence):
1445  myFunctor = ApplyFunctionToSequence(RemoveComparisonPlotCommands)
1446  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetReferenceFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 1429 of file RecoTauValidation_cfi.py.

1430 def SetReferenceFileToPlot(myProcess, FileLoc):
1431  if FileLoc == None:
1432  del myProcess.loadTau.reference
1433  else:
1434  myProcess.loadTau.reference.inputFileNames = cms.vstring(FileLoc)
def RecoTauValidation_cfi.SetSmartLogScale (   myPlottingSequence)

Definition at line 1439 of file RecoTauValidation_cfi.py.

References SetYmodulesToLog().

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

Definition at line 1418 of file RecoTauValidation_cfi.py.

References MakeLabeler().

1419 def SetTestAndReferenceLabels(myPlottingSequence, TestLabel, ReferenceLabel):
1420  myFunctor = ApplyFunctionToSequence(MakeLabeler(TestLabel, ReferenceLabel))
1421  myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi.SetTestFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 1426 of file RecoTauValidation_cfi.py.

1427 def SetTestFileToPlot(myProcess, FileLoc):
1428  myProcess.loadTau.test.inputFileNames = cms.vstring(FileLoc)
def RecoTauValidation_cfi.SetYmodulesToLog (   matchingNames = [])
set all modules whose name contains one of the matching names to log y scale

Definition at line 1375 of file RecoTauValidation_cfi.py.

References dir, and Association.map.

Referenced by SetLogScale(), and SetSmartLogScale().

1376 def SetYmodulesToLog(matchingNames = []):
1377  ''' set all modules whose name contains one of the matching names to log y scale'''
1378  def yLogger(module):
1379  ''' set a module to use log scaling in the yAxis'''
1380  if hasattr(module, 'drawJobs'):
1381  print "EK DEBUG"
1382  drawJobParamGetter = lambda subName : getattr(module.drawJobs, subName)
1383  #for subModule in [getattr(module.drawJobs, subModuleName) for subModuleName in dir(module.drawJobs)]:
1384  attrNames = dir(module.drawJobs)
1385  for subModuleName, subModule in zip(attrNames, map(drawJobParamGetter, attrNames)):
1386  matchedNames = [name for name in matchingNames if subModuleName.find( name) > -1] # matching sub strings
1387  if hasattr(subModule, "yAxis") and len(matchedNames):
1388  print "Setting drawJob: ", subModuleName, " to log scale."
1389  subModule.yAxis = cms.string('fakeRate') #'fakeRate' configuration specifies the log scaling
1390  return yLogger
1391 
dictionary map
Definition: Association.py:160
dbl *** dir
Definition: mlp_gen.cc:35
def RecoTauValidation_cfi.TranslateToLegacyProdNames (   input)

Definition at line 1320 of file RecoTauValidation_cfi.py.

Referenced by ConvertDrawJobToLegacyCompare().

1321 def TranslateToLegacyProdNames(input):
1322  input = re.sub('fixedConePFTauProducer', 'pfRecoTauProducer', input)
1323  #fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination( \w* )')
1324  fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination(\w*)')
1325  input = fixedDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1', input)
1326  input = re.sub('shrinkingConePFTauProducer', 'pfRecoTauProducerHighEfficiency', input)
1327  shrinkingDiscriminationRegex = re.compile('shrinkingConePFTauDiscrimination(\w*)')
1328  input = shrinkingDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1HighEfficiency', input)
1329  return input
1330 

Variable Documentation

tuple RecoTauValidation_cfi.CaloTausBothProngs
Initial value:
1 = cms.EDAnalyzer("TauTagValidation",
2  StandardMatchingParameters,
3  ExtensionName = cms.string(""),
4  TauProducer = cms.InputTag('caloRecoTauProducer'),
5  discriminators = cms.VPSet(
6  cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationByLeadingTrackFinding"),selectionCut = cms.double(0.5)),
7  cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationByLeadingTrackPtCut"),selectionCut = cms.double(0.5)),
8  cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationByIsolation"),selectionCut = cms.double(0.5)),
9  cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5))
10  )
11 )

Definition at line 164 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.kinematicSelectedTauValDenominator
Initial value:
1 = cms.EDFilter("GenJetSelector",
2  src = cms.InputTag("objectTypeSelectedTauValDenominator"),
3  cut = cms.string('pt > 5. && abs(eta) < 2.5'),
4  filter = cms.bool(False)
5 )

Definition at line 70 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.loadAndPlotTauValidation
Initial value:
1 = cms.Sequence(
2  loadTau
3  +plotTancValidation
4  )

Definition at line 1299 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.loadTau
Initial value:
1 = cms.EDAnalyzer("DQMFileLoader",
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  scaleFactor = cms.double(1.),
5  dqmDirectory_store = cms.string('test')
6  ),
7  reference = cms.PSet(
8  inputFileNames = cms.vstring('/afs/cern.ch/user/f/friis/CMSSW/pre6/src/Validation/RecoTau/test/CMSSW_3_1_0_pre6_ZTT.root'),
9  scaleFactor = cms.double(1.),
10  dqmDirectory_store = cms.string('reference')
11  )
12 )

Definition at line 462 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.PFTausBothProngs
Initial value:
1 = cms.EDAnalyzer("TauTagValidation",
2  StandardMatchingParameters,
3  ExtensionName = cms.string(""),
4  TauProducer = cms.InputTag('fixedConePFTauProducer'),
5  discriminators = cms.VPSet(
6  cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByLeadingTrackFinding"),selectionCut = cms.double(0.5)),
7  cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByLeadingTrackPtCut"),selectionCut = cms.double(0.5)),
8  cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByTrackIsolation"),selectionCut = cms.double(0.5)),
9  cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByECALIsolation"),selectionCut = cms.double(0.5)),
10  cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
11  cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
12  )
13 )

Definition at line 150 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.PFTausHighEfficiencyBothProngs
Initial value:
1 = cms.EDAnalyzer("TauTagValidation",
2  StandardMatchingParameters,
3  ExtensionName = cms.string(""),
4  TauProducer = cms.InputTag('shrinkingConePFTauProducer'),
5  discriminators = cms.VPSet(
6  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingTrackFinding"),selectionCut = cms.double(0.5)),
7  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingTrackPtCut"),selectionCut = cms.double(0.5)),
8  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTrackIsolation"),selectionCut = cms.double(0.5)),
9  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByECALIsolation"),selectionCut = cms.double(0.5)),
10  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
11  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
12  )
13 )

Definition at line 110 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.PFTausHighEfficiencyLeadingPionBothProngs
Initial value:
1 = cms.EDAnalyzer("TauTagValidation",
2  StandardMatchingParameters,
3  ExtensionName = cms.string("LeadingPion"),
4  TauProducer = cms.InputTag('shrinkingConePFTauProducer'),
5  discriminators = cms.VPSet(
6  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingPionPtCut"),selectionCut = cms.double(0.5)),
7  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion"),selectionCut = cms.double(0.5)),
8  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion"),selectionCut = cms.double(0.5)),
9  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
10  cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
11  )
12 )

Definition at line 97 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.plotCaloTauEfficiencies

The plotting of all the CaloTau ID efficiencies.

Definition at line 1003 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.plotHPSEfficiencies

The plotting of HPS Efficiencies.

Definition at line 803 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.plotPFTauEfficiencies

The plotting of all the PFTau ID efficiencies.

Definition at line 706 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.plotPFTauHighEfficiencyEfficiencies

The plotting of all the PFTauHighEfficiencies ID efficiencies.

Definition at line 906 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.plotPFTauHighEfficiencyEfficienciesLeadingPion

The plotting of all the PFTauHighEfficiencyUsingLeadingPion ID efficiencies.

Definition at line 1198 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.plotTancValidation

Plot Tanc performance.

Definition at line 1074 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.plotTauValidation
Initial value:
1 = cms.Sequence(
2  plotPFTauEfficiencies
3  +plotPFTauHighEfficiencyEfficiencies
4  +plotCaloTauEfficiencies
5  +plotTancValidation
6  +plotPFTauHighEfficiencyEfficienciesLeadingPion
7  +plotHPSEfficiencies
8  )

Definition at line 1289 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.RunHPSValidation = copy.deepcopy(PFTausHighEfficiencyBothProngs)

Definition at line 136 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.RunTancValidation = copy.deepcopy(PFTausHighEfficiencyBothProngs)

Definition at line 124 of file RecoTauValidation_cfi.py.

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

tuple RecoTauValidation_cfi.standardDrawingStuff

Definition at line 478 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.standardEfficiencyOverlay
Initial value:
1 = cms.PSet(
2  parameter = cms.vstring('pt', 'eta', 'phi', 'energy'),
3  title = cms.string('TauId step by step efficiencies'),
4  xAxis = cms.string('#PAR#'),
5  yAxis = cms.string('efficiency'),
6  legend = cms.string('efficiency_overlay'),
7  labels = cms.vstring('pt', 'eta')
8 )

Definition at line 691 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.standardEfficiencyParameters
Initial value:
1 = cms.PSet(
2  parameter = cms.vstring('pt', 'eta', 'phi', 'energy'),
3  xAxis = cms.string('#PAR#'),
4  yAxis = cms.string('efficiency'),
5  legend = cms.string('efficiency'),
6  labels = cms.vstring('pt', 'eta'),
7  drawOptionSet = cms.string('efficiency')
8 )

Definition at line 682 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),
6  #RefCollection = cms.InputTag("TauGenJetProducer","selectedGenTauDecaysToHadronsPt5Cumulative"),
7  RefCollection = cms.InputTag("kinematicSelectedTauValDenominator"),
8 )

Definition at line 88 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.TauEfficiencies

Definition at line 196 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi.TauValNumeratorAndDenominator
Initial value:
1 = cms.Sequence(
2  PFTausBothProngs+
3  CaloTausBothProngs +
4  PFTausHighEfficiencyBothProngs+
5  PFTausHighEfficiencyLeadingPionBothProngs+
6  RunTancValidation+
7  RunHPSValidation
8  )

Definition at line 176 of file RecoTauValidation_cfi.py.