Skip to content

background correlations in unfolding

When unfolding several observables on the same data set, the statistical correlations in the unfolding should also be taken into account. After a discussion with Stefan Schmitt two years ago, we obtained the following instructions (to be applied in TUnfold directly):

Here is my corollar for the background subtraction.

  • the code is located in:
    • TUnfoldSys.h TUnfoldSysV17.cxx
  • the following method has to take an additional argument
    • TUnfoldSys::SubtractBackground(... , TH2 *correlations=0)
  • the C-code to be modified in TUnfoldSysV17.cxx is this one:
    • Line 377ff TUnfoldSysV17::DoBackgroundSubtraction
    • Line 354ff TUnfoldSysV17::SubtractBackground
    • Line 584ff TUnfoldSysV17::GetBackground
    • Line 1281ff TUnfoldSysV17::GetEmatrixSysBackgroundUncorr

Basically everywhere where the data member fBgrErrUncorrInSq is used, the impact of the modification has to be checked. better to also check in TUnfoldDensity... These are the methods which I found:

  • TUnfoldSysV17::DoBackgroundSubtraction: construct background-subtracted data and corresponding covariance matrix, using all stored background sources
  • TUnfoldSysV17::SubtractBackground: store data for a given backgriound source
  • TUnfoldSysV17::GetBackground: get background and uncertainties in a histogram
  • TUnfoldSysV17::GetEmatrixSysBackgroundUncorr: calculate uncertainty contribution to teh result from background "uncorrelated" errors

Present way of background subtraction workd like this: fBgrErrUncorrInSq holds a TMatrixD of dimension (N,1). These are the diagonal elements of the background uncorrelated uncertainties.

New way of implementing the backgroung subtraction: fBgrErrUncorrInSq is going to hold a matrix of dimension (N,N). If no correlation coefficients are specified, only the diagonals will be non-zero otherwise, the covariance matrix is constructed from the correlation coefficients and the diagional errors

Anticipated changes:

  • TUnfoldSysV17::DoBackgroundSubtraction
    • line 433-451: add NxN matrix instead of only adding diagonals
  • TUnfoldSysV17::SubtractBackground
    • line 546-555: construct NxN matrix, set up diagonals and off-diagonals taking into account correlation coefficients
  • TUnfoldSysV17::GetBackground
    • line 630: use diagonal element (i,i) instead of (i,0)
  • TUnfoldSysV17::GetEmatrixSysBackgroundUncorr
    • line 1288: instead of calling emat=MultiplyMSparseMSparseTranspVector(...), one will have to do two matrix multiplications: (DXDY() * dySquared) * DXDY()^transposed where DXDY () is a "sparse" matrix and dysquared is a "normal" matrix. Something like this:
TMatrixDSparse *tmp=MultiplyMSparseM(DXDY(),dySquared);
emat=MultiplyMSparseMSparseTranspVector(tmp,DXDY(),0);
delete tmp;