Details
-
Bug
-
Status: Closed (View Workflow)
-
High
-
Resolution: Fixed
-
6.14/04
-
lxplus6 (slc6)
python 2.7.4
root 6.14.04
Description
This TGLLine3 constructor
https://root.cern.ch/doc/v614/classTGLLine3.html#ac51eb4c07e9e4faf0f205f06820b0ac7
behaves differently in C++ and Python. Consider this snippet:
C++:
trackAfterScattering = TGLLine3(TGLVertex3(2., 3., 0.2), TGLVector3(0., 0., -20.));
|
printf("Track vector: (%f, %f, %f)\n", trackAfterScattering.Vector().X(), trackAfterScattering.Vector().Y(), trackAfterScattering.Vector().Z());
|
Python:
import ROOT
|
from ROOT import TGLLine3, TGLVertex3, TGLVector3
|
trackAfterScattering = TGLLine3(TGLVertex3(2., 3., 0.2), TGLVector3(0., 0., -20.))
|
print("Track vector: (%f, %f, %f)" % (trackAfterScattering.Vector().X(), trackAfterScattering.Vector().Y(), trackAfterScattering.Vector().Z()))
|
The first one outputs the vector attributes as provided in the constructor (correct behavior):
Track vector: (0.000000, 0.000000, -20.000000)
|
, while the second one outputs something else (incorrect behavior):
Track vector: (-2.000000, -3.000000, -20.200000)
|
A bit more details can be found here: https://root-forum.cern.ch/t/difference-between-c-and-python-outputs/33905