SelfPower

Description

Computes the result of a coefficient-wise \((x/a)^{\pm x/a}\) function.

The objects handles two transformations selfpower and selfpower_inv for positive and negative power respectively. Inputs and outputs are the same.

Inputs

  1. selfpower.points and selfpower_inv.points\(x\), input array (not histogram).

Outputs

  1. selfpower.result and selfpower_inv.result\(f\), the function result of the same shape as \(x\).

Variables

  1. sp_scale\(a\), scale to be applied to \(x\).

Arguments

  1. const char* scalename="sp_scale" — the variable name for \(a\) may be optionally redefined via constructor argument.

Tests

Use the following commands for the usage example and testing:

./tests/detector/test_selfpower.py

Implementation

The result of the selfpower is:

\[f_{i} = \left(\frac{x_{i}}{a_{\phantom{i}}}\right)^\frac{x_{i}}{a_{\phantom{i}}}\]

and for the selfpower_inv is:

\[f_{i} = \left(\frac{x_{i}}{a_{\phantom{i}}}\right)^{-\frac{x_{i}}{a_{\phantom{i}}}}.\]

Since \(x\) may be multidimensional \(i\) in these equations may represent hyper-index.