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
jetTools.SwitchJetCollection Class Reference
Inheritance diagram for jetTools.SwitchJetCollection:

Public Member Functions

def __call__
 
def __init__
 
def getDefaultParameters
 
def toolCode
 

Static Public Attributes

list algo = self._parameters['algo']
 
 algo = algo,
 
list btagDiscriminators = self._parameters['btagDiscriminators']
 
 btagDiscriminators = btagDiscriminators,
 
list btagInfos = self._parameters['btagInfos']
 
 btagInfos = btagInfos,
 
list jetCorrections = self._parameters['jetCorrections']
 
 jetCorrections = jetCorrections,
 
 jetSource = jetSource,
 
list jetTrackAssociation = self._parameters['jetTrackAssociation']
 
 jetTrackAssociation = jetTrackAssociation,
 
string labelName = ''
 call addJetCollections w/o labelName; this will act on the default patJets collection More...
 
list outputModules = self._parameters['outputModules']
 
 outputModules = outputModules,
 
 postfix = postfix,
 
tuple switchJetCollection = SwitchJetCollection()
 

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 429 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 436 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().

437  def __init__(self):
438  """
439  Initialize elements of the class. Note that the tool needs to be derived from ConfigToolBase to be usable in the configEditor.
440  """
441  ## initialization of the base class
442  ConfigToolBase.__init__(self)
443  ## add all parameters that should be known to the class
444  self.addParameter(self._defaultParameters,'jetSource','', "Label of the input collection from which the new patJet collection should be created", cms.InputTag)
445  self.addParameter(self._defaultParameters,'algo','', "Jet algorithm of the input collection from which the new patJet collection should be created")
446  self.addParameter(self._defaultParameters,'postfix','', "postfix from usePF2PAT")
447  self.addParameter(self._defaultParameters,'jetCorrections',None, "Add all relevant information about jet energy corrections that you want to be added to your new patJet \
448  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 \
449  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 \
450  new patJet collection. This should be given as a list of strings. Available values are L1Offset, L1FastJet, L1JPTOffset, L2Relative, L3Absolute, L5Falvour, L7Parton; the \
451  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 \
452  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 \
453  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)
454  self.addParameter(self._defaultParameters,'btagDiscriminators',['None'], "If you are interested in btagging in general the btag discriminators is all relevant \
455  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 \
456  discriminator information will be added to your new patJet collection.", allowedValues=supportedBtagDiscr.keys(),Type=list)
457  self.addParameter(self._defaultParameters,'btagInfos',['None'], "The btagInfos objects conatin all relevant information from which all discriminators of a certain \
458  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 \
459  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 \
460  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)
461  self.addParameter(self._defaultParameters,'jetTrackAssociation',False, "Add JetTrackAssociation and JetCharge from reconstructed tracks to your new patJet collection. This \
462  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 \
463  your new patJetCollection. If btag information is added to the new patJet collection this information will be added automatically.")
464  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 \
465  be added, in case you use more than one output module.")
466  ## set defaults
467  self._parameters=copy.deepcopy(self._defaultParameters)
468  ## add comments
469  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 \
470  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 \
471  parameter for more information."
_parameters
initialization of the base class
Definition: jetTools.py:466

Member Function Documentation

def jetTools.SwitchJetCollection.__call__ (   self,
  process,
  jetSource = None,
  algo = None,
  postfix = 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 478 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(), MatrixReader.MatrixReader.apply, SignedTransverseImpactParameter.apply(), SignedDecayLength3D.apply(), gen::PhotosInterface.apply(), SurveyParameters.apply(), FWPSetCellEditor.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 >.apply(), npstat::ArrayND< Numeric, StackLen, StackDim >.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().

479  def __call__(self,process,jetSource=None,algo=None,postfix=None,jetCorrections=None,btagDiscriminators=None,btagInfos=None,jetTrackAssociation=None,outputModules=None):
480  """
481  Function call wrapper. This will check the parameters and call the actual implementation that
482  can be found in toolCode via the base class function apply.
483  """
484  if jetSource is None:
485  jetSource=self._defaultParameters['jetSource'].value
486  self.setParameter('jetSource', jetSource)
487  if algo is None:
488  algo=self._defaultParameters['algo'].value
489  self.setParameter('algo', algo)
490  if postfix is None:
491  postfix=self._defaultParameters['postfix'].value
492  self.setParameter('postfix', postfix)
493  if jetCorrections is None:
494  jetCorrections=self._defaultParameters['jetCorrections'].value
495  self.setParameter('jetCorrections', jetCorrections)
496  if btagDiscriminators is None:
497  btagDiscriminators=self._defaultParameters['btagDiscriminators'].value
498  self.setParameter('btagDiscriminators', btagDiscriminators)
499  if btagInfos is None:
500  btagInfos=self._defaultParameters['btagInfos'].value
501  self.setParameter('btagInfos', btagInfos)
502  if jetTrackAssociation is None:
503  jetTrackAssociation=self._defaultParameters['jetTrackAssociation'].value
504  self.setParameter('jetTrackAssociation', jetTrackAssociation)
505  if outputModules is None:
506  outputModules=self._defaultParameters['outputModules'].value
507  self.setParameter('outputModules', outputModules)
508  self.apply(process)
def jetTools.SwitchJetCollection.getDefaultParameters (   self)
Return default parameters of the class

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

473  def getDefaultParameters(self):
474  """
475  Return default parameters of the class
476  """
477  return self._defaultParameters
def jetTools.SwitchJetCollection.toolCode (   self,
  process 
)
Tool code implementation

Definition at line 509 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, jetTools.AddJetCollection._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, coreTools.RemoveMCMatching._parameters, heavyIonTools.SelectionDefaults._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, and jetTools.SwitchJetCollection._parameters.

510  def toolCode(self, process):
511  """
512  Tool code implementation
513  """
514  ## initialize parameters
jetSource=self._parameters['jetSource'].value
_parameters
initialization of the base class
Definition: jetTools.py:466

Member Data Documentation

jetTools.SwitchJetCollection._comment
private

add comments

Definition at line 468 of file jetTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__().

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

Definition at line 434 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__(), tauTools.AddTauCollection.__call__(), trackTools.MakeTrackCandidates.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.AddJetID.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__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__(), tauTools.AddTauCollection.__init__(), trackTools.MakeTrackCandidates.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.RemoveCleaning.__init__(), HiCoreTools.AddCleaning.__init__(), jetTools.SwitchJetCollection.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), jetTools.AddJetID.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__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(), tauTools.AddTauCollection.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), jetTools.SwitchJetCollection.getDefaultParameters(), jetTools.AddJetID.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), jetTools.SetTagInfos.getDefaultParameters(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

string jetTools.SwitchJetCollection._label = 'switchJetCollection'
staticprivate

Definition at line 433 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 466 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(), tauTools.AddTauCollection.toolCode(), trackTools.MakeTrackCandidates.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), jetTools.SwitchJetCollection.toolCode(), jetTools.AddJetID.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), jetTools.SetTagInfos.toolCode(), and metUncertaintyTools.RunMEtUncertainties.toolCode().

list jetTools.SwitchJetCollection.algo = self._parameters['algo']
static

Definition at line 516 of file jetTools.py.

jetTools.SwitchJetCollection.algo = algo,
static

Definition at line 529 of file jetTools.py.

list jetTools.SwitchJetCollection.btagDiscriminators = self._parameters['btagDiscriminators']
static

Definition at line 518 of file jetTools.py.

jetTools.SwitchJetCollection.btagDiscriminators = btagDiscriminators,
static

Definition at line 531 of file jetTools.py.

list jetTools.SwitchJetCollection.btagInfos = self._parameters['btagInfos']
static

Definition at line 519 of file jetTools.py.

jetTools.SwitchJetCollection.btagInfos = btagInfos,
static

Definition at line 532 of file jetTools.py.

list jetTools.SwitchJetCollection.jetCorrections = self._parameters['jetCorrections']
static

Definition at line 517 of file jetTools.py.

jetTools.SwitchJetCollection.jetCorrections = jetCorrections,
static

Definition at line 530 of file jetTools.py.

jetTools.SwitchJetCollection.jetSource = jetSource,
static

Definition at line 528 of file jetTools.py.

list jetTools.SwitchJetCollection.jetTrackAssociation = self._parameters['jetTrackAssociation']
static

Definition at line 520 of file jetTools.py.

jetTools.SwitchJetCollection.jetTrackAssociation = jetTrackAssociation,
static

Definition at line 533 of file jetTools.py.

string jetTools.SwitchJetCollection.labelName = ''
static

call addJetCollections w/o labelName; this will act on the default patJets collection

Definition at line 526 of file jetTools.py.

list jetTools.SwitchJetCollection.outputModules = self._parameters['outputModules']
static

Definition at line 521 of file jetTools.py.

jetTools.SwitchJetCollection.outputModules = outputModules,
static

Definition at line 534 of file jetTools.py.

jetTools.SwitchJetCollection.postfix = postfix,
static

Definition at line 527 of file jetTools.py.

tuple jetTools.SwitchJetCollection.switchJetCollection = SwitchJetCollection()
static

Definition at line 537 of file jetTools.py.