CMS 3D CMS Logo

tauTools.py
Go to the documentation of this file.
1 from __future__ import print_function
2 import FWCore.ParameterSet.Config as cms
3 
5 from PhysicsTools.PatAlgos.tools.helpers import cloneProcessingSnippet
8 
9 # applyPostFix function adapted to unscheduled mode
10 def applyPostfix(process, label, postfix):
11  result = None
12  if hasattr(process, label+postfix):
13  result = getattr(process, label + postfix)
14  else:
15  raise ValueError("Error in <applyPostfix>: No module of name = %s attached to process !!" % (label + postfix))
16  return result
17 
18 def _buildIDSourcePSet(tauType, idSources, postfix =""):
19  """ Build a PSet defining the tau ID sources to embed into the pat::Tau """
20  output = cms.PSet()
21  for label, discriminator in idSources:
22  if ":" in discriminator:
23  discr = discriminator.split(":")
24  setattr(output, label, cms.InputTag(tauType + discr[0] + postfix + ":" + discr[1]))
25  else:
26  setattr(output, label, cms.InputTag(tauType + discriminator + postfix))
27  return output
28 
29 def _switchToPFTau(process,
30  tauSource,
31  pfTauType,
32  idSources,
33  patTauLabel = "",
34  postfix = ""):
35  """internal auxiliary function to switch to **any** PFTau collection"""
36  print(' switching PAT Tau input to: ', tauSource)
37 
38  applyPostfix(process, "tauMatch" + patTauLabel, postfix).src = tauSource
39  applyPostfix(process, "tauGenJetMatch" + patTauLabel, postfix).src = tauSource
40 
41  applyPostfix(process, "tauIsoDepositPFCandidates" + patTauLabel, postfix).src = tauSource
42  applyPostfix(process, "tauIsoDepositPFCandidates" + patTauLabel, postfix).ExtractorPSet.tauSource = tauSource
43  applyPostfix(process, "tauIsoDepositPFChargedHadrons" + patTauLabel, postfix).src = tauSource
44  applyPostfix(process, "tauIsoDepositPFChargedHadrons" + patTauLabel, postfix).ExtractorPSet.tauSource = tauSource
45  applyPostfix(process, "tauIsoDepositPFNeutralHadrons" + patTauLabel, postfix).src = tauSource
46  applyPostfix(process, "tauIsoDepositPFNeutralHadrons" + patTauLabel, postfix).ExtractorPSet.tauSource = tauSource
47  applyPostfix(process, "tauIsoDepositPFGammas" + patTauLabel, postfix).src = tauSource
48  applyPostfix(process, "tauIsoDepositPFGammas" + patTauLabel, postfix).ExtractorPSet.tauSource = tauSource
49 
50  applyPostfix(process, "patTaus" + patTauLabel, postfix).tauSource = tauSource
51  # CV: reconstruction of tau lifetime information not enabled for tau collections other than 'hpsPFTauProducer' yet
52  applyPostfix(process, "patTaus" + patTauLabel, postfix).tauTransverseImpactParameterSource = ""
53  applyPostfix(process, "patTaus" + patTauLabel, postfix).tauIDSources = _buildIDSourcePSet(pfTauType, idSources, postfix)
54 
55  if hasattr(process, "cleanPatTaus" + patTauLabel + postfix):
56  getattr(process, "cleanPatTaus" + patTauLabel + postfix).preselection = preselection
57 
58 # Name mapping for classic tau ID sources (present for fixed and shrinkingCones)
59 classicTauIDSources = [
60  ("leadingTrackFinding", "DiscriminationByLeadingTrackFinding"),
61  ("leadingTrackPtCut", "DiscriminationByLeadingTrackPtCut"),
62  ("trackIsolation", "DiscriminationByTrackIsolation"),
63  ("ecalIsolation", "DiscriminationByECALIsolation"),
64  ("byIsolation", "DiscriminationByIsolation"),
65  ("againstElectron", "DiscriminationAgainstElectron"),
66  ("againstMuon", "DiscriminationAgainstMuon")
67 ]
68 
69 classicPFTauIDSources = [
70  ("leadingPionPtCut", "DiscriminationByLeadingPionPtCut"),
71  ("trackIsolationUsingLeadingPion", "DiscriminationByTrackIsolationUsingLeadingPion"),
72  ("ecalIsolationUsingLeadingPion", "DiscriminationByECALIsolationUsingLeadingPion"),
73  ("byIsolationUsingLeadingPion", "DiscriminationByIsolationUsingLeadingPion")
74 ]
75 
76 # Hadron-plus-strip(s) (HPS) Tau Discriminators
77 hpsTauIDSources = [
78  ("decayModeFindingNewDMs", "DiscriminationByDecayModeFindingNewDMs"),
79  ("decayModeFinding", "DiscriminationByDecayModeFinding"), # CV: kept for backwards compatibility
80  ("byLooseCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits"),
81  ("byMediumCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"),
82  ("byTightCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"),
83  ("byCombinedIsolationDeltaBetaCorrRaw3Hits", "DiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"),
84  ("byLooseCombinedIsolationDeltaBetaCorr3HitsdR03", "DiscriminationByLooseCombinedIsolationDBSumPtCorr3HitsdR03"),
85  ("byMediumCombinedIsolationDeltaBetaCorr3HitsdR03", "DiscriminationByMediumCombinedIsolationDBSumPtCorr3HitsdR03"),
86  ("byTightCombinedIsolationDeltaBetaCorr3HitsdR03", "DiscriminationByTightCombinedIsolationDBSumPtCorr3HitsdR03"),
87  ("byPhotonPtSumOutsideSignalCone", "DiscriminationByPhotonPtSumOutsideSignalCone"),
88  ("chargedIsoPtSum", "ChargedIsoPtSum"),
89  ("neutralIsoPtSum", "NeutralIsoPtSum"),
90  ("puCorrPtSum", "PUcorrPtSum"),
91  ("neutralIsoPtSumWeight", "NeutralIsoPtSumWeight"),
92  ("footprintCorrection", "FootprintCorrection"),
93  ("photonPtSumOutsideSignalCone", "PhotonPtSumOutsideSignalCone"),
94  ("againstMuonLoose3", "DiscriminationByLooseMuonRejection3"),
95  ("againstMuonTight3", "DiscriminationByTightMuonRejection3"),
96  ("byIsolationMVArun2v1DBoldDMwLTraw", "DiscriminationByIsolationMVArun2v1DBoldDMwLTraw"),
97  ("byVVLooseIsolationMVArun2v1DBoldDMwLT", "DiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT"),
98  ("byVLooseIsolationMVArun2v1DBoldDMwLT", "DiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT"),
99  ("byLooseIsolationMVArun2v1DBoldDMwLT", "DiscriminationByLooseIsolationMVArun2v1DBoldDMwLT"),
100  ("byMediumIsolationMVArun2v1DBoldDMwLT", "DiscriminationByMediumIsolationMVArun2v1DBoldDMwLT"),
101  ("byTightIsolationMVArun2v1DBoldDMwLT", "DiscriminationByTightIsolationMVArun2v1DBoldDMwLT"),
102  ("byVTightIsolationMVArun2v1DBoldDMwLT", "DiscriminationByVTightIsolationMVArun2v1DBoldDMwLT"),
103  ("byVVTightIsolationMVArun2v1DBoldDMwLT", "DiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT"),
104  ("byIsolationMVArun2v1DBnewDMwLTraw", "DiscriminationByIsolationMVArun2v1DBnewDMwLTraw"),
105  ("byVVLooseIsolationMVArun2v1DBnewDMwLT", "DiscriminationByVVLooseIsolationMVArun2v1DBnewDMwLT"),
106  ("byVLooseIsolationMVArun2v1DBnewDMwLT", "DiscriminationByVLooseIsolationMVArun2v1DBnewDMwLT"),
107  ("byLooseIsolationMVArun2v1DBnewDMwLT", "DiscriminationByLooseIsolationMVArun2v1DBnewDMwLT"),
108  ("byMediumIsolationMVArun2v1DBnewDMwLT", "DiscriminationByMediumIsolationMVArun2v1DBnewDMwLT"),
109  ("byTightIsolationMVArun2v1DBnewDMwLT", "DiscriminationByTightIsolationMVArun2v1DBnewDMwLT"),
110  ("byVTightIsolationMVArun2v1DBnewDMwLT", "DiscriminationByVTightIsolationMVArun2v1DBnewDMwLT"),
111  ("byVVTightIsolationMVArun2v1DBnewDMwLT", "DiscriminationByVVTightIsolationMVArun2v1DBnewDMwLT"),
112  ("byIsolationMVArun2v1PWoldDMwLTraw", "DiscriminationByIsolationMVArun2v1PWoldDMwLTraw"),
113  ("byVLooseIsolationMVArun2v1PWoldDMwLT", "DiscriminationByVLooseIsolationMVArun2v1PWoldDMwLT"),
114  ("byLooseIsolationMVArun2v1PWoldDMwLT", "DiscriminationByLooseIsolationMVArun2v1PWoldDMwLT"),
115  ("byMediumIsolationMVArun2v1PWoldDMwLT", "DiscriminationByMediumIsolationMVArun2v1PWoldDMwLT"),
116  ("byTightIsolationMVArun2v1PWoldDMwLT", "DiscriminationByTightIsolationMVArun2v1PWoldDMwLT"),
117  ("byVTightIsolationMVArun2v1PWoldDMwLT", "DiscriminationByVTightIsolationMVArun2v1PWoldDMwLT"),
118  ("byVVTightIsolationMVArun2v1PWoldDMwLT", "DiscriminationByVVTightIsolationMVArun2v1PWoldDMwLT"),
119  ("byIsolationMVArun2v1PWnewDMwLTraw", "DiscriminationByIsolationMVArun2v1PWnewDMwLTraw"),
120  ("byVLooseIsolationMVArun2v1PWnewDMwLT", "DiscriminationByVLooseIsolationMVArun2v1PWnewDMwLT"),
121  ("byLooseIsolationMVArun2v1PWnewDMwLT", "DiscriminationByLooseIsolationMVArun2v1PWnewDMwLT"),
122  ("byMediumIsolationMVArun2v1PWnewDMwLT", "DiscriminationByMediumIsolationMVArun2v1PWnewDMwLT"),
123  ("byTightIsolationMVArun2v1PWnewDMwLT", "DiscriminationByTightIsolationMVArun2v1PWnewDMwLT"),
124  ("byVTightIsolationMVArun2v1PWnewDMwLT", "DiscriminationByVTightIsolationMVArun2v1PWnewDMwLT"),
125  ("byVVTightIsolationMVArun2v1PWnewDMwLT", "DiscriminationByVVTightIsolationMVArun2v1PWnewDMwLT"),
126  ("chargedIsoPtSumdR03", "ChargedIsoPtSumdR03"),
127  ("neutralIsoPtSumdR03", "NeutralIsoPtSumdR03"),
128  ("neutralIsoPtSumWeightdR03", "NeutralIsoPtSumWeightdR03"),
129  ("footprintCorrectiondR03", "FootprintCorrectiondR03"),
130  ("photonPtSumOutsideSignalConedR03", "PhotonPtSumOutsideSignalConedR03"),
131  ("byIsolationMVArun2v1DBdR03oldDMwLTraw", "DiscriminationByIsolationMVArun2v1DBdR03oldDMwLTraw"),
132  ("byVVLooseIsolationMVArun2v1DBdR03oldDMwLT", "DiscriminationByVVLooseIsolationMVArun2v1DBdR03oldDMwLT"),
133  ("byVLooseIsolationMVArun2v1DBdR03oldDMwLT", "DiscriminationByVLooseIsolationMVArun2v1DBdR03oldDMwLT"),
134  ("byLooseIsolationMVArun2v1DBdR03oldDMwLT", "DiscriminationByLooseIsolationMVArun2v1DBdR03oldDMwLT"),
135  ("byMediumIsolationMVArun2v1DBdR03oldDMwLT", "DiscriminationByMediumIsolationMVArun2v1DBdR03oldDMwLT"),
136  ("byTightIsolationMVArun2v1DBdR03oldDMwLT", "DiscriminationByTightIsolationMVArun2v1DBdR03oldDMwLT"),
137  ("byVTightIsolationMVArun2v1DBdR03oldDMwLT", "DiscriminationByVTightIsolationMVArun2v1DBdR03oldDMwLT"),
138  ("byVVTightIsolationMVArun2v1DBdR03oldDMwLT", "DiscriminationByVVTightIsolationMVArun2v1DBdR03oldDMwLT"),
139  ("byIsolationMVArun2v1PWdR03oldDMwLTraw", "DiscriminationByIsolationMVArun2v1PWdR03oldDMwLTraw"),
140  ("byVLooseIsolationMVArun2v1PWdR03oldDMwLT", "DiscriminationByVLooseIsolationMVArun2v1PWdR03oldDMwLT"),
141  ("byLooseIsolationMVArun2v1PWdR03oldDMwLT", "DiscriminationByLooseIsolationMVArun2v1PWdR03oldDMwLT"),
142  ("byMediumIsolationMVArun2v1PWdR03oldDMwLT", "DiscriminationByMediumIsolationMVArun2v1PWdR03oldDMwLT"),
143  ("byTightIsolationMVArun2v1PWdR03oldDMwLT", "DiscriminationByTightIsolationMVArun2v1PWdR03oldDMwLT"),
144  ("byVTightIsolationMVArun2v1PWdR03oldDMwLT", "DiscriminationByVTightIsolationMVArun2v1PWdR03oldDMwLT"),
145  ("byVVTightIsolationMVArun2v1PWdR03oldDMwLT", "DiscriminationByVVTightIsolationMVArun2v1PWdR03oldDMwLT"),
146  ("againstElectronMVA6Raw", "DiscriminationByMVA6rawElectronRejection"),
147  ("againstElectronMVA6category", "DiscriminationByMVA6rawElectronRejection:category"),
148  ("againstElectronVLooseMVA6", "DiscriminationByMVA6VLooseElectronRejection"),
149  ("againstElectronLooseMVA6", "DiscriminationByMVA6LooseElectronRejection"),
150  ("againstElectronMediumMVA6", "DiscriminationByMVA6MediumElectronRejection"),
151  ("againstElectronTightMVA6", "DiscriminationByMVA6TightElectronRejection"),
152  ("againstElectronVTightMVA6", "DiscriminationByMVA6VTightElectronRejection"),
153 ]
154 
155 # switch to PFTau collection produced for fixed dR = 0.07 signal cone size
156 def switchToPFTauFixedCone(process,
157  tauSource = cms.InputTag('fixedConePFTauProducer'),
158  patTauLabel = "",
159  postfix = ""):
160  fixedConeIDSources = copy.copy(classicTauIDSources)
161  fixedConeIDSources.extend(classicPFTauIDSources)
162 
163  _switchToPFTau(process, tauSource, 'fixedConePFTau', fixedConeIDSources,
164  patTauLabel = patTauLabel, postfix = postfix)
165 
166 # switch to PFTau collection produced for shrinking signal cone of size dR = 5.0/Et(PFTau)
167 def switchToPFTauShrinkingCone(process,
168  tauSource = cms.InputTag('shrinkingConePFTauProducer'),
169  patTauLabel = "",
170  postfix = ""):
171  shrinkingIDSources = copy.copy(classicTauIDSources)
172  shrinkingIDSources.extend(classicPFTauIDSources)
173 
174  _switchToPFTau(process, tauSource, 'shrinkingConePFTau', shrinkingIDSources,
175  patTauLabel = patTauLabel, postfix = postfix)
176 
177 # switch to hadron-plus-strip(s) (HPS) PFTau collection
178 def switchToPFTauHPS(process,
179  tauSource = cms.InputTag('hpsPFTauProducer'),
180  patTauLabel = "",
181  jecLevels = [],
182  postfix = ""):
183 
184  _switchToPFTau(process, tauSource, 'hpsPFTau', hpsTauIDSources,
185  patTauLabel = patTauLabel, postfix = postfix)
186 
187  # CV: enable tau lifetime information for HPS PFTaus
188  applyPostfix(process, "patTaus" + patTauLabel, postfix).tauTransverseImpactParameterSource = tauSource.value().replace("Producer", "TransverseImpactParameters")
189 
190  ## adapt cleanPatTaus
191  if hasattr(process, "cleanPatTaus" + patTauLabel + postfix):
192  getattr(process, "cleanPatTaus" + patTauLabel + postfix).preselection = preselection
193 
194 # Select switcher by string
195 def switchToPFTauByType(process,
196  pfTauType = None,
197  tauSource = cms.InputTag('hpsPFTauProducer'),
198  patTauLabel = "",
199  postfix = "" ):
200  mapping = {
201  'shrinkingConePFTau' : switchToPFTauShrinkingCone,
202  'fixedConePFTau' : switchToPFTauFixedCone,
203  'hpsPFTau' : switchToPFTauHPS
204  }
205  if not pfTauType in mapping.keys():
206  raise ValueError("Error in <switchToPFTauByType>: Undefined pfTauType = %s !!" % pfTauType)
207 
208  mapping[pfTauType](process, tauSource = tauSource,
209  patTauLabel = patTauLabel, postfix = postfix)
210 
212 
213  """ Add a new collection of taus. Takes the configuration from the
214  already configured standard tau collection as starting point;
215  replaces before calling addTauCollection will also affect the
216  new tau collections
217  """
218  _label='addTauCollection'
219  _defaultParameters=dicttypes.SortedKeysDict()
220  def __init__(self):
221  ConfigToolBase.__init__(self)
222  self.addParameter(self._defaultParameters, 'tauCollection',
223  self._defaultValue, 'Input tau collection', cms.InputTag)
224  self.addParameter(self._defaultParameters, 'algoLabel',
225  self._defaultValue, "label to indicate the tau algorithm (e.g.'hps')", str)
226  self.addParameter(self._defaultParameters, 'typeLabel',
227  self._defaultValue, "label to indicate the type of constituents (either 'PFTau' or 'Tau')", str)
228  self.addParameter(self._defaultParameters, 'doPFIsoDeposits',
229  True, "run sequence for computing particle-flow based IsoDeposits")
230  self.addParameter(self._defaultParameters, 'standardAlgo',
231  "hps", "standard algorithm label of the collection from which the clones " \
232  + "for the new tau collection will be taken from " \
233  + "(note that this tau collection has to be available in the event before hand)")
234  self.addParameter(self._defaultParameters, 'standardType',
235  "PFTau", "standard constituent type label of the collection from which the clones " \
236  + " for the new tau collection will be taken from "\
237  + "(note that this tau collection has to be available in the event before hand)")
238 
239  self._parameters=copy.deepcopy(self._defaultParameters)
240  self._comment = ""
241 
243  return self._defaultParameters
244 
245  def __call__(self,process,
246  tauCollection = None,
247  algoLabel = None,
248  typeLabel = None,
249  doPFIsoDeposits = None,
250  jetCorrLabel = None,
251  standardAlgo = None,
252  standardType = None):
253 
254  if tauCollection is None:
255  tauCollection = self._defaultParameters['tauCollection'].value
256  if algoLabel is None:
257  algoLabel = self._defaultParameters['algoLabel'].value
258  if typeLabel is None:
259  typeLabel = self._defaultParameters['typeLabel'].value
260  if doPFIsoDeposits is None:
261  doPFIsoDeposits = self._defaultParameters['doPFIsoDeposits'].value
262  if standardAlgo is None:
263  standardAlgo = self._defaultParameters['standardAlgo'].value
264  if standardType is None:
265  standardType = self._defaultParameters['standardType'].value
266 
267  self.setParameter('tauCollection', tauCollection)
268  self.setParameter('algoLabel', algoLabel)
269  self.setParameter('typeLabel', typeLabel)
270  self.setParameter('doPFIsoDeposits', doPFIsoDeposits)
271  self.setParameter('standardAlgo', standardAlgo)
272  self.setParameter('standardType', standardType)
273 
274  self.apply(process)
275 
276  def toolCode(self, process):
277  tauCollection = self._parameters['tauCollection'].value
278  algoLabel = self._parameters['algoLabel'].value
279  typeLabel = self._parameters['typeLabel'].value
280  doPFIsoDeposits = self._parameters['doPFIsoDeposits'].value
281  standardAlgo = self._parameters['standardAlgo'].value
282  standardType = self._parameters['standardType'].value
283 
284  ## disable computation of particle-flow based IsoDeposits
285  ## in case tau is of CaloTau type
286  if typeLabel == 'Tau':
287  print("NO PF Isolation will be computed for CaloTau (this could be improved later)")
288  doPFIsoDeposits = False
289 
290  ## create old module label from standardAlgo
291  ## and standardType and return
292  def oldLabel(prefix = ''):
293  if prefix == '':
294  return "patTaus"
295  else:
296  return prefix + "PatTaus"
297 
298  ## capitalize first character of appended part
299  ## when creating new module label
300  ## (giving e.g. "patTausCaloRecoTau")
301  def capitalize(label):
302  return label[0].capitalize() + label[1:]
303 
304  ## create new module label from old module
305  ## label and return
306  def newLabel(oldLabel):
307  newLabel = oldLabel
308  if ( oldLabel.find(standardAlgo) >= 0 and oldLabel.find(standardType) >= 0 ):
309  oldLabel = oldLabel.replace(standardAlgo, algoLabel).replace(standardType, typeLabel)
310  else:
311  oldLabel = oldLabel + capitalize(algoLabel + typeLabel)
312  return oldLabel
313 
314  ## clone module and add it to the patDefaultSequence
315  def addClone(hook, **replaceStatements):
316  ## create a clone of the hook with corresponding
317  ## parameter replacements
318  newModule = getattr(process, hook).clone(**replaceStatements)
319 
320  ## clone module for computing particle-flow IsoDeposits
321  def addPFIsoDepositClone(hook, **replaceStatements):
322  newModule = getattr(process, hook).clone(**replaceStatements)
323  newModuleIsoDepositExtractor = getattr(newModule, "ExtractorPSet")
324  setattr(newModuleIsoDepositExtractor, "tauSource", getattr(newModule, "src"))
325 
326  ## add a clone of patTaus
327  addClone(oldLabel(), tauSource = tauCollection)
328 
329  ## add a clone of selectedPatTaus
330  addClone(oldLabel('selected'), src = cms.InputTag(newLabel(oldLabel())))
331 
332  ## add a clone of cleanPatTaus
333  addClone(oldLabel('clean'), src=cms.InputTag(newLabel(oldLabel('selected'))))
334 
335  ## get attributes of new module
336  newTaus = getattr(process, newLabel(oldLabel()))
337 
338  ## add a clone of gen tau matching
339  addClone('tauMatch', src = tauCollection)
340  addClone('tauGenJetMatch', src = tauCollection)
341 
342  ## add a clone of IsoDeposits computed based on particle-flow
343  if doPFIsoDeposits:
344  addPFIsoDepositClone('tauIsoDepositPFCandidates', src = tauCollection)
345  addPFIsoDepositClone('tauIsoDepositPFChargedHadrons', src = tauCollection)
346  addPFIsoDepositClone('tauIsoDepositPFNeutralHadrons', src = tauCollection)
347  addPFIsoDepositClone('tauIsoDepositPFGammas', src = tauCollection)
348 
349  ## fix label for input tag
350  def fixInputTag(x):
351  x.setModuleLabel(newLabel(x.moduleLabel))
352 
353  ## provide patTau inputs with individual labels
354  fixInputTag(newTaus.genParticleMatch)
355  fixInputTag(newTaus.genJetMatch)
356  fixInputTag(newTaus.isoDeposits.pfAllParticles)
357  fixInputTag(newTaus.isoDeposits.pfNeutralHadron)
358  fixInputTag(newTaus.isoDeposits.pfChargedHadron)
359  fixInputTag(newTaus.isoDeposits.pfGamma)
360  fixInputTag(newTaus.userIsolation.pfAllParticles.src)
361  fixInputTag(newTaus.userIsolation.pfNeutralHadron.src)
362  fixInputTag(newTaus.userIsolation.pfChargedHadron.src)
363  fixInputTag(newTaus.userIsolation.pfGamma.src)
364 
365  ## set discriminators
366  ## (using switchTauCollection functions)
367  oldTaus = getattr(process, oldLabel())
368  switchToPFTauByType(process, pfTauType = algoLabel + typeLabel,
369  tauSource = getattr(newTaus, "tauSource"),
370  patTauLabel = capitalize(algoLabel + typeLabel))
371 
372 addTauCollection=AddTauCollection()
def _buildIDSourcePSet(tauType, idSources, postfix="")
Definition: tauTools.py:18
def replace(string, replacements)
def switchToPFTauShrinkingCone(process, tauSource=cms.InputTag('shrinkingConePFTauProducer'), patTauLabel="", postfix="")
Definition: tauTools.py:170
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def __call__(self, process, tauCollection=None, algoLabel=None, typeLabel=None, doPFIsoDeposits=None, jetCorrLabel=None, standardAlgo=None, standardType=None)
Definition: tauTools.py:252
def switchToPFTauByType(process, pfTauType=None, tauSource=cms.InputTag('hpsPFTauProducer'), patTauLabel="", postfix="")
Definition: tauTools.py:199
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
def switchToPFTauHPS(process, tauSource=cms.InputTag('hpsPFTauProducer'), patTauLabel="", jecLevels=[], postfix="")
Definition: tauTools.py:182
def toolCode(self, process)
Definition: tauTools.py:276
def getDefaultParameters(self)
Definition: tauTools.py:242
def _switchToPFTau(process, tauSource, pfTauType, idSources, patTauLabel="", postfix="")
Definition: tauTools.py:34
def switchToPFTauFixedCone(process, tauSource=cms.InputTag('fixedConePFTauProducer'), patTauLabel="", postfix="")
Definition: tauTools.py:159
def applyPostfix(process, label, postfix)
Definition: tauTools.py:10