Home » PANDA » PandaRoot » Tracking » Urgent fixes in FairGeanePro.cxx needed
Urgent fixes in FairGeanePro.cxx needed [message #8152] |
Tue, 31 March 2009 15:26 |
Anonymous Poster
|
|
From: *r.pppool.de
|
|
Dear Geane experts,
we found other floating point exceptions in FairGeanePro.cxx. I made a list of all divisions that need to be protected against division by zero. Thi is very important and in my opinion the main source of of instabilities in our tracking software. Please let me know about your progress. As I imagine error handling could be difficult in these cases, I want to suggest to use exceptions for that since they are so easy to use.
Cheers, Christian
line number and content:
762: a= 1./(x2-x1).Mag();
884: xpR[1] = 0.5*(xp32[0]*xp3[0]/xp3[1]+ xp3[1]);
919: it = t.SolveQuartic(d3/d4,d2/d4,d1/d4,d0/d4,sol4);
977: Angle = TMath::ACos((x1-xR).Dot(Pfinal-xR)/((x1-xR).Mag()*(Pfinal-xR).Mag()));
982: Double_t epsi = Radius*(1.-TMath::Cos(0.5*(x3-x1).Mag()/Radius));
1048: m1 = 1./x21.Mag();
1064: m3 = 1./e3.Mag();
1096: xpR[1] = 0.5*(xp32[0]*xp3[0]/xp3[1]+ xp3[1]);
1104: Rt = Radius/(wpt-xpR).Mag();
1127: Angle = TMath::ACos((x1-xR).Dot(Pfinal-xR)/((x1-xR).Mag()*(Pfinal-xR).Mag()));
1131: Double_t epsi = Radius*(1.-TMath::Cos(0.5*(x3-x1).Mag()/Radius));
|
|
|
Re: Urgent fixes in FairGeanePro.cxx needed [message #8154 is a reply to message #8152] |
Tue, 31 March 2009 16:16 |
Felix Boehmer
Messages: 149 Registered: May 2007 Location: Munich
|
first-grade participant |
From: *e18.physik.tu-muenchen.de
|
|
Hi all,
let me show you an example:
Quote: | *** PndTpcSPHit positions ***
(16, -3.5, -5.6); (17, -3.8, -6); (18, -4.3, -6.3); (19, -4.9, -6.8); (20, -5.3, -7.1);
(21, -5.7, -7.4); (21, -5.9, -7.6); (22, -6.3, -7.8); (22, -6.5, -7.9);
(23, -6.7, -8.1); (23, -7, -8.3); (24, -7.5, -8.6); (25, -8.1, -9);
(26, -8.7, -9.4); (27, -9.3, -9.8); (27, -9.6, -10); (28, -9.9, -10);
(29, -11, -11); (29, -11, -11); (30, -12, -11); (31, -12, -11);
(31, -13, -12); (32, -13, -12); (33, -14, -12); (34, -15, -13);
(34, -15, -13); (34, -16, -13); (35, -16, -13); (36, -17, -14);
(36, -17, -14); (37, -18, -14); starting fit
Position : (5.2, -0.13, -1.9)
Slopes : dx/dz = -3.2e-17, dy/dz = 3.1e-17
q/p = 2.5
Propagate in flight direction
Error in ERTRAK : particle type 0 unknown in GEANT
sighandler for sig 8
|
This is the associated backtrace from the core dump:
Quote: | #0 0xffffe410 in __kernel_vsyscall ()
#1 0xb6d72811 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb6d73fb9 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb31e67c4 in sighandler (sig=8) at /afs/e18/panda/SIM/fboehmer/trunk/recotasks/KalmanTask.cxx:56
#4 <signal handler called>
#5 0xb2b1162d in FairGeanePro::Track2ToPoint (this=0xe106188, x1=@0xbfdcde28, x2=@0xbfdcde04, w1=@0xbfdcdde0, Pfinal=@0xe106388,
Dist=@0xe106380, Length=@0xbfdcdd70) at /afs/e18/panda/SIM/fboehmer/trunk/geane/FairGeanePro.cxx:762
#6 0xb2b14ca2 in FairGeanePro::FindPCA (this=0xe106188, pca=1, PDGCode=1000010020, point=@0xbfdceb84, wire1=@0xbfdceb60,
wire2=@0xbfdceb3c, maxdistance=23.679142069207522, Rad=@0xe106378, vpf=@0xe106388, vwi=@0xe1063ac, Di=@0xe106380, trklength=@0xe1063d0)
at /afs/e18/panda/SIM/fboehmer/trunk/geane/FairGeanePro.cxx:554
#7 0xb2b180f5 in FairGeanePro::Propagate (this=0xe106188, TStart=0xbfdcf18c, TEnd=0xbfdced60, PDG=1000010020)
at /afs/e18/panda/SIM/fboehmer/trunk/geane/FairGeanePro.cxx:180
#8 0xb394482e in GeaneTrackRep::extrapolateToPoca (this=0x119f2268, pos=@0xbfdcfd0c, poca=@0xbfdcfce8, dirInPoca=@0xbfdcfcc4)
at /afs/e18/panda/SIM/fboehmer/trunk/trackrep/GeaneTrackRep.cxx:272
|
Specifically, in frame 5:
Quote: | #5 0xb2b1162d in FairGeanePro::Track2ToPoint (this=0xe106188, x1=@0xbfdcde28, x2=@0xbfdcde04, w1=@0xbfdcdde0, Pfinal=@0xe106388,
Dist=@0xe106380, Length=@0xbfdcdd70) at /afs/e18/panda/SIM/fboehmer/trunk/geane/FairGeanePro.cxx:762
762 a= 1./(x2-x1).Mag();
(gdb) print x1
$4 = (class TVector3 &) @0xbfdcde28: {<TObject> = {_vptr.TObject = 0xb4ae6b88, fUniqueID = 0, fBits = 33554432, static fgDtorOnly = 0,
static fgObjectStat = false, static fgIsA = 0x84367d8}, fX = 0, fY = 0, fZ = 0, static fgIsA = 0x88ba2b8}
(gdb) print x2
$5 = (class TVector3 &) @0xbfdcde04: {<TObject> = {_vptr.TObject = 0xb4ae6b88, fUniqueID = 0, fBits = 33554432, static fgDtorOnly = 0,
static fgObjectStat = false, static fgIsA = 0x84367d8}, fX = 0, fY = 0, fZ = 0, static fgIsA = 0x88ba2b8
|
As you can see, at FairGeanePro.cxx:762 division by zero is performed, both x1 and x2 are zero in all coordinates. I don't know if this is associated with the error message directly above the crash concerning an unknown particle type. Looking at frame 6 of the backtrace, the pdg ID appears to be 1000010020, which is the one of the deuteron, I think.
So it looks like GEANE doesn't recognize the deuteron (as it probably doesn't have to) but does not treat the case of an unidentified particle correctly ...
Thanks for your effort and any replies in advance
Felix
|
|
|
|
|
|
|
|
|
|
Re: Urgent fixes in FairGeanePro.cxx needed [message #8163 is a reply to message #8162] |
Wed, 01 April 2009 00:25 |
Anonymous Poster
|
|
From: *pool.einsundeins.de
|
|
Hi,
there is another place I dont like in FairGeanePro which I forgot earlier. Please someone apply the following diff:
hoeppi@hoeppi-MacBook:~/pandaroot/geane$ svn diff FairGeanePro.cxx
Index: FairGeanePro.cxx
===================================================================
--- FairGeanePro.cxx (revision 5184)
+++ FairGeanePro.cxx (working copy)
@@ -66,7 +66,7 @@
Init(TParam);
Double_t Q = TParam->GetQ();
- if (Q!=0)ch= Q/TMath::Abs(Q);
+ if (fabs(Q)<1.E-8)ch= Q/TMath::Abs(Q);
if (ProMode==1){ //Propagate to Volume
//***** We have the right representation go further
for(Int_t i=0;i<15;i++) {
Q is a double, so we dont want to use == or != on it.
Cheers, Christian
|
|
|
Re: Urgent fixes in FairGeanePro.cxx needed [message #8164 is a reply to message #8163] |
Wed, 01 April 2009 00:27 |
Anonymous Poster
|
|
From: *pool.einsundeins.de
|
|
Oops the < should be a > .....
Index: FairGeanePro.cxx
===================================================================
--- FairGeanePro.cxx (revision 5184)
+++ FairGeanePro.cxx (working copy)
@@ -66,7 +66,7 @@
Init(TParam);
Double_t Q = TParam->GetQ();
- if (Q!=0)ch= Q/TMath::Abs(Q);
+ if (fabs(Q)>1.E-8)ch= Q/TMath::Abs(Q);
if (ProMode==1){ //Propagate to Volume
//***** We have the right representation go further
for(Int_t i=0;i<15;i++) {
Sleep tight!
Christian
|
|
|
Goto Forum:
Current Time: Tue Dec 03 01:50:06 CET 2024
Total time taken to generate the page: 0.01196 seconds
|