ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/DGele/PhysicsTools/PatAlgos/python/tools/metTools.py
Revision: 1.1.1.1 (vendor branch)
Committed: Tue Oct 20 17:15:14 2009 UTC (15 years, 6 months ago) by dgele
Content type: text/x-python
Branch: ANA
CVS Tags: start
Changes since 1.1: +0 -0 lines
Log Message:
version CMSSW_2_2_10

File Contents

# Content
1 import FWCore.ParameterSet.Config as cms
2
3
4 def addTcMET(process,
5 postfixLabel = 'TC'):
6 """
7 ------------------------------------------------------------------
8 add track corrected MET collection to patEventContent:
9
10 process : process
11 ------------------------------------------------------------------
12 """
13 ## add module as process to the default sequence
14 def addAlso (label,value):
15 existing = getattr(process, label)
16 setattr( process, label+postfixLabel, value)
17 process.patDefaultSequence.replace( existing, existing*value )
18
19 ## clone and add a module as process to the
20 ## default sequence
21 def addClone(label,**replaceStatements):
22 new = getattr(process, label).clone(**replaceStatements)
23 addAlso(label, new)
24
25 ## addClone('corMetType1Icone5Muons', uncorMETInputTag = cms.InputTag("tcMet"))
26 addClone('layer1METs', metSource = cms.InputTag("tcMet"),
27 addTrigMatch = False
28 )
29
30 ## add new met collections output to the pat summary
31 process.allLayer1Summary.candidates += [ cms.InputTag('layer1METs'+postfixLabel) ]