GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Tracking » Urgent fixes in FairGeanePro.cxx needed
Urgent fixes in FairGeanePro.cxx needed [message #8152] Tue, 31 March 2009 15:26 Go to next message
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 Go to previous messageGo to next message
Felix Boehmer is currently offline  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 Smile

Felix
Re: Urgent fixes in FairGeanePro.cxx needed [message #8155 is a reply to message #8152] Tue, 31 March 2009 16:19 Go to previous messageGo to next message
Sebastian Neubert is currently offline  Sebastian Neubert
Messages: 282
Registered: March 2006
Location: Munich
first-grade participant

From: *natpool.mwn.de
Hi!

I have write permissions on GeanePro. If you like we can also do this.

Sebastian.


Sebastian Neubert
Technische Universität München
Department Physik E18
sneubert@e18.physik.tu-muenchen.de
tel: +49-8928912592
Re: Urgent fixes in FairGeanePro.cxx needed [message #8156 is a reply to message #8155] Tue, 31 March 2009 16:47 Go to previous messageGo to next message
Sebastian Neubert is currently offline  Sebastian Neubert
Messages: 282
Registered: March 2006
Location: Munich
first-grade participant

From: *natpool.mwn.de
Hi!

I will take care of these issues. Let's see what I can do.

Cheers! Sebastian.


Sebastian Neubert
Technische Universität München
Department Physik E18
sneubert@e18.physik.tu-muenchen.de
tel: +49-8928912592
Re: Urgent fixes in FairGeanePro.cxx needed [message #8157 is a reply to message #8154] Tue, 31 March 2009 17:06 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *kph.uni-mainz.de
Hi Felix,
maybe you can use the following function
for those particles whose pdg is larger than 5000
,namely, ions. i have some time ago problems
also to extract the charge using the
TDatabasePDG::Instance()->GetParticle(pdg)->Charge()/3..

the variable ion corresponds to the pdg code of the
particle, for example, 1000010020.

Int_t PndHypDPatternRecoTask::GetChargeIon(Int_t ion)
261 {
262 Int_t A,Z,L;
263
264 if(ion>1000000000&&(ion<1010000000))
265 { ion -= 1000000000;
266 Z = ion/10000;
267 ion -= 10000*Z;
268 A = ion/10;
269 cout<<" ion charge "<<Z<<endl;
270
271 return Z;
272
273 }

I hope it can help you,
best regrads
Alicia S.
Re: Urgent fixes in FairGeanePro.cxx needed [message #8158 is a reply to message #8156] Tue, 31 March 2009 17:21 Go to previous messageGo to next message
Lia Lavezzi
Messages: 291
Registered: May 2007
Location: Torino
first-grade participant

From: 151.47.174*
Hi,
sorry if I didn' t reply soon...
I want to thank you, Sebastian, if you can take care of this Very Happy
If on the contrary you cannot (or you need info/help) please let me know, I will have a look to that but it will take some time since I am busy in other issues at the moment... Sad

Bye,
Lia.
Re: Urgent fixes in FairGeanePro.cxx needed [message #8160 is a reply to message #8152] Tue, 31 March 2009 18:02 Go to previous messageGo to next message
Sebastian Neubert is currently offline  Sebastian Neubert
Messages: 282
Registered: March 2006
Location: Munich
first-grade participant

From: *natpool.mwn.de
Hi!

The above mentioned place where a division by 0 could happen have been protected now. Please try if it works!

Cheers! Sebastian.


Sebastian Neubert
Technische Universität München
Department Physik E18
sneubert@e18.physik.tu-muenchen.de
tel: +49-8928912592
Re: Urgent fixes in FairGeanePro.cxx needed [message #8161 is a reply to message #8160] Tue, 31 March 2009 23:15 Go to previous messageGo to next message
Anonymous Poster From: *pool.einsundeins.de
Wow, looks like we're becoming a good team! Way to go!!!
Re: Urgent fixes in FairGeanePro.cxx needed [message #8162 is a reply to message #8161] Wed, 01 April 2009 00:19 Go to previous messageGo to next message
Anonymous Poster From: *pool.einsundeins.de
Hi,

shouldnt the ClassDef macro in FairGeanePro.h be public. Well I think I know it should. Can somebody fix it?

Christian
Re: Urgent fixes in FairGeanePro.cxx needed [message #8163 is a reply to message #8162] Wed, 01 April 2009 00:25 Go to previous messageGo to next message
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 Go to previous message
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
Previous Topic: problem with TrackCand
Next Topic: WirepointHitPolicy detplane implementation
Goto Forum:
  


Current Time: Mon Jun 17 06:11:03 CEST 2024

Total time taken to generate the page: 0.00943 seconds