CMS 3D CMS Logo

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.
tuple plotHPSEfficiencies
 The plotting of HPS Efficiencies.
tuple plotPFTauEfficiencies
 The plotting of all the PFTau ID efficiencies.
tuple plotPFTauHighEfficiencyEfficiencies
 The plotting of all the PFTauHighEfficiencies ID efficiencies.
tuple plotPFTauHighEfficiencyEfficienciesLeadingPion
 The plotting of all the PFTauHighEfficiencyUsingLeadingPion ID efficiencies.
tuple plotTancValidation
 Plot Tanc performance.
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.

01332                                         :
01333    """ Converts a draw job defined to compare 31X named PFTau validtion efficiencies
01334        to comapre a 31X to a 22X named validation """
01335    # get the list of drawjobs { name : copyOfPSet }
01336    if not hasattr(input, "drawJobs"):
01337       return
01338    myDrawJobs = input.drawJobs.parameters_()
01339    for drawJobName, drawJobData in myDrawJobs.iteritems():
01340       print drawJobData
01341       if not drawJobData.plots.pythonTypeName() == "cms.PSet":
01342          continue
01343       pSetToInsert = cms.PSet(
01344             standardEfficiencyParameters,
01345             plots = cms.VPSet(
01346                # test plot w/ modern names
01347                cms.PSet(
01348                   dqmMonitorElements = drawJobData.plots.dqmMonitorElements,
01349                   process = cms.string('test'),
01350                   drawOptionEntry = cms.string('eff_overlay01'),
01351                   legendEntry = cms.string(input.processes.test.legendEntry.value())
01352                   ),
01353                # ref plot w/ vintage name
01354                cms.PSet(
01355                   # translate the name
01356                   dqmMonitorElements = cms.vstring(TranslateToLegacyProdNames(drawJobData.plots.dqmMonitorElements.value()[0])),
01357                   process = cms.string('reference'),
01358                   drawOptionEntry = cms.string('eff_overlay02'),
01359                   legendEntry = cms.string(input.processes.reference.legendEntry.value())
01360                   )
01361                )
01362             )
01363       input.drawJobs.__setattr__(drawJobName, pSetToInsert)

def RecoTauValidation_cfi::MakeLabeler (   TestLabel,
  ReferenceLabel 
)

Definition at line 1364 of file RecoTauValidation_cfi.py.

01365                                           :
01366    def labeler(module):
01367       if hasattr(module, 'processes'):
01368          if module.processes.hasParameter(['test', 'legendEntry']) and module.processes.hasParameter([ 'reference', 'legendEntry']):
01369             module.processes.test.legendEntry = TestLabel
01370             module.processes.reference.legendEntry = ReferenceLabel
01371             print "Set test label to %s and reference label to %s for plot producer %s" % (TestLabel, ReferenceLabel, module.label())
01372          else:
01373             print "ERROR in RecoTauValidation_cfi::MakeLabeler - trying to set test/reference label but %s does not have processes.(test/reference).legendEntry parameters!" % module.label()
01374    return labeler

def RecoTauValidation_cfi::RemoveComparisonPlotCommands (   module)

Definition at line 1405 of file RecoTauValidation_cfi.py.

01406                                         :
01407    if hasattr(module, 'drawJobs'):
01408       #get draw job parameter names
01409       drawJobs = module.drawJobs.parameterNames_()
01410       for drawJob in drawJobs:
01411          if drawJob != "TauIdEffStepByStep":
01412             module.drawJobs.__delattr__(drawJob)
01413             print "Removing comparison plot", drawJob

def RecoTauValidation_cfi::SetBaseDirectory (   Directory)

Definition at line 1392 of file RecoTauValidation_cfi.py.

01393                                :
01394    def BaseDirectorizer(module):
01395       newPath = Directory
01396       #if module.hasParameter("outputFilePath"):
01397       if hasattr(module, "outputFilePath"):
01398          oldPath = module.outputFilePath.value()
01399          newPath = os.path.join(newPath, oldPath)
01400          if not os.path.exists(newPath):
01401             os.makedirs(newPath)
01402          print newPath
01403          module.outputFilePath = cms.string("%s" % newPath)
01404    return BaseDirectorizer

def RecoTauValidation_cfi::SetCompareToLegacyProductNames (   myPlottingSequence)

Definition at line 1422 of file RecoTauValidation_cfi.py.

01423                                                       :
01424    myFunctor = ApplyFunctionToSequence(ConvertDrawJobToLegacyCompare)
01425    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetLogScale (   myPlottingSequence)

Definition at line 1435 of file RecoTauValidation_cfi.py.

01436                                    :
01437    myFunctor = ApplyFunctionToSequence(SetYmodulesToLog())
01438    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetPlotDirectory (   myPlottingSequence,
  directory 
)

Definition at line 1414 of file RecoTauValidation_cfi.py.

01415                                                    :
01416    myFunctor = ApplyFunctionToSequence(SetBaseDirectory(directory))
01417    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetPlotOnlyStepByStep (   myPlottingSequence)

Definition at line 1443 of file RecoTauValidation_cfi.py.

01444                                              :
01445    myFunctor = ApplyFunctionToSequence(RemoveComparisonPlotCommands)
01446    myPlottingSequence.visit(myFunctor)
def RecoTauValidation_cfi::SetReferenceFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 1429 of file RecoTauValidation_cfi.py.

01430                                               :
01431    if FileLoc == None:
01432       del myProcess.loadTau.reference
01433    else:
01434       myProcess.loadTau.reference.inputFileNames = cms.vstring(FileLoc)

def RecoTauValidation_cfi::SetSmartLogScale (   myPlottingSequence)

Definition at line 1439 of file RecoTauValidation_cfi.py.

01440                                         :
01441    myFunctor = ApplyFunctionToSequence(SetYmodulesToLog(['Electron', 'Muon', 'Isolation', 'TaNC']))
01442    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetTestAndReferenceLabels (   myPlottingSequence,
  TestLabel,
  ReferenceLabel 
)

Definition at line 1418 of file RecoTauValidation_cfi.py.

01419                                                                             :
01420    myFunctor = ApplyFunctionToSequence(MakeLabeler(TestLabel, ReferenceLabel))
01421    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetTestFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 1426 of file RecoTauValidation_cfi.py.

01427                                          :
01428    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.

01376                                         :
01377    ''' set all modules whose name contains one of the matching names to log y scale'''
01378    def yLogger(module):
01379       ''' set a module to use log scaling in the yAxis'''
01380       if hasattr(module, 'drawJobs'):
01381          print "EK DEBUG"
01382          drawJobParamGetter = lambda subName : getattr(module.drawJobs, subName)
01383          #for subModule in [getattr(module.drawJobs, subModuleName) for subModuleName in dir(module.drawJobs)]:
01384          attrNames = dir(module.drawJobs)
01385          for subModuleName, subModule in zip(attrNames, map(drawJobParamGetter, attrNames)):
01386             matchedNames = [name for name in matchingNames if subModuleName.find( name) > -1] # matching sub strings
01387             if hasattr(subModule, "yAxis") and len(matchedNames):
01388                print "Setting drawJob: ", subModuleName, " to log scale."
01389                subModule.yAxis = cms.string('fakeRate') #'fakeRate' configuration specifies the log scaling
01390    return yLogger
01391 

def RecoTauValidation_cfi::TranslateToLegacyProdNames (   input)

Definition at line 1320 of file RecoTauValidation_cfi.py.

01321                                      :
01322    input = re.sub('fixedConePFTauProducer', 'pfRecoTauProducer', input)
01323    #fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination( \w* )')
01324    fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination(\w*)')
01325    input = fixedDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1', input)
01326    input = re.sub('shrinkingConePFTauProducer', 'pfRecoTauProducerHighEfficiency', input)
01327    shrinkingDiscriminationRegex = re.compile('shrinkingConePFTauDiscrimination(\w*)')
01328    input = shrinkingDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1HighEfficiency', input)
01329    return input
01330 


Variable Documentation

Initial value:
00001 cms.EDAnalyzer("TauTagValidation",
00002    StandardMatchingParameters,
00003    ExtensionName                = cms.string(""),
00004    TauProducer                  = cms.InputTag('caloRecoTauProducer'),
00005    discriminators = cms.VPSet(
00006     cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationByLeadingTrackFinding"),selectionCut = cms.double(0.5)),
00007     cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationByLeadingTrackPtCut"),selectionCut = cms.double(0.5)),
00008     cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationByIsolation"),selectionCut = cms.double(0.5)),
00009     cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5))
00010  )
00011 )

Definition at line 164 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.EDFilter("GenJetSelector",
00002      src = cms.InputTag("objectTypeSelectedTauValDenominator"),
00003      cut = cms.string('pt > 5. && abs(eta) < 2.5'),
00004      filter = cms.bool(False)
00005 )

Definition at line 70 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.Sequence(
00002       loadTau
00003       +plotTancValidation
00004       )

Definition at line 1299 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.EDAnalyzer("DQMFileLoader",
00002   test = cms.PSet(
00003     inputFileNames = cms.vstring('/afs/cern.ch/user/f/friis/scratch0/MyValidationArea/310pre6NewTags/src/Validation/RecoTau/test/CMSSW_3_1_0_pre6_ZTT_0505Fixes.root'),
00004     scaleFactor = cms.double(1.),
00005     dqmDirectory_store = cms.string('test')
00006   ),
00007   reference = cms.PSet(
00008     inputFileNames = cms.vstring('/afs/cern.ch/user/f/friis/CMSSW/pre6/src/Validation/RecoTau/test/CMSSW_3_1_0_pre6_ZTT.root'),
00009     scaleFactor = cms.double(1.),
00010     dqmDirectory_store = cms.string('reference')
00011   )
00012 )

Definition at line 462 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.EDAnalyzer("TauTagValidation",
00002    StandardMatchingParameters,
00003    ExtensionName                = cms.string(""),
00004    TauProducer                  = cms.InputTag('fixedConePFTauProducer'),
00005    discriminators = cms.VPSet(
00006     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByLeadingTrackFinding"),selectionCut = cms.double(0.5)),
00007     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByLeadingTrackPtCut"),selectionCut = cms.double(0.5)),
00008     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByTrackIsolation"),selectionCut = cms.double(0.5)),
00009     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByECALIsolation"),selectionCut = cms.double(0.5)),
00010     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
00011     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
00012  )
00013 )

Definition at line 150 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.EDAnalyzer("TauTagValidation",
00002    StandardMatchingParameters,
00003    ExtensionName                = cms.string(""),
00004    TauProducer                  = cms.InputTag('shrinkingConePFTauProducer'),
00005    discriminators               = cms.VPSet(
00006     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingTrackFinding"),selectionCut = cms.double(0.5)),
00007     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingTrackPtCut"),selectionCut = cms.double(0.5)),
00008     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTrackIsolation"),selectionCut = cms.double(0.5)),
00009     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByECALIsolation"),selectionCut = cms.double(0.5)),
00010     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
00011     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
00012  )
00013 )

Definition at line 110 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.EDAnalyzer("TauTagValidation",
00002    StandardMatchingParameters,
00003    ExtensionName                = cms.string("LeadingPion"),
00004    TauProducer                  = cms.InputTag('shrinkingConePFTauProducer'),
00005    discriminators               = cms.VPSet(
00006     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingPionPtCut"),selectionCut = cms.double(0.5)),
00007     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion"),selectionCut = cms.double(0.5)),
00008     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion"),selectionCut = cms.double(0.5)),
00009     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
00010     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
00011  )
00012 )

Definition at line 97 of file RecoTauValidation_cfi.py.

The plotting of all the CaloTau ID efficiencies.

Definition at line 1003 of file RecoTauValidation_cfi.py.

The plotting of HPS Efficiencies.

Definition at line 803 of file RecoTauValidation_cfi.py.

The plotting of all the PFTau ID efficiencies.

Definition at line 706 of file RecoTauValidation_cfi.py.

The plotting of all the PFTauHighEfficiencies ID efficiencies.

Definition at line 906 of file RecoTauValidation_cfi.py.

The plotting of all the PFTauHighEfficiencyUsingLeadingPion ID efficiencies.

Definition at line 1198 of file RecoTauValidation_cfi.py.

Plot Tanc performance.

Definition at line 1074 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.Sequence(
00002       plotPFTauEfficiencies
00003       +plotPFTauHighEfficiencyEfficiencies
00004       +plotCaloTauEfficiencies
00005       +plotTancValidation
00006       +plotPFTauHighEfficiencyEfficienciesLeadingPion
00007       +plotHPSEfficiencies
00008       )

Definition at line 1289 of file RecoTauValidation_cfi.py.

Definition at line 136 of file RecoTauValidation_cfi.py.

Definition at line 124 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.PSet(
00002   processes = cms.PSet(
00003     test = cms.PSet(
00004       dqmDirectory = cms.string('test'),
00005       legendEntry = cms.string('no test label'),
00006       type = cms.string('smMC') # Data/smMC/bsmMC/smSumMC
00007     ),
00008     reference = cms.PSet(
00009       dqmDirectory = cms.string('reference'),
00010       legendEntry = cms.string('no ref label'),
00011       type = cms.string('smMC') # Data/smMC/bsmMC/smSumMC
00012     )
00013   ),
00014 )

Definition at line 667 of file RecoTauValidation_cfi.py.

Definition at line 478 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.PSet(
00002       parameter = cms.vstring('pt', 'eta', 'phi', 'energy'),
00003       title = cms.string('TauId step by step efficiencies'),
00004       xAxis = cms.string('#PAR#'),
00005       yAxis = cms.string('efficiency'),
00006       legend = cms.string('efficiency_overlay'),
00007       labels = cms.vstring('pt', 'eta')
00008 )

Definition at line 691 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.PSet(
00002       parameter = cms.vstring('pt', 'eta', 'phi', 'energy'),
00003       xAxis = cms.string('#PAR#'),
00004       yAxis = cms.string('efficiency'),
00005       legend = cms.string('efficiency'),
00006       labels = cms.vstring('pt', 'eta'),
00007       drawOptionSet = cms.string('efficiency')
00008 )

Definition at line 682 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.PSet(
00002    DataType                     = cms.string('Leptons'),               
00003    MatchDeltaR_Leptons          = cms.double(0.15),
00004    MatchDeltaR_Jets             = cms.double(0.3),
00005    SaveOutputHistograms         = cms.bool(False),
00006    #RefCollection                = cms.InputTag("TauGenJetProducer","selectedGenTauDecaysToHadronsPt5Cumulative"),
00007    RefCollection                = cms.InputTag("kinematicSelectedTauValDenominator"),
00008 )

Definition at line 88 of file RecoTauValidation_cfi.py.

Definition at line 196 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.Sequence(
00002       PFTausBothProngs+
00003       CaloTausBothProngs +
00004       PFTausHighEfficiencyBothProngs+
00005       PFTausHighEfficiencyLeadingPionBothProngs+
00006       RunTancValidation+
00007       RunHPSValidation
00008       )

Definition at line 176 of file RecoTauValidation_cfi.py.