GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Analysis » Bug fixed in PndKinFitter read-in covariance matrix
Bug fixed in PndKinFitter read-in covariance matrix [message #19588] Thu, 29 September 2016 16:33 Go to next message
Lu Cao is currently offline  Lu Cao
Messages: 77
Registered: February 2013
continuous participant
From: *ext.kfa-juelich.de
Dear all,

I just found a bug in RhoKinFitter::ReadMatrix(), when the original cov matrix is re-arranged from (X, Y, Z, Px, Py, Pz, E) basis to (Px, Py, Pz, E, X, Y, Z).
For example, the origianal cov matrix of a photon in (X, Y, Z, Px, Py, Pz, E) is
     |      0    |      1    |      2    |      3    |      4    |       5    |      6    |
---------------------------------------------------------------------------------------------
   0 |     0.2111    0.008221    -0.02881   0.0002914   1.135e-05   -3.977e-05           0 
   1 |   0.008221      0.2217     0.02912   1.135e-05   0.0003061     4.02e-05           0 
   2 |   -0.02881     0.02912    0.008063  -3.977e-05    4.02e-05    1.113e-05           0 
   3 |  0.0002914   1.135e-05  -3.977e-05   3.203e-06  -2.683e-06     1.97e-05   2.013e-05 
   4 |  1.135e-05   0.0003061    4.02e-05  -2.683e-06   3.022e-06   -1.897e-05  -1.939e-05 
   5 | -3.977e-05    4.02e-05   1.113e-05    1.97e-05  -1.897e-05    0.0001393    0.000142 
   6 |          0           0           0   2.013e-05  -1.939e-05     0.000142   0.0001447 


but the re-arranged one in (Px, Py, Pz, E, X, Y, Z) is
     |      0    |      1    |      2    |      3    |      4    |       5    |      6    |
----------------------------------------------------------------------------------------------
   0 |  3.203e-06  -2.683e-06    1.97e-05   2.013e-05   1.135e-05    -3.977e-05           0 
   1 | -2.683e-06   3.022e-06  -1.897e-05  -1.939e-05   0.0003061      4.02e-05           0 
   2 |   1.97e-05  -1.897e-05   0.0001393    0.000142    4.02e-05     1.113e-05           0 
   3 |  2.013e-05  -1.939e-05    0.000142   0.0001447           0             0           0 
   4 |  0.0002914   1.135e-05  -3.977e-05           0      0.2111      0.008221    -0.02881
   5 |  1.135e-05   0.0003061    4.02e-05           0    0.008221        0.2217     0.02912 
   6 | -3.977e-05    4.02e-05   1.113e-05           0    -0.02881       0.02912    0.008063
.

One can notice that some elements in the new cov matrix are wrongly filled, eg. the new (0,4) should be equel to the old (3,0)=0.0002914 rather than 1.135e-05. Since the new cov matrix is not symmetric, the whole fitting procedure will be badly influenced. This is caused by a bug in the code:
272	//Change to px,py,pz,E,x,y,z
273	    for(int i=0; i<7; i++) {
274	      for(int j=0; j<7; j++) {
275	        if(i>=3) {
276	          if(j>=3) {
277	            p4Cov[i-3][j-3] = p3Cov[i][j];
278	          } else { p4Cov[i-3][j+3] = p3Cov[i][j]; }
279	        } else {
280	          if(j>=3) {
281	            p4Cov[i+4][j-3] = p3Cov[i][j];
282	          } else { p4Cov[i+4][j+4] = p3Cov[i][j]; }
283	        }
284	      }
285	    }
.

The line #278,
Quote:
p4Cov[i-3][j+3] = p3Cov[i][j]
should be p4Cov[i-3][j+4] = p3Cov[i][j].

I've studied the pull distributions of befor & after fixing, combining with another bug fixed in this fitter recetly (trk 29480), with my Ds semileptonic decay chain. The result shows several issues regarding to the covariane matrix itself and the fitter, and seems may evoke a long and detailed discussion. For a more efficent and direct communication, I would prefer to present the plots in the upcoming software meeting on 4th Oct..

BTW, the fixed code is attached. (No right to commit... Crying or Very Sad )

Best regards,
Lu
Re: Bug fixed in PndKinFitter read-in covariance matrix [message #19598 is a reply to message #19588] Fri, 30 September 2016 09:33 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: *gsi.de
Dear Lu,

I changed the line in the repository for you. Great thing you found that bug!

Cheers!
Ralf
Re: Bug fixed in PndKinFitter read-in covariance matrix [message #19604 is a reply to message #19598] Fri, 30 September 2016 09:57 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
I would be curious to see the difference between probability distributions before and after the bug fix. Could you please provide such plots?
Re: Bug fixed in PndKinFitter read-in covariance matrix [message #19607 is a reply to message #19598] Fri, 30 September 2016 14:41 Go to previous messageGo to next message
Lu Cao is currently offline  Lu Cao
Messages: 77
Registered: February 2013
continuous participant
From: *ext.kfa-juelich.de
Thanks, Ralf.

Lu
Re: Bug fixed in PndKinFitter read-in covariance matrix [message #19610 is a reply to message #19604] Fri, 30 September 2016 14:47 Go to previous messageGo to next message
Lu Cao is currently offline  Lu Cao
Messages: 77
Registered: February 2013
continuous participant
From: *ext.kfa-juelich.de
Hi Stefano,

Here's a link of my slides for our group seminar yesterday, which includes the plots you asked for.
https://www.dropbox.com/s/hvh6263wqylv46x/lucao_ikp_29092016.pdf?dl=0
I'm going to present the results on the software meeting basically with the same slides.

Best,
Lu
Re: Bug fixed in PndKinFitter read-in covariance matrix [message #19673 is a reply to message #19588] Thu, 06 October 2016 14:33 Go to previous message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: *gsi.de
Hi.

As it was pointed out by Jennifer, the same bug was existent in the KinVtxFitter, too. It's fixed now, too (rev. 29531).

Cheers!
Ralf
Previous Topic: How to distinguish between STT hits in barrel part and forward tracker?
Next Topic: Fitters and hyperons
Goto Forum:
  


Current Time: Fri Apr 19 20:58:02 CEST 2024

Total time taken to generate the page: 0.00871 seconds