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

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

def RecoTauValidation_cfi::MakeLabeler (   TestLabel,
  ReferenceLabel 
)

Definition at line 439 of file RecoTauValidation_cfi.py.

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

def RecoTauValidation_cfi::RemoveComparisonPlotCommands (   module)

Definition at line 485 of file RecoTauValidation_cfi.py.

00486                                         :
00487    if hasattr(module, 'drawJobs'):
00488       #get draw job parameter names
00489       drawJobs = module.drawJobs.parameterNames_()
00490       for drawJob in drawJobs:
00491          if drawJob != "TauIdEffStepByStep":
00492             module.drawJobs.__delattr__(drawJob)
00493             print "Removing comparison plot", drawJob

def RecoTauValidation_cfi::SetBaseDirectory (   Directory)

Definition at line 472 of file RecoTauValidation_cfi.py.

00473                                :
00474    def BaseDirectorizer(module):
00475       newPath = Directory
00476       #if module.hasParameter("outputFilePath"):
00477       if hasattr(module, "outputFilePath"):
00478          oldPath = module.outputFilePath.value()
00479          newPath = os.path.join(newPath, oldPath)
00480          if not os.path.exists(newPath):
00481             os.makedirs(newPath)
00482          print newPath
00483          module.outputFilePath = cms.string("%s" % newPath)
00484    return BaseDirectorizer

def RecoTauValidation_cfi::setBinning (   module,
  pset 
)

Definition at line 530 of file RecoTauValidation_cfi.py.

00531                            :
00532     if module._TypedParameterizable__type == 'TauTagValidation':
00533         module.histoSettings = pset

def RecoTauValidation_cfi::SetCompareToLegacyProductNames (   myPlottingSequence)

Definition at line 502 of file RecoTauValidation_cfi.py.

00503                                                       :
00504    myFunctor = ApplyFunctionToSequence(ConvertDrawJobToLegacyCompare)
00505    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetLogScale (   myPlottingSequence)

Definition at line 515 of file RecoTauValidation_cfi.py.

00516                                    :
00517    myFunctor = ApplyFunctionToSequence(SetYmodulesToLog())
00518    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetPlotDirectory (   myPlottingSequence,
  directory 
)

Definition at line 494 of file RecoTauValidation_cfi.py.

00495                                                    :
00496    myFunctor = ApplyFunctionToSequence(SetBaseDirectory(directory))
00497    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetPlotOnlyStepByStep (   myPlottingSequence)

Definition at line 523 of file RecoTauValidation_cfi.py.

00524                                              :
00525    myFunctor = ApplyFunctionToSequence(RemoveComparisonPlotCommands)
00526    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetReferenceFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 509 of file RecoTauValidation_cfi.py.

00510                                               :
00511    if FileLoc == None:
00512       del myProcess.loadTau.reference
00513    else:
00514       myProcess.loadTau.reference.inputFileNames = cms.vstring(FileLoc)

def RecoTauValidation_cfi::SetSmartLogScale (   myPlottingSequence)

Definition at line 519 of file RecoTauValidation_cfi.py.

00520                                         :
00521    myFunctor = ApplyFunctionToSequence(SetYmodulesToLog(['Electron', 'Muon', 'Isolation', 'TaNC']))
00522    myPlottingSequence.visit(myFunctor)

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

Definition at line 498 of file RecoTauValidation_cfi.py.

00499                                                                             :
00500    myFunctor = ApplyFunctionToSequence(MakeLabeler(TestLabel, ReferenceLabel))
00501    myPlottingSequence.visit(myFunctor)

def RecoTauValidation_cfi::SetTestFileToPlot (   myProcess,
  FileLoc 
)

Definition at line 506 of file RecoTauValidation_cfi.py.

00507                                          :
00508    myProcess.loadTau.test.inputFileNames = cms.vstring(FileLoc)

def RecoTauValidation_cfi::setTrigger (   module,
  pset 
)

Definition at line 534 of file RecoTauValidation_cfi.py.

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

Definition at line 527 of file RecoTauValidation_cfi.py.

00528                                              :
00529     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 450 of file RecoTauValidation_cfi.py.

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

def RecoTauValidation_cfi::TranslateToLegacyProdNames (   input)

Definition at line 395 of file RecoTauValidation_cfi.py.

00396                                      :
00397    input = re.sub('fixedConePFTauProducer', 'pfRecoTauProducer', input)
00398    #fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination( \w* )')
00399    fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination(\w*)')
00400    input = fixedDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1', input)
00401    input = re.sub('shrinkingConePFTauProducer', 'pfRecoTauProducerHighEfficiency', input)
00402    shrinkingDiscriminationRegex = re.compile('shrinkingConePFTauDiscrimination(\w*)')
00403    input = shrinkingDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1HighEfficiency', input)
00404    return input
00405 


Variable Documentation

tuple RecoTauValidation_cfi::denominator = cms.InputTag("kinematicSelectedTauValDenominator")
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 253 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 243 of file RecoTauValidation_cfi.py.

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

Definition at line 118 of file RecoTauValidation_cfi.py.

Definition at line 117 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 241 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 231 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 195 of file RecoTauValidation_cfi.py.

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

Normalizes All the histograms.

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

Definition at line 255 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('')

Definition at line 119 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 212 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 217 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 219 of file RecoTauValidation_cfi.py.

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

Definition at line 229 of file RecoTauValidation_cfi.py.