Tau ID Analysis

Running the MuTauAnalysis private package of Chi Nhan & Alfredo

Introduction

With the first collisions only a few months away, the rapid rate at which the TauAnalysis package is changing and its current complexity has convinced us to set up a private package that will serve as the main tool for any studies in the immediate future. The private MuTauAnalysis package will allow us to validate old results obtained with private analyzers or old versions of the TauAnalysis package without the added hassle of trying to keep up with all the changes made to the TauAnalysis package everyday. This private package will ensure a stable code and also provide a common tool for all tau related analyses so that any discrepancies between results from one analysis to the next can be tackled as easily as possible and in a very methodical and proper manner. Results obtained from the tau ID analysis will serve as the starting point for any additions/modifications to this package. The goal of this page is to provide very detailed instructions for running the private package. The complexity of the package makes it extremely difficult to make simply modifications and produce basic results. Therefore, this page provides elaborate instructions on how to change cuts, change sequence of cuts, etc.

Checking out the MuTauAnalysis Package

The MuTauAnalysis package is based on the April 24, 2009 version of the TauAnalysis package:
newConfigPATv2_20090424 TauAnalysis
The MuTauAnalysis package is based on CMSSW_2_2_7. Therefore, to run the package, first create the proper working area:
scramv1 project CMSSW CMSSW_2_2_7
cd CMSSW_2_2_7/src
cmsenv
Next, checkout the addtional packages from CVS needed to run the MuTauAnalysis package. To setup access to CVS, if running on lxplus, type the following command:
project CMSSW
If running on cmslpc, type the following commands:
cmscvsroot CMSSW
cvs login
The password for anonymous login is 98passwd. Then checkout the necessary packages by typing the following commands:
cvs co -r PfElecTauisol_for22x PhysicsTools/PatAlgos
cvs up -r 1.3  PhysicsTools/PatAlgos/python/recoLayer0/photonId_cff.py
cvs up -r 1.4.2.1 PhysicsTools/PatAlgos/python/cleaningLayer0/caloMetCleaner_cfi.py
cvs up -r 1.7.2.2 PhysicsTools/PatAlgos/python/recoLayer0/jetMETCorrections_cff.py
cvs co -r V03-05-02 PhysicsTools/PatUtils
cvs co -r PfElecTauisol_for22x PhysicsTools/IsolationAlgos
cvs co -r PfElecisol_for22x PhysicsTools/PFCandProducer 
cvs co -r PfElecisol_for22x DataFormats/PatCandidates 
cvs up -rB22X_Production_v1 DataFormats/PatCandidates/src/Tau.cc
cvs up -rB22X_Production_v1 DataFormats/PatCandidates/interface/Tau.h
cvs co -r V00-16-10 DataFormats/RecoCandidate
cvs co -r V09-25-00-01 PhysicsTools/HepMCCandAlgos
cvs co -r PfElecTauisol_for22x PhysicsTools/IsolationAlgos
cvs co -r V01-03-04 PhysicsTools/JetCharge
cvs co -r V00-11-02 PhysicsTools/JetMCAlgos
cvs co -r V00-02-07 PhysicsTools/JetMCUtils
cvs co -r V03-06-02 PhysicsTools/PatUtils
cvs co -r PfElecTauMuIso_for22x PhysicsTools/PFCandProducer
cvs co -r PfElecTauMuIsoV4_for22x PhysicsTools/PatAlgos
cvs co -r 1.4 PhysicsTools/PatAlgos/python/patEventContent_cff.py
rm PhysicsTools/PatAlgos/plugins/PATElectronCleaner.cc
cvs co -r PfElecTauMuIso_for22x PhysicsTools/RecoAlgos
cvs co -r V07-03-26 PhysicsTools/UtilAlgos
cvs co -r 1.1 CommonTools/Utils/interface/PtComparator.h
cvs co -r CMSSW_2_2_7 RecoEgamma/EgammaIsolationAlgos
cvs update -r 1.2 RecoEgamma/EgammaIsolationAlgos/python/eleIsoDepositHcalFromTowers_cff.py
cvs co -r global_PFTau_22X_V00-02-00 RecoTauTag/Configuration
cvs co -r global_PFTau_22X_V00-02-00 RecoTauTag/RecoTau
cvs co -r global_PFTau_22X_V00-02-00 RecoTauTag/TauTagTools
cvs co -r PfElecTauMuIsoV5_for22x DataFormats/PatCandidates 
cvs co -r V00-16-10 DataFormats/RecoCandidate
cvs co -r V00-12-01-02 DataFormats/TauReco
cvs co -r V01-08-03 CondFormats/JetMETObjects
cvs co -r newConfigPATv2_20090409 AnalysisDataFormats/TauAnalysis
Checkout the private MuTauAnalysis package as the TauAnalysis directory with the following command:
cvs co -d TauAnalysis UserCode/chinhan/MuTauAnalysis
Finally, compile:
scramv1 b

Ready to use Configuration File

A configuration file to run the entire tau ID analysis is provided:
Configuration/test/runTauIdAnalysis_cfg.py
The most important part of the configuration file consists of 3 lines:
  • process.load("TauAnalysis.Configuration.TauIdAnalysisPatTupleProduction_cff")
  • process.load("TauAnalysis.Configuration.TauIdAnalysisEventSelectionSequences_cff")
  • process.load("TauAnalysis.Configuration.TauIdAnalysisAnalyze_cff")

PAT Tuple Production

The first file TauIdAnalysisPatTupleProduction_cff.py contains the sequences for the production of all objects starting from reco level to pat layer1 and finally to the final filtered object collections created at the selector level. The file TauIdAnalysisPatTupleProduction_cff.py is composed of 2 important files:
from TauAnalysis.RecoTools.TauIdAnalysisProducersParameters_cff import *
from TauAnalysis.RecoTools.TauIdAnalysisSelectorParametersAndSequences_cff import *
The file TauAnalysis.RecoTools.TauIdAnalysisProducersParameters_cff contains a list of producer parameters. It has been added to the MuTauAnalysis package to serve as the central file where ALL producer parameters can be modified. Previously, in order to modify a few parameters (e.g. change the isolation parameters for muons/taus), the user needed to dig through the long list of file inclusions and modify several of them along the way. It made it very tedious and time consuming to do very simply modifications and achieve quick turnaround on any results. As an example, the part of the code where isodeposit parameters can be modified is shown below:
#####################################################################################
# Set parameters for the creation of pfChargedHadron isodeposits for muon isolation. 
# These parameters are pretty stable, so there's a good chance they will not need
# modification. Changing these cuts might be equivalent to changing conesizes and
# thresholds (in terms of signal to background ratios). Conesizes and thesholds
# can be modified in the selector parameters.
#####################################################################################
pfmuIsoChDepositPFCandidates.ExtractorPSet.Diff_z = 0.2
pfmuIsoChDepositPFCandidates.ExtractorPSet.DR_Max = 1.0
pfmuIsoChDepositPFCandidates.ExtractorPSet.Diff_r = 0.1
pfmuIsoChDepositPFCandidates.ExtractorPSet.DR_Veto = 1e-05
#####################################################################################

#####################################################################################
# Set parameters for the creation of pfGamma isodeposits for muon isolation.
# These parameters are pretty stable, so there's a good chance they will not need
# modification. Changing these cuts might be equivalent to changing conesizes and
# thresholds (in terms of signal to background ratios). Conesizes and thesholds
# can be modified in the selector parameters.
#####################################################################################
pfmuIsoGaDepositPFCandidates.ExtractorPSet.Diff_z = 0.2
pfmuIsoGaDepositPFCandidates.ExtractorPSet.DR_Max = 1.0
pfmuIsoGaDepositPFCandidates.ExtractorPSet.Diff_r = 0.1
pfmuIsoGaDepositPFCandidates.ExtractorPSet.DR_Veto = 1e-05
#####################################################################################
Suppose one wanted to produce a collection of isodeposits using a veto cone of 0.03 and outer cone of 2.0 (instead of the default cases 0.00001 & 1.0 respectively). This can be accomplished by making the modifications:
pfmuIsoChDepositPFCandidates.ExtractorPSet.DR_Max = 2.0
pfmuIsoChDepositPFCandidates.ExtractorPSet.DR_Veto = 0.03
pfmuIsoGaDepositPFCandidates.ExtractorPSet.DR_Max = 2.0
pfmuIsoGaDepositPFCandidates.ExtractorPSet.DR_Veto = 0.03
The part of the code that sets the producer parameters for reco level taus is shown below:
#####################################################################################
# Set the parameters for the high efficiency PFTau producer
#####################################################################################
fixedConeHighEffPFTauProducer.LeadPFCand_minPt = 6.0
fixedConeHighEffPFTauProducer.TrackerSignalConeSizeFormula = '0.15'
fixedConeHighEffPFTauProducer.ECALSignalConeSizeFormula    = '0.15'
fixedConeHighEffPFTauProducer.HCALSignalConeSizeFormula    = '0.15'
fixedConeHighEffPFTauProducer.TrackerIsolConeSize_max      = 1.0
fixedConeHighEffPFTauProducer.TrackerIsolConeSizeFormula   = '0.70'
fixedConeHighEffPFTauProducer.ECALIsolConeSize_max         = 1.0
fixedConeHighEffPFTauProducer.ECALIsolConeSizeFormula      = '0.70'
fixedConeHighEffPFTauProducer.HCALIsolConeSize_max         = 1.0
fixedConeHighEffPFTauProducer.HCALIsolConeSizeFormula      = '0.70'
fixedConeHighEffPFTauProducer.MatchingConeSizeFormula      = '0.20'
#####################################################################################
If the user wanted to create a reco::PFTau collection (and hence a pat::Tau collection) with larger track & ecal isolation cones and larger seed track threshold (e.g. conesize 0.8 and seed track threshold of 10), this could be accomplished in the following manner:
fixedConeHighEffPFTauProducer.LeadPFCand_minPt = 10.0
fixedConeHighEffPFTauProducer.TrackerIsolConeSizeFormula   = '0.80'
fixedConeHighEffPFTauProducer.ECALIsolConeSizeFormula      = '0.80'

The second file included in TauIdAnalysisPatTupleProduction_cff.py is the file TauAnalysis.RecoTools.TauIdAnalysisSelectorParametersAndSequences_cff. It serves as the central file where ALL selector level parameters and selector level sequences can be modified. For example, the part of the code where the muon and tau selector parameters are defined is shown below:

#####################################################################################
# modify the cuts for the pat muon selectors
#####################################################################################
selectedLayer1MuonsGlobal.cut = cms.string('isGlobalMuon()')
selectedLayer1MuonsEta21.cut = cms.string('abs(eta) < 2.1')
selectedLayer1MuonsPt15.cut = cms.string('pt > 20. && pt < 50.')
selectedLayer1MuonsTrkIso.type = cms.string('pfChargedHadron')
#selectedLayer1MuonsTrkIso.vetos = cms.vstring("0.01")
selectedLayer1MuonsTrkIso.vetos = cms.vstring("0.01", "Threshold(0.0)")
selectedLayer1MuonsTrkIso.dRisoCone = cms.double(0.8)
selectedLayer1MuonsTrkIso.sumPtMax = cms.double(1.0)
selectedLayer1MuonsEcalIso.type = cms.string('pfGamma')
#selectedLayer1MuonsEcalIso.vetos = cms.vstring("0.0")
selectedLayer1MuonsEcalIso.vetos = cms.vstring("0.00", "Threshold(0.0)")
selectedLayer1MuonsEcalIso.dRisoCone = cms.double(0.8)
selectedLayer1MuonsEcalIso.sumPtMax = cms.double(1.0)
selectedLayer1MuonsPionVeto.CaloCompCoefficient = cms.double(0.8)
selectedLayer1MuonsPionVeto.SegmCompCoefficient = cms.double(1.2)
selectedLayer1MuonsPionVeto.AntiPionCut = cms.double(1.0)
selectedLayer1MuonsTrk.cut = cms.string('innerTrack.isNonnull')
selectedLayer1MuonsTrkIP.vertexSource = cms.InputTag("selectedPrimaryVertexPosition")
selectedLayer1MuonsTrkIP.IpMax = cms.double(0.01)
#####################################################################################
Suppose one wanted to change the pt requirement on muons to pt>30 and the track isolation sumPt cut to 3. This can be accomplished by modifying TauAnalysis.RecoTools.TauIdAnalysisSelectorParametersAndSequences_cff:
selectedLayer1MuonsPt15.cut = cms.string('pt > 30.')
selectedLayer1MuonsTrkIso.sumPtMax = cms.double(3.0)
The order in which the selected object collections are produced can also be modified in this file. By default the selected object collections are produced in the following order:

  • global muon cut
  • eta cut on muons
  • pt cut on muons
  • eta cut on taus
  • pt cut on taus
  • seed track requirement on taus
  • seed track pt requirement on taus
  • jet veto "non'overlap" cut (Selects jets that DO NOT overlap with the user defined objects. By default, ALL jets are selected!)
  • jet veto eta cut
  • jet veto et cut
  • taus matched to 'good' jets obtained from the jet veto cuts
  • muon track isolation
  • muon ecal isolation
  • muon 'anti-pion' cut
  • muon impact parameter cut
  • tau 'non-overlap' cut (By default, selects taus that DO NOT overlap with the 'good quality' muons)
  • tau track isolation cut
  • tau ecal isolation cut
  • tau prong cut
  • tau 'anti-muon' cut
  • production of mu+tau pairs
  • select mu+tau+MET candidates that DO NOT overlap
  • select mu+tau+MET candidates passing dPhi cut
  • select mu+tau+MET candidates passing opposite sign requirement
  • select mu+tau+MET candidates passing invariant mass cut
IMPORTANT NOTE: This is NOT where the order of the event selection criteria (e.g. > 0 global muons) is defined! This file only defines the order in which the required object collections are produced. A special file is dedicated to the event selection criteria and will be discussed later.

The part of the code that sets the production sequence for taus is shown below:

#####################################################################################
# Define the order in which the tau selections are applied. This sequence is used
# for the actual analysis sequence.
#####################################################################################
patTauSelConfiguratorForMuTau = objSelConfigurator(
    [ selectedLayer1TausForMuTauEta21,
      selectedLayer1TausForMuTauPt20,
      selectedLayer1TausForMuTauLeadTrk,
      selectedLayer1TausForMuTauLeadTrkPt,
      selectedLayer1TausForMuTauOverlapWithJets,
      selectedLayer1TausForMuTauAntiOverlapWithMuonsVeto,
      selectedLayer1TausForMuTauTrkIso,
      selectedLayer1TausForMuTauEcalIso,
      selectedLayer1TausForMuTauProng,
      selectedLayer1TausForMuTauMuonVeto ],
    src = "cleanLayer1Taus",
    pyModuleName = __name__,
    doSelIndividual = True
)
selectLayer1TausForMuTau = patTauSelConfiguratorForMuTau.configure(namespace = locals())
#####################################################################################
Suppose one wanted to move the 'anti-overlap with muons' cut to the end of the sequence. This can be done by modifying the code shown above so that this selection shows up as the last one in the comma seperated list.
patTauSelConfiguratorForMuTau = objSelConfigurator(
    [ selectedLayer1TausForMuTauEta21,
      selectedLayer1TausForMuTauPt20,
      selectedLayer1TausForMuTauLeadTrk,
      selectedLayer1TausForMuTauLeadTrkPt,
      selectedLayer1TausForMuTauOverlapWithJets,
      selectedLayer1TausForMuTauTrkIso,
      selectedLayer1TausForMuTauEcalIso,
      selectedLayer1TausForMuTauProng,
      selectedLayer1TausForMuTauMuonVeto,
      selectedLayer1TausForMuTauAntiOverlapWithMuonsVeto ],
    src = "cleanLayer1Taus",
    pyModuleName = __name__,
    doSelIndividual = True
)
selectLayer1TausForMuTau = patTauSelConfiguratorForMuTau.configure(namespace = locals())
Similar modifications can be done for the case of muons, jets, and ditau pairs.

Event Selection

The second important file included in runTauIdAnalysis_cfg.py is TauIdAnalysisEventSelectionSequences_cff. It defines all event selection criteria:

  • generator level event requirements
  • trigger level requirements
  • Acceptance level event requirements
  • Muon ID stage event requirements
  • Tau ID stage event requirements
  • Kinematic stage event requirements
For example, the part of the code that defines tau ID stage event requirements is shown below:
#---------------------------------------------------------------------------------------------
#                                       Tau Id Event Selections
#---------------------------------------------------------------------------------------------

cfgTauAntiOverlapWithMuonsVeto.pluginName = cms.string('tauAntiOverlapWithMuonsVeto')
cfgTauAntiOverlapWithMuonsVeto.pluginType = cms.string('PATCandViewMinEventSelector')
cfgTauAntiOverlapWithMuonsVeto.src_cumulative = cms.InputTag('selectedLayer1TausForMuTauAntiOverlapWithMuonsVetoCumulative')
cfgTauAntiOverlapWithMuonsVeto.src_individual = cms.InputTag('selectedLayer1TausForMuTauAntiOverlapWithMuonsVetoIndividual')
cfgTauAntiOverlapWithMuonsVeto.minNumber = cms.uint32(1)

cfgTauTrkIsoCut.pluginName = cms.string('tauTrkIsoCut')
cfgTauTrkIsoCut.pluginType = cms.string('PATCandViewMinEventSelector')
cfgTauTrkIsoCut.src_cumulative = cms.InputTag('selectedLayer1TausForMuTauTrkIsoCumulative')
cfgTauTrkIsoCut.src_individual = cms.InputTag('selectedLayer1TausForMuTauTrkIsoIndividual')
cfgTauTrkIsoCut.minNumber = cms.uint32(1)

cfgTauEcalIsoCut.pluginName = cms.string('tauEcalIsoCut')
cfgTauEcalIsoCut.pluginType = cms.string('PATCandViewMinEventSelector')
cfgTauEcalIsoCut.src_cumulative = cms.InputTag('selectedLayer1TausForMuTauEcalIsoCumulative')
cfgTauEcalIsoCut.src_individual = cms.InputTag('selectedLayer1TausForMuTauEcalIsoIndividual')
cfgTauEcalIsoCut.minNumber = cms.uint32(1)

cfgTauProngCut.pluginName = cms.string('tauProngCut')
cfgTauProngCut.pluginType = cms.string('PATCandViewMinEventSelector')
cfgTauProngCut.src_cumulative = cms.InputTag('selectedLayer1TausForMuTauProngCumulative')
cfgTauProngCut.src_individual = cms.InputTag('selectedLayer1TausForMuTauProngIndividual')
cfgTauProngCut.minNumber = cms.uint32(1)

cfgTauMuonVeto.pluginName = cms.string('tauMuonVeto')
cfgTauMuonVeto.pluginType = cms.string('PATCandViewMinEventSelector')
cfgTauMuonVeto.src_cumulative = cms.InputTag('selectedLayer1TausForMuTauMuonVetoCumulative')
cfgTauMuonVeto.src_individual = cms.InputTag('selectedLayer1TausMuonVetoIndividual')
cfgTauMuonVeto.minNumber = cms.uint32(1)
Suppose one wanted to require events to have at least 2 taus passing the track isolation requirement. This could be accomplished in the following manner:
cfgTauTrkIsoCut.minNumber = cms.uint32(2)
Finally, the part of the code in which the order of the event selection criteria is defined is shown below:
TauIdAnalysisEventSelConfigurator = eventSelFlagProdConfigurator(
    [ 
      cfgGenMuonCut,
      cfgGenTauCut,
#      cfgTrigger,
      cfgPrimaryEventVertex,
      cfgPrimaryEventVertexQuality,
      cfgPrimaryEventVertexPosition,
      cfgGlobalMuonCut,
      cfgMuonEtaCut,
      cfgMuonPtCut,
      cfgTauEtaCut,
      cfgTauPtCut,
      cfgTauLeadTrkCut,
      cfgTauLeadTrkPtCut,
      cfgJetMinVetoCut,
      cfgJetMaxVetoCut,
      cfgTauJetVetoMatchCut,
      cfgMuonTrkIsoCut,
      cfgMuonEcalIsoCut,
      cfgMuonAntiPionCut,
      cfgMuonTrkIPcut,
      cfgTauAntiOverlapWithMuonsVeto,
      cfgTauTrkIsoCut,
      cfgTauEcalIsoCut,
#      cfgTauProngCut,
#      cfgTauMuonVeto,
      cfgDiTauCandidateForMuTauAntiOverlapVeto,
      cfgDiTauCandidateForMuTauCosDelPhiCut,
      cfgDiTauCandidateForMuTauZeroChargeCut 
#      cfgDiTauCandidateForMuTauMt1METcut
    ],
    boolEventSelFlagProducer = "BoolEventSelFlagProducer",
    pyModuleName = __name__
)

selectTauIdAnalysisEvents = TauIdAnalysisEventSelConfigurator.configure()
The code above produces a set of boolean flags that allows one to calculate efficiencies & produce the necessary histograms. Notice that the trigger, tau prong, & muon veto cuts have been commented out. The reason for this is because the tau ID analysis does not use these event requirements. Suppose one wanted to apply the 'tau anti-overlap with muons' event requirement after the tau ecal isolation event requirement. This can be done in the following manner:
TauIdAnalysisEventSelConfigurator = eventSelFlagProdConfigurator(
    [ 
      cfgGenMuonCut,
      cfgGenTauCut,
#      cfgTrigger,
      cfgPrimaryEventVertex,
      cfgPrimaryEventVertexQuality,
      cfgPrimaryEventVertexPosition,
      cfgGlobalMuonCut,
      cfgMuonEtaCut,
      cfgMuonPtCut,
      cfgTauEtaCut,
      cfgTauPtCut,
      cfgTauLeadTrkCut,
      cfgTauLeadTrkPtCut,
      cfgJetMinVetoCut,
      cfgJetMaxVetoCut,
      cfgTauJetVetoMatchCut,
      cfgMuonTrkIsoCut,
      cfgMuonEcalIsoCut,
      cfgMuonAntiPionCut,
      cfgMuonTrkIPcut,
      cfgTauTrkIsoCut,
      cfgTauEcalIsoCut,
      cfgTauAntiOverlapWithMuonsVeto,
#      cfgTauProngCut,
#      cfgTauMuonVeto,
      cfgDiTauCandidateForMuTauAntiOverlapVeto,
      cfgDiTauCandidateForMuTauCosDelPhiCut,
      cfgDiTauCandidateForMuTauZeroChargeCut 
#      cfgDiTauCandidateForMuTauMt1METcut
    ],
    boolEventSelFlagProducer = "BoolEventSelFlagProducer",
    pyModuleName = __name__
)

Producing Efficiencies & Histograms

The final important file included in runTauIdAnalysis_cfg.py is TauIdAnalysisAnalyze_cff. It defines everything required to calculate efficiencies (both event and object efficiencies) and produce plots. The code shown below (TauIdAnalysisAnalyze_cfi), shows how the sequence is defined:
TauIdAnalysisSequence = cms.VPSet(
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = offlinePrimaryVerticesWithBS')
    ),
    cms.PSet(
        filter = cms.string('genPhaseSpaceCut'),
        title = cms.string('gen. Phase-Space'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = offlinePrimaryVerticesWithBS')
    ),
    cms.PSet(
        filter = cms.string('evtSelGenMuonCut'),
        title = cms.string('gen. Muon'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = offlinePrimaryVerticesWithBS')
    ),
    cms.PSet(
        filter = cms.string('evtSelGenTauCut'),
        title = cms.string('gen. Tau'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = offlinePrimaryVerticesWithBS')
    ),
#    cms.PSet(
#        filter = cms.string('evtSelTrigger'),
#        title = cms.string('mu15 || isoMu11 Trigger'),
#        saveRunEventNumbers = cms.vstring('')
#    ),
#    cms.PSet(
#        histManagers = muTauHistManagers,
#        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
#                              'tauHistManager.tauSource = cleanLayer1Taus',
#                              'jetHistManager.jetSource = cleanLayer1Jets',
#                              'vertexHistManager.vertexSource = offlinePrimaryVerticesWithBS')
#
#    ),
    cms.PSet(
        filter = cms.string('evtSelPrimaryEventVertex'),
        title = cms.string('Vertex'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexHighestPtTrackSum')
    ),
    cms.PSet(
        filter = cms.string('evtSelPrimaryEventVertexQuality'),
        title = cms.string('p(chi2Vertex)>0.01 & >=2 trks'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexQuality')
    ),
    cms.PSet(
        filter = cms.string('evtSelPrimaryEventVertexPosition'),
        title = cms.string('-25 < zVertex < +25 cm'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelGlobalMuon'),
        title = cms.string('global Muon'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsGlobalCumulative',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonEta'),
        title = cms.string('-2.1 < eta(Muon) < +2.1'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEta21Cumulative',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonPt'),
        title = cms.string('20 < Pt(Muon) < 50  GeV'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPt15Cumulative',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauEta'),
        title = cms.string('-2.5 < eta(Tau) < +2.5'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPt15Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEta21Cumulative',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauPt'),
        title = cms.string('Pt(Tau) > 10 GeV'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPt15Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauPt20Cumulative',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauLeadTrk'),
        title = cms.string('Tau lead. Track find.'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPt15Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauLeadTrkCumulative',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauLeadTrkPt'),
        title = cms.string('Tau lead. Track Pt > 6'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPt15Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauLeadTrkPtCumulative',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelJetMinVeto'),
        title = cms.string('>= 1 jet w/ Et > 10'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPt15Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauLeadTrkPtCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelJetMaxVeto'),
        title = cms.string('<= 1 jet w/ Et > 10'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPt15Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauLeadTrkPtCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauJetVetoMatch'),
        title = cms.string('tau matched to veto jet'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPt15Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauOverlapWithJetsCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonTrkIso'),
        title = cms.string('Muon Track iso.'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIsoCumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauOverlapWithJetsCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonEcalIso'),
        title = cms.string('Muon ECAL iso.'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEcalIsoCumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauOverlapWithJetsCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonAntiPion'),
        title = cms.string('Muon pi-Veto'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPionVetoCumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauOverlapWithJetsCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonTrkIP'),
        title = cms.string('Muon Track IP'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauOverlapWithJetsCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauAntiOverlapWithMuonsVeto'),
        title = cms.string('Tau not overlapping w. Muon'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauAntiOverlapWithMuonsVetoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauTrkIso'),
        title = cms.string('Tau Track iso.'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauTrkIsoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauEcalIso'),
        title = cms.string('Tau ECAL iso.'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEcalIsoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    #cms.PSet(
    #    filter = cms.string('evtSelTauProng'),
    #    title = cms.string('Tau 1||3-Prong'),
    #    saveRunEventNumbers = cms.vstring('')
    #),
    #cms.PSet(
    #    histManagers = muTauHistManagers,
    #    replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
    #                          'tauHistManager.tauSource = selectedLayer1TausForMuTauProngCumulative')
    #),
    #cms.PSet(
    #    filter = cms.string('evtSelTauMuonVeto'),
    #    title = cms.string('Tau mu-Veto'),
    #    saveRunEventNumbers = cms.vstring('')
    #),
    #cms.PSet(
    #    histManagers = muTauHistManagers,
    #    replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
    #                          'tauHistManager.tauSource = selectedLayer1TausForMuTauMuonVetoCumulative')
    #),
    cms.PSet(
        filter = cms.string('evtSelDiTauCandidateForMuTauAntiOverlapVeto'),
        title = cms.string('dR(Muon-Tau) > 0.7'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEcalIsoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition',
                              'diTauCandidateHistManagerForMuTau.diTauCandidateSource = selectedMuTauPairsAntiOverlapVetoCumulative')
    ),
    cms.PSet(
        filter = cms.string('evtSelDiTauCandidateForMuTauCosDelPhi'),
        title = cms.string('cosine dPhi(Muon-Tau) < -0.95'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEcalIsoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition',
                              'diTauCandidateHistManagerForMuTau.diTauCandidateSource = selectedMuTauPairsCosDelPhiCumulative')
    ),
    cms.PSet(
        filter = cms.string('evtSelDiTauCandidateForMuTauZeroCharge'),
        title = cms.string('q(Muon) * q(TauSeedTrk) < 0'),
        saveRunEventNumbers = cms.vstring('passed_cumulative')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEcalIsoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition',
                              'diTauCandidateHistManagerForMuTau.diTauCandidateSource = selectedMuTauPairsZeroChargeCumulative')
    #cms.PSet(
    #    filter = cms.string('evtSelDiTauCandidateForMuTauMt1MET'),
    #    title = cms.string('M_{T}(Muon-MET) < 60 GeV'),
    #    saveRunEventNumbers = cms.vstring('passed_cumulative')
    #),
    #cms.PSet(
    #    histManagers = muTauHistManagers,
    #    replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
    #                          'tauHistManager.tauSource = selectedLayer1TausForMuTauMuonVetoCumulative',
    #                          'diTauCandidateHistManagerForMuTau.diTauCandidateSource = selectedMuTauPairsMt1METcumulative')
    #),
    )
)
Notice that the general sequence of steps goes as follows:
  • produce plots for all events before any selections
  • apply event selection criteria #1
  • produce plots for all events passing event selection criteria #1
  • apply event selection criteria #2
  • produce plots for all events passing event selection criteria #2
  • ...
  • ...
  • apply event selection criteria #n
  • produce plots for all events passing event selection criteria #n

For each stage of plotting defined above, a few hundred histograms are created (met plots, muon plots, tau plots, vertex plots, ...). One again, the trigger, tau prong, tau mun veto, and invariant mass cuts have been commented out because the current version of the tau ID analysis does not require these selections. Notice that the correct input collections must defined at each plotting stage. For example, to produce the correct plots for events passing the tau eta cut, the correct input collections must be defined:

  • input collection for the muon plotting tool: collection of muons passing eta & pt & track isolation & ecal Isolation & 'anti-pion' & impact parameters cuts
  • input collection for the vertex plotting tool: collection of vertices passing the defined quality cuts (chi2, z position, ...)
  • input collection for the tau plotting tool: collection of taus passing 'non-overlap with muons' & eta cuts
  • ...
  • ...
This is shown in the code below:
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPt15Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEta21Cumulative',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),

Example: Changing the object selection cuts & the order of object/event criteria

Any possible changes made to the analysis can be accomplished by modifying a combination of the following files: To illustrate how one can modify the parameters and sequences to suit their needs, this section provides an example with detailed step by step instructions for the specific case of changing the muon pt requirement (e.g. pt>30) and allowing this cut to be performed before the muon eta cut (as opposed to the default case where it is applied after the muon eta cut). These are the steps:
  • Modify the selector parameter:
    1. cd RecoTools/python
    2. Modify the file TauIdAnalysisSelectorParametersAndSequences_cff
      selectedLayer1MuonsPt15.cut = cms.string('pt > 30.')
  • Modify the selector sequence:
    1. cd RecoTools/python
    2. Modify the file TauIdAnalysisSelectorParametersAndSequences_cff so that the pt cut is applied before the eta cut
      patMuonSelConfigurator = objSelConfigurator(
                    [ selectedLayer1MuonsGlobal,
                      selectedLayer1MuonsPt15,
                      selectedLayer1MuonsEta21,
                      selectedLayer1MuonsTrkIso,
                      selectedLayer1MuonsEcalIso,
                      selectedLayer1MuonsPionVeto,
                      selectedLayer1MuonsTrk,
                      selectedLayer1MuonsTrkIP ],
                      src = "cleanLayer1Muons",
                      pyModuleName = __name__,
                      doSelIndividual = True
                )
  • Modify the event requirement sequence:
    1. cd Configuration/python
    2. Modify the file TauIdAnalysisEventSelectionSequences_cff so that the correct event selection sequence is performed:
TauIdAnalysisEventSelConfigurator = eventSelFlagProdConfigurator(
    [ 
      cfgGenMuonCut,
      cfgGenTauCut,
#      cfgTrigger,
      cfgPrimaryEventVertex,
      cfgPrimaryEventVertexQuality,
      cfgPrimaryEventVertexPosition,
      cfgGlobalMuonCut,
      cfgMuonPtCut,
      cfgMuonEtaCut,
      cfgTauEtaCut,
      cfgTauPtCut,
      cfgTauLeadTrkCut,
      cfgTauLeadTrkPtCut,
      cfgJetMinVetoCut,
      cfgJetMaxVetoCut,
      cfgTauJetVetoMatchCut,
      cfgMuonTrkIsoCut,
      cfgMuonEcalIsoCut,
      cfgMuonAntiPionCut,
      cfgMuonTrkIPcut,
      cfgTauAntiOverlapWithMuonsVeto,
      cfgTauTrkIsoCut,
      cfgTauEcalIsoCut,
#      cfgTauProngCut,
#      cfgTauMuonVeto,
      cfgDiTauCandidateForMuTauAntiOverlapVeto,
      cfgDiTauCandidateForMuTauCosDelPhiCut,
      cfgDiTauCandidateForMuTauZeroChargeCut 
#      cfgDiTauCandidateForMuTauMt1METcut
    ],
    boolEventSelFlagProducer = "BoolEventSelFlagProducer",
    pyModuleName = __name__
)
  • Modify the plotting sequence:
    1. cd Configuration/python
    2. Modify the file TauIdAnalysisAnalyze_cfi as shown below (pay close attention to what has changed: the order, the input collections, and titles)
TauIdAnalysisSequence = cms.VPSet(
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = offlinePrimaryVerticesWithBS')
    ),
    cms.PSet(
        filter = cms.string('genPhaseSpaceCut'),
        title = cms.string('gen. Phase-Space'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = offlinePrimaryVerticesWithBS')
    ),
    cms.PSet(
        filter = cms.string('evtSelGenMuonCut'),
        title = cms.string('gen. Muon'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = offlinePrimaryVerticesWithBS')
    ),
    cms.PSet(
        filter = cms.string('evtSelGenTauCut'),
        title = cms.string('gen. Tau'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = offlinePrimaryVerticesWithBS')
    ),
#    cms.PSet(
#        filter = cms.string('evtSelTrigger'),
#        title = cms.string('mu15 || isoMu11 Trigger'),
#        saveRunEventNumbers = cms.vstring('')
#    ),
#    cms.PSet(
#        histManagers = muTauHistManagers,
#        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
#                              'tauHistManager.tauSource = cleanLayer1Taus',
#                              'jetHistManager.jetSource = cleanLayer1Jets',
#                              'vertexHistManager.vertexSource = offlinePrimaryVerticesWithBS')
#
#    ),
    cms.PSet(
        filter = cms.string('evtSelPrimaryEventVertex'),
        title = cms.string('Vertex'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexHighestPtTrackSum')
    ),
    cms.PSet(
        filter = cms.string('evtSelPrimaryEventVertexQuality'),
        title = cms.string('p(chi2Vertex)>0.01 & >=2 trks'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexQuality')
    ),
    cms.PSet(
        filter = cms.string('evtSelPrimaryEventVertexPosition'),
        title = cms.string('-25 < zVertex < +25 cm'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = cleanLayer1Muons',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelGlobalMuon'),
        title = cms.string('global Muon'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsGlobalCumulative',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonPt'),
        title = cms.string('30 < Pt(Muon)'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPt15Cumulative',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonEta'),
        title = cms.string('-2.1 < eta(Muon) < +2.1'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEta21Cumulative',
                              'tauHistManager.tauSource = cleanLayer1Taus',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauEta'),
        title = cms.string('-2.5 < eta(Tau) < +2.5'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEta21Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEta21Cumulative',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauPt'),
        title = cms.string('Pt(Tau) > 10 GeV'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEta21Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauPt20Cumulative',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauLeadTrk'),
        title = cms.string('Tau lead. Track find.'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEta21Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauLeadTrkCumulative',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauLeadTrkPt'),
        title = cms.string('Tau lead. Track Pt > 6'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEta21Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauLeadTrkPtCumulative',
                              'jetHistManager.jetSource = cleanLayer1Jets',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelJetMinVeto'),
        title = cms.string('>= 1 jet w/ Et > 10'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEta21Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauLeadTrkPtCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelJetMaxVeto'),
        title = cms.string('<= 1 jet w/ Et > 10'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEta21Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauLeadTrkPtCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauJetVetoMatch'),
        title = cms.string('tau matched to veto jet'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEta21Cumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauOverlapWithJetsCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonTrkIso'),
        title = cms.string('Muon Track iso.'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIsoCumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauOverlapWithJetsCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonEcalIso'),
        title = cms.string('Muon ECAL iso.'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsEcalIsoCumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauOverlapWithJetsCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonAntiPion'),
        title = cms.string('Muon pi-Veto'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsPionVetoCumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauOverlapWithJetsCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelMuonTrkIP'),
        title = cms.string('Muon Track IP'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauOverlapWithJetsCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauAntiOverlapWithMuonsVeto'),
        title = cms.string('Tau not overlapping w. Muon'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauAntiOverlapWithMuonsVetoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauTrkIso'),
        title = cms.string('Tau Track iso.'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauTrkIsoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    cms.PSet(
        filter = cms.string('evtSelTauEcalIso'),
        title = cms.string('Tau ECAL iso.'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEcalIsoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition')
    ),
    #cms.PSet(
    #    filter = cms.string('evtSelTauProng'),
    #    title = cms.string('Tau 1||3-Prong'),
    #    saveRunEventNumbers = cms.vstring('')
    #),
    #cms.PSet(
    #    histManagers = muTauHistManagers,
    #    replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
    #                          'tauHistManager.tauSource = selectedLayer1TausForMuTauProngCumulative')
    #),
    #cms.PSet(
    #    filter = cms.string('evtSelTauMuonVeto'),
    #    title = cms.string('Tau mu-Veto'),
    #    saveRunEventNumbers = cms.vstring('')
    #),
    #cms.PSet(
    #    histManagers = muTauHistManagers,
    #    replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
    #                          'tauHistManager.tauSource = selectedLayer1TausForMuTauMuonVetoCumulative')
    #),
    cms.PSet(
        filter = cms.string('evtSelDiTauCandidateForMuTauAntiOverlapVeto'),
        title = cms.string('dR(Muon-Tau) > 0.7'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEcalIsoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition',
                              'diTauCandidateHistManagerForMuTau.diTauCandidateSource = selectedMuTauPairsAntiOverlapVetoCumulative')
    ),
    cms.PSet(
        filter = cms.string('evtSelDiTauCandidateForMuTauCosDelPhi'),
        title = cms.string('cosine dPhi(Muon-Tau) < -0.95'),
        saveRunEventNumbers = cms.vstring('')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEcalIsoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition',
                              'diTauCandidateHistManagerForMuTau.diTauCandidateSource = selectedMuTauPairsCosDelPhiCumulative')
    ),
    cms.PSet(
        filter = cms.string('evtSelDiTauCandidateForMuTauZeroCharge'),
        title = cms.string('q(Muon) * q(TauSeedTrk) < 0'),
        saveRunEventNumbers = cms.vstring('passed_cumulative')
    ),
    cms.PSet(
        histManagers = muTauHistManagers,
        replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
                              'tauHistManager.tauSource = selectedLayer1TausForMuTauEcalIsoCumulative',
                              'jetHistManager.jetSource = selectedLayer1JetsEt20Cumulative',
                              'vertexHistManager.vertexSource = selectedPrimaryVertexPosition',
                              'diTauCandidateHistManagerForMuTau.diTauCandidateSource = selectedMuTauPairsZeroChargeCumulative')
    #cms.PSet(
    #    filter = cms.string('evtSelDiTauCandidateForMuTauMt1MET'),
    #    title = cms.string('M_{T}(Muon-MET) < 60 GeV'),
    #    saveRunEventNumbers = cms.vstring('passed_cumulative')
    #),
    #cms.PSet(
    #    histManagers = muTauHistManagers,
    #    replace = cms.vstring('muonHistManager.muonSource = selectedLayer1MuonsTrkIPcumulative',
    #                          'tauHistManager.tauSource = selectedLayer1TausForMuTauMuonVetoCumulative',
    #                          'diTauCandidateHistManagerForMuTau.diTauCandidateSource = selectedMuTauPairsMt1METcumulative')
    #),
    )
)
    1. Modify the file TauIdAnalysisAnalyze_cfi so that correct event selection sequence is defined:
analyzeTauIdAnalysisEvents = cms.EDAnalyzer("GenericAnalyzer",
  
    name = cms.string('zMuTauAnalyzer'), 
                            
    eventSelection = cms.VPSet(
        genPhaseSpaceCut,
        evtSelGenMuonCut,
        evtSelGenTauCut,
#        evtSelTrigger,
        evtSelPrimaryEventVertex,
        evtSelPrimaryEventVertexQuality,
        evtSelPrimaryEventVertexPosition,
        evtSelGlobalMuon,
        evtSelMuonPt,
        evtSelMuonEta,
        evtSelTauEta,
        evtSelTauPt,
        evtSelTauLeadTrk,
        evtSelTauLeadTrkPt,
        evtSelJetMinVeto,
        evtSelJetMaxVeto,
        evtSelTauJetVetoMatch,
        evtSelMuonTrkIso,
        evtSelMuonEcalIso,
        evtSelMuonAntiPion,
        evtSelMuonTrkIP,
        evtSelTauAntiOverlapWithMuonsVeto,
        evtSelTauTrkIso,
        evtSelTauEcalIso,
#        evtSelTauProng,
#        evtSelTauMuonVeto,
        evtSelDiTauCandidateForMuTauAntiOverlapVeto,
        evtSelDiTauCandidateForMuTauCosDelPhi,
        evtSelDiTauCandidateForMuTauZeroCharge
#        evtSelDiTauCandidateForMuTauMt1MET
    ),
  
    histManagers = cms.VPSet(
        genPhaseSpaceEventInfoHistManager,
        muonHistManager,
        tauHistManager,
        diTauCandidateHistManagerForMuTau,
        metHistManager,
        jetHistManager,
        vertexHistManager,
        triggerHistManager
    ),

    eventDumps = cms.VPSet(
        muTauEventDump
    ),
   
    analysisSequence = TauIdAnalysisSequence
)
  • Run the cfg file:
    cmsRun runTauIdAnalysis_cfg.py
          

Output

Running the tau ID analysis cfg file produces a root file plotsTauIdAnalysis.root with histograms and prints out a table with efficencies per selection.

Table of Efficiencies

An example output table is shown below:
GenericAnalyzer-zMuTauAnalyzer: Real Time = 513.89 seconds Cpu Time = 384.75 seconds
Filter Statistics for zMuTauAnalyzer-FilterStatisticsService

 number of events processed = 20, of which 0 passed all Filters

Cut                                          Passed    cumul. Efficiency           Efficiency      excl. Rejection
--------------------------------------------------------------------------------------------------------------------------------------
gen. Phase-Space                             20.000             100.000%             100.000%                0.000
gen. Muon                                     5.000              25.000%              70.000%                0.000
gen. Tau                                      2.000              10.000%              60.000%                0.000
Vertex                                        2.000              10.000%             100.000%                0.000
p(chi2Vertex)>0.01 & >=2 trks                 2.000              10.000%             100.000%                0.000
-25 < zVertex < +25 cm                        2.000              10.000%             100.000%                0.000
global Muon                                   1.000               5.000%              15.000%                0.000
-2.1 < eta(Muon) < +2.1                       1.000               5.000%              15.000%                0.000
20 < Pt(Muon) < 50  GeV                       0.000               0.000%              10.000%                0.000
-2.5 < eta(Tau) < +2.5                        0.000               0.000%             100.000%                0.000
Pt(Tau) > 10 GeV                              0.000               0.000%              75.000%                0.000
Tau lead. Track find.                         0.000               0.000%             100.000%                0.000
Tau lead. Track Pt > 6                        0.000               0.000%              80.000%                0.000
>= 1 jet w/ Et > 10                           0.000               0.000%              95.000%                0.000
<= 1 jet w/ Et > 10                           0.000               0.000%              35.000%                0.000
tau matched to veto jet                       0.000               0.000%              35.000%                0.000
Muon Track iso.                               0.000               0.000%              10.000%                0.000
Muon ECAL iso.                                0.000               0.000%              25.000%                0.000
Muon pi-Veto                                  0.000               0.000%              20.000%                0.000
Muon Track IP                                 0.000               0.000%              15.000%                0.000
Tau not overlapping w. Muon                   0.000               0.000%             100.000%                0.000
Tau Track iso.                                0.000               0.000%              95.000%                0.000
Tau ECAL iso.                                 0.000               0.000%              95.000%                0.000
dR(Muon-Tau) > 0.7                            0.000               0.000%               0.000%                0.000
cosine dPhi(Muon-Tau) < -0.95                 0.000               0.000%               0.000%                0.000
q(Muon) * q(TauSeedTrk) < 0                   0.000               0.000%               0.000%                0.000
-----------------------------------------------------------------------------------------------------------------------------

Plots

A few important validation plots are attached below:

-- AlfredoGurrola - 04 May 2009

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2009-05-04 - AlfredoGurrola
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback