CMS 3D CMS Logo

tauProducer_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 patTaus = cms.EDProducer("PATTauProducer",
4  # input
5  tauSource = cms.InputTag("hpsPFTauProducer"),
6  tauTransverseImpactParameterSource = cms.InputTag("hpsPFTauTransverseImpactParameters"),
7 
8  # add user data
9  userData = cms.PSet(
10  # add custom classes here
11  userClasses = cms.PSet(
12  src = cms.VInputTag('')
13  ),
14  # add doubles here
15  userFloats = cms.PSet(
16  src = cms.VInputTag('')
17  ),
18  # add ints here
19  userInts = cms.PSet(
20  src = cms.VInputTag('')
21  ),
22  # add candidate ptrs here
23  userCands = cms.PSet(
24  src = cms.VInputTag('')
25  ),
26  # add "inline" functions here
27  userFunctions = cms.vstring(),
28  userFunctionLabels = cms.vstring()
29  ),
30 
31  # jet energy corrections
32  addTauJetCorrFactors = cms.bool(False),
33  tauJetCorrFactorsSource = cms.VInputTag(cms.InputTag("patTauJetCorrFactors")),
34 
35  # embedding objects (for Calo- and PFTaus)
36  embedLeadTrack = cms.bool(False),
37  embedSignalTracks = cms.bool(False),
38  embedIsolationTracks = cms.bool(False),
40  embedLeadPFCand = cms.bool(False),
41  embedLeadPFChargedHadrCand = cms.bool(False),
42  embedLeadPFNeutralCand = cms.bool(False),
43  embedSignalPFCands = cms.bool(False),
44  embedSignalPFChargedHadrCands = cms.bool(False),
45  embedSignalPFNeutralHadrCands = cms.bool(False),
46  embedSignalPFGammaCands = cms.bool(False),
47  embedIsolationPFCands = cms.bool(False),
48  embedIsolationPFChargedHadrCands = cms.bool(False),
49  embedIsolationPFNeutralHadrCands = cms.bool(False),
50  embedIsolationPFGammaCands = cms.bool(False),
51 
52  # embed IsoDeposits
53  isoDeposits = cms.PSet(),
54 
55  # user defined isolation variables the variables defined here will be accessible
56  # via pat::Tau::userIsolation(IsolationKeys key) with the key as defined in
57  # DataFormats/PatCandidates/interface/Isolation.h
58  userIsolation = cms.PSet(),
59 
60  # tau ID (for efficiency studies)
61  addTauID = cms.bool(True),
62  tauIDSources = cms.PSet(),
63  # IDs added below
64 
65  skipMissingTauID = cms.bool(False), #Allow to skip a tau ID variable when not present in the event"
66  # mc matching configurables
67  addGenMatch = cms.bool(True),
68  embedGenMatch = cms.bool(True),
69  genParticleMatch = cms.InputTag("tauMatch"),
70  addGenJetMatch = cms.bool(True),
71  embedGenJetMatch = cms.bool(True),
72  genJetMatch = cms.InputTag("tauGenJetMatch"),
73 
74  # efficiencies
75  addEfficiencies = cms.bool(False),
76  efficiencies = cms.PSet(),
77 
78  # resolution
79  addResolutions = cms.bool(False),
80  resolutions = cms.PSet()
81 )
82 
83 # helper functions for ID configuration
84 def singleID(pset, inputID, label):
85  setattr(pset, label, cms.PSet(inputTag=cms.InputTag(inputID), provenanceConfigLabel=cms.string(""), idLabel=cms.string("")))
86 def containerID(pset, inputID, provCfgLabel, wps):
87  for wp in wps:
88  setattr(pset, wp[0], cms.PSet(inputTag=cms.InputTag(inputID), provenanceConfigLabel=cms.string(provCfgLabel), idLabel=cms.string(wp[1])))
89 
90 # configure many IDs
91 # you can comment out those you don't want to save some disk space
92 singleID(patTaus.tauIDSources, "hpsPFTauDiscriminationByDecayModeFinding", "decayModeFinding")
93 singleID(patTaus.tauIDSources, "hpsPFTauDiscriminationByDecayModeFindingNewDMs", "decayModeFindingNewDMs")
94 containerID(patTaus.tauIDSources, "hpsPFTauDiscriminationByMuonRejection3", "IDWPdefinitions", [
95  ["againstMuonLoose3", "ByLooseMuonRejection3"],
96  ["againstMuonTight3", "ByTightMuonRejection3"]
97  ])
98 containerID(patTaus.tauIDSources, "hpsPFTauBasicDiscriminators", "IDdefinitions", [
99  ["chargedIsoPtSum", "ChargedIsoPtSum"],
100  ["neutralIsoPtSum", "NeutralIsoPtSum"],
101  ["puCorrPtSum", "PUcorrPtSum"],
102  ["neutralIsoPtSumWeight", "NeutralIsoPtSumWeight"],
103  ["footprintCorrection", "TauFootprintCorrection"],
104  ["photonPtSumOutsideSignalCone", "PhotonPtSumOutsideSignalCone"],
105  ["byCombinedIsolationDeltaBetaCorrRaw3Hits", "ByRawCombinedIsolationDBSumPtCorr3Hits"]
106  ])
107 containerID(patTaus.tauIDSources, "hpsPFTauBasicDiscriminators", "IDWPdefinitions", [
108  ["byLooseCombinedIsolationDeltaBetaCorr3Hits", "ByLooseCombinedIsolationDBSumPtCorr3Hits"],
109  ["byMediumCombinedIsolationDeltaBetaCorr3Hits", "ByMediumCombinedIsolationDBSumPtCorr3Hits"],
110  ["byTightCombinedIsolationDeltaBetaCorr3Hits", "ByTightCombinedIsolationDBSumPtCorr3Hits"],
111  ["byPhotonPtSumOutsideSignalCone", "ByPhotonPtSumOutsideSignalCone"]
112  ])
113 containerID(patTaus.tauIDSources, "hpsPFTauBasicDiscriminatorsdR03", "IDdefinitions", [
114  ["chargedIsoPtSumdR03", "ChargedIsoPtSumdR03"],
115  ["neutralIsoPtSumdR03", "NeutralIsoPtSumdR03"],
116  ["neutralIsoPtSumWeightdR03", "NeutralIsoPtSumWeightdR03"],
117  ["footprintCorrectiondR03", "TauFootprintCorrectiondR03"],
118  ["photonPtSumOutsideSignalConedR03", "PhotonPtSumOutsideSignalConedR03"]
119  ])
120 singleID(patTaus.tauIDSources, "hpsPFTauDiscriminationByDeadECALElectronRejection", "againstElectronDeadECAL")
def singleID(pset, inputID, label)
def containerID(pset, inputID, provCfgLabel, wps)