CMS 3D CMS Logo

Public Member Functions | Private Attributes | Static Private Attributes

jetTools::AddJetCollection 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 = 'addJetCollection'

Detailed Description

Add a new collection of jets. Takes the configuration from the
already configured standard jet collection as starting point;
replaces before calling addJetCollection will also affect the
new jet collections

Definition at line 208 of file jetTools.py.


Constructor & Destructor Documentation

def jetTools::AddJetCollection::__init__ (   self)

Definition at line 218 of file jetTools.py.

00219                       :
00220         ConfigToolBase.__init__(self)
00221         self.addParameter(self._defaultParameters,'jetCollection',self._defaultValue,'Input jet collection', cms.InputTag)
00222         self.addParameter(self._defaultParameters,'algoLabel',self._defaultValue, "label to indicate the jet algorithm (e.g.'AK5')",str)
00223         self.addParameter(self._defaultParameters,'typeLabel',self._defaultValue, "label to indicate the type of constituents (e.g. 'Calo', 'Pflow', 'Jpt', ...)",str)
00224         self.addParameter(self._defaultParameters,'btagInfo',['impactParameterTagInfos','secondaryVertexTagInfos','softMuonTagInfos','secondaryVertexNegativeTagInfos'],"input btag info",allowedValues=['impactParameterTagInfos','secondaryVertexTagInfos','softMuonTagInfos','secondaryVertexNegativeTagInfos'],Type=list)
00225         self.addParameter(self._defaultParameters,'btagdiscriminators',['jetBProbabilityBJetTags', 'jetProbabilityBJetTags','trackCountingHighPurBJetTags','trackCountingHighEffBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexBJetTags','combinedSecondaryVertexMVABJetTags','softMuonBJetTags','softMuonByPtBJetTags','softMuonByIP3dBJetTags','simpleSecondaryVertexNegativeHighEffBJetTags','simpleSecondaryVertexNegativeHighPurBJetTags','negativeTrackCountingHighEffJetTags','negativeTrackCountingHighPurJetTags'],"input btag discriminators", allowedValues=['jetBProbabilityBJetTags', 'jetProbabilityBJetTags','trackCountingHighPurBJetTags', 'trackCountingHighEffBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexBJetTags','combinedSecondaryVertexMVABJetTags','softMuonBJetTags','softMuonByPtBJetTags','softMuonByIP3dBJetTags','simpleSecondaryVertexNegativeHighEffBJetTags','simpleSecondaryVertexNegativeHighPurBJetTags','negativeTrackCountingHighEffJetTags','negativeTrackCountingHighPurJetTags'],Type=list)
00226         self.addParameter(self._defaultParameters,'doJTA',True, "run b tagging sequence for new jet collection and add it to the new pat jet collection")
00227         self.addParameter(self._defaultParameters,'doBTagging',True, 'run JetTracksAssociation and JetCharge and add it to the new pat jet collection (will autom. be true if doBTagging is set to true)')
00228         self.addParameter(self._defaultParameters,'jetCorrLabel',None, "payload and list of new jet correction labels, such as (\'AK5Calo\',[\'L2Relative\', \'L3Absolute\'])", tuple,acceptNoneValue=True )
00229         self.addParameter(self._defaultParameters,'doType1MET',True, "if jetCorrLabel is not 'None', set this to 'True' to redo the Type1 MET correction for the new jet colllection; at the moment it must be 'False' for non CaloJets otherwise the JetMET POG module crashes. ")
00230         self.addParameter(self._defaultParameters,'doL1Cleaning',True, "copy also the producer modules for cleanLayer1 will be set to 'True' automatically when doL1Counters is 'True'")
00231         self.addParameter(self._defaultParameters,'doL1Counters',False, "copy also the filter modules that accept/reject the event looking at the number of jets")
00232         self.addParameter(self._defaultParameters,'genJetCollection',cms.InputTag("ak5GenJets"), "GenJet collection to match to")
00233         self.addParameter(self._defaultParameters,'doJetID',True, "add jetId variables to the added jet collection?")
00234         self.addParameter(self._defaultParameters,'jetIdLabel',"ak5", " specify the label prefix of the xxxJetID object; in general it is the jet collection tag like ak5, kt4 sc5, aso. For more information have a look to SWGuidePATTools#add_JetCollection")
00235         self.addParameter(self._defaultParameters,'standardAlgo',"AK5", "standard algorithm label of the collection from which the clones for the new jet collection will be taken from (note that this jet collection has to be available in the event before hand)")
00236         self.addParameter(self._defaultParameters,'standardType',"Calo", "standard constituent type label of the collection from which the clones for the new jet collection will be taken from (note that this jet collection has to be available in the event before hand)")
00237         self.addParameter(self._defaultParameters, 'outputModules', ['out'], "output module labels, empty list of label indicates no output, default: ['out']")
00238 
00239         self._parameters=copy.deepcopy(self._defaultParameters)
00240         self._comment = ""


Member Function Documentation

def jetTools::AddJetCollection::__call__ (   self,
  process,
  jetCollection = None,
  algoLabel = None,
  typeLabel = None,
  doJTA = None,
  doBTagging = None,
  jetCorrLabel = None,
  doType1MET = None,
  doL1Cleaning = None,
  doL1Counters = None,
  genJetCollection = None,
  doJetID = None,
  jetIdLabel = None,
  outputModule = None,
  outputModules = None,
  btagInfo = None,
  btagdiscriminators = None 
)

Definition at line 244 of file jetTools.py.

00263                                        :
00264 
00265         ## stop processing if 'outputModule' exists and show the new alternative
00266         if  not outputModule is None:
00267             depricatedOptionOutputModule(self)
00268         if jetCollection  is None:
00269             jetCollection=self._defaultParameters['jetCollection'].value
00270         if algoLabel is None:
00271             algoLabel=self._defaultParameters['algoLabel'].value
00272         if typeLabel is None:
00273             typeLabel=self._defaultParameters['typeLabel'].value
00274         if doJTA is None:
00275             doJTA=self._defaultParameters['doJTA'].value
00276         if doBTagging is None:
00277             doBTagging=self._defaultParameters['doBTagging'].value
00278         if jetCorrLabel  is None:
00279             jetCorrLabel=self._defaultParameters['jetCorrLabel'].value
00280         if doType1MET  is None:
00281             doType1MET=self._defaultParameters['doType1MET'].value
00282         if doL1Cleaning is None:
00283             doL1Cleaning=self._defaultParameters['doL1Cleaning'].value
00284         if doL1Counters  is None:
00285             doL1Counters=self._defaultParameters['doL1Counters'].value
00286         if genJetCollection  is None:
00287             genJetCollection=self._defaultParameters['genJetCollection'].value
00288         if doJetID  is None:
00289             doJetID=self._defaultParameters['doJetID'].value
00290         if jetIdLabel  is None:
00291             jetIdLabel=self._defaultParameters['jetIdLabel'].value
00292         if outputModules is None:
00293             outputModules=self._defaultParameters['outputModules'].value     
00294         if  btagInfo is None:
00295             btagInfo=self._defaultParameters['btagInfo'].value
00296         if  btagdiscriminators is None:
00297             btagdiscriminators=self._defaultParameters['btagdiscriminators'].value
00298 
00299         self.setParameter('jetCollection',jetCollection)
00300         self.setParameter('algoLabel',algoLabel)
00301         self.setParameter('typeLabel',typeLabel)
00302         self.setParameter('doJTA',doJTA)
00303         self.setParameter('doBTagging',doBTagging)
00304         self.setParameter('jetCorrLabel',jetCorrLabel)
00305         self.setParameter('doType1MET',doType1MET)
00306         self.setParameter('doL1Cleaning',doL1Cleaning)
00307         self.setParameter('doL1Counters',doL1Counters)
00308         self.setParameter('genJetCollection',genJetCollection)
00309         self.setParameter('doJetID',doJetID)
00310         self.setParameter('jetIdLabel',jetIdLabel)
00311         self.setParameter('outputModules',outputModules)
00312         self.setParameter('btagInfo',btagInfo)
00313         self.setParameter('btagdiscriminators',btagdiscriminators)
00314  
00315         self.apply(process) 
        
def jetTools::AddJetCollection::getDefaultParameters (   self)

Definition at line 241 of file jetTools.py.

00242                                   :
00243         return self._defaultParameters

def jetTools::AddJetCollection::toolCode (   self,
  process 
)

Definition at line 316 of file jetTools.py.

00316                                :        
00317 
00318         jetCollection=self._parameters['jetCollection'].value
00319         algoLabel=self._parameters['algoLabel'].value
00320         typeLabel=self._parameters['typeLabel'].value
00321         doJTA=self._parameters['doJTA'].value
00322         doBTagging=self._parameters['doBTagging'].value
00323         jetCorrLabel=self._parameters['jetCorrLabel'].value
00324         doType1MET =self._parameters['doType1MET'].value
00325         doL1Cleaning=self._parameters['doL1Cleaning'].value
00326         doL1Counters=self._parameters['doL1Counters'].value
00327         genJetCollection=self._parameters['genJetCollection'].value
00328         doJetID=self._parameters['doJetID'].value
00329         jetIdLabel=self._parameters['jetIdLabel'].value
00330         outputModules=self._parameters['outputModules'].value
00331         btagInfo=self._parameters['btagInfo'].value
00332         btagdiscriminators=self._parameters['btagdiscriminators'].value
00333 
00334 
00335         ## create old module label from standardAlgo
00336         ## and standardType and return
00337         def oldLabel(prefix=''):        
00338             return jetCollectionString(prefix, '', '')
00339 
00340         ## create new module label from old module
00341         ## label and return
00342         def newLabel(oldLabel):
00343             newLabel=oldLabel
00344             oldLabel=oldLabel+algoLabel+typeLabel
00345             return oldLabel
00346 
00347         ## clone module and add it to the patDefaultSequence
00348         def addClone(hook, **replaceStatements):
00349             ## create a clone of the hook with corresponding
00350             ## parameter replacements
00351             newModule = getattr(process, hook).clone(**replaceStatements)
00352             ## add the module to the sequence
00353             addModuleToSequence(hook, newModule)
00354 
00355         ## add module to the patDefaultSequence
00356         def addModuleToSequence(hook, newModule):
00357             hookModule = getattr(process, hook)
00358             ## add the new module with standardAlgo &
00359             ## standardType replaced in module label
00360             setattr( process, newLabel(hook), newModule)
00361             ## add new module to default sequence
00362             ## just behind the hookModule
00363             process.patDefaultSequence.replace( hookModule, hookModule*newModule )
00364 
00365         ## add a clone of patJets
00366         addClone(oldLabel(), jetSource = jetCollection)
00367         ## add a clone of selectedPatJets    
00368         addClone(oldLabel('selected'), src=cms.InputTag(newLabel(oldLabel())))
00369         ## add a clone of cleanPatJets    
00370         if( doL1Cleaning ):
00371             addClone(oldLabel('clean'), src=cms.InputTag(newLabel(oldLabel('selected'))))
00372         ## add a clone of countPatJets    
00373         if( doL1Counters ):
00374             if( doL1Cleaning ):
00375                 addClone(oldLabel('count'), src=cms.InputTag(newLabel(oldLabel('clean'))))
00376             else:
00377                 addClone(oldLabel('count'), src=cms.InputTag(newLabel(oldLabel('selected'))))            
00378 
00379         ## get attributes of new module
00380         l1Jets = getattr(process, newLabel(oldLabel()))
00381 
00382         ## add a clone of gen jet matching
00383         addClone('patJetPartonMatch', src = jetCollection)
00384         addClone('patJetGenJetMatch', src = jetCollection, matched = genJetCollection)
00385 
00386         ## add a clone of parton and flavour associations
00387         addClone('patJetPartonAssociation', jets = jetCollection)
00388         addClone('patJetFlavourAssociation', srcByReference = cms.InputTag(newLabel('patJetPartonAssociation')))
00389 
00390         ## fix label for input tag
00391         def fixInputTag(x): x.setModuleLabel(newLabel(x.moduleLabel))
00392         ## fix label for vector of input tags
00393         def fixVInputTag(x): x[0].setModuleLabel(newLabel(x[0].moduleLabel))
00394 
00395         ## provide allLayer1Jet inputs with individual labels
00396         fixInputTag(l1Jets.genJetMatch)
00397         fixInputTag(l1Jets.genPartonMatch)
00398         fixInputTag(l1Jets.JetPartonMapSource)
00399 
00400         ## make VInputTag from strings 
00401         def vit(*args) : return cms.VInputTag( *[ cms.InputTag(x) for x in args ] )
00402 
00403         if (doJTA or doBTagging):
00404             ## add clone of jet track association        
00405             process.load("RecoJets.JetAssociationProducers.ak5JTA_cff")
00406             from RecoJets.JetAssociationProducers.ak5JTA_cff import ak5JetTracksAssociatorAtVertex
00407             ## add jet track association module to processes
00408             jtaLabel = 'jetTracksAssociatorAtVertex'+algoLabel+typeLabel
00409             setattr( process, jtaLabel, ak5JetTracksAssociatorAtVertex.clone(jets = jetCollection) )
00410             process.patDefaultSequence.replace(process.patJetCharge, getattr(process,jtaLabel)+process.patJetCharge)
00411             l1Jets.trackAssociationSource = cms.InputTag(jtaLabel)
00412             addClone('patJetCharge', src=cms.InputTag(jtaLabel)),
00413             fixInputTag(l1Jets.jetChargeSource)
00414         else:
00415             ## switch embedding of track association and jet
00416             ## charge estimate to 'False'        
00417             l1Jets.addAssociatedTracks = False
00418             l1Jets.addJetCharge = False
00419 
00420         if (doBTagging):
00421             ## define postfixLabel
00422             postfixLabel=algoLabel+typeLabel
00423             ## add b tagging sequence
00424             (btagSeq, btagLabels) = runBTagging(process, jetCollection, postfixLabel,"", btagInfo,btagdiscriminators) 
00425             ## add b tagging sequence before running the allLayer1Jets modules
00426             process.patDefaultSequence.replace(getattr(process,jtaLabel), getattr(process,jtaLabel)+btagSeq)
00427             ## replace corresponding tags for pat jet production
00428             l1Jets.trackAssociationSource = cms.InputTag(btagLabels['jta'])
00429             l1Jets.tagInfoSources = cms.VInputTag( *[ cms.InputTag(x) for x in btagLabels['tagInfos'] ] )
00430             l1Jets.discriminatorSources = cms.VInputTag( *[ cms.InputTag(x) for x in btagLabels['jetTags']  ] )
00431         else:
00432             ## switch general b tagging info switch off
00433             l1Jets.addBTagInfo = False
00434             ## adjust output
00435             if len(outputModules) > 0:
00436                 for outMod in outputModules:
00437                     if hasattr(process,outMod):
00438                         getattr(process,outMod).outputCommands.append("drop *_"+newLabel(oldLabel('selected'))+"_tagInfos_*")
00439                     else:
00440                         raise KeyError, "process has no OutModule named", outMod
00441 
00442         if (doJetID):
00443             l1Jets.addJetID = cms.bool(True)
00444             jetIdLabelNew = jetIdLabel + 'JetID'
00445             l1Jets.jetIDMap = cms.InputTag( jetIdLabelNew )
00446         else :
00447             l1Jets.addJetID = cms.bool(False)
00448 
00449         if (jetCorrLabel != None):
00450             ## add clone of jet energy corrections;
00451             ## catch a couple of exceptions first
00452             if (jetCorrLabel == False ):
00453                 raise ValueError, "In addJetCollection 'jetCorrLabel' must be set to 'None', not 'False'"
00454             if (jetCorrLabel == "None"):
00455                 raise ValueError, "In addJetCollection 'jetCorrLabel' must be set to 'None' (without quotes)"
00456             ## check for the correct format
00457             if type(jetCorrLabel) != type(('AK5Calo',['L2Relative'])): 
00458                 raise ValueError, "In addJetCollection 'jetCorrLabel' must be 'None', or of type ('payload',['correction1', 'correction2'])"            
00459 
00460             ## add clone of jetCorrFactors
00461             addClone('patJetCorrFactors', src = jetCollection)
00462             switchJetCorrLevels(process, jetCorrLabel = jetCorrLabel, postfix=algoLabel+typeLabel)
00463             getattr(process, newLabel('patJets')).jetCorrFactorsSource = cms.VInputTag(  cms.InputTag(newLabel('patJetCorrFactors')) )
00464         
00465             ## find out type of jet collection, switch type1MET corrections off for JPTJets
00466             jetCollType = ''
00467             if   ( 'CaloJets' in jetCollection.getModuleLabel() ):
00468                 jetCollType = 'Calo'
00469             elif ( 'PFJets' in jetCollection.getModuleLabel() or jetCollection.getModuleLabel().startswith('pfNo') or jetCollection.getModuleLabel() == 'particleFlow'):
00470                 jetCollType = 'PF'
00471             else:
00472                 print '============================================='
00473                 print 'Type1MET corrections are switched off for    '
00474                 print 'JPT Jets. Users are recommened to use tcMET  '
00475                 print 'together with JPT jets.                      '
00476                 print '============================================='
00477                 doType1MET=False
00478 
00479             ## add a clone of the type1MET correction for the new jet collection
00480             if (doType1MET):
00481                 ## create jet correctors for MET corrections
00482                 from JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff import ak5PFL1Fastjet, ak5PFL1Offset, ak5PFL2Relative, ak5PFL3Absolute, ak5PFResidual
00483                 setattr(process, jetCorrLabel[0]+'L1FastJet'   , ak5PFL1Fastjet.clone ( algorithm=jetCorrLabel[0]
00484                                                                                       , srcRho=cms.InputTag(newLabel('kt6'+jetCollType+'Jets'),'rho') ) )
00485                 setattr(process, jetCorrLabel[0]+'L1Offset'    , ak5PFL1Offset.clone  ( algorithm=jetCorrLabel[0] ) )
00486                 setattr(process, jetCorrLabel[0]+'L2Relative'  , ak5PFL2Relative.clone( algorithm=jetCorrLabel[0] ) )
00487                 setattr(process, jetCorrLabel[0]+'L3Absolute'  , ak5PFL3Absolute.clone( algorithm=jetCorrLabel[0] ) )
00488                 setattr(process, jetCorrLabel[0]+'L2L3Residual', ak5PFResidual.clone  ( algorithm=jetCorrLabel[0] ) )
00489                 ## combinded corrections
00490                 setattr(process, jetCorrLabel[0]+'CombinedCorrector', cms.ESProducer( 'JetCorrectionESChain'
00491                                                                                   , correctors = cms.vstring() ) )
00492                 
00493                 for corrLbl in jetCorrLabel[1]:
00494                     if corrLbl != 'L1FastJet' and corrLbl != 'L1Offset' and corrLbl != 'L2Relative' and corrLbl != 'L3Absolute' and corrLbl != 'L2L3Residual':
00495                         print '========================================='
00496                         print ' Type1MET corrections are currently only  '
00497                         print ' supported for the following corrections: '
00498                         print '   - L1FastJet'
00499                         print '   - L1Offset'
00500                         print '   - L2Relative'
00501                         print '   - L3Absolute'
00502                         print '   - L2L3Residual'
00503                         print ' But given was:'
00504                         print '   -', corrLbl
00505                         print '============================================='
00506                         raise ValueError, 'unsupported JEC for TypeI MET correction: '+corrLbl
00507                     else:
00508                         getattr(process, jetCorrLabel[0]+'CombinedCorrector').correctors.append(jetCorrLabel[0]+corrLbl)
00509 
00510                 ## configuration of MET corrections
00511                 if jetCollType == 'Calo':
00512                     from JetMETCorrections.Type1MET.caloMETCorrections_cff import caloJetMETcorr,caloType1CorrectedMet,caloType1p2CorrectedMet,produceCaloMETCorrections
00513                     
00514                     setattr(process,jetCorrLabel[0]+'JetMETcorr',   caloJetMETcorr.clone(srcMET       = "corMetGlobalMuons"))
00515                     setattr(process,jetCorrLabel[0]+'Type1CorMet',  caloType1CorrectedMet.clone(src   = "corMetGlobalMuons"))
00516                     setattr(process,jetCorrLabel[0]+'Type1p2CorMet',caloType1p2CorrectedMet.clone(src = "corMetGlobalMuons"))
00517                     
00518                     getattr(process,jetCorrLabel[0]+'JetMETcorr'   ).src          = cms.InputTag(jetCollection.getModuleLabel())
00519                     if ('L1FastJet' in jetCorrLabel[1] or 'L1Fastjet' in jetCorrLabel[1]):
00520                         getattr(process,jetCorrLabel[0]+'JetMETcorr'   ).offsetCorrLabel = cms.string(jetCorrLabel[0]+'L1FastJet')
00521                     elif ('L1Offset' in jetCorrLabel[1]):
00522                         getattr(process,jetCorrLabel[0]+'JetMETcorr'   ).offsetCorrLabel = cms.string(jetCorrLabel[0]+'L1Offset')
00523                     else:
00524                         getattr(process,jetCorrLabel[0]+'JetMETcorr'   ).offsetCorrLabel = cms.string('')
00525                     getattr(process,jetCorrLabel[0]+'JetMETcorr'   ).jetCorrLabel = cms.string(jetCorrLabel[0]+'CombinedCorrector')
00526 
00527                     getattr(process,jetCorrLabel[0]+'Type1CorMet'  ).srcType1Corrections = cms.VInputTag(
00528                         cms.InputTag(jetCorrLabel[0]+'JetMETcorr', 'type1')
00529                         )
00530                     
00531                     getattr(process,jetCorrLabel[0]+'Type1p2CorMet').srcType1Corrections = cms.VInputTag(
00532                         cms.InputTag(jetCorrLabel[0]+'JetMETcorr', 'type1')
00533                         )
00534                     getattr(process,jetCorrLabel[0]+'Type1p2CorMet').srcUnclEnergySums = cms.VInputTag(
00535                         cms.InputTag(jetCorrLabel[0]+'JetMETcorr', 'type2'),
00536                         cms.InputTag(jetCorrLabel[0]+'JetMETcorr', 'offset'),
00537                         cms.InputTag('muonCaloMETcorr')
00538                         )
00539 
00540                     ## add MET corrections to sequence
00541                     addClone('patMETs', metSource = cms.InputTag(jetCorrLabel[0]+'Type1CorMet'))
00542                     
00543                     setattr(process,'produce'+jetCorrLabel[0]+'METCorrections',produceCaloMETCorrections.copy())
00544                     getattr(process,'produce'+jetCorrLabel[0]+'METCorrections').replace(getattr(process,'caloJetMETcorr'),         getattr(process,jetCorrLabel[0]+'JetMETcorr'))
00545                     getattr(process,'produce'+jetCorrLabel[0]+'METCorrections').replace(getattr(process,'caloType1CorrectedMet'),  getattr(process,jetCorrLabel[0]+'Type1CorMet'))
00546                     getattr(process,'produce'+jetCorrLabel[0]+'METCorrections').replace(getattr(process,'caloType1p2CorrectedMet'),getattr(process,jetCorrLabel[0]+'Type1p2CorMet'))
00547                     process.patDefaultSequence.replace( getattr(process,newLabel('patMETs')),
00548                                                         getattr(process,'produce'+jetCorrLabel[0]+'METCorrections')
00549                                                         *getattr(process,newLabel('patMETs')) )                    
00550                 elif jetCollType == 'PF':
00551                     from JetMETCorrections.Type1MET.pfMETCorrections_cff import pfCandsNotInJet,pfJetMETcorr,pfCandMETcorr,pfType1CorrectedMet,pfType1p2CorrectedMet,producePFMETCorrections
00552                     setattr(process,jetCorrLabel[0]+'CandsNotInJet',pfCandsNotInJet.clone(topCollection = jetCollection))
00553                     setattr(process,jetCorrLabel[0]+'JetMETcorr',   pfJetMETcorr.clone(src              = jetCollection))
00554                     setattr(process,jetCorrLabel[0]+'CandMETcorr',  pfCandMETcorr.clone(src             = cms.InputTag(jetCorrLabel[0]+'CandsNotInJet')))
00555                     setattr(process,jetCorrLabel[0]+'Type1CorMet',  pfType1CorrectedMet.clone())
00556                     setattr(process,jetCorrLabel[0]+'Type1p2CorMet',pfType1p2CorrectedMet.clone())
00557 
00558                     if ('L1FastJet' in jetCorrLabel[1] or 'L1Fastjet' in jetCorrLabel[1]):
00559                         getattr(process,jetCorrLabel[0]+'JetMETcorr'   ).offsetCorrLabel = cms.string(jetCorrLabel[0]+'L1FastJet')
00560                     elif ('L1Offset' in jetCorrLabel[1]):
00561                         getattr(process,jetCorrLabel[0]+'JetMETcorr'   ).offsetCorrLabel = cms.string(jetCorrLabel[0]+'L1Offset')
00562                     else:
00563                         getattr(process,jetCorrLabel[0]+'JetMETcorr'   ).offsetCorrLabel = cms.string('')
00564                     getattr(process,jetCorrLabel[0]+'JetMETcorr').jetCorrLabel    = cms.string(jetCorrLabel[0]+'CombinedCorrector')
00565 
00566                     getattr(process,jetCorrLabel[0]+'Type1CorMet').srcType1Corrections = cms.VInputTag(
00567                         cms.InputTag(jetCorrLabel[0]+'JetMETcorr', 'type1')
00568                         )
00569                     getattr(process,jetCorrLabel[0]+'Type1p2CorMet').srcType1Corrections = cms.VInputTag(
00570                         cms.InputTag(jetCorrLabel[0]+'JetMETcorr', 'type1')
00571                         )
00572                     getattr(process,jetCorrLabel[0]+'Type1p2CorMet').srcUnclEnergySums = cms.VInputTag(
00573                         cms.InputTag(jetCorrLabel[0]+'JetMETcorr', 'type2'),
00574                         cms.InputTag(jetCorrLabel[0]+'JetMETcorr', 'offset'),
00575                         cms.InputTag(jetCorrLabel[0]+'CandMETcorr')                                    
00576                         )
00577 
00578                     ## add MET corrections to sequence
00579                     addClone('patMETs', metSource = cms.InputTag(jetCorrLabel[0]+'Type1CorMet'), addMuonCorrections = False)
00580                     setattr(process,'produce'+jetCorrLabel[0]+'METCorrections',producePFMETCorrections.copy())
00581                     getattr(process,'produce'+jetCorrLabel[0]+'METCorrections').replace(getattr(process,'pfCandsNotInJet'),      getattr(process,jetCorrLabel[0]+'CandsNotInJet'))
00582                     getattr(process,'produce'+jetCorrLabel[0]+'METCorrections').replace(getattr(process,'pfJetMETcorr'),         getattr(process,jetCorrLabel[0]+'JetMETcorr'))
00583                     getattr(process,'produce'+jetCorrLabel[0]+'METCorrections').replace(getattr(process,'pfCandMETcorr'),        getattr(process,jetCorrLabel[0]+'CandMETcorr'))
00584                     getattr(process,'produce'+jetCorrLabel[0]+'METCorrections').replace(getattr(process,'pfType1CorrectedMet'),  getattr(process,jetCorrLabel[0]+'Type1CorMet'))
00585                     getattr(process,'produce'+jetCorrLabel[0]+'METCorrections').replace(getattr(process,'pfType1p2CorrectedMet'),getattr(process,jetCorrLabel[0]+'Type1p2CorMet'))
00586                     process.patDefaultSequence.replace( getattr(process,newLabel('patMETs')),
00587                                                         getattr(process,'produce'+jetCorrLabel[0]+'METCorrections')
00588                                                         *getattr(process,newLabel('patMETs')) )
00589         else:
00590             ## switch jetCorrFactors off
00591             l1Jets.addJetCorrFactors = False
00592                
00593 addJetCollection=AddJetCollection()
00594 
00595 

Member Data Documentation

Definition at line 218 of file jetTools.py.

tuple jetTools::AddJetCollection::_defaultParameters = dicttypes.SortedKeysDict() [static, private]

Definition at line 216 of file jetTools.py.

string jetTools::AddJetCollection::_label = 'addJetCollection' [static, private]

Definition at line 215 of file jetTools.py.

Definition at line 218 of file jetTools.py.