CMS 3D CMS Logo

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

Public Member Functions

def __call__
 
def __init__
 
def getDefaultParameters
 
def toolCode
 

Private Attributes

 _comment
 add comments More...
 
 _parameters
 initialization of the base class More...
 

Static Private Attributes

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

Detailed Description

Tool to switch parameters of the PAT jet collection to your PAT Tuple.

Definition at line 522 of file jetTools.py.

Constructor & Destructor Documentation

def jetTools.SwitchJetCollection.__init__ (   self)
Initialize elements of the class. Note that the tool needs to be derived from ConfigToolBase to be usable in the configEditor.

Definition at line 529 of file jetTools.py.

References editorTools.UserCodeTool._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, jetTools.AddJetCollection._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, 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(), ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

530  def __init__(self):
531  """
532  Initialize elements of the class. Note that the tool needs to be derived from ConfigToolBase to be usable in the configEditor.
533  """
534  ## initialization of the base class
535  ConfigToolBase.__init__(self)
536  ## add all parameters that should be known to the class
537  self.addParameter(self._defaultParameters,'postfix','', "postfix from usePF2PAT")
538  self.addParameter(self._defaultParameters,'jetSource','', "Label of the input collection from which the new patJet collection should be created", cms.InputTag)
539  self.addParameter(self._defaultParameters,'trackSource',cms.InputTag('generalTracks'), "Label of the input collection for tracks to be used in b-tagging", cms.InputTag)
540  self.addParameter(self._defaultParameters,'pvSource',cms.InputTag('offlinePrimaryVertices'), "Label of the input collection for primary vertices used in b-tagging", cms.InputTag)
541  self.addParameter(self._defaultParameters,'svSource',cms.InputTag('inclusiveSecondaryVertices'), "Label of the input collection for IVF vertices used in b-tagging", cms.InputTag)
542  self.addParameter(self._defaultParameters,'algo', 'AK4', "Jet algorithm of the input collection from which the new patJet collection should be created")
543  self.addParameter(self._defaultParameters,'rParam', 0.4, "Jet size (distance parameter R used in jet clustering)")
544  self.addParameter(self._defaultParameters,'getJetMCFlavour', True, "Get jet MC truth flavour")
545  self.addParameter(self._defaultParameters,'genJetCollection', cms.InputTag("ak4GenJets"), "GenJet collection to match to")
546  self.addParameter(self._defaultParameters,'jetCorrections',None, "Add all relevant information about jet energy corrections that you want to be added to your new patJet \
547  collection. The format is to be passed on in a python tuple: e.g. (\'AK4Calo\',[\'L2Relative\', \'L3Absolute\'], patMet). The first argument corresponds to the payload \
548  in the CMS Conditions database for the given jet collection; the second argument corresponds to the jet energy correction level that you want to be embedded into your \
549  new patJet collection. This should be given as a list of strings. Available values are L1Offset, L1FastJet, L1JPTOffset, L2Relative, L3Absolute, L5Falvour, L7Parton; the \
550  third argument indicates whether MET(Type1) corrections should be applied corresponding to the new patJetCollection. If so a new patMet collection will be added to your PAT \
551  Tuple in addition to the raw patMet with the MET(Type1) corrections applied. The argument corresponds to the patMet collection to which the MET(Type1) corrections should be \
552  applied. If you are not interested in MET(Type1) corrections to this new patJet collection pass None as third argument of the python tuple.", tuple, acceptNoneValue=True)
553  self.addParameter(self._defaultParameters,'btagDiscriminators',['None'], "If you are interested in btagging in general the btag discriminators is all relevant \
554  information that you need for a high level analysis. Add here all btag discriminators, that you are interested in as a list of strings. If this list is empty no btag \
555  discriminator information will be added to your new patJet collection.", allowedValues=supportedBtagDiscr.keys(),Type=list)
556  self.addParameter(self._defaultParameters,'btagInfos',['None'], "The btagInfos objects conatin all relevant information from which all discriminators of a certain \
557  type have been calculated. Note that this information on the one hand can be very space consuming and on the other hand is not necessary to access the btag discriminator \
558  information that has been derived from it. Only in very special cases the btagInfos might really be needed in your analysis. Add here all btagInfos, that you are interested \
559  in as a list of strings. If this list is empty no btagInfos will be added to your new patJet collection.", allowedValues=supportedBtagInfos,Type=list)
560  self.addParameter(self._defaultParameters,'jetTrackAssociation',False, "Add JetTrackAssociation and JetCharge from reconstructed tracks to your new patJet collection. This \
561  switch is only of relevance if you don\'t add any btag information to your new patJet collection (btagDiscriminators or btagInfos) and still want this information added to \
562  your new patJetCollection. If btag information is added to the new patJet collection this information will be added automatically.")
563  self.addParameter(self._defaultParameters,'outputModules',['out'],"Output module labels. Add a list of all output modules to which you would like the new jet collection to \
564  be added, in case you use more than one output module.")
565  ## set defaults
566  self._parameters=copy.deepcopy(self._defaultParameters)
567  ## add comments
568  self._comment = "This is a tool to add more patJet collectinos to your PAT Tuple. You can add and embed additional information like jet energy correction factors, btag \
569  infomration and generatro match information to the new patJet collection depending on the parameters that you pass on to this function. Consult the descriptions of each \
570  parameter for more information."
_parameters
initialization of the base class
Definition: jetTools.py:565

Member Function Documentation

def jetTools.SwitchJetCollection.__call__ (   self,
  process,
  postfix = None,
  jetSource = None,
  trackSource = None,
  pvSource = None,
  svSource = None,
  algo = None,
  rParam = None,
  getJetMCFlavour = None,
  genJetCollection = None,
  jetCorrections = None,
  btagDiscriminators = None,
  btagInfos = None,
  jetTrackAssociation = None,
  outputModules = None 
)
Function call wrapper. This will check the parameters and call the actual implementation that
can be found in toolCode via the base class function apply.

Definition at line 577 of file jetTools.py.

References editorTools.UserCodeTool._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, jetTools.AddJetCollection._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, SignedImpactParameter3D.apply(), gen::PhotosInterfaceBase.apply(), SignedTransverseImpactParameter.apply(), MatrixReader.MatrixReader.apply, SignedDecayLength3D.apply(), DummyOOTPileupCorrection.apply(), gen::PhotosppInterface.apply(), FWPSetCellEditor.apply(), gen::PhotosInterface.apply(), SurveyParameters.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), MatRepSparse< T, D1, D2, S, F >.apply(), ConfigToolBase.ConfigToolBase.apply(), OOTPileupCorrData.apply(), AlignmentParameters.apply(), BowedSurfaceAlignmentParameters.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.apply(), AbsOOTPileupCorrection.apply(), TwoBowedSurfacesAlignmentParameters.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), Vispa.Gui.BoxContentDialog.BoxContentDialog.apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog.apply(), reco::Add< T >.apply(), reco::Sub< T >.apply(), reco::Mul< T >.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), reco::Div< T >.apply(), reco::And< bool >.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(), npstat::ArrayND< Numeric, StackLen, StackDim >.apply(), npstat::ArrayND< Numeric >.apply(), npstat::ArrayND< Num1, Len1, Dim1 >.apply(), ora::OraMainTable.setParameter(), ora::IMainTable.setParameter(), ora::PoolMainTable.setParameter(), PedeReader.setParameter(), IntegratedCalibrationBase.setParameter(), SiStripLorentzAngleCalibration.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

578  def __call__(self,process,postfix=None,jetSource=None,trackSource=None,pvSource=None,svSource=None,algo=None,rParam=None,getJetMCFlavour=None,genJetCollection=None,jetCorrections=None,btagDiscriminators=None,btagInfos=None,jetTrackAssociation=None,outputModules=None):
579  """
580  Function call wrapper. This will check the parameters and call the actual implementation that
581  can be found in toolCode via the base class function apply.
582  """
583  if postfix is None:
584  postfix=self._defaultParameters['postfix'].value
585  self.setParameter('postfix', postfix)
586  if jetSource is None:
587  jetSource=self._defaultParameters['jetSource'].value
588  self.setParameter('jetSource', jetSource)
589  if trackSource is None:
590  trackSource=self._defaultParameters['trackSource'].value
591  self.setParameter('trackSource', trackSource)
592  if pvSource is None:
593  pvSource=self._defaultParameters['pvSource'].value
594  self.setParameter('pvSource', pvSource)
595  if svSource is None:
596  svSource=self._defaultParameters['svSource'].value
597  self.setParameter('svSource', svSource)
598  if algo is None:
599  algo=self._defaultParameters['algo'].value
600  self.setParameter('algo', algo)
601  if rParam is None:
602  rParam=self._defaultParameters['rParam'].value
603  self.setParameter('rParam', rParam)
604  if getJetMCFlavour is None:
605  getJetMCFlavour=self._defaultParameters['getJetMCFlavour'].value
606  self.setParameter('getJetMCFlavour', getJetMCFlavour)
607  if genJetCollection is None:
608  genJetCollection=self._defaultParameters['genJetCollection'].value
609  self.setParameter('genJetCollection', genJetCollection)
610  if jetCorrections is None:
611  jetCorrections=self._defaultParameters['jetCorrections'].value
612  self.setParameter('jetCorrections', jetCorrections)
613  if btagDiscriminators is None:
614  btagDiscriminators=self._defaultParameters['btagDiscriminators'].value
615  self.setParameter('btagDiscriminators', btagDiscriminators)
616  if btagInfos is None:
617  btagInfos=self._defaultParameters['btagInfos'].value
618  self.setParameter('btagInfos', btagInfos)
619  if jetTrackAssociation is None:
620  jetTrackAssociation=self._defaultParameters['jetTrackAssociation'].value
621  self.setParameter('jetTrackAssociation', jetTrackAssociation)
622  if outputModules is None:
623  outputModules=self._defaultParameters['outputModules'].value
624  self.setParameter('outputModules', outputModules)
625  self.apply(process)
def jetTools.SwitchJetCollection.getDefaultParameters (   self)
Return default parameters of the class

Definition at line 571 of file jetTools.py.

References editorTools.UserCodeTool._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, jetTools.AddJetCollection._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, and jetTools.SwitchJetCollection._defaultParameters.

572  def getDefaultParameters(self):
573  """
574  Return default parameters of the class
575  """
576  return self._defaultParameters
def jetTools.SwitchJetCollection.toolCode (   self,
  process 
)
Tool code implementation

Definition at line 626 of file jetTools.py.

References editorTools.UserCodeTool._parameters, heavyIonTools.ConfigureHeavyIons._parameters, coreTools.RunOnData._parameters, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, heavyIonTools.ProductionDefaults._parameters, ConfigToolBase.ConfigToolBase._parameters, editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, jetTools.AddJetCollection._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, coreTools.RemoveMCMatching._parameters, heavyIonTools.SelectionDefaults._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, and jetTools.SwitchJetCollection._parameters.

627  def toolCode(self, process):
628  """
629  Tool code implementation
630  """
631  ## initialize parameters
632  postfix=self._parameters['postfix'].value
633  jetSource=self._parameters['jetSource'].value
634  trackSource=self._parameters['trackSource'].value
635  pvSource=self._parameters['pvSource'].value
636  svSource=self._parameters['svSource'].value
637  algo=self._parameters['algo'].value
638  rParam=self._parameters['rParam'].value
639  getJetMCFlavour=self._parameters['getJetMCFlavour'].value
640  genJetCollection=self._parameters['genJetCollection'].value
641  jetCorrections=self._parameters['jetCorrections'].value
642  btagDiscriminators=self._parameters['btagDiscriminators'].value
643  btagInfos=self._parameters['btagInfos'].value
644  jetTrackAssociation=self._parameters['jetTrackAssociation'].value
645  outputModules=self._parameters['outputModules'].value
646 
647  ## call addJetCollections w/o labelName; this will act on the default patJets collection
648  addJetCollection(
649  process,
650  labelName='',
651  postfix=postfix,
652  jetSource=jetSource,
653  trackSource=trackSource,
654  pvSource=pvSource,
655  svSource=svSource,
656  algo=algo,
657  rParam=rParam,
658  getJetMCFlavour=getJetMCFlavour,
659  genJetCollection=genJetCollection,
660  jetCorrections=jetCorrections,
661  btagDiscriminators=btagDiscriminators,
662  btagInfos=btagInfos,
663  jetTrackAssociation=jetTrackAssociation,
664  outputModules=outputModules,
665  )
666 
667 switchJetCollection=SwitchJetCollection()
_parameters
initialization of the base class
Definition: jetTools.py:565

Member Data Documentation

jetTools.SwitchJetCollection._comment
private

add comments

Definition at line 567 of file jetTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__().

tuple jetTools.SwitchJetCollection._defaultParameters = dicttypes.SortedKeysDict()
staticprivate

Definition at line 527 of file jetTools.py.

Referenced by HiCoreTools.RestrictInputToAOD.__call__(), trackTools.MakeAODTrackCandidates.__call__(), metTools.AddMETCollection.__call__(), HiCoreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.AddJetID.__call__(), jetTools.SetTagInfos.__call__(), metUncertaintyTools.RunMEtUncertainties.__call__(), metTools.AddMETCollection.__init__(), trackTools.MakeAODTrackCandidates.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), metUncertaintyTools.RunMEtUncertainties.__init__(), HiCoreTools.RemoveMCMatching.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), trackTools.MakeTrackCandidates.__init__(), tauTools.AddTauCollection.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.RemoveCleaning.__init__(), HiCoreTools.AddCleaning.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), jetTools.SwitchJetCollection.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), jetTools.AddJetID.__init__(), jetTools.SetTagInfos.__init__(), metUncertaintyTools.RunMEtUncertainties._initializeInputTag(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), metTools.AddMETCollection.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), metUncertaintyTools.RunMEtUncertainties.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), tauTools.AddTauCollection.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), jetTools.SwitchJetCollection.getDefaultParameters(), jetTools.AddJetID.getDefaultParameters(), jetTools.SetTagInfos.getDefaultParameters(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

string jetTools.SwitchJetCollection._label = 'switchJetCollection'
staticprivate

Definition at line 526 of file jetTools.py.

Referenced by trigTools.SwitchOnTrigger.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), and trigTools.SwitchOnTriggerMatchEmbedding.toolCode().

jetTools.SwitchJetCollection._parameters
private

initialization of the base class

add all parameters that should be known to the class set defaults

Definition at line 565 of file jetTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__(), HiCoreTools.RestrictInputToAOD.toolCode(), trackTools.MakeAODTrackCandidates.toolCode(), metTools.AddMETCollection.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), trigTools.SwitchOnTrigger.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trackTools.MakeTrackCandidates.toolCode(), tauTools.AddTauCollection.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), jetTools.SwitchJetCollection.toolCode(), jetTools.AddJetID.toolCode(), jetTools.SetTagInfos.toolCode(), and metUncertaintyTools.RunMEtUncertainties.toolCode().