EnergyResolution

Description

Applies energy smearing matrix to the input histograms of events binned in \(E_{\text{vis}}\). Each bin of the histogram is smeared according to Gaussian function with width, defined as a function of bin center.

Transformations

The object contains at least two transformations. One matrix transformation and at least one smear transformation.

Matrix transformation

The matrix transformation computes the smearing matrix depending on three parameters \(a\), \(b\) and \(c\).

Inputs

  1. matrix.Edges – a histogram defining the bin edges.

The transformations reads only the bins definitions. The actual data from the histogram is not requested and the taintflag is not propagated.

Outputs

  1. matrix.FakeMatrix – smearing matrix.

By default the output matrix is used to propagate the taintstatus only. The actual matrix is sparse and is stored internally. propagate_matrix option should be set in order to matrix.FakeMatrix to be written.

Variables

  1. Eres_a\(a\),

  2. Eres_b\(b\) and

  3. Eres_c\(c\)

are the parameters of the energy resolution formula. See below.

Smear transformation

Inputs

  1. smear.FakeMatrix — smearing matrix. Binded automatically when transformation is created.

  2. smear.Ntrue — one-dimensional histogram of number of events \(N_{\text{vis}}\).

  3. smear.Ntrue_02 — another histogram of the same shape(optional).

Outputs

  1. smear.Nrec — one-dimensional smeared histogram of number of events \(N_{\text{rec}}\)

  2. smear.Nrec_02 — the second histogram smeared.

Subsequent transformations

Subsequent transformations are named smear_02, smear_03 etc.

Arguments and functions

There is a pythonic constructor defined in gna.constructors:

EnergyResolution(parameters, propagate_matrix=False)

initializes energy resolution with a list of parameters (should contain three items) and a boolean flag that may trigger the matrix.FakeMatrix output to be written.

The constructor creates a single smear transformation with a single input and corresponding output.

The EnergyResolution object contains the following methods:

add_transformation(name=’’)

adds a new smear transformation with name, passed as input, or generated automatically. Returns new transformation.

add_input(inputname=’’, output=’name’)

adds a new input/output pair to the last smear transformation. The names are either set as arguments or generated automatically. Returns newly created input.

add_input(output, inputname=’’, output=’name’)

adds a new input/output pair to the last smear transformation. The names are either set as arguments or generated automatically. The output, passed as argument is connected to the newly created input. Returns new output.

The inputs of a single transformation are all processed, even if only one of them is tainted. For the description see the tutorial.

Also, since the constructor of the object creates a transformation with an input, first call to any of the add_input() method will use this input if it is unbound.

Tests

Use the following commands for the usage example and testing:

./tests/detector/test_eres.py -s

Implementation

The smeared histo \(N_{\text{rec}}\) and true \(N_{\text{vis}}\) are connected through a matrix transformation:

\[N^{\text{rec}}_i = \sum_j V^{\text{res}}_{ij} N^{\text{vis}}_j,\]

where \(N^{\text{rec}}_i\) is a reconstructed number of events in a i-th bin, \(N^{\text{vis}}_j\) is a true number of events in a j-th bin and \(V^{\text{res}}_{ij}\) is a probability for events to flow from j-th to i bin.

That probability is given by:

\[V^{\text{res}}_{ij} = \frac{1}{\sqrt{2 \pi} \sigma(E_j)} \exp \left( - \frac{(E_j - E_i)^2}{2 \sigma^2(E_j)} \right),\]

where \(\sigma(E_j)\) is:

\[\sigma(E_j) = E_j \sqrt{ a^2 + \frac{b^2}{E_j} + \left( \frac{c}{E_j}\right)^2}\]

where \(a\), \(b\), \(c\) are resolution parameters.

../_images/eres_scheme.png

Energy resolution bundle scheme.