CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Validation/RecoTau/python/RecoTauValidation_cfi.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 import copy
00003 import re
00004 import os
00005 
00006 """
00007 
00008    RecoTauValidation_cfi.py
00009 
00010    Contains the standard tau validation parameters.  It is organized into
00011    the following sections.
00012 
00013    DENOMINATOR 
00014      
00015      Set common kinematic cuts (pt > 5 and eta < 2.5) on the denominator source.
00016      Note that the denominator depends on the type of test (signal/background/e etc)
00017 
00018      The denominator kinematic cutter requires that 
00019 
00020    HISTOGRAMS
00021 
00022      Produce numerator and denominator histgorams used to produce
00023      tau efficiency plots
00024 
00025         Provides sequence: 
00026           TauValNumeratorAndDenominator 
00027         Requires:
00028           tauValSelectedDenominator (filtered GenJet collection)
00029         
00030    EFFICIENCY
00031    
00032      Using numerator and denominators, calculate and store
00033      the efficiency curves
00034 
00035         Provides sequence:
00036           TauEfficiencies
00037         Requires:
00038           TauValNumeratorAndDenominator
00039 
00040    PLOTTING
00041 
00042      Plot curves calculated in efficiency, in both an overlay mode
00043      showing overall performance for a release, and the indvidual 
00044      discriminator efficiency compared to a given release
00045 
00046         Provides sequence:
00047           loadTau
00048           plotTauValidation
00049           loadAndPlotTauValidation
00050 
00051         Requires:
00052           TauEfficiencies, external root file to compare to
00053 
00054      Plotting must be executed in a separate cmsRun job!
00055 
00056    UTILITIES
00057      
00058      Various scripts to automate things...
00059 
00060 
00061 """
00062 
00063 """
00064 
00065 DENOMINATOR
00066 
00067 """
00068 
00069 # require generator level hadrons produced in tau-decay to have transverse momentum above threshold
00070 kinematicSelectedTauValDenominator = cms.EDFilter("GenJetSelector",
00071      src = cms.InputTag("objectTypeSelectedTauValDenominator"),
00072      cut = cms.string('pt > 5. && abs(eta) < 2.5'),
00073      filter = cms.bool(False)
00074 )
00075 
00076 
00077 """
00078 
00079 HISTOGRAMS
00080 
00081         Plot the pt/eta/energy/phi spectrum of PFTaus that pass 
00082         a series of PFTauDiscriminator cuts.
00083 
00084         These will be used as the numerator/denominators of the
00085         efficiency calculations
00086 """
00087 
00088 StandardMatchingParameters = cms.PSet(
00089    DataType                     = cms.string('Leptons'),               
00090    MatchDeltaR_Leptons          = cms.double(0.15),
00091    MatchDeltaR_Jets             = cms.double(0.3),
00092    SaveOutputHistograms         = cms.bool(False),
00093    #RefCollection                = cms.InputTag("TauGenJetProducer","selectedGenTauDecaysToHadronsPt5Cumulative"),
00094    RefCollection                = cms.InputTag("kinematicSelectedTauValDenominator"),
00095 )
00096 
00097 PFTausHighEfficiencyLeadingPionBothProngs = cms.EDAnalyzer("TauTagValidation",
00098    StandardMatchingParameters,
00099    ExtensionName                = cms.string("LeadingPion"),
00100    TauProducer                  = cms.InputTag('shrinkingConePFTauProducer'),
00101    discriminators               = cms.VPSet(
00102     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingPionPtCut"),selectionCut = cms.double(0.5)),
00103     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion"),selectionCut = cms.double(0.5)),
00104     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion"),selectionCut = cms.double(0.5)),
00105     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
00106     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
00107  )
00108 )
00109 
00110 PFTausHighEfficiencyBothProngs = cms.EDAnalyzer("TauTagValidation",
00111    StandardMatchingParameters,
00112    ExtensionName                = cms.string(""),
00113    TauProducer                  = cms.InputTag('shrinkingConePFTauProducer'),
00114    discriminators               = cms.VPSet(
00115     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingTrackFinding"),selectionCut = cms.double(0.5)),
00116     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingTrackPtCut"),selectionCut = cms.double(0.5)),
00117     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTrackIsolation"),selectionCut = cms.double(0.5)),
00118     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByECALIsolation"),selectionCut = cms.double(0.5)),
00119     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
00120     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
00121  )
00122 )
00123 
00124 RunTancValidation = copy.deepcopy(PFTausHighEfficiencyBothProngs)
00125 RunTancValidation.ExtensionName = "Tanc"
00126 RunTancValidation.discriminators = cms.VPSet(
00127     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByLeadingPionPtCut"),selectionCut = cms.double(0.5)),
00128     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTaNCfrOnePercent"),selectionCut = cms.double(0.5)),
00129     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTaNCfrHalfPercent"),selectionCut = cms.double(0.5)),
00130     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent"),selectionCut = cms.double(0.5)),
00131     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationByTaNCfrTenthPercent"),selectionCut = cms.double(0.5)),
00132     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
00133     cms.PSet( discriminator = cms.string("shrinkingConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
00134 )
00135 
00136 RunHPSValidation = copy.deepcopy(PFTausHighEfficiencyBothProngs)
00137 RunHPSValidation.ExtensionName = ""
00138 RunHPSValidation.TauProducer   = cms.InputTag('hpsPFTauProducer')
00139 RunHPSValidation.discriminators = cms.VPSet(
00140     cms.PSet( discriminator = cms.string("hpsPFTauDiscriminationByDecayModeFinding"),selectionCut = cms.double(0.5)),
00141     cms.PSet( discriminator = cms.string("hpsPFTauDiscriminationByLooseIsolation"),selectionCut = cms.double(0.5)),
00142     cms.PSet( discriminator = cms.string("hpsPFTauDiscriminationByMediumIsolation"),selectionCut = cms.double(0.5)),
00143     cms.PSet( discriminator = cms.string("hpsPFTauDiscriminationByTightIsolation"),selectionCut = cms.double(0.5)),
00144     cms.PSet( discriminator = cms.string("hpsPFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
00145     cms.PSet( discriminator = cms.string("hpsPFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
00146 )
00147 
00148 
00149 
00150 PFTausBothProngs = cms.EDAnalyzer("TauTagValidation",
00151    StandardMatchingParameters,
00152    ExtensionName                = cms.string(""),
00153    TauProducer                  = cms.InputTag('fixedConePFTauProducer'),
00154    discriminators = cms.VPSet(
00155     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByLeadingTrackFinding"),selectionCut = cms.double(0.5)),
00156     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByLeadingTrackPtCut"),selectionCut = cms.double(0.5)),
00157     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByTrackIsolation"),selectionCut = cms.double(0.5)),
00158     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationByECALIsolation"),selectionCut = cms.double(0.5)),
00159     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5)),
00160     cms.PSet( discriminator = cms.string("fixedConePFTauDiscriminationAgainstMuon"),selectionCut = cms.double(0.5))
00161  )
00162 )
00163 
00164 CaloTausBothProngs = cms.EDAnalyzer("TauTagValidation",
00165    StandardMatchingParameters,
00166    ExtensionName                = cms.string(""),
00167    TauProducer                  = cms.InputTag('caloRecoTauProducer'),
00168    discriminators = cms.VPSet(
00169     cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationByLeadingTrackFinding"),selectionCut = cms.double(0.5)),
00170     cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationByLeadingTrackPtCut"),selectionCut = cms.double(0.5)),
00171     cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationByIsolation"),selectionCut = cms.double(0.5)),
00172     cms.PSet( discriminator = cms.string("caloRecoTauDiscriminationAgainstElectron"),selectionCut = cms.double(0.5))
00173  )
00174 )
00175 
00176 TauValNumeratorAndDenominator = cms.Sequence(
00177       PFTausBothProngs+
00178       CaloTausBothProngs +
00179       PFTausHighEfficiencyBothProngs+
00180       PFTausHighEfficiencyLeadingPionBothProngs+
00181       RunTancValidation+
00182       RunHPSValidation
00183       )
00184 
00185 """
00186 
00187 EFFICIENCY
00188 
00189         Tau efficiency calculations
00190 
00191         Define the Efficiency curves to produce.  Each
00192         efficiency producer takes the numberator and denominator
00193         histograms and the dependent variables.
00194 """
00195 
00196 TauEfficiencies = cms.EDAnalyzer("DQMHistEffProducer",
00197     plots = cms.PSet(
00198 # REGULAR PFTAU EFFICIENCIES CALCULATION
00199       PFTauIDMatchingEfficiencies = cms.PSet(
00200         numerator = cms.string('RecoTauV/fixedConePFTauProducer_Matched/fixedConePFTauProducerMatched_vs_#PAR#TauVisible'),
00201         denominator = cms.string('RecoTauV/fixedConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00202         efficiency = cms.string('RecoTauV/fixedConePFTauProducer_Matched/PFJetMatchingEff#PAR#'),
00203         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00204       ),
00205       PFTauIDLeadingTrackFindEfficiencies = cms.PSet(
00206         numerator = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByLeadingTrackFinding/fixedConePFTauDiscriminationByLeadingTrackFinding_vs_#PAR#TauVisible'),
00207         denominator = cms.string('RecoTauV/fixedConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00208         efficiency = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByLeadingTrackFinding/LeadingTrackFindingEff#PAR#'),
00209         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00210       ),
00211       PFTauIDLeadingTrackPtCutEfficiencies = cms.PSet(
00212         numerator = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByLeadingTrackPtCut/fixedConePFTauDiscriminationByLeadingTrackPtCut_vs_#PAR#TauVisible'),
00213         denominator = cms.string('RecoTauV/fixedConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00214         efficiency = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByLeadingTrackPtCut/LeadingTrackPtCutEff#PAR#'),
00215         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00216       ),
00217       PFTauIDTrackIsolationEfficienies = cms.PSet(
00218         numerator = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByTrackIsolation/fixedConePFTauDiscriminationByTrackIsolation_vs_#PAR#TauVisible'),
00219         denominator = cms.string('RecoTauV/fixedConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00220         efficiency = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByTrackIsolation/TrackIsolationEff#PAR#'),
00221         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00222       ),
00223       PFTauIDECALIsolationEfficienies = cms.PSet(
00224         numerator = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByECALIsolation/fixedConePFTauDiscriminationByECALIsolation_vs_#PAR#TauVisible'),
00225         denominator = cms.string('RecoTauV/fixedConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00226         efficiency = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByECALIsolation/ECALIsolationEff#PAR#'),
00227         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00228       ),
00229       PFTauIDMuonRejectionEfficiencies = cms.PSet(
00230         numerator = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationAgainstElectron/fixedConePFTauDiscriminationAgainstElectron_vs_#PAR#TauVisible'),
00231         denominator = cms.string('RecoTauV/fixedConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00232         efficiency = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
00233         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00234       ),
00235       PFTauIDElectronRejectionEfficiencies = cms.PSet(
00236         numerator = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationAgainstMuon/fixedConePFTauDiscriminationAgainstMuon_vs_#PAR#TauVisible'),
00237         denominator = cms.string('RecoTauV/fixedConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00238         efficiency = cms.string('RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'),
00239         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00240       ),
00241 #HPS EfficiencyCalculation
00242       HPSIDMatchingEfficiencies = cms.PSet(
00243         numerator = cms.string('RecoTauV/hpsPFTauProducer_Matched/hpsPFTauProducerMatched_vs_#PAR#TauVisible'),
00244         denominator = cms.string('RecoTauV/hpsPFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00245         efficiency = cms.string('RecoTauV/hpsPFTauProducer_Matched/PFJetMatchingEff#PAR#'),
00246         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00247       ),
00248       HPSIDDecayModeFindingEfficiencies = cms.PSet(
00249         numerator = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByDecayModeFinding/hpsPFTauDiscriminationByDecayModeFinding_vs_#PAR#TauVisible'),
00250         denominator = cms.string('RecoTauV/hpsPFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00251         efficiency = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByDecayModeFinding/DecayModeFindingEff#PAR#'),
00252         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00253       ),
00254       HPSIDLooseIsolationEfficienies = cms.PSet(
00255         numerator = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByLooseIsolation/hpsPFTauDiscriminationByLooseIsolation_vs_#PAR#TauVisible'),
00256         denominator = cms.string('RecoTauV/hpsPFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00257         efficiency = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByLooseIsolation/LooseIsolationEff#PAR#'),
00258         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00259       ),
00260       HPSIDMediumIsolationEfficienies = cms.PSet(
00261         numerator = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByMediumIsolation/hpsPFTauDiscriminationByMediumIsolation_vs_#PAR#TauVisible'),
00262         denominator = cms.string('RecoTauV/hpsPFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00263         efficiency = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByMediumIsolation/MediumIsolationEff#PAR#'),
00264         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00265       ),
00266       HPSIDTightIsolationEfficienies = cms.PSet(
00267         numerator = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByTightIsolation/hpsPFTauDiscriminationByTightIsolation_vs_#PAR#TauVisible'),
00268         denominator = cms.string('RecoTauV/hpsPFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00269         efficiency = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByTightIsolation/TightIsolationEff#PAR#'),
00270         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00271       ),
00272       HPSIDElectronRejectionEfficiencies = cms.PSet(
00273         numerator = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationAgainstElectron/hpsPFTauDiscriminationAgainstElectron_vs_#PAR#TauVisible'),
00274         denominator = cms.string('RecoTauV/hpsPFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00275         efficiency = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
00276         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00277       ),
00278       HPSIDMuonRejectionEfficiencies = cms.PSet(
00279         numerator = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationAgainstMuon/hpsPFTauDiscriminationAgainstMuon_vs_#PAR#TauVisible'),
00280         denominator = cms.string('RecoTauV/hpsPFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00281         efficiency = cms.string('RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'),
00282         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00283       ),
00284       
00285 
00286 
00287 
00288 # PFTAUHIGHEFFICIENCY EFFICIENCY CALCULATION
00289       PFTauHighEfficiencyIDMatchingEfficiencies = cms.PSet(
00290         numerator = cms.string('RecoTauV/shrinkingConePFTauProducer_Matched/shrinkingConePFTauProducerMatched_vs_#PAR#TauVisible'),
00291         denominator = cms.string('RecoTauV/shrinkingConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00292         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducer_Matched/PFJetMatchingEff#PAR#'),
00293         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00294       ),
00295       PFTauHighEfficiencyIDLeadingTrackFindEfficiencies = cms.PSet(
00296         numerator = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByLeadingTrackFinding/shrinkingConePFTauDiscriminationByLeadingTrackFinding_vs_#PAR#TauVisible'),
00297         denominator = cms.string('RecoTauV/shrinkingConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00298         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByLeadingTrackFinding/LeadingTrackFindingEff#PAR#'),
00299         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00300       ),
00301       PFTauHighEfficiencyIDLeadingTrackPtCutEfficiencies = cms.PSet(
00302         numerator = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByLeadingTrackPtCut/shrinkingConePFTauDiscriminationByLeadingTrackPtCut_vs_#PAR#TauVisible'),
00303         denominator = cms.string('RecoTauV/shrinkingConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00304         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByLeadingTrackPtCut/LeadingTrackPtCutEff#PAR#'),
00305         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00306       ),
00307       PFTauHighEfficiencyIDTrackIsolationEfficienies = cms.PSet(
00308         numerator = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByTrackIsolation/shrinkingConePFTauDiscriminationByTrackIsolation_vs_#PAR#TauVisible'),
00309         denominator = cms.string('RecoTauV/shrinkingConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00310         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByTrackIsolation/TrackIsolationEff#PAR#'),
00311         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00312       ),
00313       PFTauHighEfficiencyIDECALIsolationEfficienies = cms.PSet(
00314         numerator = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByECALIsolation/shrinkingConePFTauDiscriminationByECALIsolation_vs_#PAR#TauVisible'),
00315         denominator = cms.string('RecoTauV/shrinkingConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00316         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByECALIsolation/ECALIsolationEff#PAR#'),
00317         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00318       ),
00319       PFTauHighEfficiencyIDMuonRejectionEfficiencies = cms.PSet(
00320         numerator = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationAgainstElectron/shrinkingConePFTauDiscriminationAgainstElectron_vs_#PAR#TauVisible'),
00321         denominator = cms.string('RecoTauV/shrinkingConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00322         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
00323         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00324       ),
00325       PFTauHighEfficiencyIDElectronRejectionEfficiencies = cms.PSet(
00326         numerator = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationAgainstMuon/shrinkingConePFTauDiscriminationAgainstMuon_vs_#PAR#TauVisible'),
00327         denominator = cms.string('RecoTauV/shrinkingConePFTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00328         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'),
00329         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00330       ),
00331 # PFTAUHIGHEFFICIENCY_LEADING_PION EFFICIENCY CALCULATION
00332       PFTauHighEfficiencyLeadingPionIDMatchingEfficiencies = cms.PSet(
00333         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_Matched/shrinkingConePFTauProducerMatched_vs_#PAR#TauVisible'),
00334         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00335         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_Matched/PFJetMatchingEff#PAR#'),
00336         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00337       ),
00338       PFTauHighEfficiencyLeadingPionIDLeadingPionPtCutEfficiencies = cms.PSet(
00339         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByLeadingPionPtCut/shrinkingConePFTauDiscriminationByLeadingPionPtCut_vs_#PAR#TauVisible'),
00340         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00341         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByLeadingPionPtCut/LeadingPionPtCutEff#PAR#'),
00342         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00343       ),
00344       PFTauHighEfficiencyLeadingPionIDTrackIsolationEfficienies = cms.PSet(
00345         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion/shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion_vs_#PAR#TauVisible'),
00346         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00347         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion/TrackIsolationEff#PAR#'),
00348         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00349       ),
00350       PFTauHighEfficiencyLeadingPionIDECALIsolationEfficienies = cms.PSet(
00351         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion/shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion_vs_#PAR#TauVisible'),
00352         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00353         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion/ECALIsolationEff#PAR#'),
00354         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00355       ),
00356       PFTauHighEfficiencyLeadingPionIDMuonRejectionEfficiencies = cms.PSet(
00357         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationAgainstElectron/shrinkingConePFTauDiscriminationAgainstElectron_vs_#PAR#TauVisible'),
00358         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00359         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
00360         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00361       ),
00362       PFTauHighEfficiencyLeadingPionIDElectronRejectionEfficiencies = cms.PSet(
00363         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationAgainstMuon/shrinkingConePFTauDiscriminationAgainstMuon_vs_#PAR#TauVisible'),
00364         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00365         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'),
00366         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00367       ),      
00368 # Tanc efficiency calculations
00369       ShrinkingConeTancIDMatchingEfficiencies = cms.PSet(
00370         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_Matched/shrinkingConePFTauProducerMatched_vs_#PAR#TauVisible'),
00371         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00372         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_Matched/PFJetMatchingEff#PAR#'),
00373         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00374       ),
00375       ShrinkingConeTancIDLeadingPionPtCutEfficiencies = cms.PSet(
00376         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByLeadingPionPtCut/shrinkingConePFTauDiscriminationByLeadingPionPtCut_vs_#PAR#TauVisible'),
00377         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00378         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByLeadingPionPtCut/LeadingPionPtCutEff#PAR#'),
00379         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00380       ),
00381       ShrinkingConeTancIDOnePercentEfficienies = cms.PSet(
00382         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrOnePercent/shrinkingConePFTauDiscriminationByTaNCfrOnePercent_vs_#PAR#TauVisible'),
00383         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00384         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrOnePercent/TaNCfrOnePercentEff#PAR#'),
00385         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00386       ),
00387       ShrinkingConeTancIDHalfPercentEfficienies = cms.PSet(
00388         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrHalfPercent/shrinkingConePFTauDiscriminationByTaNCfrHalfPercent_vs_#PAR#TauVisible'),
00389         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00390         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrHalfPercent/TaNCfrHalfPercentEff#PAR#'),
00391         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00392       ),
00393       ShrinkingConeTancIDQuarterPercentEfficienies = cms.PSet(
00394         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent/shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent_vs_#PAR#TauVisible'),
00395         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00396         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent/TaNCfrQuarterPercentEff#PAR#'),
00397         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00398       ),
00399       ShrinkingConeTancIDTenthPercentEfficienies = cms.PSet(
00400         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrTenthPercent/shrinkingConePFTauDiscriminationByTaNCfrTenthPercent_vs_#PAR#TauVisible'),
00401         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00402         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrTenthPercent/TaNCfrTenthPercentEff#PAR#'),
00403         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00404       ),
00405       ShrinkingConeTancIDMuonRejectionEfficiencies = cms.PSet(
00406         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationAgainstElectron/shrinkingConePFTauDiscriminationAgainstElectron_vs_#PAR#TauVisible'),
00407         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00408         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
00409         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00410       ),
00411       ShrinkingConeTancIDElectronRejectionEfficiencies = cms.PSet(
00412         numerator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationAgainstMuon/shrinkingConePFTauDiscriminationAgainstMuon_vs_#PAR#TauVisible'),
00413         denominator = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00414         efficiency = cms.string('RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'),
00415         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00416       ),      
00417 # CALOTAU EFFICIENCY CALCULATIONS      
00418       CaloTauIDMatchingEfficiencies = cms.PSet(
00419         numerator = cms.string('RecoTauV/caloRecoTauProducer_Matched/caloRecoTauProducerMatched_vs_#PAR#TauVisible'),
00420         denominator = cms.string('RecoTauV/caloRecoTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00421         efficiency = cms.string('RecoTauV/caloRecoTauProducer_Matched/CaloJetMatchingEff#PAR#'),
00422         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00423       ),
00424       CaloTauIDLeadingTrackFindEfficiencies = cms.PSet(
00425         numerator = cms.string('RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationByLeadingTrackFinding/caloRecoTauDiscriminationByLeadingTrackFinding_vs_#PAR#TauVisible'),
00426         denominator = cms.string('RecoTauV/caloRecoTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00427         efficiency = cms.string('RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationByLeadingTrackFinding/LeadingTrackFindingEff#PAR#'),
00428         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00429       ),
00430       CaloTauIDLeadingTrackPtCutEfficiencies = cms.PSet(
00431         numerator = cms.string('RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationByLeadingTrackPtCut/caloRecoTauDiscriminationByLeadingTrackPtCut_vs_#PAR#TauVisible'),
00432         denominator = cms.string('RecoTauV/caloRecoTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00433         efficiency = cms.string('RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationByLeadingTrackPtCut/LeadingTrackPtCutEff#PAR#'),
00434         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00435       ),
00436       CaloTauIDIsolationEfficienies = cms.PSet(
00437         numerator = cms.string('RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationByIsolation/caloRecoTauDiscriminationByIsolation_vs_#PAR#TauVisible'),
00438         denominator = cms.string('RecoTauV/caloRecoTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00439         efficiency = cms.string('RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationByIsolation/IsolationEff#PAR#'),
00440         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00441       ),
00442       CaloTauIDMuonRejectionEfficiencies = cms.PSet(
00443         numerator = cms.string('RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationAgainstElectron/caloRecoTauDiscriminationAgainstElectron_vs_#PAR#TauVisible'),
00444         denominator = cms.string('RecoTauV/caloRecoTauProducer_ReferenceCollection/nRef_Taus_vs_#PAR#TauVisible'),
00445         efficiency = cms.string('RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
00446         parameter = cms.vstring('pt', 'eta', 'phi', 'energy')
00447       )      
00448     )                                
00449 )
00450 
00451 
00452  
00453 """
00454 
00455 PLOTTING
00456 
00457         loadTau:  load two separate TauVal root files into the DQM
00458                   so the plotter can access them
00459 
00460 """
00461 
00462 loadTau = cms.EDAnalyzer("DQMFileLoader",
00463   test = cms.PSet(
00464     inputFileNames = cms.vstring('/afs/cern.ch/user/f/friis/scratch0/MyValidationArea/310pre6NewTags/src/Validation/RecoTau/test/CMSSW_3_1_0_pre6_ZTT_0505Fixes.root'),
00465     scaleFactor = cms.double(1.),
00466     dqmDirectory_store = cms.string('test')
00467   ),
00468   reference = cms.PSet(
00469     inputFileNames = cms.vstring('/afs/cern.ch/user/f/friis/CMSSW/pre6/src/Validation/RecoTau/test/CMSSW_3_1_0_pre6_ZTT.root'),
00470     scaleFactor = cms.double(1.),
00471     dqmDirectory_store = cms.string('reference')
00472   )
00473 )
00474 
00475 # Lots of junk to define the plot style
00476 
00477 # standard drawing stuff
00478 standardDrawingStuff = cms.PSet(
00479   canvasSizeX = cms.int32(640),
00480   canvasSizeY = cms.int32(640),                         
00481   indOutputFileName = cms.string('#PLOT#.png'),
00482   xAxes = cms.PSet(
00483     pt = cms.PSet(
00484       xAxisTitle = cms.string('P_{T} / GeV'),
00485       xAxisTitleOffset = cms.double(0.9),
00486       xAxisTitleSize = cms.double(0.05)
00487     ),
00488     eta = cms.PSet(
00489       xAxisTitle = cms.string('#eta'),
00490       xAxisTitleOffset = cms.double(0.9),
00491       xAxisTitleSize = cms.double(0.05)
00492     ),
00493     phi = cms.PSet(
00494       xAxisTitle = cms.string('#phi'),
00495       xAxisTitleOffset = cms.double(0.9),
00496       xAxisTitleSize = cms.double(0.05)
00497     ),
00498     energy = cms.PSet(
00499       xAxisTitle = cms.string('E / GeV'),
00500       xAxisTitleOffset = cms.double(0.9),
00501       xAxisTitleSize = cms.double(0.05)
00502     )
00503   ),
00504 
00505   yAxes = cms.PSet(                         
00506     efficiency = cms.PSet(
00507       yScale = cms.string('linear'), # linear/log
00508       minY_linear = cms.double(0.),
00509       maxY_linear = cms.double(1.6),
00510       minY_log = cms.double(0.001),
00511       maxY_log = cms.double(1.8),
00512       yAxisTitle = cms.string('#varepsilon'), 
00513       yAxisTitleOffset = cms.double(1.1),
00514       yAxisTitleSize = cms.double(0.05)
00515     ),
00516     fakeRate = cms.PSet(
00517       yScale = cms.string('log'), # linear/log
00518       minY_linear = cms.double(0.),
00519       maxY_linear = cms.double(1.6),
00520       minY_log = cms.double(0.001),
00521       maxY_log = cms.double(1.8),
00522       yAxisTitle = cms.string('#varepsilon'), 
00523       yAxisTitleOffset = cms.double(1.1),
00524       yAxisTitleSize = cms.double(0.05)
00525     )
00526   ),
00527 
00528   legends = cms.PSet(
00529     efficiency = cms.PSet(
00530       posX = cms.double(0.50),
00531       posY = cms.double(0.72),
00532       sizeX = cms.double(0.39),
00533       sizeY = cms.double(0.17),
00534       header = cms.string(''),
00535       option = cms.string('brNDC'),
00536       borderSize = cms.int32(0),
00537       fillColor = cms.int32(0)
00538     ),
00539     efficiency_overlay = cms.PSet(
00540       posX = cms.double(0.50),
00541       posY = cms.double(0.66),
00542       sizeX = cms.double(0.39),
00543       sizeY = cms.double(0.23),
00544       header = cms.string(''),
00545       option = cms.string('brNDC'),
00546       borderSize = cms.int32(0),
00547       fillColor = cms.int32(0)
00548     )
00549   ),
00550 
00551   labels = cms.PSet(
00552     pt = cms.PSet(
00553       posX = cms.double(0.19),
00554       posY = cms.double(0.77),
00555       sizeX = cms.double(0.12),
00556       sizeY = cms.double(0.04),
00557       option = cms.string('brNDC'),
00558       borderSize = cms.int32(0),
00559       fillColor = cms.int32(0),
00560       textColor = cms.int32(1),
00561       textSize = cms.double(0.04),
00562       textAlign = cms.int32(22),
00563       text = cms.vstring('P_{T} > 5 GeV')
00564     ),
00565     eta = cms.PSet(
00566       posX = cms.double(0.19),
00567       posY = cms.double(0.83),
00568       sizeX = cms.double(0.12),
00569       sizeY = cms.double(0.04),
00570       option = cms.string('brNDC'),
00571       borderSize = cms.int32(0),
00572       fillColor = cms.int32(0),
00573       textColor = cms.int32(1),
00574       textSize = cms.double(0.04),
00575       textAlign = cms.int32(22),
00576       text = cms.vstring('-2.5 < #eta < +2.5')
00577     )
00578   ),
00579 
00580   drawOptionSets = cms.PSet(
00581     efficiency = cms.PSet(
00582       test = cms.PSet(
00583         markerColor = cms.int32(4),
00584         markerSize = cms.double(1.),
00585         markerStyle = cms.int32(20),
00586         lineColor = cms.int32(1),
00587         lineStyle = cms.int32(1),
00588         lineWidth = cms.int32(1),
00589         drawOption = cms.string('ep'),
00590         drawOptionLegend = cms.string('p')
00591       ),
00592       reference = cms.PSet(
00593         lineColor = cms.int32(1),
00594         lineStyle = cms.int32(1),
00595         lineWidth = cms.int32(1),
00596         fillColor = cms.int32(41),
00597         drawOption = cms.string('eBand'),
00598         drawOptionLegend = cms.string('l')
00599       )
00600     )
00601   ),
00602                                      
00603   drawOptionEntries = cms.PSet(
00604     eff_overlay01 = cms.PSet(
00605       markerColor = cms.int32(1),
00606       markerSize = cms.double(1.),
00607       markerStyle = cms.int32(20),
00608       lineColor = cms.int32(1),
00609       lineStyle = cms.int32(1),
00610       lineWidth = cms.int32(2),
00611       drawOption = cms.string('ex0'),
00612       drawOptionLegend = cms.string('p')
00613     ),
00614     eff_overlay02 = cms.PSet(
00615       markerColor = cms.int32(2),
00616       markerSize = cms.double(1.),
00617       markerStyle = cms.int32(20),
00618       lineColor = cms.int32(2),
00619       lineStyle = cms.int32(1),
00620       lineWidth = cms.int32(2),
00621       drawOption = cms.string('ex0'),
00622       drawOptionLegend = cms.string('p')
00623     ),
00624     eff_overlay03 = cms.PSet(
00625       markerColor = cms.int32(3),
00626       markerSize = cms.double(1.),
00627       markerStyle = cms.int32(20),
00628       lineColor = cms.int32(3),
00629       lineStyle = cms.int32(1),
00630       lineWidth = cms.int32(2),
00631       drawOption = cms.string('ex0'),
00632       drawOptionLegend = cms.string('p')
00633     ),
00634     eff_overlay04 = cms.PSet(
00635       markerColor = cms.int32(4),
00636       markerSize = cms.double(1.),
00637       markerStyle = cms.int32(20),
00638       lineColor = cms.int32(4),
00639       lineStyle = cms.int32(1),
00640       lineWidth = cms.int32(2),
00641       drawOption = cms.string('ex0'),
00642       drawOptionLegend = cms.string('p')
00643     ),
00644     eff_overlay05 = cms.PSet(
00645       markerColor = cms.int32(6),
00646       markerSize = cms.double(1.),
00647       markerStyle = cms.int32(20),
00648       lineColor = cms.int32(6),
00649       lineStyle = cms.int32(1),
00650       lineWidth = cms.int32(2),
00651       drawOption = cms.string('ex0'),
00652       drawOptionLegend = cms.string('p')
00653     ),
00654     eff_overlay06 = cms.PSet(
00655       markerColor = cms.int32(5),
00656       markerSize = cms.double(1.),
00657       markerStyle = cms.int32(20),
00658       lineColor = cms.int32(5),
00659       lineStyle = cms.int32(1),
00660       lineWidth = cms.int32(2),
00661       drawOption = cms.string('ex0'),
00662       drawOptionLegend = cms.string('p')
00663     )
00664   ),
00665 )
00666 
00667 standardCompareTestAndReference = cms.PSet(
00668   processes = cms.PSet(
00669     test = cms.PSet(
00670       dqmDirectory = cms.string('test'),
00671       legendEntry = cms.string('no test label'),
00672       type = cms.string('smMC') # Data/smMC/bsmMC/smSumMC
00673     ),
00674     reference = cms.PSet(
00675       dqmDirectory = cms.string('reference'),
00676       legendEntry = cms.string('no ref label'),
00677       type = cms.string('smMC') # Data/smMC/bsmMC/smSumMC
00678     )
00679   ),
00680 )
00681 
00682 standardEfficiencyParameters = cms.PSet(
00683       parameter = cms.vstring('pt', 'eta', 'phi', 'energy'),
00684       xAxis = cms.string('#PAR#'),
00685       yAxis = cms.string('efficiency'),
00686       legend = cms.string('efficiency'),
00687       labels = cms.vstring('pt', 'eta'),
00688       drawOptionSet = cms.string('efficiency')
00689 )
00690 
00691 standardEfficiencyOverlay = cms.PSet(
00692       parameter = cms.vstring('pt', 'eta', 'phi', 'energy'),
00693       title = cms.string('TauId step by step efficiencies'),
00694       xAxis = cms.string('#PAR#'),
00695       yAxis = cms.string('efficiency'),
00696       legend = cms.string('efficiency_overlay'),
00697       labels = cms.vstring('pt', 'eta')
00698 )
00699 
00700         
00701 ##################################################
00702 #
00703 #   The plotting of all the PFTau ID efficiencies
00704 #
00705 ##################################################
00706 plotPFTauEfficiencies = cms.EDAnalyzer("DQMHistPlotter",
00707   standardDrawingStuff,
00708   standardCompareTestAndReference,
00709   drawJobs = cms.PSet(                                     
00710     PFJetMatchingEff = cms.PSet(
00711       standardEfficiencyParameters,
00712       plots = cms.PSet(
00713         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_Matched/PFJetMatchingEff#PAR#'),
00714         processes = cms.vstring('test', 'reference')
00715       )
00716     ),
00717     LeadingTrackPtCutEff = cms.PSet(
00718       standardEfficiencyParameters,
00719       plots = cms.PSet(
00720         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByLeadingTrackPtCut/LeadingTrackPtCutEff#PAR#'),
00721         processes = cms.vstring('test', 'reference')
00722       )  
00723     ),
00724     TrackIsolationEff = cms.PSet(
00725       standardEfficiencyParameters,
00726       plots = cms.PSet(
00727         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByTrackIsolation/TrackIsolationEff#PAR#'),
00728         processes = cms.vstring('test', 'reference')
00729       ),
00730     ),
00731     ECALIsolationEff = cms.PSet(
00732       standardEfficiencyParameters,
00733       plots = cms.PSet(
00734         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByECALIsolation/ECALIsolationEff#PAR#'),
00735         processes = cms.vstring('test', 'reference')
00736       ),
00737     ),
00738     AgainstElectronEff = cms.PSet(
00739       standardEfficiencyParameters,
00740       plots = cms.PSet(
00741         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'), 
00742         processes = cms.vstring('test', 'reference')
00743       ),
00744     ),
00745     AgainstMuonEff = cms.PSet(
00746       standardEfficiencyParameters,
00747       plots = cms.PSet(
00748         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'), 
00749         processes = cms.vstring('test', 'reference')
00750       ),
00751     ),
00752     TauIdEffStepByStep = cms.PSet(
00753       standardEfficiencyOverlay,
00754       plots = cms.VPSet(
00755         cms.PSet(
00756           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_Matched/PFJetMatchingEff#PAR#'),
00757           process = cms.string('test'),
00758           drawOptionEntry = cms.string('eff_overlay01'),
00759           legendEntry = cms.string('PFJet Matching')
00760         ),    
00761         cms.PSet(
00762           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByLeadingTrackPtCut/LeadingTrackPtCutEff#PAR#'),
00763           process = cms.string('test'),
00764           drawOptionEntry = cms.string('eff_overlay02'),
00765           legendEntry = cms.string('Lead Track Finding')
00766         ),
00767         cms.PSet(
00768           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByTrackIsolation/TrackIsolationEff#PAR#'),
00769           process = cms.string('test'),
00770           drawOptionEntry = cms.string('eff_overlay03'),
00771           legendEntry = cms.string('Track Iso.')
00772         ),
00773         cms.PSet(
00774           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationByECALIsolation/ECALIsolationEff#PAR#'),
00775           process = cms.string('test'),
00776           drawOptionEntry = cms.string('eff_overlay04'),
00777           legendEntry = cms.string('Track + Gamma Iso.')
00778         ),
00779         cms.PSet(
00780           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
00781           process = cms.string('test'),
00782           drawOptionEntry = cms.string('eff_overlay05'),
00783           legendEntry = cms.string('Electron Rejection')
00784         ),
00785         cms.PSet(
00786           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/fixedConePFTauProducer_fixedConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'),
00787           process = cms.string('test'),
00788           drawOptionEntry = cms.string('eff_overlay06'),
00789           legendEntry = cms.string('Muon Rejection')
00790         )
00791       ),
00792     )
00793   ),
00794   outputFilePath = cms.string('./fixedConePFTauProducer/'),
00795 )                    
00796 ##################################################
00797 #
00798 #   The plotting of HPS Efficiencies
00799 #
00800 ##################################################
00801 
00802 
00803 plotHPSEfficiencies = cms.EDAnalyzer("DQMHistPlotter",
00804   standardDrawingStuff,
00805   standardCompareTestAndReference,
00806   drawJobs = cms.PSet(                                     
00807     PFJetMatchingEff = cms.PSet(
00808       standardEfficiencyParameters,
00809       plots = cms.PSet(
00810         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_Matched/PFJetMatchingEff#PAR#'),
00811         processes = cms.vstring('test', 'reference')
00812       ),
00813     ),
00814     DecayModeEff = cms.PSet(
00815       standardEfficiencyParameters,
00816       plots = cms.PSet(
00817         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByDecayModeFinding/DecayModeFindingEff#PAR#'),
00818         processes = cms.vstring('test', 'reference')
00819       ),  
00820     ),
00821     LooseIsolationEff = cms.PSet(
00822       standardEfficiencyParameters,
00823       plots = cms.PSet(
00824         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByLooseIsolation/LooseIsolationEff#PAR#'),
00825         processes = cms.vstring('test', 'reference')
00826       ),
00827     ),
00828     MediumIsolationEff = cms.PSet(
00829       standardEfficiencyParameters,
00830       plots = cms.PSet(
00831         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByMediumIsolation/MediumIsolationEff#PAR#'),
00832         processes = cms.vstring('test', 'reference')
00833       ),
00834     ),
00835     TightIsolationEff = cms.PSet(
00836       standardEfficiencyParameters,
00837       plots = cms.PSet(
00838         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByTightIsolation/TightIsolationEff#PAR#'),
00839         processes = cms.vstring('test', 'reference')
00840       ),
00841     ),
00842     AgainstElectronEff = cms.PSet(
00843       standardEfficiencyParameters,
00844       plots = cms.PSet(
00845         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'), 
00846         processes = cms.vstring('test', 'reference')
00847       ),
00848     ),
00849     AgainstMuonEff = cms.PSet(
00850       standardEfficiencyParameters,
00851       plots = cms.PSet(
00852         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'), 
00853         processes = cms.vstring('test', 'reference')
00854       ),
00855     ),
00856     TauIdEffStepByStep = cms.PSet(
00857       standardEfficiencyOverlay,
00858       plots = cms.VPSet(
00859         cms.PSet(
00860           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_Matched/PFJetMatchingEff#PAR#'),
00861           process = cms.string('test'),
00862           drawOptionEntry = cms.string('eff_overlay01'),
00863           legendEntry = cms.string('PFJet Matching')
00864         ),    
00865         cms.PSet(
00866           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByDecayModeFinding/DecayModeFindingEff#PAR#'),
00867           process = cms.string('test'),
00868           drawOptionEntry = cms.string('eff_overlay02'),
00869           legendEntry = cms.string('Decay Mode Finding')
00870         ),
00871         cms.PSet(
00872           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByLooseIsolation/LooseIsolationEff#PAR#'),
00873           process = cms.string('test'),
00874           drawOptionEntry = cms.string('eff_overlay03'),
00875           legendEntry = cms.string('Loose Iso.')
00876         ),
00877         cms.PSet(
00878           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByMediumIsolation/MediumIsolationEff#PAR#'),
00879           process = cms.string('test'),
00880           drawOptionEntry = cms.string('eff_overlay03'),
00881           legendEntry = cms.string('Medium Iso.')
00882         ),
00883         cms.PSet(
00884           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/hpsPFTauProducer_hpsPFTauDiscriminationByTightIsolation/TightIsolationEff#PAR#'),
00885           process = cms.string('test'),
00886           drawOptionEntry = cms.string('eff_overlay03'),
00887           legendEntry = cms.string('Tight Iso.')
00888         )
00889       )
00890     )
00891   ),
00892   outputFilePath = cms.string('./hpsPFTauProducer/')
00893 )      
00894 
00895 
00896 
00897 
00898 
00899 
00900 ##################################################
00901 #
00902 #   The plotting of all the PFTauHighEfficiencies ID efficiencies
00903 #
00904 ##################################################
00905 
00906 plotPFTauHighEfficiencyEfficiencies = cms.EDAnalyzer("DQMHistPlotter",
00907   standardDrawingStuff,
00908   standardCompareTestAndReference,
00909   drawJobs = cms.PSet(                                     
00910     PFJetMatchingEff = cms.PSet(
00911       standardEfficiencyParameters,
00912       plots = cms.PSet(
00913         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_Matched/PFJetMatchingEff#PAR#'),
00914         processes = cms.vstring('test', 'reference')
00915       ),
00916     ),
00917     LeadingTrackPtCutEff = cms.PSet(
00918       standardEfficiencyParameters,
00919       plots = cms.PSet(
00920         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByLeadingTrackPtCut/LeadingTrackPtCutEff#PAR#'),
00921         processes = cms.vstring('test', 'reference')
00922       ),  
00923     ),
00924     TrackIsolationEff = cms.PSet(
00925       standardEfficiencyParameters,
00926       plots = cms.PSet(
00927         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByTrackIsolation/TrackIsolationEff#PAR#'),
00928         processes = cms.vstring('test', 'reference')
00929       ),
00930     ),
00931     ECALIsolationEff = cms.PSet(
00932       standardEfficiencyParameters,
00933       plots = cms.PSet(
00934         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByECALIsolation/ECALIsolationEff#PAR#'),
00935         processes = cms.vstring('test', 'reference')
00936       ),
00937     ),    
00938     AgainstElectronEff = cms.PSet(
00939       standardEfficiencyParameters,
00940       plots = cms.PSet(
00941         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'), 
00942         processes = cms.vstring('test', 'reference')
00943       ),
00944     ),
00945     AgainstMuonEff = cms.PSet(
00946       standardEfficiencyParameters,
00947       plots = cms.PSet(
00948         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'), 
00949         processes = cms.vstring('test', 'reference')
00950       ),
00951     ),
00952     TauIdEffStepByStep = cms.PSet(
00953       standardEfficiencyOverlay,
00954       plots = cms.VPSet(
00955         cms.PSet(
00956           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_Matched/PFJetMatchingEff#PAR#'),
00957           process = cms.string('test'),
00958           drawOptionEntry = cms.string('eff_overlay01'),
00959           legendEntry = cms.string('PFJet Matching')
00960         ),    
00961         cms.PSet(
00962           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByLeadingTrackPtCut/LeadingTrackPtCutEff#PAR#'),
00963           process = cms.string('test'),
00964           drawOptionEntry = cms.string('eff_overlay02'),
00965           legendEntry = cms.string('Lead Track Finding')
00966         ),
00967         cms.PSet(
00968           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByTrackIsolation/TrackIsolationEff#PAR#'),
00969           process = cms.string('test'),
00970           drawOptionEntry = cms.string('eff_overlay03'),
00971           legendEntry = cms.string('Track Iso.')
00972         ),
00973         cms.PSet(
00974           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationByECALIsolation/ECALIsolationEff#PAR#'),
00975           process = cms.string('test'),
00976           drawOptionEntry = cms.string('eff_overlay04'),
00977           legendEntry = cms.string('Track + Gamma Iso.')
00978         ),
00979         cms.PSet(
00980           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
00981           process = cms.string('test'),
00982           drawOptionEntry = cms.string('eff_overlay05'),
00983           legendEntry = cms.string('Electron Rejection')
00984         ),
00985         cms.PSet(
00986           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducer_shrinkingConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'),
00987           process = cms.string('test'),
00988           drawOptionEntry = cms.string('eff_overlay06'),
00989           legendEntry = cms.string('Muon Rejection')
00990         )
00991       ),
00992     )
00993   ),
00994   outputFilePath = cms.string('./shrinkingConePFTauProducer/'),
00995 )      
00996 
00997 ##################################################
00998 #
00999 #   The plotting of all the CaloTau ID efficiencies
01000 #
01001 ##################################################
01002 
01003 plotCaloTauEfficiencies = cms.EDAnalyzer("DQMHistPlotter",
01004   standardDrawingStuff,
01005   standardCompareTestAndReference,
01006   drawJobs = cms.PSet(                                     
01007     CaloJetMatchingEff = cms.PSet(
01008       standardEfficiencyParameters,
01009       plots = cms.PSet(
01010         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/caloRecoTauProducer_Matched/CaloJetMatchingEff#PAR#'),
01011         processes = cms.vstring('test', 'reference')
01012       ),
01013     ),
01014     LeadingTrackPtCutEff = cms.PSet(
01015       standardEfficiencyParameters,
01016       plots = cms.PSet(
01017         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationByLeadingTrackPtCut/LeadingTrackPtCutEff#PAR#'),
01018         processes = cms.vstring('test', 'reference')
01019       ),  
01020     ),
01021     IsolationEff = cms.PSet(
01022       standardEfficiencyParameters,
01023       plots = cms.PSet(
01024         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationByIsolation/IsolationEff#PAR#'),
01025         processes = cms.vstring('test', 'reference')
01026       ),
01027     ),
01028     AgainstElectronEff = cms.PSet(
01029       standardEfficiencyParameters,
01030       plots = cms.PSet(
01031         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'), 
01032         processes = cms.vstring('test', 'reference')
01033       ),
01034     ),
01035     TauIdEffStepByStep = cms.PSet(
01036       standardEfficiencyOverlay,
01037       plots = cms.VPSet(
01038         cms.PSet(
01039           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/caloRecoTauProducer_Matched/CaloJetMatchingEff#PAR#'),
01040           process = cms.string('test'),
01041           drawOptionEntry = cms.string('eff_overlay01'),
01042           legendEntry = cms.string('CaloJet Matching')
01043         ),    
01044         cms.PSet(
01045           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationByLeadingTrackPtCut/LeadingTrackPtCutEff#PAR#'),
01046           process = cms.string('test'),
01047           drawOptionEntry = cms.string('eff_overlay02'),
01048           legendEntry = cms.string('Lead Track Finding')
01049         ),
01050         cms.PSet(
01051           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationByIsolation/IsolationEff#PAR#'),
01052           process = cms.string('test'),
01053           drawOptionEntry = cms.string('eff_overlay03'),
01054           legendEntry = cms.string('Track Isolation')
01055         ),
01056         cms.PSet(
01057           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/caloRecoTauProducer_caloRecoTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
01058           process = cms.string('test'),
01059           drawOptionEntry = cms.string('eff_overlay04'),
01060           legendEntry = cms.string('Electron Rejection')
01061         )
01062       ),
01063     )
01064   ),
01065   outputFilePath = cms.string('./caloRecoTauProducer/'),
01066 )
01067 
01068 ##################################################
01069 #
01070 #   Plot Tanc performance
01071 #
01072 ##################################################
01073 
01074 plotTancValidation = cms.EDAnalyzer("DQMHistPlotter",
01075   standardDrawingStuff,
01076   standardCompareTestAndReference,
01077   drawJobs = cms.PSet(                                     
01078     PFJetMatchingEff = cms.PSet(
01079       standardEfficiencyParameters,
01080       plots = cms.PSet(
01081         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_Matched/PFJetMatchingEff#PAR#'),
01082         processes = cms.vstring('test', 'reference')
01083       ),
01084     ),
01085     LeadingTrackPtCutEff = cms.PSet(
01086       standardEfficiencyParameters,
01087       plots = cms.PSet(
01088         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByLeadingPionPtCut/LeadingPionPtCutEff#PAR#'),
01089         processes = cms.vstring('test', 'reference')
01090       ),  
01091     ),
01092     TaNCfrOnePercentEff = cms.PSet(
01093       standardEfficiencyParameters,
01094       plots = cms.PSet(
01095         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrOnePercent/TaNCfrOnePercentEff#PAR#'),
01096         processes = cms.vstring('test', 'reference')
01097       ),
01098     ),
01099     TaNCfrHalfPercentEff = cms.PSet(
01100       standardEfficiencyParameters,
01101       plots = cms.PSet(
01102         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrHalfPercent/TaNCfrHalfPercentEff#PAR#'),
01103         processes = cms.vstring('test', 'reference')
01104       ),
01105     ),
01106     TaNCfrQuarterPercentEff = cms.PSet(
01107       standardEfficiencyParameters,
01108       plots = cms.PSet(
01109         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent/TaNCfrQuarterPercentEff#PAR#'),
01110         processes = cms.vstring('test', 'reference')
01111       ),
01112     ),
01113     TaNCfrTenthPercentEff = cms.PSet(
01114       standardEfficiencyParameters,
01115       plots = cms.PSet(
01116         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrTenthPercent/TaNCfrTenthPercentEff#PAR#'),
01117         processes = cms.vstring('test', 'reference')
01118       ),
01119     ),
01120     AgainstElectronEff = cms.PSet(
01121       standardEfficiencyParameters,
01122       plots = cms.PSet(
01123         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'), 
01124         processes = cms.vstring('test', 'reference')
01125       ),
01126     ),
01127     AgainstMuonEff = cms.PSet(
01128       standardEfficiencyParameters,
01129       plots = cms.PSet(
01130         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'), 
01131         processes = cms.vstring('test', 'reference')
01132       ),
01133     ),
01134     TauIdEffStepByStep = cms.PSet(
01135       standardEfficiencyOverlay,
01136       plots = cms.VPSet(
01137         cms.PSet(
01138           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_Matched/PFJetMatchingEff#PAR#'),
01139           process = cms.string('test'),
01140           drawOptionEntry = cms.string('eff_overlay01'),
01141           legendEntry = cms.string('PFJet Matching')
01142         ),    
01143         cms.PSet(
01144           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByLeadingPionPtCut/LeadingPionPtCutEff#PAR#'),
01145           process = cms.string('test'),
01146           drawOptionEntry = cms.string('eff_overlay02'),
01147           legendEntry = cms.string('Lead Pion Finding')
01148         ),
01149         cms.PSet(
01150           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrOnePercent/TaNCfrOnePercentEff#PAR#'),
01151           process = cms.string('test'),
01152           drawOptionEntry = cms.string('eff_overlay03'),
01153           legendEntry = cms.string('TaNC One Percent')
01154         ),
01155         cms.PSet(
01156           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrHalfPercent/TaNCfrHalfPercentEff#PAR#'),
01157           process = cms.string('test'),
01158           drawOptionEntry = cms.string('eff_overlay03'),
01159           legendEntry = cms.string('TaNC Half Percent')
01160         ),
01161         cms.PSet(
01162           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrQuarterPercent/TaNCfrQuarterPercentEff#PAR#'),
01163           process = cms.string('test'),
01164           drawOptionEntry = cms.string('eff_overlay03'),
01165           legendEntry = cms.string('TaNC Quarter Percent')
01166         ),
01167         cms.PSet(
01168           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationByTaNCfrTenthPercent/TaNCfrTenthPercentEff#PAR#'),
01169           process = cms.string('test'),
01170           drawOptionEntry = cms.string('eff_overlay03'),
01171           legendEntry = cms.string('TaNC Tenth Percent')
01172         ),
01173         cms.PSet(
01174           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
01175           process = cms.string('test'),
01176           drawOptionEntry = cms.string('eff_overlay05'),
01177           legendEntry = cms.string('Electron Rejection')
01178         ),
01179         cms.PSet(
01180           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerTanc_shrinkingConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'),
01181           process = cms.string('test'),
01182           drawOptionEntry = cms.string('eff_overlay06'),
01183           legendEntry = cms.string('Muon Rejection')
01184         )
01185       ),
01186     )
01187   ),
01188   outputFilePath = cms.string('./shrinkingConePFTauProducerTanc/'),
01189 )
01190 
01191 
01192 ##################################################
01193 #
01194 #   The plotting of all the PFTauHighEfficiencyUsingLeadingPion ID efficiencies
01195 #
01196 ##################################################
01197 
01198 plotPFTauHighEfficiencyEfficienciesLeadingPion = cms.EDAnalyzer("DQMHistPlotter",
01199   standardDrawingStuff,
01200   standardCompareTestAndReference,
01201   drawJobs = cms.PSet(                                     
01202     PFJetMatchingEff = cms.PSet(
01203       standardEfficiencyParameters,
01204       plots = cms.PSet(
01205         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_Matched/PFJetMatchingEff#PAR#'),
01206         processes = cms.vstring('test', 'reference')
01207       ),
01208     ),
01209     LeadingTrackPtCutEff = cms.PSet(
01210       standardEfficiencyParameters,
01211       plots = cms.PSet(
01212         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByLeadingPionPtCut/LeadingPionPtCutEff#PAR#'),
01213         processes = cms.vstring('test', 'reference')
01214       ),  
01215     ),
01216     TrackIsolationEff = cms.PSet(
01217       standardEfficiencyParameters,
01218       plots = cms.PSet(
01219         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion/TrackIsolationEff#PAR#'),
01220         processes = cms.vstring('test', 'reference')
01221       ),
01222     ),
01223     ECALIsolationEff = cms.PSet(
01224       standardEfficiencyParameters,
01225       plots = cms.PSet(
01226         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion/ECALIsolationEff#PAR#'),
01227         processes = cms.vstring('test', 'reference')
01228       ),
01229     ),
01230     AgainstElectronEff = cms.PSet(
01231       standardEfficiencyParameters,
01232       plots = cms.PSet(
01233         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'), 
01234         processes = cms.vstring('test', 'reference')
01235       ),
01236     ),
01237     AgainstMuonEff = cms.PSet(
01238       standardEfficiencyParameters,
01239       plots = cms.PSet(
01240         dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'), 
01241         processes = cms.vstring('test', 'reference')
01242       ),
01243     ),
01244     TauIdEffStepByStep = cms.PSet(
01245       standardEfficiencyOverlay,
01246       plots = cms.VPSet(
01247         cms.PSet(
01248           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_Matched/PFJetMatchingEff#PAR#'),
01249           process = cms.string('test'),
01250           drawOptionEntry = cms.string('eff_overlay01'),
01251           legendEntry = cms.string('PFJet Matching')
01252         ),    
01253         cms.PSet(
01254           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByLeadingPionPtCut/LeadingPionPtCutEff#PAR#'),
01255           process = cms.string('test'),
01256           drawOptionEntry = cms.string('eff_overlay02'),
01257           legendEntry = cms.string('Lead Pion Finding')
01258         ),
01259         cms.PSet(
01260           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByTrackIsolationUsingLeadingPion/TrackIsolationEff#PAR#'),
01261           process = cms.string('test'),
01262           drawOptionEntry = cms.string('eff_overlay03'),
01263           legendEntry = cms.string('Track Iso. Using Lead. Pion')
01264         ),
01265         cms.PSet(
01266           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationByECALIsolationUsingLeadingPion/ECALIsolationEff#PAR#'),
01267           process = cms.string('test'),
01268           drawOptionEntry = cms.string('eff_overlay04'),
01269           legendEntry = cms.string('Track + Gamma Iso. Using Lead. Pioon')
01270         ),
01271         cms.PSet(
01272           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationAgainstElectron/AgainstElectronEff#PAR#'),
01273           process = cms.string('test'),
01274           drawOptionEntry = cms.string('eff_overlay05'),
01275           legendEntry = cms.string('Electron Rejection')
01276         ),
01277         cms.PSet(
01278           dqmMonitorElements = cms.vstring('#PROCESSDIR#/RecoTauV/shrinkingConePFTauProducerLeadingPion_shrinkingConePFTauDiscriminationAgainstMuon/AgainstMuonEff#PAR#'),
01279           process = cms.string('test'),
01280           drawOptionEntry = cms.string('eff_overlay06'),
01281           legendEntry = cms.string('Muon Rejection')
01282         )
01283       ),
01284     )
01285   ),
01286   outputFilePath = cms.string('./shrinkingConePFTauProducerLeadingPion/'),
01287 )
01288 
01289 plotTauValidation = cms.Sequence(
01290       plotPFTauEfficiencies
01291       +plotPFTauHighEfficiencyEfficiencies
01292       +plotCaloTauEfficiencies
01293       +plotTancValidation
01294       +plotPFTauHighEfficiencyEfficienciesLeadingPion
01295       +plotHPSEfficiencies
01296       )
01297 
01298 
01299 loadAndPlotTauValidation = cms.Sequence(
01300       loadTau
01301       +plotTancValidation
01302       )
01303 
01304 """
01305 
01306 UTILITIES
01307 
01308 """
01309 
01310 class ApplyFunctionToSequence:
01311    """ Helper class that applies a given function to all modules
01312        in a sequence """
01313    def __init__(self,function):
01314       self.functor = function
01315    def enter(self, module):
01316       self.functor(module)
01317    def leave(self, module):
01318       pass
01319 
01320 def TranslateToLegacyProdNames(input):
01321    input = re.sub('fixedConePFTauProducer', 'pfRecoTauProducer', input)
01322    #fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination( \w* )')
01323    fixedDiscriminationRegex = re.compile('fixedConePFTauDiscrimination(\w*)')
01324    input = fixedDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1', input)
01325    input = re.sub('shrinkingConePFTauProducer', 'pfRecoTauProducerHighEfficiency', input)
01326    shrinkingDiscriminationRegex = re.compile('shrinkingConePFTauDiscrimination(\w*)')
01327    input = shrinkingDiscriminationRegex.sub(r'pfRecoTauDiscrimination\1HighEfficiency', input)
01328    return input
01329 
01330 
01331 def ConvertDrawJobToLegacyCompare(input):
01332    """ Converts a draw job defined to compare 31X named PFTau validtion efficiencies
01333        to comapre a 31X to a 22X named validation """
01334    # get the list of drawjobs { name : copyOfPSet }
01335    if not hasattr(input, "drawJobs"):
01336       return
01337    myDrawJobs = input.drawJobs.parameters_()
01338    for drawJobName, drawJobData in myDrawJobs.iteritems():
01339       print drawJobData
01340       if not drawJobData.plots.pythonTypeName() == "cms.PSet":
01341          continue
01342       pSetToInsert = cms.PSet(
01343             standardEfficiencyParameters,
01344             plots = cms.VPSet(
01345                # test plot w/ modern names
01346                cms.PSet(
01347                   dqmMonitorElements = drawJobData.plots.dqmMonitorElements,
01348                   process = cms.string('test'),
01349                   drawOptionEntry = cms.string('eff_overlay01'),
01350                   legendEntry = cms.string(input.processes.test.legendEntry.value())
01351                   ),
01352                # ref plot w/ vintage name
01353                cms.PSet(
01354                   # translate the name
01355                   dqmMonitorElements = cms.vstring(TranslateToLegacyProdNames(drawJobData.plots.dqmMonitorElements.value()[0])),
01356                   process = cms.string('reference'),
01357                   drawOptionEntry = cms.string('eff_overlay02'),
01358                   legendEntry = cms.string(input.processes.reference.legendEntry.value())
01359                   )
01360                )
01361             )
01362       input.drawJobs.__setattr__(drawJobName, pSetToInsert)
01363 
01364 def MakeLabeler(TestLabel, ReferenceLabel):
01365    def labeler(module):
01366       if hasattr(module, 'processes'):
01367          if module.processes.hasParameter(['test', 'legendEntry']) and module.processes.hasParameter([ 'reference', 'legendEntry']):
01368             module.processes.test.legendEntry = TestLabel
01369             module.processes.reference.legendEntry = ReferenceLabel
01370             print "Set test label to %s and reference label to %s for plot producer %s" % (TestLabel, ReferenceLabel, module.label())
01371          else:
01372             print "ERROR in RecoTauValidation_cfi::MakeLabeler - trying to set test/reference label but %s does not have processes.(test/reference).legendEntry parameters!" % module.label()
01373    return labeler
01374 
01375 def SetYmodulesToLog(matchingNames = []):
01376    ''' set all modules whose name contains one of the matching names to log y scale'''
01377    def yLogger(module):
01378       ''' set a module to use log scaling in the yAxis'''
01379       if hasattr(module, 'drawJobs'):
01380          print "EK DEBUG"
01381          drawJobParamGetter = lambda subName : getattr(module.drawJobs, subName)
01382          #for subModule in [getattr(module.drawJobs, subModuleName) for subModuleName in dir(module.drawJobs)]:
01383          attrNames = dir(module.drawJobs)
01384          for subModuleName, subModule in zip(attrNames, map(drawJobParamGetter, attrNames)):
01385             matchedNames = [name for name in matchingNames if subModuleName.find( name) > -1] # matching sub strings
01386             if hasattr(subModule, "yAxis") and len(matchedNames):
01387                print "Setting drawJob: ", subModuleName, " to log scale."
01388                subModule.yAxis = cms.string('fakeRate') #'fakeRate' configuration specifies the log scaling
01389    return yLogger
01390 
01391 
01392 def SetBaseDirectory(Directory):
01393    def BaseDirectorizer(module):
01394       newPath = Directory
01395       #if module.hasParameter("outputFilePath"):
01396       if hasattr(module, "outputFilePath"):
01397          oldPath = module.outputFilePath.value()
01398          newPath = os.path.join(newPath, oldPath)
01399          if not os.path.exists(newPath):
01400             os.makedirs(newPath)
01401          print newPath
01402          module.outputFilePath = cms.string("%s" % newPath)
01403    return BaseDirectorizer
01404 
01405 def RemoveComparisonPlotCommands(module):
01406    if hasattr(module, 'drawJobs'):
01407       #get draw job parameter names
01408       drawJobs = module.drawJobs.parameterNames_()
01409       for drawJob in drawJobs:
01410          if drawJob != "TauIdEffStepByStep":
01411             module.drawJobs.__delattr__(drawJob)
01412             print "Removing comparison plot", drawJob
01413 
01414 def SetPlotDirectory(myPlottingSequence, directory):
01415    myFunctor = ApplyFunctionToSequence(SetBaseDirectory(directory))
01416    myPlottingSequence.visit(myFunctor)
01417 
01418 def SetTestAndReferenceLabels(myPlottingSequence, TestLabel, ReferenceLabel):
01419    myFunctor = ApplyFunctionToSequence(MakeLabeler(TestLabel, ReferenceLabel))
01420    myPlottingSequence.visit(myFunctor)
01421 
01422 def SetCompareToLegacyProductNames(myPlottingSequence):
01423    myFunctor = ApplyFunctionToSequence(ConvertDrawJobToLegacyCompare)
01424    myPlottingSequence.visit(myFunctor)
01425 
01426 def SetTestFileToPlot(myProcess, FileLoc):
01427    myProcess.loadTau.test.inputFileNames = cms.vstring(FileLoc)
01428 
01429 def SetReferenceFileToPlot(myProcess, FileLoc):
01430    if FileLoc == None:
01431       del myProcess.loadTau.reference
01432    else:
01433       myProcess.loadTau.reference.inputFileNames = cms.vstring(FileLoc)
01434 
01435 def SetLogScale(myPlottingSequence):
01436    myFunctor = ApplyFunctionToSequence(SetYmodulesToLog())
01437    myPlottingSequence.visit(myFunctor)
01438 
01439 def SetSmartLogScale(myPlottingSequence):
01440    myFunctor = ApplyFunctionToSequence(SetYmodulesToLog(['Electron', 'Muon', 'Isolation', 'TaNC']))
01441    myPlottingSequence.visit(myFunctor)
01442 
01443 def SetPlotOnlyStepByStep(myPlottingSequence):
01444    myFunctor = ApplyFunctionToSequence(RemoveComparisonPlotCommands)
01445    myPlottingSequence.visit(myFunctor)