CMS 3D CMS Logo

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("LeadingPion")
 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.
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('shrinkingConePFTauProducer')
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 412 of file RecoTauValidation_cfi.py.

00413                                         :
00414    """ Converts a draw job defined to compare 31X named PFTau validtion efficiencies
00415        to comapre a 31X to a 22X named validation """
00416    # get the list of drawjobs { name : copyOfPSet }
00417    if not hasattr(input, "drawJobs"):
00418       return
00419    myDrawJobs = input.drawJobs.parameters_()
00420    for drawJobName, drawJobData in myDrawJobs.iteritems():
00421       print drawJobData
00422       if not drawJobData.plots.pythonTypeName() == "cms.PSet":
00423          continue
00424       pSetToInsert = cms.PSet(
00425             standardEfficiencyParameters,
00426             plots = cms.VPSet(
00427                # test plot w/ modern names
00428                cms.PSet(
00429                   dqmMonitorElements = drawJobData.plots.dqmMonitorElements,
00430                   process = cms.string('test'),
00431                   drawOptionEntry = cms.string('eff_overlay01'),
00432                   legendEntry = cms.string(input.processes.test.legendEntry.value())
00433                   ),
00434                # ref plot w/ vintage name
00435                cms.PSet(
00436                   # translate the name
00437                   dqmMonitorElements = cms.vstring(TranslateToLegacyProdNames(drawJobData.plots.dqmMonitorElements.value()[0])),
00438                   process = cms.string('reference'),
00439                   drawOptionEntry = cms.string('eff_overlay02'),
00440                   legendEntry = cms.string(input.processes.reference.legendEntry.value())
00441                   )
00442                )
00443             )
00444       input.drawJobs.__setattr__(drawJobName, pSetToInsert)

def RecoTauValidation_cfi::MakeLabeler (   TestLabel,
  ReferenceLabel 
)

Definition at line 445 of file RecoTauValidation_cfi.py.

00446                                           :
00447    def labeler(module):
00448       if hasattr(module, 'processes'):
00449          if module.processes.hasParameter(['test', 'legendEntry']) and module.processes.hasParameter([ 'reference', 'legendEntry']):
00450             module.processes.test.legendEntry = TestLabel
00451             module.processes.reference.legendEntry = ReferenceLabel
00452             print "Set test label to %s and reference label to %s for plot producer %s" % (TestLabel, ReferenceLabel, module.label())
00453          else:
00454             print "ERROR in RecoTauValidation_cfi::MakeLabeler - trying to set test/reference label but %s does not have processes.(test/reference).legendEntry parameters!" % module.label()
00455    return labeler

def RecoTauValidation_cfi::RemoveComparisonPlotCommands (   module)

Definition at line 491 of file RecoTauValidation_cfi.py.

00492                                         :
00493    if hasattr(module, 'drawJobs'):
00494       #get draw job parameter names
00495       drawJobs = module.drawJobs.parameterNames_()
00496       for drawJob in drawJobs:
00497          if drawJob != "TauIdEffStepByStep":
00498             module.drawJobs.__delattr__(drawJob)
00499             print "Removing comparison plot", drawJob

def RecoTauValidation_cfi::SetBaseDirectory (   Directory)

Definition at line 478 of file RecoTauValidation_cfi.py.

00479                                :
00480    def BaseDirectorizer(module):
00481       newPath = Directory
00482       #if module.hasParameter("outputFilePath"):
00483       if hasattr(module, "outputFilePath"):
00484          oldPath = module.outputFilePath.value()
00485          newPath = os.path.join(newPath, oldPath)
00486          if not os.path.exists(newPath):
00487             os.makedirs(newPath)
00488          print newPath
00489          module.outputFilePath = cms.string("%s" % newPath)
00490    return BaseDirectorizer

def RecoTauValidation_cfi::setBinning (   module,
  pset 
)

Definition at line 536 of file RecoTauValidation_cfi.py.

00537                            :
00538     if module._TypedParameterizable__type == 'TauTagValidation':
00539         module.histoSettings = pset

def RecoTauValidation_cfi::SetCompareToLegacyProductNames (   myPlottingSequence)

Definition at line 508 of file RecoTauValidation_cfi.py.

00509                                                       :
00510    myFunctor = ApplyFunctionToSequence(ConvertDrawJobToLegacyCompare)
00511    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetLogScale (   myPlottingSequence)

Definition at line 521 of file RecoTauValidation_cfi.py.

00522                                    :
00523    myFunctor = ApplyFunctionToSequence(SetYmodulesToLog())
00524    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetPlotDirectory (   myPlottingSequence,
  directory 
)

Definition at line 500 of file RecoTauValidation_cfi.py.

00501                                                    :
00502    myFunctor = ApplyFunctionToSequence(SetBaseDirectory(directory))
00503    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetPlotOnlyStepByStep (   myPlottingSequence)

Definition at line 529 of file RecoTauValidation_cfi.py.

00530                                              :
00531    myFunctor = ApplyFunctionToSequence(RemoveComparisonPlotCommands)
00532    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetReferenceFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 515 of file RecoTauValidation_cfi.py.

00516                                               :
00517    if FileLoc == None:
00518       del myProcess.loadTau.reference
00519    else:
00520       myProcess.loadTau.reference.inputFileNames = cms.vstring(FileLoc)

def RecoTauValidation_cfi::SetSmartLogScale (   myPlottingSequence)

Definition at line 525 of file RecoTauValidation_cfi.py.

00526                                         :
00527    myFunctor = ApplyFunctionToSequence(SetYmodulesToLog(['Electron', 'Muon', 'Isolation', 'TaNC']))
00528    myPlottingSequence.visit(myFunctor)

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

Definition at line 504 of file RecoTauValidation_cfi.py.

00505                                                                             :
00506    myFunctor = ApplyFunctionToSequence(MakeLabeler(TestLabel, ReferenceLabel))
00507    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetTestFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 512 of file RecoTauValidation_cfi.py.

00513                                          :
00514    myProcess.loadTau.test.inputFileNames = cms.vstring(FileLoc)

def RecoTauValidation_cfi::setTrigger (   module,
  pset 
)

Definition at line 540 of file RecoTauValidation_cfi.py.

00541                            :
00542    if hasattr(module,'_TypedParameterizable__type') and module._TypedParameterizable__type == 'TauTagValidation':
00543       setattr(module,'turnOnTrigger',cms.bool(True)) #Turns on trigger (in case is off)
00544       for item in pset.parameters_().items():
00545          setattr(module.GenericTriggerSelection,item[0],item[1])
def RecoTauValidation_cfi::SetValidationExtention (   module,
  extension 
)

Definition at line 533 of file RecoTauValidation_cfi.py.

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

00457                                         :
00458    ''' set all modules whose name contains one of the matching names to log y scale'''
00459    def yLogger(module):
00460       ''' set a module to use log scaling in the yAxis'''
00461       if hasattr(module, 'drawJobs'):
00462          print "EK DEBUG"
00463          drawJobParamGetter = lambda subName : getattr(module.drawJobs, subName)
00464          #for subModule in [getattr(module.drawJobs, subModuleName) for subModuleName in dir(module.drawJobs)]:
00465          attrNames = dir(module.drawJobs)
00466          for subModuleName, subModule in zip(attrNames, map(drawJobParamGetter, attrNames)):
00467             matchedNames = [name for name in matchingNames if subModuleName.find( name) > -1] # matching sub strings
00468             if len(matchingNames) == 0:
00469                matchedNames = ['take','everything','and','dont','bother']
00470             if hasattr(subModule, "yAxis") and len(matchedNames):
00471                print "Setting drawJob: ", subModuleName, " to log scale."
00472                subModule.yAxis = cms.string('fakeRate') #'fakeRate' configuration specifies the log scaling
00473          if len(matchingNames) == 0: 
00474             module.yAxes.efficiency.maxY_log = 40
00475             module.yAxes.fakeRate.maxY_log = 40
00476    return yLogger
00477 

def RecoTauValidation_cfi::TranslateToLegacyProdNames (   input)

Definition at line 401 of file RecoTauValidation_cfi.py.

00402                                      :
00403    input = re.sub('fixedConePFTauProducer', 'pfRecoTauProducer', input)
00404    #fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination( \w* )')
00405    fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination(\w*)')
00406    input = fixedDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1', input)
00407    input = re.sub('shrinkingConePFTauProducer', 'pfRecoTauProducerHighEfficiency', input)
00408    shrinkingDiscriminationRegex = re.compile('shrinkingConePFTauDiscrimination(\w*)')
00409    input = shrinkingDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1HighEfficiency', input)
00410    return input
00411 


Variable Documentation

tuple RecoTauValidation_cfi::denominator = cms.InputTag("kinematicSelectedTauValDenominator")
Initial value:
00001 cms.VPSet(
00002     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingTrackFinding"),selectionCut = cms.double(0.5),plotStep = cms.bool(True)),
00003     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingPionPtCut"),selectionCut = cms.double(0.5),plotStep = cms.bool(False)), #not plotted
00004     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion"),selectionCut = cms.double(0.5),plotStep = cms.bool(True)),
00005     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion"),selectionCut = cms.double(0.5),plotStep = cms.bool(True)),
00006     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5),plotStep = cms.bool(True)),
00007     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5),plotStep = cms.bool(True))
00008  )

Definition at line 119 of file RecoTauValidation_cfi.py.

Referenced by PFTauSelectorDefinition::PFTauSelectorDefinition(), reco::tau::RecoTauDiscriminantFromDiscriminator::RecoTauDiscriminantFromDiscriminator(), and CaloTauSelectorDefinition::select().

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

Initial value:
00001 cms.PSet(
00002    markerColor = cms.int32(1),
00003    markerSize = cms.double(1.),
00004    markerStyle = cms.int32(20),
00005    lineColor = cms.int32(1),
00006    lineStyle = cms.int32(1),
00007    lineWidth = cms.int32(2),
00008    drawOption = cms.string('ex0'),
00009    drawOptionLegend = cms.string('p')
00010 )

Definition at line 249 of file RecoTauValidation_cfi.py.

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

Definition at line 117 of file RecoTauValidation_cfi.py.

Definition at line 116 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.PSet(
00002    andOr          = cms.bool( False ),#specifies the logical combination of the single filters' (L1, HLT and DCS) decisions at top level (True=OR)
00003    dbLabel        = cms.string("PFTauDQMTrigger"),#specifies the label under which the DB payload is available from the ESSource or Global Tag
00004    andOrHlt       = cms.bool(True),#specifies the logical combination of the single HLT paths' decisions (True=OR)
00005    hltInputTag    = cms.InputTag("TriggerResults::HLT"),
00006    #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
00007    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)
00008    errorReplyHlt  = cms.bool(False),#specifies the desired return value of the HLT filter and the single HLT path filter in case of certain errors
00009    verbosityLevel = cms.uint32(0) #0: complete silence (default), needed for T0 processing;
00010 )

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

Initial value:
00001 cms.PSet(
00002    posX = cms.double(0.50),
00003    posY = cms.double(0.72),
00004    sizeX = cms.double(0.39),
00005    sizeY = cms.double(0.17),
00006    header = cms.string(''),
00007    option = cms.string('brNDC'),
00008    borderSize = cms.int32(0),
00009    fillColor = cms.int32(0)
00010 )

Definition at line 237 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.EDAnalyzer("TauDQMFileLoader",
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     inputFileNames = cms.vstring('/opt/sbg/cms/ui4_data1/dbodin/CMSSW_3_5_1/src/TauID/QCD_recoFiles/TauVal_CMSSW_3_6_0_QCD.root'),
00005     scaleFactor = cms.double(1.),
00006     dqmDirectory_store = cms.string('test')
00007   ),
00008   reference = cms.PSet(
00009     inputFileNames = cms.vstring('/opt/sbg/cms/ui4_data1/dbodin/CMSSW_3_5_1/src/TauID/QCD_recoFiles/TauVal_CMSSW_3_6_0_QCD.root'),
00010     scaleFactor = cms.double(1.),
00011     dqmDirectory_store = cms.string('reference')
00012   )
00013 )

Definition at line 201 of file RecoTauValidation_cfi.py.

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

Normalizes All the histograms.

Definition at line 183 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi::plotPset = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominator)
tuple RecoTauValidation_cfi::proc = cms.Process('helper')

Definition at line 88 of file RecoTauValidation_cfi.py.

tuple RecoTauValidation_cfi::reference = cms.string('*_pTRatio_allHadronic')
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 321 of file RecoTauValidation_cfi.py.

Definition at line 261 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), #TRUE FOR TEST ONLY
00006    #RefCollection                = cms.InputTag("TauGenJetProducer","selectedGenTauDecaysToHadronsPt5Cumulative"),
00007    RefCollection                = denominator,
00008    TauPtCut                     = cms.double(0.), #almost deprecated, since recoCuts provides more flexibility
00009    recoCuts                     = cms.string(''), #filter reconstructed candidates. leave this empty to select all. or use sth like: pt > 20 & abs(eta) < 2.3
00010    genCuts                      = cms.string(''), #filter generated candidates. leave this empty to select all. or use sth like: pt > 20 & abs(eta) < 2.3
00011    chainCuts                    = cms.bool(False) #Decide whether to chain discriminators or not
00012 )

Definition at line 90 of file RecoTauValidation_cfi.py.

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

Definition at line 118 of file RecoTauValidation_cfi.py.

Initial value:
00001 cms.PSet(
00002    xAxisTitle = cms.string('P_{T} / GeV'),
00003    xAxisTitleOffset = cms.double(0.9),
00004    xAxisTitleSize = cms.double(0.05)
00005 )

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

Initial value:
00001 cms.PSet(
00002    yScale = cms.string('linear'), # linear/log
00003    minY_linear = cms.double(0.),
00004    maxY_linear = cms.double(1.6),
00005    minY_log = cms.double(0.001),
00006    maxY_log = cms.double(1.8),
00007    yAxisTitle = cms.string('#varepsilon'), 
00008    yAxisTitleOffset = cms.double(1.1),
00009    yAxisTitleSize = cms.double(0.05)
00010 )

Definition at line 225 of file RecoTauValidation_cfi.py.

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

Definition at line 235 of file RecoTauValidation_cfi.py.