CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
metTools.AddMETCollection Class Reference
Inheritance diagram for metTools.AddMETCollection:

Public Member Functions

def __call__ (self, process, labelName=None, metSource=None)
 
def __init__ (self)
 
def getDefaultParameters (self)
 
def toolCode (self, process)
 

Private Attributes

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

Static Private Attributes

 _defaultParameters
 
 _label
 

Detailed Description

Tool to add alternative MET collection(s) to your PAT Tuple

Definition at line 5 of file metTools.py.

Constructor & Destructor Documentation

def metTools.AddMETCollection.__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 12 of file metTools.py.

References heavyIonTools.ConfigureHeavyIons._defaultParameters, metTools.AddMETCollection._defaultParameters, coreTools.RunOnData._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, 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(), l1t::TriggerSystem.addParameter(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

12  def __init__(self):
13  """
14  Initialize elements of the class. Note that the tool needs to be derived from ConfigToolBase
15  to be usable in the configEditor.
16  """
17  ## initialization of the base class
18  ConfigToolBase.__init__(self)
19  ## add all parameters that should be known to the class
20  self.addParameter(self._defaultParameters,'labelName',self._defaultValue, "Label name of the new patMET collection.", str)
21  self.addParameter(self._defaultParameters,'metSource',self._defaultValue, "Label of the input collection from which the new patMet collection should be created.", str)
22  ## set defaults
23  self._parameters=copy.deepcopy(self._defaultParameters)
24  ## add comments
25  self._comment = "Add alternative MET collections as PAT object to your PAT Tuple"
26 
_comment
add comments
Definition: metTools.py:25
_parameters
initialization of the base class
Definition: metTools.py:23

Member Function Documentation

def metTools.AddMETCollection.__call__ (   self,
  process,
  labelName = None,
  metSource = 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 33 of file metTools.py.

References heavyIonTools.ConfigureHeavyIons._defaultParameters, metTools.AddMETCollection._defaultParameters, coreTools.RunOnData._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.UpdateJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._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(), 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(), Vispa.Gui.BoxContentDialog.BoxContentDialog.apply(), reco::modules::TrackerTrackHitFilter::Rule.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(), models.RegExp.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(), ArrayND< Num2, Len2, Dim2 >.apply(), ArrayND< Accumulator >.apply(), ArrayND< Numeric, Len, Dim >.apply(), npstat::ArrayND< Num1, Len1, Dim1 >.apply(), ArrayND< Numeric, Len2, Dim2 >.apply(), Config.ProcessModifier.apply(), PedeReader.setParameter(), QIE8Simulator.setParameter(), AbsElectronicODERHS.setParameter(), IntegratedCalibrationBase.setParameter(), SiStripLorentzAngleCalibration.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

33  def __call__(self,process,labelName=None,metSource=None):
34  """
35  Function call wrapper. This will check the parameters and call the actual implementation that
36  can be found in toolCode via the base class function apply.
37  """
38  if labelName is None:
39  labelName=self._defaultParameters['labelName'].value
40  self.setParameter('labelName', labelName)
41  if metSource is None:
42  metSource=self._defaultParameters['metSource'].value
43  self.setParameter('metSource', metSource)
44  self.apply(process)
45 
def __call__(self, process, labelName=None, metSource=None)
Definition: metTools.py:33
def metTools.AddMETCollection.getDefaultParameters (   self)
def metTools.AddMETCollection.toolCode (   self,
  process 
)
Tool code implementation

Definition at line 46 of file metTools.py.

References editorTools.UserCodeTool._parameters, heavyIonTools.ConfigureHeavyIons._parameters, coreTools.RunOnData._parameters, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, metTools.AddMETCollection._parameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, heavyIonTools.ProductionDefaults._parameters, ConfigToolBase.ConfigToolBase._parameters, editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, coreTools.RemoveMCMatching._parameters, heavyIonTools.SelectionDefaults._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, jetTools.AddJetCollection._parameters, jetTools.SwitchJetCollection._parameters, jetTools.UpdateJetCollection._parameters, jetTools.AddJetID._parameters, jetTools.SetTagInfos._parameters, helpers.addToProcessAndTask(), and helpers.getPatAlgosToolsTask().

46  def toolCode(self, process):
47  """
48  Tool code implementation
49  """
50  ## initialize parameters
51  labelName=self._parameters['labelName'].value
52  metSource=self._parameters['metSource'].value
53  ## do necessary imports
55  ## add module to the process
56  task = getPatAlgosToolsTask(process)
57  addToProcessAndTask(labelName, patMETs.clone(metSource = metSource, addMuonCorrections=False), process, task)
58 
59  ## add module to output
60  if hasattr(process, "out"):
61  process.out.outputCommands+=["keep *_{LABEL_NAME}_*_*".format(LABEL_NAME=labelName)]
62 
63 addMETCollection=AddMETCollection()
64 
def addToProcessAndTask(label, module, process, task)
Definition: helpers.py:27
def toolCode(self, process)
Definition: metTools.py:46
_parameters
initialization of the base class
Definition: metTools.py:23
def getPatAlgosToolsTask(process)
Definition: helpers.py:12

Member Data Documentation

metTools.AddMETCollection._comment
private

add comments

Definition at line 25 of file metTools.py.

metTools.AddMETCollection._defaultParameters
staticprivate

Definition at line 10 of file metTools.py.

Referenced by HiCoreTools.RestrictInputToAOD.__call__(), trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), editorTools.ChangeSource.__call__(), HiCoreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__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__(), editorTools.UserCodeTool.__init__(), trackTools.MakeAODTrackCandidates.__init__(), metTools.AddMETCollection.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), runJetUncertainties.RunJetUncertainties.__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__init__(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.__init__(), editorTools.ChangeSource.__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__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), metTools.AddMETCollection.getDefaultParameters(), editorTools.ChangeSource.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.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(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.initializeInputTag(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

metTools.AddMETCollection._parameters
private

initialization of the base class

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

Definition at line 23 of file metTools.py.

Referenced by runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.ak4JetReclustering(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createMVAMETModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createSmearedJetModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.extractMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getCorrectedMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getUnclusteredVariationsForMVAMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getVariations(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetCleaning(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfigurationPost(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.produceMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.recomputeRawMetFromPfcs(), HiCoreTools.RestrictInputToAOD.toolCode(), trackTools.MakeAODTrackCandidates.toolCode(), metTools.AddMETCollection.toolCode(), runJetUncertainties.RunJetUncertainties.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), trigTools.SwitchOnTrigger.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.toolCode(), trackTools.MakeTrackCandidates.toolCode(), tauTools.AddTauCollection.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.updateJECs().