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¶
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¶
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¶
Eres_a
— \(a\),Eres_b
— \(b\) andEres_c
— \(c\)
are the parameters of the energy resolution formula. See below.
Smear transformation¶
Inputs¶
smear.FakeMatrix
— smearing matrix. Binded automatically when transformation is created.smear.Ntrue
— one-dimensional histogram of number of events \(N_{\text{vis}}\).smear.Ntrue_02
— another histogram of the same shape(optional).…
Outputs¶
smear.Nrec
— one-dimensional smeared histogram of number of events \(N_{\text{rec}}\)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:
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:
where \(\sigma(E_j)\) is:
where \(a\), \(b\), \(c\) are resolution parameters.