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
ElectronCalibrator.EmbeddedElectronCalibrator Class Reference

Public Member Functions

def __init__
 
def correct
 

Private Attributes

 _label
 

Detailed Description

Definition at line 3 of file ElectronCalibrator.py.

Constructor & Destructor Documentation

def ElectronCalibrator.EmbeddedElectronCalibrator.__init__ (   self,
  label = "calib" 
)

Member Function Documentation

def ElectronCalibrator.EmbeddedElectronCalibrator.correct (   self,
  cmgelectron,
  dummy 
)

Definition at line 6 of file ElectronCalibrator.py.

References ElectronCalibrator.EmbeddedElectronCalibrator._label, editorTools.UserCodeTool._label, MagneticFieldMapESProducer._label, TrackerInteractionGeometryESProducer._label, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._label, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._label, ConfigToolBase.ConfigToolBase._label, editorTools.ChangeSource._label, LHECOMWeightProducer._label, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool._label, Vispa.Views.LineDecayView.DecayLine._label, and reco.get().

Referenced by JetReCalibrator.JetReCalibrator.correctAll().

6 
7  def correct(self,cmgelectron,dummy):
8  ele = cmgelectron.sourcePtr().get()
9  if not ele.hasUserFloat("p_"+self._label):
10  raise RuntimeError, "Electron does not have an embedded energy scale correction with label '%s'" % self._label
11  kind_in = ele.candidateP4Kind()
12  p4_in = ele.p4(kind_in)
13  pCalib = ele.userFloat("p_"+self._label)
14  pErrCalib = ele.userFloat("pError_"+self._label)
15  pKindCalib = ele.userInt("pKind_"+self._label)
16  ecalCalib = ele.userFloat("ecalEnergy_"+self._label)
17  eErrCalib = ele.userFloat("ecalEnergyError_"+self._label)
18  ele.setCorrectedEcalEnergy( ecalCalib )
19  ele.setCorrectedEcalEnergyError( eErrCalib )
20  p4_out = p4_in * (pCalib/p4_in.P())
21  ele.setP4(pKindCalib, p4_out, pErrCalib, True)
22  cmgelectron.setP4(p4_out)
23 
T get(const Candidate &c)
Definition: component.h:55

Member Data Documentation

ElectronCalibrator.EmbeddedElectronCalibrator._label
private

Definition at line 5 of file ElectronCalibrator.py.

Referenced by cmsswVersionTools.PickRelValInputFiles.apply(), ElectronCalibrator.EmbeddedElectronCalibrator.correct(), cmsswVersionTools.PickRelValInputFiles.messageEmptyList(), trigTools.SwitchOnTrigger.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), and trigTools.SwitchOnTriggerMatchEmbedding.toolCode().