def configurePlotWtoTauNuIntegrated(meName_data, meName_mc, meName_compatibility,
                                    plotName, plotTitle,
                                    outputFileName):
    drawTemplateHistConfiguratorWtoTauNuIntegrated = drawTemplateHistConfigurator(
        template = drawJobTemplateHistIntegrated.clone(
        labels = cms.vstring('ksProb')
        )
        )
    drawTemplateHistConfiguratorWtoTauNuIntegrated.add(
        meNames = [ meName_data, meName_mc ],
        name = plotName,
        title = plotTitle
        )
    plotHistWtoTauNuIntegrated = plotHistWtoTauNu.clone(
        labels = cms.PSet(
           ksProb = label_mcNormScale.clone(
               text = cms.vstring('KS prob.: %f1.2'),
               meName = cms.string(meName_compatibility)
               )
           ),
        drawJobs = drawTemplateHistConfiguratorWtoTauNuIntegrated.configure(),
        indOutputFileName = cms.string(outputFileName)
        )
    
    return plotHistWtoTauNuIntegrated
def configurePlotWtoTauNuIntegrated(meName_data, meName_mc,
                                    meName_compatibility, plotName, plotTitle,
                                    outputFileName):
    drawTemplateHistConfiguratorWtoTauNuIntegrated = drawTemplateHistConfigurator(
        template=drawJobTemplateHistIntegrated.clone(
            labels=cms.vstring('ksProb')))
    drawTemplateHistConfiguratorWtoTauNuIntegrated.add(
        meNames=[meName_data, meName_mc], name=plotName, title=plotTitle)
    plotHistWtoTauNuIntegrated = plotHistWtoTauNu.clone(
        labels=cms.PSet(ksProb=label_mcNormScale.clone(
            text=cms.vstring('KS prob.: %f1.2'),
            meName=cms.string(meName_compatibility))),
        drawJobs=drawTemplateHistConfiguratorWtoTauNuIntegrated.configure(),
        indOutputFileName=cms.string(outputFileName))

    return plotHistWtoTauNuIntegrated
Exemple #3
0
                    meName_test = cms.string(meNameMapping_distName_data['template']),
                    meName_reference = cms.string(meNameMapping_mc[selectionName][selectionType][distName]['template']),
                    meName_compatibility = cms.string(meName_compatibility)
    	        ))
    
process.compKolmogorovProbWtoTauNu = cms.EDAnalyzer("DQMHistKolmogorovTest",
    config = cms.VPSet(jobsKolmogorovTest)
)

#--------------------------------------------------------------------------------
# plot template histograms obtained from Monte Carlo
# compared to the shapes determined by background enriched regions in (pseudo)Data
#--------------------------------------------------------------------------------

drawTemplateHistConfiguratorWtoTauNu = drawTemplateHistConfigurator(
    template = drawJobTemplateHist
)

drawAnalysisHistConfiguratorWtoTauNuData = drawTemplateHistConfigurator(
    template = drawJobAnalysisHistData
)

drawAnalysisHistConfiguratorWtoTauNuMC = drawTemplateHistConfigurator(
    template = drawJobAnalysisHistMC
)

#process.plotTemplateHistWtoTauNuIntegrated = cms.Sequence()

meNameMapping_mcSMsum = meNameMapping['smSum']
meNameMapping_data = meNameMapping['Data']
for selectionName, meNameMapping_selectionName_data in meNameMapping_data.items():
                        meName_test=cms.string(
                            meNameMapping_distName_data['template']),
                        meName_reference=cms.string(
                            meNameMapping_mc[selectionName][selectionType]
                            [distName]['template']),
                        meName_compatibility=cms.string(meName_compatibility)))

process.compKolmogorovProbZtoMuTau = cms.EDAnalyzer(
    "DQMHistKolmogorovTest", config=cms.VPSet(jobsKolmogorovTest))

#--------------------------------------------------------------------------------
# plot template histograms obtained from Monte Carlo
# compared to the shapes determined by background enriched regions in (pseudo)Data
#--------------------------------------------------------------------------------

drawTemplateHistConfiguratorZtoMuTau = drawTemplateHistConfigurator(
    template=drawJobTemplateHist)

drawAnalysisHistConfiguratorZtoMuTauData = drawTemplateHistConfigurator(
    template=drawJobAnalysisHistData)

drawAnalysisHistConfiguratorZtoMuTauMC = drawTemplateHistConfigurator(
    template=drawJobAnalysisHistMC)

drawAnalysisHistConfiguratorZtoMuTauZmumuEmbedding = drawTemplateHistConfigurator(
    template=drawJobAnalysisHistZmumuEmbedding)

process.plotTemplateHistZtoMuTauIntegrated = cms.Sequence()

meNameMapping_mcSMsum = meNameMapping['smSum']
meNameMapping_data = meNameMapping['Data']
for selectionName, meNameMapping_selectionName_data in meNameMapping_data.items(
process.normalizeAnalysisHistZtoElecTau = cms.Sequence(
    process.normalizeAnalysisHistZtoElecTau_Ztautau
   + process.normalizeAnalysisHistZtoElecTau_Zee
   + process.normalizeAnalysisHistZtoElecTau_WplusJets
   + process.normalizeAnalysisHistZtoElecTau_TTplusJets
   #+ process.normalizeAnalysisHistZtoElecTau_gammaPlusJets
   + process.normalizeAnalysisHistZtoElecTau_QCD
)

#--------------------------------------------------------------------------------
# plot template histograms of "pure" Monte Carlo processes
# compared to the shapes determined by background enriched regions in (pseudo)Data
#--------------------------------------------------------------------------------

drawTemplateHistConfiguratorZtoElecTau = drawTemplateHistConfigurator(
    template = drawJobTemplateHist
)

#--------------------------------------------------------------------------------
# define draw jobs for Z --> tau+ tau- signal
#
# NOTE: backgrounds contributing to Z --> mu+ mu- sample from which
#       template histogram for Ztautau signal process is determined using MCEmbeddingTools
#       not included yet, so use "pure" sample as approximation for sample determined in "deta"
#       for the time being...
#--------------------------------------------------------------------------------

drawTemplateHistConfiguratorZtoElecTau.add(
    meNames = [
        dqmDirectory_Ztautau_ZmumuTemplate + "DiTauCandidateQuantities" + "/" + meName_diTauMvis12_norm,
        dqmDirectory_Ztautau_ZmumuTemplate + "DiTauCandidateQuantities" + "/" + meName_diTauMvis12_norm,
    norm=cms.double(1.))

process.normalizeAnalysisHistZtoElecTau = cms.Sequence(
    process.normalizeAnalysisHistZtoElecTau_Ztautau +
    process.normalizeAnalysisHistZtoElecTau_Zee +
    process.normalizeAnalysisHistZtoElecTau_WplusJets +
    process.normalizeAnalysisHistZtoElecTau_TTplusJets
    #+ process.normalizeAnalysisHistZtoElecTau_gammaPlusJets
    + process.normalizeAnalysisHistZtoElecTau_QCD)

#--------------------------------------------------------------------------------
# plot template histograms of "pure" Monte Carlo processes
# compared to the shapes determined by background enriched regions in (pseudo)Data
#--------------------------------------------------------------------------------

drawTemplateHistConfiguratorZtoElecTau = drawTemplateHistConfigurator(
    template=drawJobTemplateHist)

#--------------------------------------------------------------------------------
# define draw jobs for Z --> tau+ tau- signal
#
# NOTE: backgrounds contributing to Z --> mu+ mu- sample from which
#       template histogram for Ztautau signal process is determined using MCEmbeddingTools
#       not included yet, so use "pure" sample as approximation for sample determined in "deta"
#       for the time being...
#--------------------------------------------------------------------------------

drawTemplateHistConfiguratorZtoElecTau.add(
    meNames=[
        dqmDirectory_Ztautau_ZmumuTemplate + "DiTauCandidateQuantities" + "/" +
        meName_diTauMvis12_norm, dqmDirectory_Ztautau_ZmumuTemplate +
        "DiTauCandidateQuantities" + "/" + meName_diTauMvis12_norm,
                    meName_test = cms.string(meNameMapping_distName_data['template']),
                    meName_reference = cms.string(meNameMapping_mc[selectionName][selectionType][distName]['template']),
                    meName_compatibility = cms.string(meName_compatibility)
                ))
    
process.compKolmogorovProbZtoMuTau = cms.EDAnalyzer("DQMHistKolmogorovTest",
    config = cms.VPSet(jobsKolmogorovTest)
)

#--------------------------------------------------------------------------------
# plot template histograms obtained from Monte Carlo
# compared to the shapes determined by background enriched regions in (pseudo)Data
#--------------------------------------------------------------------------------

drawTemplateHistConfiguratorZtoMuTau = drawTemplateHistConfigurator(
    template = drawJobTemplateHist
)

drawAnalysisHistConfiguratorZtoMuTauData = drawTemplateHistConfigurator(
    template = drawJobAnalysisHistData
)

drawAnalysisHistConfiguratorZtoMuTauMC = drawTemplateHistConfigurator(
    template = drawJobAnalysisHistMC
)

drawAnalysisHistConfiguratorZtoMuTauZmumuEmbedding = drawTemplateHistConfigurator(
    template = drawJobAnalysisHistZmumuEmbedding
)

process.plotTemplateHistZtoMuTauIntegrated = cms.Sequence()
                    meName_output = cms.string(meNameMapping_distName['integrated']),
                    integrateFrom = cms.string("right")
                ))
    
process.integrateHistZtoElecTau = cms.EDAnalyzer("DQMHistIntegrator",
    config = cms.VPSet(jobsHistIntegration)
)


#--------------------------------------------------------------------------------
# plot template histograms obtained from Monte Carlo
# compared to the shapes determined by background enriched regions in (pseudo)Data
#--------------------------------------------------------------------------------

drawTemplateHistConfiguratorZtoElecTau = drawTemplateHistConfigurator(
    template = drawJobTemplateHist2
)

drawAnalysisHistConfiguratorZtoElecTauBias = drawTemplateHistConfigurator(
    template = drawJobAnalysisHistBias
)

drawAnalysisHistConfiguratorZtoElecTauPurity = drawTemplateHistConfigurator(
    template = drawJobAnalysisHistPurity
)


process.plotTemplateHistZtoElecTauIntegrated = cms.Sequence()

meNameMapping_mcSMsum = meNameMapping['smSum']
meNameMapping_data = meNameMapping['Data']