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, "hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT", "rawValues", [
114  ["byIsolationMVArun2v1DBoldDMwLTraw", "discriminator"]
115  ])
116 containerID(patTaus.tauIDSources, "hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT", "workingPoints", [
117  ["byVVLooseIsolationMVArun2v1DBoldDMwLT", "_VVLoose"],
118  ["byVLooseIsolationMVArun2v1DBoldDMwLT", "_VLoose"],
119  ["byLooseIsolationMVArun2v1DBoldDMwLT", "_Loose"],
120  ["byMediumIsolationMVArun2v1DBoldDMwLT", "_Medium"],
121  ["byTightIsolationMVArun2v1DBoldDMwLT", "_Tight"],
122  ["byVTightIsolationMVArun2v1DBoldDMwLT", "_VTight"],
123  ["byVVTightIsolationMVArun2v1DBoldDMwLT", "_VVTight"]
124  ])
125 containerID(patTaus.tauIDSources, "hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLT", "rawValues", [
126  ["byIsolationMVArun2v1DBnewDMwLTraw", "discriminator"]
127  ])
128 containerID(patTaus.tauIDSources, "hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLT", "workingPoints", [
129  ["byVVLooseIsolationMVArun2v1DBnewDMwLT", "_VVLoose"],
130  ["byVLooseIsolationMVArun2v1DBnewDMwLT", "_VLoose"],
131  ["byLooseIsolationMVArun2v1DBnewDMwLT", "_Loose"],
132  ["byMediumIsolationMVArun2v1DBnewDMwLT", "_Medium"],
133  ["byTightIsolationMVArun2v1DBnewDMwLT", "_Tight"],
134  ["byVTightIsolationMVArun2v1DBnewDMwLT", "_VTight"],
135  ["byVVTightIsolationMVArun2v1DBnewDMwLT", "_VVTight"]
136  ])
137 containerID(patTaus.tauIDSources, "hpsPFTauBasicDiscriminatorsdR03", "IDdefinitions", [
138  ["chargedIsoPtSumdR03", "ChargedIsoPtSumdR03"],
139  ["neutralIsoPtSumdR03", "NeutralIsoPtSumdR03"],
140  ["neutralIsoPtSumWeightdR03", "NeutralIsoPtSumWeightdR03"],
141  ["footprintCorrectiondR03", "TauFootprintCorrectiondR03"],
142  ["photonPtSumOutsideSignalConedR03", "PhotonPtSumOutsideSignalConedR03"]
143  ])
144 containerID(patTaus.tauIDSources, "hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLT", "rawValues", [
145  ["byIsolationMVArun2v1DBdR03oldDMwLTraw", "discriminator"]
146  ])
147 containerID(patTaus.tauIDSources, "hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLT", "workingPoints", [
148  ["byVVLooseIsolationMVArun2v1DBdR03oldDMwLT", "_VVLoose"],
149  ["byVLooseIsolationMVArun2v1DBdR03oldDMwLT", "_VLoose"],
150  ["byLooseIsolationMVArun2v1DBdR03oldDMwLT", "_Loose"],
151  ["byMediumIsolationMVArun2v1DBdR03oldDMwLT", "_Medium"],
152  ["byTightIsolationMVArun2v1DBdR03oldDMwLT", "_Tight"],
153  ["byVTightIsolationMVArun2v1DBdR03oldDMwLT", "_VTight"],
154  ["byVVTightIsolationMVArun2v1DBdR03oldDMwLT", "_VVTight"]
155  ])
156 containerID(patTaus.tauIDSources, "hpsPFTauDiscriminationByMVA6ElectronRejection", "rawValues", [
157  ["againstElectronMVA6Raw", "discriminator"],
158  ["againstElectronMVA6category", "category"]
159  ])
160 containerID(patTaus.tauIDSources, "hpsPFTauDiscriminationByMVA6ElectronRejection", "workingPoints", [
161  ["againstElectronVLooseMVA6", "_VLoose"],
162  ["againstElectronLooseMVA6", "_Loose"],
163  ["againstElectronMediumMVA6", "_Medium"],
164  ["againstElectronTightMVA6", "_Tight"],
165  ["againstElectronVTightMVA6", "_VTight"]
166  ])
167 singleID(patTaus.tauIDSources, "hpsPFTauDiscriminationByDeadECALElectronRejection", "againstElectronDeadECAL")
tauProducer_cfi.singleID
def singleID(pset, inputID, label)
Definition: tauProducer_cfi.py:84
tauProducer_cfi.containerID
def containerID(pset, inputID, provCfgLabel, wps)
Definition: tauProducer_cfi.py:86