CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes
cmsswVersionTools.SwitchJetCollection35X Class Reference
Inheritance diagram for cmsswVersionTools.SwitchJetCollection35X:

Public Member Functions

def __call__
 
def __init__
 
def getDefaultParameters
 
def toolCode
 
def vit
 replace input jet collection for pat jet production More...
 

Static Public Attributes

tuple correctors
 redo the type1MET correction for the new jet collection More...
 
 doType1MET = False
 replace jet energy corrections; catch a couple of exceptions first More...
 
string jetIdLabelNew = jetIdLabel+'JetID'
 remove the jet track association from the std sequence More...
 
tuple switchJetCollection35X = SwitchJetCollection35X()
 configure the type1MET correction the following muonMET corrections have the metJESCorAK5CaloJet as input and are automatically correct More...
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

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

Detailed Description

------------------------------------------------------------------
Switch the collection of jets in PAT from the default value to a
new jet collection. This is a re-implementation to run the 36X
version of PAT on 35X input samples.
------------------------------------------------------------------

Definition at line 558 of file cmsswVersionTools.py.

Constructor & Destructor Documentation

def cmsswVersionTools.SwitchJetCollection35X.__init__ (   self)

Definition at line 569 of file cmsswVersionTools.py.

References python.editorTools.UserCodeTool._defaultParameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, python.editorTools.ChangeSource._defaultParameters, cmsswVersionTools.RunBTagging35X._defaultParameters, cmsswVersionTools.AddJetCollection35X._defaultParameters, cmsswVersionTools.SwitchJetCollection35X._defaultParameters, python.ConfigToolBase.ConfigToolBase._defaultValue, GenObject.GenObject._defaultValue, root::helper::RootFunctionAdapter< F, args >.addParameter(), root::helper::RootFunctionHelper< F, args, Tag >.addParameter(), ParameterMgr.addParameter(), fit::RootMinuit< Function >.addParameter(), DropBoxMetadata::Parameters.addParameter(), PythonParameterSet.addParameter(), LutXml.addParameter(), python.ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

570  def __init__(self):
571  ConfigToolBase.__init__(self)
572  self.addParameter(self._defaultParameters,'jetCollection',self._defaultValue,'Input jet collection', cms.InputTag)
573  self.addParameter(self._defaultParameters,'doJTA',True, "run b tagging sequence for new jet collection and add it to the new pat jet collection")
574  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)')
575  self.addParameter(self._defaultParameters,'jetCorrLabel',None, "algorithm and type of JEC; use 'None' for no JEC; examples are ('AK5','Calo'), ('SC7','Calo'), ('KT4','PF')", tuple,acceptNoneValue=True)
576  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 colleection; at the moment it must be 'False' for non CaloJets otherwise the JetMET POG module crashes. ")
577  self.addParameter(self._defaultParameters,'genJetCollection',cms.InputTag("ak5GenJets"), "GenJet collection to match to")
578  self.addParameter(self._defaultParameters,'doJetID',True, "add jetId variables to the added jet collection")
579  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")
580  self.addParameter(self._defaultParameters,'postfix',"", "postfix of default sequence")
582  self._parameters=copy.deepcopy(self._defaultParameters)
583  self._comment = ""

Member Function Documentation

def cmsswVersionTools.SwitchJetCollection35X.__call__ (   self,
  process,
  jetCollection = None,
  doJTA = None,
  doBTagging = None,
  jetCorrLabel = None,
  doType1MET = None,
  genJetCollection = None,
  doJetID = None,
  jetIdLabel = None,
  postfix = None 
)

Definition at line 596 of file cmsswVersionTools.py.

References python.editorTools.UserCodeTool._defaultParameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, python.editorTools.ChangeSource._defaultParameters, cmsswVersionTools.RunBTagging35X._defaultParameters, cmsswVersionTools.AddJetCollection35X._defaultParameters, cmsswVersionTools.SwitchJetCollection35X._defaultParameters, SignedImpactParameter3D.apply(), SignedTransverseImpactParameter.apply(), SignedDecayLength3D.apply(), SurveyParameters.apply(), gen::PhotosInterface.apply(), FWPSetCellEditor.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), jetTools.RunBTagging.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), python.ConfigToolBase.ConfigToolBase.apply(), AlignmentParameters.apply(), BowedSurfaceAlignmentParameters.apply(), python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.apply(), TwoBowedSurfacesAlignmentParameters.apply(), python.Vispa.Gui.BoxContentDialog.BoxContentDialog.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), python.Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog.apply(), reco::Add< T >.apply(), reco::Sub< T >.apply(), reco::Mul< T >.apply(), reco::Div< T >.apply(), reco::And< bool >.apply(), cmsswVersionTools.RunBTagging35X.apply(), reco::Or< bool >.apply(), reco::Less< T >.apply(), reco::LessEqual< T >.apply(), reco::More< T >.apply(), reco::MoreEqual< T >.apply(), reco::Equal< T >.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), PedeReader.setParameter(), fit::RootMinuit< Function >.setParameter(), and python.ConfigToolBase.ConfigToolBase.setParameter().

Referenced by cmsswVersionTools.SwitchJetCollection35X.getDefaultParameters().

597  postfix = None):
598 
599  if jetCollection is None:
600  jetCollection=self._defaultParameters['jetCollection'].value
601  if doJTA is None:
602  doJTA=self._defaultParameters['doJTA'].value
603  if doBTagging is None:
604  doBTagging=self._defaultParameters['doBTagging'].value
605  if jetCorrLabel is None:
606  jetCorrLabel=self._defaultParameters['jetCorrLabel'].value
607  if doType1MET is None:
608  doType1MET=self._defaultParameters['doType1MET'].value
609  if genJetCollection is None:
610  genJetCollection=self._defaultParameters['genJetCollection'].value
611  if doJetID is None:
612  doJetID=self._defaultParameters['doJetID'].value
613  if jetIdLabel is None:
614  jetIdLabel=self._defaultParameters['jetIdLabel'].value
615  if postfix is None:
616  postfix=self._defaultParameters['postfix'].value
617 
618  self.setParameter('jetCollection',jetCollection)
619  self.setParameter('doJTA',doJTA)
620  self.setParameter('doBTagging',doBTagging)
621  self.setParameter('jetCorrLabel',jetCorrLabel)
622  self.setParameter('doType1MET',doType1MET)
623  self.setParameter('genJetCollection',genJetCollection)
624  self.setParameter('doJetID',doJetID)
625  self.setParameter('jetIdLabel',jetIdLabel)
626  self.setParameter('postfix',postfix)
627 
628  self.apply(process)
def cmsswVersionTools.SwitchJetCollection35X.getDefaultParameters (   self)

Definition at line 584 of file cmsswVersionTools.py.

References cmsswVersionTools.SwitchJetCollection35X.__call__(), python.editorTools.UserCodeTool._defaultParameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, python.editorTools.ChangeSource._defaultParameters, cmsswVersionTools.RunBTagging35X._defaultParameters, cmsswVersionTools.AddJetCollection35X._defaultParameters, and cmsswVersionTools.SwitchJetCollection35X._defaultParameters.

Referenced by cmsswVersionTools.PickRelValInputFiles.__call__(), cmsswVersionTools.PickRelValInputFiles.__init__(), cmsswVersionTools.PickRelValInputFiles.apply(), trigTools.SwitchOnTrigger.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), and trigTools.SwitchOnTriggerMatchingStandAlone.toolCode().

585  def getDefaultParameters(self):
586  return self._defaultParameters
def cmsswVersionTools.SwitchJetCollection35X.toolCode (   self,
  process 
)

Definition at line 629 of file cmsswVersionTools.py.

References python.editorTools.UserCodeTool._parameters, python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, python.ConfigToolBase.ConfigToolBase._parameters, python.editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, cmsswVersionTools.RunBTagging35X._parameters, cmsswVersionTools.AddJetCollection35X._parameters, cmsswVersionTools.SwitchJetCollection35X._parameters, and helpers.applyPostfix().

630  def toolCode(self, process):
631  jetCollection=self._parameters['jetCollection'].value
632  doJTA=self._parameters['doJTA'].value
633  doBTagging=self._parameters['doBTagging'].value
634  jetCorrLabel=self._parameters['jetCorrLabel'].value
635  doType1MET =self._parameters['doType1MET'].value
636  genJetCollection=self._parameters['genJetCollection'].value
637  doJetID=self._parameters['doJetID'].value
638  jetIdLabel=self._parameters['jetIdLabel'].value
639  postfix=self._parameters['postfix'].value
640 
641 
642  ## save label of old input jet collection
643  oldLabel = applyPostfix(process, "patJets", postfix).jetSource;
644 
## replace input jet collection for generator matches
def applyPostfix
Helpers to perform some technically boring tasks like looking for all modules with a given parameter ...
Definition: helpers.py:6
def cmsswVersionTools.SwitchJetCollection35X.vit (   args)

replace input jet collection for pat jet production

make VInputTag from strings

Definition at line 653 of file cmsswVersionTools.py.

References helpers.applyPostfix(), helpers.removeIfInSequence(), and python.rootplot.root2matplotlib.replace().

654  def vit(*args) : return cms.VInputTag( *[ cms.InputTag(x) for x in args ] )
def vit
replace input jet collection for pat jet production

Member Data Documentation

cmsswVersionTools.SwitchJetCollection35X._comment
private

Definition at line 582 of file cmsswVersionTools.py.

tuple cmsswVersionTools.SwitchJetCollection35X._defaultParameters = dicttypes.SortedKeysDict()
staticprivate

Definition at line 568 of file cmsswVersionTools.py.

Referenced by electronTools.AddElectronUserIsolation.__call__(), photonTools.AddPhotonUserIsolation.__call__(), metTools.AddTcMET.__call__(), muonTools.AddMuonUserIsolation.__call__(), HiCoreTools.RestrictInputToAOD.__call__(), coreTools.RestrictInputToAOD.__call__(), trackTools.MakeAODTrackCandidates.__call__(), jetTools.RunBTagging.__call__(), metTools.AddPfMET.__call__(), HiCoreTools.RemoveMCMatching.__call__(), coreTools.RunOnData.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), coreTools.RemoveMCMatching.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), jetTools.AddJetCollection.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), coreTools.RemoveAllPATObjectsBut.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), coreTools.RemoveSpecificPATObjects.__call__(), tauTools.AddTauCollection.__call__(), HiCoreTools.RemoveCleaning.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.AddCleaning.__call__(), coreTools.RemoveCleaning.__call__(), coreTools.AddCleaning.__call__(), jetTools.SwitchJetCollection.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), cmsswVersionTools.SwitchJetCollection35X.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetID.__call__(), jetTools.SetTagInfos.__call__(), trigTools.RemoveCleaningFromTriggerMatching.__call__(), jetTools.SwitchJetCorrLevels.__call__(), photonTools.AddPhotonUserIsolation.__init__(), electronTools.AddElectronUserIsolation.__init__(), trackTools.MakeAODTrackCandidates.__init__(), metTools.AddTcMET.__init__(), muonTools.AddMuonUserIsolation.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), coreTools.RestrictInputToAOD.__init__(), jetTools.RunBTagging.__init__(), HiCoreTools.RemoveMCMatching.__init__(), metTools.AddPfMET.__init__(), coreTools.RunOnData.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), coreTools.RemoveMCMatching.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), jetTools.AddJetCollection.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), coreTools.RemoveAllPATObjectsBut.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), trackTools.MakeTrackCandidates.__init__(), coreTools.RemoveSpecificPATObjects.__init__(), tauTools.AddTauCollection.__init__(), HiCoreTools.RemoveCleaning.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.AddCleaning.__init__(), coreTools.RemoveCleaning.__init__(), coreTools.AddCleaning.__init__(), jetTools.SwitchJetCollection.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), cmsswVersionTools.SwitchJetCollection35X.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), jetTools.AddJetID.__init__(), jetTools.SetTagInfos.__init__(), trigTools.RemoveCleaningFromTriggerMatching.__init__(), jetTools.SwitchJetCorrLevels.__init__(), cmsswVersionTools.PickRelValInputFiles.__init__(), python.ConfigToolBase.ConfigToolBase.getAllowedValues(), photonTools.AddPhotonUserIsolation.getDefaultParameters(), electronTools.AddElectronUserIsolation.getDefaultParameters(), metTools.AddTcMET.getDefaultParameters(), heavyIonTools.ConfigureHeavyIons.getDefaultParameters(), muonTools.AddMuonUserIsolation.getDefaultParameters(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), coreTools.RestrictInputToAOD.getDefaultParameters(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), jetTools.RunBTagging.getDefaultParameters(), heavyIonTools.ProductionDefaults.getDefaultParameters(), metTools.AddPfMET.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), coreTools.RunOnData.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), coreTools.RemoveMCMatching.getDefaultParameters(), heavyIonTools.SelectionDefaults.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), heavyIonTools.DisbaleMonteCarloDeps.getDefaultParameters(), jetTools.AddJetCollection.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), coreTools.RemoveAllPATObjectsBut.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), coreTools.RemoveSpecificPATObjects.getDefaultParameters(), tauTools.AddTauCollection.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), coreTools.RemoveCleaning.getDefaultParameters(), coreTools.AddCleaning.getDefaultParameters(), jetTools.SwitchJetCollection.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), cmsswVersionTools.SwitchJetCollection35X.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), jetTools.AddJetID.getDefaultParameters(), jetTools.SetTagInfos.getDefaultParameters(), trigTools.RemoveCleaningFromTriggerMatching.getDefaultParameters(), jetTools.SwitchJetCorrLevels.getDefaultParameters(), cmsswVersionTools.PickRelValInputFiles.getDefaultParameters(), python.ConfigToolBase.ConfigToolBase.reset(), and python.ConfigToolBase.ConfigToolBase.setParameter().

string cmsswVersionTools.SwitchJetCollection35X._label = 'switchJetCollection35X'
staticprivate

Definition at line 567 of file cmsswVersionTools.py.

Referenced by cmsswVersionTools.PickRelValInputFiles.apply(), cmsswVersionTools.PickRelValInputFiles.messageEmptyList(), trigTools.SwitchOnTrigger.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), and trigTools.RemoveCleaningFromTriggerMatching.toolCode().

cmsswVersionTools.SwitchJetCollection35X._parameters
private

Definition at line 581 of file cmsswVersionTools.py.

Referenced by jetTools.RunBTagging.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), electronTools.AddElectronUserIsolation.toolCode(), photonTools.AddPhotonUserIsolation.toolCode(), metTools.AddTcMET.toolCode(), muonTools.AddMuonUserIsolation.toolCode(), coreTools.RestrictInputToAOD.toolCode(), HiCoreTools.RestrictInputToAOD.toolCode(), trackTools.MakeAODTrackCandidates.toolCode(), metTools.AddPfMET.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), coreTools.RunOnData.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), trigTools.SwitchOnTrigger.toolCode(), coreTools.RemoveMCMatching.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), coreTools.RemoveAllPATObjectsBut.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), jetTools.AddJetCollection.toolCode(), coreTools.RemoveSpecificPATObjects.toolCode(), trackTools.MakeTrackCandidates.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), tauTools.AddTauCollection.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), coreTools.RemoveCleaning.toolCode(), coreTools.AddCleaning.toolCode(), jetTools.SwitchJetCollection.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), cmsswVersionTools.SwitchJetCollection35X.toolCode(), jetTools.AddJetID.toolCode(), jetTools.SetTagInfos.toolCode(), trigTools.RemoveCleaningFromTriggerMatching.toolCode(), and jetTools.SwitchJetCorrLevels.toolCode().

tuple cmsswVersionTools.SwitchJetCollection35X.correctors
static
Initial value:
1 = cms.vstring('%s%sL2Relative' % (jetCorrLabel[0].swapcase(), jetCorrLabel[1]),
2  '%s%sL3Absolute' % (jetCorrLabel[0].swapcase(), jetCorrLabel[1])
3  )

redo the type1MET correction for the new jet collection

in case there is no jet correction service in the paths add it as L2L3 if possible, as combined from L2 and L3 otherwise

Definition at line 739 of file cmsswVersionTools.py.

cmsswVersionTools.SwitchJetCollection35X.doType1MET = False
static

replace jet energy corrections; catch a couple of exceptions first

check for the correct format switch JEC parameters to the new jet collection switch type1MET corrections off for PFJets

Definition at line 730 of file cmsswVersionTools.py.

string cmsswVersionTools.SwitchJetCollection35X.jetIdLabelNew = jetIdLabel+'JetID'
static

remove the jet track association from the std sequence

switch embedding of track association and jet charge estimate to 'False' replace b tagging sequence; add postfix label 'AOD' as crab will crash when confronted with empy labels add b tagging sequence before running the allLayer1Jets modules replace corresponding tags for pat jet production remove b tagging from the std sequence switch embedding of b tagging for pat jet production to 'False'

Definition at line 701 of file cmsswVersionTools.py.

tuple cmsswVersionTools.SwitchJetCollection35X.switchJetCollection35X = SwitchJetCollection35X()
static

configure the type1MET correction the following muonMET corrections have the metJESCorAK5CaloJet as input and are automatically correct

remove the jetCorrFactors from the std sequence switch embedding of jetCorrFactors off for pat jet production

Definition at line 757 of file cmsswVersionTools.py.