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 438 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 445 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().

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

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 487 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().

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

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

482  def getDefaultParameters(self):
483  """
484  Return default parameters of the class
485  """
486  return self._defaultParameters
def jetTools.SwitchJetCollection.toolCode (   self,
  process 
)
Tool code implementation

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

519  def toolCode(self, process):
520  """
521  Tool code implementation
522  """
523  ## initialize parameters
jetSource=self._parameters['jetSource'].value
_parameters
initialization of the base class
Definition: jetTools.py:475

Member Data Documentation

jetTools.SwitchJetCollection._comment
private

add comments

Definition at line 477 of file jetTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__().

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

Definition at line 443 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__(), 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__(), trackTools.MakeTrackCandidates.__init__(), tauTools.AddTauCollection.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.RemoveCleaning.__init__(), HiCoreTools.AddCleaning.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), jetTools.SwitchJetCollection.__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(), trackTools.MakeTrackCandidates.getDefaultParameters(), tauTools.AddTauCollection.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 442 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 475 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(), 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 525 of file jetTools.py.

jetTools.SwitchJetCollection.algo = algo,
static

Definition at line 538 of file jetTools.py.

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

Definition at line 527 of file jetTools.py.

jetTools.SwitchJetCollection.btagDiscriminators = btagDiscriminators,
static

Definition at line 540 of file jetTools.py.

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

Definition at line 528 of file jetTools.py.

jetTools.SwitchJetCollection.btagInfos = btagInfos,
static

Definition at line 541 of file jetTools.py.

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

Definition at line 526 of file jetTools.py.

jetTools.SwitchJetCollection.jetCorrections = jetCorrections,
static

Definition at line 539 of file jetTools.py.

jetTools.SwitchJetCollection.jetSource = jetSource,
static

Definition at line 537 of file jetTools.py.

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

Definition at line 529 of file jetTools.py.

jetTools.SwitchJetCollection.jetTrackAssociation = jetTrackAssociation,
static

Definition at line 542 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 535 of file jetTools.py.

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

Definition at line 530 of file jetTools.py.

jetTools.SwitchJetCollection.outputModules = outputModules,
static

Definition at line 543 of file jetTools.py.

jetTools.SwitchJetCollection.postfix = postfix,
static

Definition at line 536 of file jetTools.py.

tuple jetTools.SwitchJetCollection.switchJetCollection = SwitchJetCollection()
static

Definition at line 546 of file jetTools.py.