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 519 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 526 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().

527  def __init__(self):
528  """
529  Initialize elements of the class. Note that the tool needs to be derived from ConfigToolBase to be usable in the configEditor.
530  """
531  ## initialization of the base class
532  ConfigToolBase.__init__(self)
533  ## add all parameters that should be known to the class
534  self.addParameter(self._defaultParameters,'postfix','', "postfix from usePF2PAT")
535  self.addParameter(self._defaultParameters,'jetSource','', "Label of the input collection from which the new patJet collection should be created", cms.InputTag)
536  self.addParameter(self._defaultParameters,'trackSource',cms.InputTag('generalTracks'), "Label of the input collection for tracks to be used in b-tagging", cms.InputTag)
537  self.addParameter(self._defaultParameters,'pvSource',cms.InputTag('offlinePrimaryVertices'), "Label of the input collection for primary vertices used in b-tagging", cms.InputTag)
538  self.addParameter(self._defaultParameters,'algo', 'AK5', "Jet algorithm of the input collection from which the new patJet collection should be created")
539  self.addParameter(self._defaultParameters,'rParam', 0.5, "Jet size (distance parameter R used in jet clustering)")
540  self.addParameter(self._defaultParameters,'getJetMCFlavour', True, "Get jet MC truth flavour")
541  self.addParameter(self._defaultParameters,'genJetCollection', cms.InputTag("ak5GenJets"), "GenJet collection to match to")
542  self.addParameter(self._defaultParameters,'svSource',cms.InputTag('inclusiveSecondaryVertices'), "Label of the input collection for IVF vertices used in b-tagging", cms.InputTag)
543  self.addParameter(self._defaultParameters,'jetCorrections',None, "Add all relevant information about jet energy corrections that you want to be added to your new patJet \
544  collection. The format is to be passed on in a python tuple: e.g. (\'AK5Calo\',[\'L2Relative\', \'L3Absolute\'], patMet). The first argument corresponds to the payload \
545  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 \
546  new patJet collection. This should be given as a list of strings. Available values are L1Offset, L1FastJet, L1JPTOffset, L2Relative, L3Absolute, L5Falvour, L7Parton; the \
547  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 \
548  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 \
549  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)
550  self.addParameter(self._defaultParameters,'btagDiscriminators',['None'], "If you are interested in btagging in general the btag discriminators is all relevant \
551  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 \
552  discriminator information will be added to your new patJet collection.", allowedValues=supportedBtagDiscr.keys(),Type=list)
553  self.addParameter(self._defaultParameters,'btagInfos',['None'], "The btagInfos objects conatin all relevant information from which all discriminators of a certain \
554  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 \
555  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 \
556  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)
557  self.addParameter(self._defaultParameters,'jetTrackAssociation',False, "Add JetTrackAssociation and JetCharge from reconstructed tracks to your new patJet collection. This \
558  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 \
559  your new patJetCollection. If btag information is added to the new patJet collection this information will be added automatically.")
560  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 \
561  be added, in case you use more than one output module.")
562  ## set defaults
563  self._parameters=copy.deepcopy(self._defaultParameters)
564  ## add comments
565  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 \
566  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 \
567  parameter for more information."
_parameters
initialization of the base class
Definition: jetTools.py:562

Member Function Documentation

def jetTools.SwitchJetCollection.__call__ (   self,
  process,
  postfix = None,
  jetSource = None,
  trackSource = None,
  pvSource = 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 574 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(), SignedTransverseImpactParameter.apply(), MatrixReader.MatrixReader.apply, SignedDecayLength3D.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(), BowedSurfaceAlignmentParameters.apply(), AlignmentParameters.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.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(), reco::Div< T >.apply(), cmsswVersionTools.PickRelValInputFiles.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(), PedeReader.setParameter(), ora::PoolMainTable.setParameter(), IntegratedCalibrationBase.setParameter(), SiStripLorentzAngleCalibration.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

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

Definition at line 568 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.

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

Definition at line 620 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.

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

Member Data Documentation

jetTools.SwitchJetCollection._comment
private

add comments

Definition at line 564 of file jetTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__().

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

Definition at line 524 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 523 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 562 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().