GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Tracking » Charge in FairTrackPar and GeaneTrackRep
Charge in FairTrackPar and GeaneTrackRep Fri, 22 October 2010 06:11
 StefanoSpataro Messages: 2736Registered: June 2005 Location: Torino first-grade participant From: 140.109.130*
Hi,
I have seen that in the constructors of FairTrackPar and GeaneTrackRep the charge is defined as integer and double respectively.
This leaves the following warning:

/.../trunk/GenfitTools/trackrep/GeaneTrackRep/GeaneTrackRep.cxx:53: warning: passing 'double' for argument 5 to 'FairTrackParP::FairTrackParP(TVector3, TVector3, TVector3, TVector3, Int_t, TVector3, TVector3, TVector3)'

and not only, due to the following lines:

GeaneTrackRep::GeaneTrackRep(FairGeanePro* geane,
const GFDetPlane& plane,
const TVector3& mom,
const TVector3& poserr,
const TVector3& momerr,
double q,
int PDGCode)
: GFAbsTrackRep(5), _geane(geane), _pdg(PDGCode), _backw(0)
{
FairTrackParP par(plane.getO(),mom,poserr,momerr,q,plane.getO(),plane.getU(),plane.getV());
(5th parameter -> q).
I think both objects should use the same kind of variable, to be much less "error prone". Indeed, the conversion from double to integer is dangerous:

int(0.9999999) = 0

I think this is quite important! Even other tracking codes should be changed to use a common standard for the particle charge, by substitution of all the current conversions (once fixed if it is better to use int or double).

 Charge in FairTrackPar and GeaneTrackRep By: StefanoSpataro on Fri, 22 October 2010 06:11 Re: Charge in FairTrackPar and GeaneTrackRep By: Anonymous Poster on Fri, 22 October 2010 06:16 Re: Charge in FairTrackPar and GeaneTrackRep By: Lia Lavezzi on Fri, 22 October 2010 10:24 Re: Charge in FairTrackPar and GeaneTrackRep By: StefanoSpataro on Sun, 24 October 2010 05:41 Re: Charge in FairTrackPar and GeaneTrackRep By: StefanoSpataro on Wed, 27 October 2010 11:26
 Previous Topic: Geometry of STT Next Topic: Bug in PndGenfitAdapters
Goto Forum:

Current Time: Fri Apr 12 15:59:31 CEST 2024

Total time taken to generate the page: 0.01169 seconds