ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ScaleE1overE2 Struct Reference

#include <egammaLayerRecalibTool.h>

Inheritance diagram for ScaleE1overE2:
Collaboration diagram for ScaleE1overE2:

Public Types

enum  NullPoint {
  ZEROBASED, ONEBASED, ZEROBASED_ALPHA, ONEBASED_ALPHA,
  SHIFT, SCALE, SUBTRACT
}
 

Public Member Functions

 ScaleE1overE2 (NullPoint base)
 
ScaleE1overE2clone () const
 
CP::CorrectionCode operator() (StdCalibrationInputs &, float amount) const
 

Private Member Functions

virtual void scale_inputs (StdCalibrationInputs &, float amount) const
 
virtual void shift_inputs (StdCalibrationInputs &, float amount) const
 

Private Attributes

NullPoint m_base
 

Detailed Description

Definition at line 286 of file egammaLayerRecalibTool.h.

Member Enumeration Documentation

◆ NullPoint

enum InputModifier::NullPoint
inherited
Enumerator
ZEROBASED 
ONEBASED 
ZEROBASED_ALPHA 
ONEBASED_ALPHA 
SHIFT 
SCALE 
SUBTRACT 

Definition at line 231 of file egammaLayerRecalibTool.h.

Constructor & Destructor Documentation

◆ ScaleE1overE2()

ScaleE1overE2::ScaleE1overE2 ( NullPoint  base)
inline

Definition at line 288 of file egammaLayerRecalibTool.h.

288 : InputModifier(base) { };

Member Function Documentation

◆ clone()

ScaleE1overE2* ScaleE1overE2::clone ( ) const
inlinevirtual

Implements InputModifier.

Definition at line 289 of file egammaLayerRecalibTool.h.

289 { return new ScaleE1overE2(*this); };

◆ operator()()

CP::CorrectionCode InputModifier::operator() ( StdCalibrationInputs inputs,
float  amount 
) const
inherited

Definition at line 130 of file egammaLayerRecalibTool.cxx.

131 {
132  if (amount == VALUE_OVERFLOW) return CP::CorrectionCode::OutOfValidityRange;
133  switch (m_base)
134  {
135  case SHIFT: shift_inputs(inputs, amount); return CP::CorrectionCode::Ok;
136  case SUBTRACT: shift_inputs(inputs, -amount); return CP::CorrectionCode::Ok;
137  case SCALE: scale_inputs(inputs, amount); return CP::CorrectionCode::Ok;
138  case ZEROBASED: scale_inputs(inputs, 1. + amount); return CP::CorrectionCode::Ok;
139  case ONEBASED: scale_inputs(inputs, amount); return CP::CorrectionCode::Ok;
140  case ONEBASED_ALPHA: scale_inputs(inputs, 1. / amount); return CP::CorrectionCode::Ok;
141  case ZEROBASED_ALPHA: scale_inputs(inputs, 1. / (1. + amount)); return CP::CorrectionCode::Ok;
142  default: return CP::CorrectionCode::Error;
143  };
144 }

◆ scale_inputs()

void ScaleE1overE2::scale_inputs ( StdCalibrationInputs inputs,
float  amount 
) const
privatevirtual

Implements InputModifier.

Definition at line 157 of file egammaLayerRecalibTool.cxx.

158 {
159  const double Es1 = inputs.E1raw;
160  const double Es2 = inputs.E2raw;
161  if (Es1 == 0 and Es2 == 0) {
162  inputs.E1raw = -999;
163  inputs.E2raw = -999;
164  return;
165  }
166  const double sum = Es1 + Es2;
167  const double alpha = amount;
168  const double den = (alpha * Es1 + Es2);
169  inputs.E1raw = alpha * Es1 * sum / den;
170  inputs.E2raw = Es2 * sum / den;
171 }

◆ shift_inputs()

void ScaleE1overE2::shift_inputs ( StdCalibrationInputs ,
float  amount 
) const
privatevirtual

Implements InputModifier.

Definition at line 173 of file egammaLayerRecalibTool.cxx.

174 {
175  // not very useful, never used
176  throw std::runtime_error("not implemented");
177 }

Member Data Documentation

◆ m_base

NullPoint InputModifier::m_base
privateinherited

Definition at line 242 of file egammaLayerRecalibTool.h.


The documentation for this struct was generated from the following files:
InputModifier::SCALE
@ SCALE
Definition: egammaLayerRecalibTool.h:231
base
std::string base
Definition: hcg.cxx:78
InputModifier::ZEROBASED
@ ZEROBASED
Definition: egammaLayerRecalibTool.h:231
InputModifier::SHIFT
@ SHIFT
Definition: egammaLayerRecalibTool.h:231
InputModifier::shift_inputs
virtual void shift_inputs(StdCalibrationInputs &, float amount) const =0
InputModifier::SUBTRACT
@ SUBTRACT
Definition: egammaLayerRecalibTool.h:231
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
InputModifier::ONEBASED_ALPHA
@ ONEBASED_ALPHA
Definition: egammaLayerRecalibTool.h:231
InputModifier::InputModifier
InputModifier()
Definition: egammaLayerRecalibTool.h:238
CP::CorrectionCode::OutOfValidityRange
@ OutOfValidityRange
Input object is out of validity range.
Definition: CorrectionCode.h:37
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
InputModifier::ONEBASED
@ ONEBASED
Definition: egammaLayerRecalibTool.h:231
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
InputModifier::ZEROBASED_ALPHA
@ ZEROBASED_ALPHA
Definition: egammaLayerRecalibTool.h:231
InputModifier::scale_inputs
virtual void scale_inputs(StdCalibrationInputs &, float amount) const =0
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
InputModifier::m_base
NullPoint m_base
Definition: egammaLayerRecalibTool.h:242
ScaleE1overE2::ScaleE1overE2
ScaleE1overE2(NullPoint base)
Definition: egammaLayerRecalibTool.h:288