CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
pfTools Namespace Reference

Functions

def adaptPFElectrons
 
def adaptPFMuons
 
def adaptPFPhotons
 
def adaptPFTaus
 
def addPFCandidates
 
def reconfigurePF2PATTaus
 
def removeMCMatchingPF2PAT
 
def switchToPFJets
 
def switchToPFMET
 
def tauTypeInPF2PAT
 
def usePF2PAT
 
def warningIsolation
 

Function Documentation

def pfTools.adaptPFElectrons (   process,
  module,
  postfix 
)

Definition at line 60 of file pfTools.py.

References helpers.removeIfInSequence(), and warningIsolation().

Referenced by usePF2PAT().

60 
61 def adaptPFElectrons(process,module, postfix):
62  # module.useParticleFlow = True
63  print "Adapting PF Electrons "
64  print "********************* "
66  print
67  module.useParticleFlow = True
68  module.userIsolation = cms.PSet()
69  module.isoDeposits = cms.PSet(
70  pfChargedHadrons = cms.InputTag("isoDepElectronWithCharged" + postfix),
71  pfNeutralHadrons = cms.InputTag("isoDepElectronWithNeutral" + postfix),
72  pfPhotons = cms.InputTag("isoDepElectronWithPhotons" + postfix)
73  )
74  module.isolationValues = cms.PSet(
75  pfChargedHadrons = cms.InputTag("isoValElectronWithCharged" + postfix),
76  pfNeutralHadrons = cms.InputTag("isoValElectronWithNeutral" + postfix),
77  pfPhotons = cms.InputTag("isoValElectronWithPhotons" + postfix)
78  )
79 
80  # COLIN: since we take the egamma momentum for pat Electrons, we must
81  # match the egamma electron to the gen electrons, and not the PFElectron.
82  # -> do not uncomment the line below.
83  # process.electronMatch.src = module.pfElectronSource
84  # COLIN: how do we depend on this matching choice?
85 
86  print " PF electron source:", module.pfElectronSource
87  print " isolation :"
88  print module.isolationValues
89  print " isodeposits: "
90  print module.isoDeposits
91  print
92 
93  print "removing traditional isolation"
94 
95  removeIfInSequence(process, "patElectronIsolation", "patDefaultSequence", postfix)
def adaptPFElectrons
Definition: pfTools.py:60
def warningIsolation
Definition: pfTools.py:29
def removeIfInSequence
Definition: helpers.py:20
def pfTools.adaptPFMuons (   process,
  module,
  postfix = "" 
)

Definition at line 32 of file pfTools.py.

References helpers.applyPostfix(), and warningIsolation().

Referenced by usePF2PAT().

32 
33 def adaptPFMuons(process,module,postfix="" ):
34  print "Adapting PF Muons "
35  print "***************** "
37  print
38  module.useParticleFlow = True
39  module.userIsolation = cms.PSet()
40  module.isoDeposits = cms.PSet(
41  pfChargedHadrons = cms.InputTag("isoDepMuonWithCharged" + postfix),
42  pfNeutralHadrons = cms.InputTag("isoDepMuonWithNeutral" + postfix),
43  pfPhotons = cms.InputTag("isoDepMuonWithPhotons" + postfix)
44  )
45  module.isolationValues = cms.PSet(
46  pfChargedHadrons = cms.InputTag("isoValMuonWithCharged" + postfix),
47  pfNeutralHadrons = cms.InputTag("isoValMuonWithNeutral" + postfix),
48  pfPhotons = cms.InputTag("isoValMuonWithPhotons" + postfix)
49  )
50  # matching the pfMuons, not the standard muons.
51  applyPostfix(process,"muonMatch",postfix).src = module.pfMuonSource
52 
53  print " muon source:", module.pfMuonSource
54  print " isolation :",
55  print module.isolationValues
56  print " isodeposits: "
57  print module.isoDeposits
58  print
59 
def adaptPFMuons
Definition: pfTools.py:32
def applyPostfix
Helpers to perform some technically boring tasks like looking for all modules with a given parameter ...
Definition: helpers.py:6
def warningIsolation
Definition: pfTools.py:29
def pfTools.adaptPFPhotons (   process,
  module 
)

Definition at line 96 of file pfTools.py.

References reconfigurePF2PATTaus().

96 
97 def adaptPFPhotons(process,module):
98  raise RuntimeError, "Photons are not supported yet"
def adaptPFPhotons
Definition: pfTools.py:96
def pfTools.adaptPFTaus (   process,
  tauType = 'shrinkingConePFTau',
  postfix = "" 
)

Definition at line 213 of file pfTools.py.

References helpers.applyPostfix(), reconfigurePF2PATTaus(), tauTools.redoPFTauDiscriminators(), python.multivaluedict.remove(), and tauTools.switchToPFTauByType().

Referenced by usePF2PAT().

214 def adaptPFTaus(process,tauType = 'shrinkingConePFTau', postfix = ""):
215  # Set up the collection used as a preselection to use this tau type
216  if tauType != 'hpsPFTau' :
217  reconfigurePF2PATTaus(process, tauType, postfix=postfix)
218  else:
219  reconfigurePF2PATTaus(process, tauType,
220  ["DiscriminationByLooseIsolation"],
221  ["DiscriminationByDecayModeFinding"],
222  postfix=postfix)
223  applyPostfix(process,"patTaus", postfix).tauSource = cms.InputTag("pfTaus"+postfix)
224 
225  redoPFTauDiscriminators(process,
226  cms.InputTag(tauType+'Producer'),
227  applyPostfix(process,"patTaus", postfix).tauSource,
228  tauType, postfix=postfix)
229 
230  switchToPFTauByType(process, pfTauType=tauType,
231  pfTauLabelNew=applyPostfix(process,"patTaus", postfix).tauSource,
232  pfTauLabelOld=cms.InputTag(tauType+'Producer'),
233  postfix=postfix)
234 
235  applyPostfix(process,"makePatTaus", postfix).remove(
236  applyPostfix(process,"patPFCandidateIsoDepositSelection", postfix)
237  )
238 
#helper function for PAT on PF2PAT sample
def adaptPFTaus
Definition: pfTools.py:213
def redoPFTauDiscriminators
Definition: tauTools.py:12
def reconfigurePF2PATTaus
Definition: pfTools.py:106
def applyPostfix
Helpers to perform some technically boring tasks like looking for all modules with a given parameter ...
Definition: helpers.py:6
def switchToPFTauByType
Definition: tauTools.py:260
def pfTools.addPFCandidates (   process,
  src,
  patLabel = 'PFParticles',
  cut = "",
  postfix = "" 
)

Definition at line 244 of file pfTools.py.

References helpers.applyPostfix(), and linker.replace().

Referenced by usePF2PAT().

245 def addPFCandidates(process,src,patLabel='PFParticles',cut="",postfix=""):
246  from PhysicsTools.PatAlgos.producersLayer1.pfParticleProducer_cfi import patPFParticles
247  # make modules
248  producer = patPFParticles.clone(pfCandidateSource = src)
249  filter = cms.EDFilter("PATPFParticleSelector",
250  src = cms.InputTag("pat" + patLabel),
251  cut = cms.string(cut))
252  counter = cms.EDFilter("PATCandViewCountFilter",
253  minNumber = cms.uint32(0),
254  maxNumber = cms.uint32(999999),
255  src = cms.InputTag("pat" + patLabel))
256  # add modules to process
257  setattr(process, "pat" + patLabel, producer)
258  setattr(process, "selectedPat" + patLabel, filter)
259  setattr(process, "countPat" + patLabel, counter)
260  # insert into sequence
261  getattr(process, "patDefaultSequence"+postfix).replace(
262  applyPostfix(process, "patCandidateSummary", postfix),
263  producer+applyPostfix(process, "patCandidateSummary", postfix)
264  )
265  getattr(process, "patDefaultSequence"+postfix).replace(
266  applyPostfix(process, "selectedPatCandidateSummary", postfix),
267  filter+applyPostfix(process, "selectedPatCandidateSummary", postfix)
268  )
269 
270  tmpCountPatCandidates = applyPostfix(process, "countPatCandidates", postfix)
271  tmpCountPatCandidates+=counter
272  # summary tables
273  applyPostfix(process, "patCandidateSummary", postfix).candidates.append(cms.InputTag('pat' + patLabel))
274  applyPostfix(process, "selectedPatCandidateSummary", postfix).candidates.append(cms.InputTag('selectedPat' + patLabel))
275 
def replace
Definition: linker.py:10
def applyPostfix
Helpers to perform some technically boring tasks like looking for all modules with a given parameter ...
Definition: helpers.py:6
def addPFCandidates
Definition: pfTools.py:244
def pfTools.reconfigurePF2PATTaus (   process,
  tauType = 'shrinkingConePFTau',
  pf2patSelection = ["DiscriminationByIsolation",
  DiscriminationByLeadingPionPtCut,
  selectionDependsOn = ["DiscriminationByLeadingTrackFinding"],
  producerFromType = lambda producer: producer+"Producer",
  postfix = "" 
)

Definition at line 106 of file pfTools.py.

References TauDiscriminatorTools.adaptTauDiscriminator(), helpers.applyPostfix(), clone(), helpers.cloneProcessingSnippet(), helpers.massSearchReplaceParam(), TauDiscriminatorTools.producerIsTauTypeMapper, and TauDiscriminatorTools.recoTauTypeMapper().

Referenced by adaptPFPhotons(), and adaptPFTaus().

107  postfix = ""):
108  print "patTaus will be produced from taus of type: %s that pass %s" \
109  % (tauType, pf2patSelection)
110 
111  #get baseSequence
112  baseSequence = getattr(process,"pfTausBaseSequence"+postfix)
113  #clean baseSequence from old modules
114  for oldBaseModuleName in baseSequence.moduleNames():
115  oldBaseModule = getattr(process,oldBaseModuleName)
116  baseSequence.remove(oldBaseModule)
117 
118  # Get the prototype of tau producer to make, i.e. fixedConePFTauProducer
119  producerName = producerFromType(tauType)
120  # Set as the source for the pf2pat taus (pfTaus) selector
121  applyPostfix(process,"pfTaus", postfix).src = producerName+postfix
122  # Start our pf2pat taus base sequence
123  oldTau = getattr(process,'pfTausProducer'+postfix)
124  ## copy tau and setup it properly
125  newTau = getattr(process,producerName).clone()
126  ## adapted to new structure in RecoTauProducers PLEASE CHECK!!!
127  if tauType=='shrinkingConePFTau': #Only shrCone tau has modifiers???
128  # like this, it should have it already definied??
129  newTau.modifiers[1] = cms.PSet(
130  pfTauTagInfoSrc = cms.InputTag("pfTauTagInfoProducer"+postfix),
131  name = cms.string('pfTauTTIworkaround'+postfix),
132  plugin = cms.string('RecoTauTagInfoWorkaroundModifer')
133  )
134  newTau.piZeroSrc = "pfJetsLegacyTaNCPiZeros"+postfix
135  elif tauType=='fixedConePFTau':
136  #newTau.piZeroSrc = "pfJetsPiZeros"+postfix
137  newTau.PFTauTagInfoProducer = cms.InputTag("pfTauTagInfoProducer"+postfix)
138  elif tauType=='hpsPFTau':
139  newTau = process.combinatoricRecoTaus.clone()
140  newTau.piZeroSrc="pfJetsLegacyHPSPiZeros"+postfix
141  newTau.modifiers[2] = cms.PSet(
142  pfTauTagInfoSrc = cms.InputTag("pfTauTagInfoProducer"+postfix),
143  name = cms.string('pfTauTTIworkaround'+postfix),
144  plugin = cms.string('RecoTauTagInfoWorkaroundModifer')
145  )
146  from PhysicsTools.PatAlgos.tools.helpers import cloneProcessingSnippet
147  cloneProcessingSnippet(process, process.produceHPSPFTaus, postfix)
148  massSearchReplaceParam(getattr(process,"produceHPSPFTaus"+postfix),
149  "PFTauProducer",
150  cms.InputTag("combinatoricRecoTaus"),
151  cms.InputTag("pfTausBase"+postfix) )
152  getattr(process,"hpsPFTauProducer"+postfix).src = "pfTausBase"+postfix
153 
154  if not tauType=='fixedConePFTau':
155  newTau.builders[0].pfCandSrc = oldTau.builders[0].pfCandSrc
156  newTau.jetSrc = oldTau.jetSrc
157 
158  # replace old tau producter by new one put it into baseSequence
159  setattr(process,"pfTausBase"+postfix,newTau)
160  baseSequence += getattr(process,"pfTausBase"+postfix)
161  if tauType=='hpsPFTau':
162  baseSequence += getattr(process,"produceHPSPFTaus"+postfix)
163  #make custom mapper to take postfix into account (could have gone with lambda of lambda but... )
164  def producerIsTauTypeMapperWithPostfix(tauProducer):
165  return lambda x: producerIsTauTypeMapper(tauProducer)+x.group(1)+postfix
166 
167  def recoTauTypeMapperWithGroup(tauProducer):
168  return "%s(.*)"%recoTauTypeMapper(tauProducer)
169 
170  # Get our prediscriminants
171  for predisc in selectionDependsOn:
172  # Get the prototype
173  originalName = tauType+predisc # i.e. fixedConePFTauProducerDiscriminationByLeadingTrackFinding
174  clonedName = "pfTausBase"+predisc+postfix
175  clonedDisc = getattr(process, originalName).clone()
176  # Register in our process
177  setattr(process, clonedName, clonedDisc)
178  baseSequence += getattr(process, clonedName)
179  if tauType != 'hpsPFTau' :
180  clonedDisc.PFTauProducer = cms.InputTag(clonedDisc.PFTauProducer.value()+postfix)
181  else:
182  clonedDisc.PFTauProducer = cms.InputTag("hpsPFTauProducer"+postfix)
183  # Adapt this discriminator for the cloned prediscriminators
184  adaptTauDiscriminator(clonedDisc, newTauProducer="pfTausBase",
185  oldTauTypeMapper=recoTauTypeMapperWithGroup,
186  newTauTypeMapper=producerIsTauTypeMapperWithPostfix,
187  preservePFTauProducer=True)
188  clonedDisc.PFTauProducer = cms.InputTag("pfTausBase"+postfix)
189  # Reconfigure the pf2pat PFTau selector discrimination sources
190  applyPostfix(process,"pfTaus", postfix).discriminators = cms.VPSet()
191  for selection in pf2patSelection:
192  # Get our discriminator that will be used to select pfTaus
193  originalName = tauType+selection
194  clonedName = "pfTausBase"+selection+postfix
195  clonedDisc = getattr(process, originalName).clone()
196  # Register in our process
197  setattr(process, clonedName, clonedDisc)
198  if tauType != 'hpsPFTau' :
199  clonedDisc.PFTauProducer = cms.InputTag(clonedDisc.PFTauProducer.value()+postfix)
200  else:
201  clonedDisc.PFTauProducer = cms.InputTag("hpsPFTauProducer"+postfix)
202  # Adapt our cloned discriminator to the new prediscriminants
203  adaptTauDiscriminator(clonedDisc, newTauProducer="pfTausBase",
204  oldTauTypeMapper=recoTauTypeMapperWithGroup,
205  newTauTypeMapper=producerIsTauTypeMapperWithPostfix,
206  preservePFTauProducer=True)
207  clonedDisc.PFTauProducer = cms.InputTag("pfTausBase"+postfix)
208  baseSequence += clonedDisc
209  # Add this selection to our pfTau selectors
210  applyPostfix(process,"pfTaus", postfix).discriminators.append(cms.PSet(
211  discriminator=cms.InputTag(clonedName), selectionCut=cms.double(0.5)))
212  applyPostfix(process,"pfTaus", postfix).src = "pfTausBase"+postfix
def cloneProcessingSnippet
Definition: helpers.py:257
def applyPostfix
Helpers to perform some technically boring tasks like looking for all modules with a given parameter ...
Definition: helpers.py:6
def massSearchReplaceParam
Definition: helpers.py:200
T * clone(const T *tp)
Definition: Ptr.h:42
def pfTools.removeMCMatchingPF2PAT (   process,
  postfix = "" 
)

Definition at line 337 of file pfTools.py.

References helpers.removeIfInSequence().

Referenced by usePF2PAT().

338 def removeMCMatchingPF2PAT( process, postfix="" ):
339  from PhysicsTools.PatAlgos.tools.coreTools import removeMCMatching
340  removeIfInSequence(process, "genForPF2PATSequence", "patDefaultSequence", postfix)
341  removeMCMatching(process, ['All'],postfix)
342 
def removeMCMatchingPF2PAT
Definition: pfTools.py:337
def removeIfInSequence
Definition: helpers.py:20
def pfTools.switchToPFJets (   process,
  input = cms.InputTag('pfNoTau'),
  algo = 'AK5',
  postfix = "",
  jetCorrections = ['L1Offset',
  L2Relative,
  L3Absolute 
)

Definition at line 298 of file pfTools.py.

References helpers.applyPostfix(), if(), and jetTools.jetAlgo().

Referenced by usePF2PAT().

299 def switchToPFJets(process, input=cms.InputTag('pfNoTau'), algo='AK5', postfix = "", jetCorrections=['L1Offset','L2Relative', 'L3Absolute']):
300 
301  print "Switching to PFJets, ", algo
302  print "************************ "
303  print "input collection: ", input
304 
305  if( algo == 'IC5' ):
306  genJetCollection = cms.InputTag('iterativeCone5GenJetsNoNu')
307  elif algo == 'AK5':
308  genJetCollection = cms.InputTag('ak5GenJetsNoNu')
309  elif algo == 'AK7':
310  genJetCollection = cms.InputTag('ak7GenJetsNoNu')
311  else:
312  print 'bad jet algorithm:', algo, '! for now, only IC5, AK5 and AK7 are allowed. If you need other algorithms, please contact Colin'
313  sys.exit(1)
314 
315  # changing the jet collection in PF2PAT:
316  from PhysicsTools.PFCandProducer.Tools.jetTools import jetAlgo
317  inputCollection = getattr(process,"pfJets"+postfix).src
318  setattr(process, "pfJets"+postfix, jetAlgo( algo ) ) # problem for cfgBrowser
319  getattr(process,"pfJets"+postfix).src = inputCollection
320  inputJetCorrLabel=(algo+'PF',jetCorrections)
321  switchJetCollection(process,
322  input,
323  jetIdLabel = algo,
324  doJTA=True,
325  doBTagging=True,
326  jetCorrLabel=inputJetCorrLabel,
327  #doType1MET=False,
328  doType1MET=True,
329  genJetCollection = genJetCollection,
330  doJetID = True,
331  postfix = postfix
332  )
333 
334  applyPostfix(process, "patJets", postfix).embedCaloTowers = False
335  applyPostfix(process, "patJets", postfix).embedPFCandidates = True
336 
#-- Remove MC dependence ------------------------------------------------------
def jetAlgo
Definition: jetTools.py:6
def applyPostfix
Helpers to perform some technically boring tasks like looking for all modules with a given parameter ...
Definition: helpers.py:6
def switchToPFJets
Definition: pfTools.py:298
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
def pfTools.switchToPFMET (   process,
  input = cms.InputTag('pfMET'),
  type1 = False,
  postfix = "" 
)

Definition at line 276 of file pfTools.py.

References helpers.applyPostfix(), if(), and python.multivaluedict.remove().

Referenced by usePF2PAT().

277 def switchToPFMET(process,input=cms.InputTag('pfMET'), type1=False, postfix=""):
278  print 'MET: using ', input
279  if( not type1 ):
280  oldMETSource = applyPostfix(process, "patMETs",postfix).metSource
281  applyPostfix(process, "patMETs",postfix).metSource = input
282  applyPostfix(process, "patMETs",postfix).addMuonCorrections = False
283  getattr(process, "patDefaultSequence"+postfix).remove(
284  applyPostfix(process, "patMETCorrections",postfix)
285  )
286  else:
287  # type1 corrected MET
288  # name of coreccted MET hardcoded in PAT and meaningless
289  print 'Apply type1 corrections for MET'
290  applyPostfix(process, "metJESCorAK5CaloJet",postfix).inputUncorMetLabel = input.getModuleLabel()
291  applyPostfix(process, "metJESCorAK5CaloJet",postfix).metType = 'PFMET'
292  applyPostfix(process, "metJESCorAK5CaloJet",postfix).jetPTthreshold = 1.0
293  applyPostfix(process, "patMETs",postfix).metSource = "metJESCorAK5CaloJet"+postfix
294  applyPostfix(process, "patMETs",postfix).addMuonCorrections = False
295  getattr(process, "patDefaultSequence"+postfix).remove(
296  applyPostfix(process, "metJESCorAK5CaloJetMuons",postfix)
297  )
def switchToPFMET
Definition: pfTools.py:276
def applyPostfix
Helpers to perform some technically boring tasks like looking for all modules with a given parameter ...
Definition: helpers.py:6
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
def pfTools.tauTypeInPF2PAT (   process,
  tauType = 'shrinkingConePFTau',
  postfix = "" 
)

Definition at line 239 of file pfTools.py.

References helpers.applyPostfix().

240 def tauTypeInPF2PAT(process,tauType='shrinkingConePFTau', postfix = ""):
241  process.load("PhysicsTools.PFCandProducer.pfTaus_cff")
242  applyPostfix(process, "pfTaus",postfix).src = cms.InputTag(tauType+'Producer'+postfix)
243 
def tauTypeInPF2PAT
Definition: pfTools.py:239
def applyPostfix
Helpers to perform some technically boring tasks like looking for all modules with a given parameter ...
Definition: helpers.py:6
def pfTools.usePF2PAT (   process,
  runPF2PAT = True,
  jetAlgo = 'AK5',
  runOnMC = True,
  postfix = "" 
)
Switch PAT to use PF2PAT instead of AOD sources. if 'runPF2PAT' is true, we'll also add PF2PAT in front of the PAT sequence

Definition at line 343 of file pfTools.py.

References adaptPFElectrons(), adaptPFMuons(), adaptPFTaus(), addPFCandidates(), helpers.applyPostfix(), helpers.cloneProcessingSnippet(), helpers.removeIfInSequence(), removeMCMatchingPF2PAT(), linker.replace(), switchToPFJets(), and switchToPFMET().

344 def usePF2PAT(process, runPF2PAT=True, jetAlgo='AK5', runOnMC=True, postfix = ""):
345  # PLEASE DO NOT CLOBBER THIS FUNCTION WITH CODE SPECIFIC TO A GIVEN PHYSICS OBJECT.
346  # CREATE ADDITIONAL FUNCTIONS IF NEEDED.
347 
348  """Switch PAT to use PF2PAT instead of AOD sources. if 'runPF2PAT' is true, we'll also add PF2PAT in front of the PAT sequence"""
349 
350  # -------- CORE ---------------
351  if runPF2PAT:
352  process.load("PhysicsTools.PFCandProducer.PF2PAT_cff")
353  #add Pf2PAT *before* cloning so that overlapping modules are cloned too
354  #process.patDefaultSequence.replace( process.patCandidates, process.PF2PAT+process.patCandidates)
355  process.patPF2PATSequence = cms.Sequence( process.PF2PAT + process.patDefaultSequence)
356  else:
357  process.patPF2PATSequence = cms.Sequence( process.patDefaultSequence )
358 
359  if not postfix == "":
360  from PhysicsTools.PatAlgos.tools.helpers import cloneProcessingSnippet
361  cloneProcessingSnippet(process, process.patPF2PATSequence, postfix)
362  #delete everything pat PF2PAT modules! if you want to test the postfixing for completeness
363  #from PhysicsTools.PatAlgos.tools.helpers import listModules,listSequences
364  #for module in listModules(process.patDefaultSequence):
365  # if not module.label() is None: process.__delattr__(module.label())
366  #for sequence in listSequences(process.patDefaultSequence):
367  # if not sequence.label() is None: process.__delattr__(sequence.label())
368  #del process.patDefaultSequence
369 
370  removeCleaning(process, postfix=postfix)
371 
372  # -------- OBJECTS ------------
373  # Muons
374  adaptPFMuons(process,
375  applyPostfix(process,"patMuons",postfix),
376  postfix)
377 
378  # Electrons
379  adaptPFElectrons(process,
380  applyPostfix(process,"patElectrons",postfix),
381  postfix)
382 
383  # Photons
384  print "Temporarily switching off photons completely"
385 
386  removeSpecificPATObjects(process,['Photons'],False,postfix)
387  removeIfInSequence(process, "patPhotonIsolation", "patDefaultSequence", postfix)
388 
389  # Jets
390  if runOnMC :
391  switchToPFJets( process, cms.InputTag('pfNoTau'+postfix), jetAlgo, postfix=postfix,
392  jetCorrections=['L1Offset','L2Relative','L3Absolute'] )
393  applyPostfix(process,"patDefaultSequence",postfix).replace(
394  applyPostfix(process,"patJetGenJetMatch",postfix),
395  getattr(process,"genForPF2PATSequence") *
396  applyPostfix(process,"patJetGenJetMatch",postfix)
397  )
398  else :
399  switchToPFJets( process, cms.InputTag('pfNoTau'+postfix), jetAlgo, postfix=postfix,
400  jetCorrections=['L1Offset','L2Relative','L3Absolute', 'L2L3Residual'] )
401 
402  # Taus
403  adaptPFTaus( process, tauType='shrinkingConePFTau', postfix=postfix )
404  #adaptPFTaus( process, tauType='fixedConePFTau', postfix=postfix )
405  #adaptPFTaus( process, tauType='hpsPFTau', postfix=postfix )
406 
407  # MET
408  switchToPFMET(process, cms.InputTag('pfMET'+postfix), postfix=postfix)
409 
410  # Unmasked PFCandidates
411  addPFCandidates(process,cms.InputTag('pfNoJet'+postfix),patLabel='PFParticles'+postfix,cut="",postfix=postfix)
412 
413  if runOnMC:
414  process.load("PhysicsTools.PFCandProducer.genForPF2PAT_cff")
415  getattr(process, "patDefaultSequence"+postfix).replace(
416  applyPostfix(process,"patCandidates",postfix),
417  process.genForPF2PATSequence+applyPostfix(process,"patCandidates",postfix)
418  )
419  else:
420  removeMCMatchingPF2PAT( process, postfix )
421 
422  print "Done: PF2PAT interfaced to PAT, postfix=", postfix
def switchToPFMET
Definition: pfTools.py:276
def adaptPFTaus
Definition: pfTools.py:213
def replace
Definition: linker.py:10
def adaptPFMuons
Definition: pfTools.py:32
def cloneProcessingSnippet
Definition: helpers.py:257
def removeMCMatchingPF2PAT
Definition: pfTools.py:337
def applyPostfix
Helpers to perform some technically boring tasks like looking for all modules with a given parameter ...
Definition: helpers.py:6
def usePF2PAT
Definition: pfTools.py:343
def addPFCandidates
Definition: pfTools.py:244
def adaptPFElectrons
Definition: pfTools.py:60
def switchToPFJets
Definition: pfTools.py:298
def removeIfInSequence
Definition: helpers.py:20
def pfTools.warningIsolation ( )

Definition at line 29 of file pfTools.py.

Referenced by adaptPFElectrons(), and adaptPFMuons().

29 
30 def warningIsolation():
31  print "WARNING: particle based isolation must be studied"
def warningIsolation
Definition: pfTools.py:29