RenormalizeDiag¶
Description¶
For a given square matrix this transformation either:
Scales \(n\) diagonals by a given number.
Scales all the elements except \(n\) diagonals by a given number.
After scale is applied, each column is normalized to 1.
RenormalizeDiag is used to implement IAV correction uncertainty (Daya Bay) and is supposed to be used with EnergySmear transformation.
Inputs¶
'renorm.inmat'
— \(C\) square input matrix.
Outputs¶
'renorm.outmat'
— \(E\) square output matrix.
Variables¶
'DiagScale'
— \(s\) scale to be applied.
Arguments¶
int ndiag
— \(n\) number of diagonals to treat as as diagonal:1 — only diagonal itself
2 — the diagonal itself, upper and lower diagonal
3 — etc
Target target
—RenormalizeDiag::Target::Diagonal
(default) orRenormalizeDiag::Target::Offdiagonal
. Shows which part of the matrix to apply the scale to.
Mode mode
—RenormalizeDiag::Mode::Full
(default) orRenormalizeDiag::Mode::Upper
. IfUpper
, the matrix is treated as upper triangular matrix with appropriate optimizations.parname='DiagScale'
— variable name.
Tests¶
Use the following commands for the usage example and testing:
./tests/detector/test_renormalizediag.py
./tests/detector/test_iavunc.py -s
Implementation¶
The result is matrix, normalized by sum of rows:
where \(D\) in Diagonal
case is:
and in Offdiagonal
case:
The Upper
mode ensures that the lower triangle (without diagonal) is set to zero before normalization: