CMS 3D CMS Logo

Public Member Functions | Private Attributes | Static Private Attributes

metTools::AddPfMET Class Reference

Inherits FWCore::GuiBrowsers::ConfigToolBase::ConfigToolBase.

List of all members.

Public Member Functions

def __call__
def __init__
def getDefaultParameters
def toolCode

Private Attributes

 _comment
 _parameters

Static Private Attributes

tuple _defaultParameters = dicttypes.SortedKeysDict()
string _label = 'addPfMET'

Detailed Description

Add pflow MET collection to patEventContent

Definition at line 51 of file metTools.py.


Constructor & Destructor Documentation

def metTools::AddPfMET::__init__ (   self)

Definition at line 58 of file metTools.py.

00059                       :
00060         ConfigToolBase.__init__(self)
00061         self.addParameter(self._defaultParameters,'postfixLabel','PF', '')
00062         self._parameters=copy.deepcopy(self._defaultParameters)
00063         self._comment = ''
        

Member Function Documentation

def metTools::AddPfMET::__call__ (   self,
  process,
  postfixLabel = None 
)

Definition at line 67 of file metTools.py.

00068                                                 :
00069         if  postfixLabel is None:
00070             postfixLabel=self._defaultParameters['postfixLabel'].value 
00071         self.setParameter('postfixLabel',postfixLabel)
00072         self.apply(process) 

def metTools::AddPfMET::getDefaultParameters (   self)

Definition at line 64 of file metTools.py.

00065                                   :
00066         return self._defaultParameters
        
def metTools::AddPfMET::toolCode (   self,
  process 
)

Definition at line 73 of file metTools.py.

00073                                : 
00074         postfixLabel=self._parameters['postfixLabel'].value
00075 
00076 
00077         ## add module as process to the default sequence
00078         def addAlso (label,value):
00079             existing = getattr(process, label)
00080             setattr( process, label+postfixLabel, value)
00081             process.patDefaultSequence.replace( existing, existing*value )        
00082             
00083         ## clone and add a module as process to the
00084         ## default sequence
00085         def addClone(label,**replaceStatements):
00086             new = getattr(process, label).clone(**replaceStatements)
00087             addAlso(label, new)
00088 
00089         ## addClone('corMetType1Icone5Muons', uncorMETInputTag = cms.InputTag("tcMet"))
00090         addClone('patMETs', metSource = cms.InputTag("pfMet"), addMuonCorrections = False)
00091 
00092         ## add new met collections output to the pat summary
00093         process.patCandidateSummary.candidates += [ cms.InputTag('patMETs'+postfixLabel) ]
00094 
00095        
00096 addPfMET=AddPfMET()
00097 

Member Data Documentation

Definition at line 58 of file metTools.py.

tuple metTools::AddPfMET::_defaultParameters = dicttypes.SortedKeysDict() [static, private]

Definition at line 56 of file metTools.py.

string metTools::AddPfMET::_label = 'addPfMET' [static, private]

Definition at line 55 of file metTools.py.

Definition at line 58 of file metTools.py.