3 #include <TGeoManager.h> 6 #include <TGeoMatrix.h> 13 const TMatrixD& matrix,
15 : TEveGeoShape(name) {
21 const TMatrixF& matrix,
23 : TEveGeoShape(name) {
29 const TMatrixD& matrix,
36 TMatrixD tubeRot(3,3);
37 for (
int i=0; i<3; ++i) {
38 for (
int j=0; j<3; ++j) {
39 tubeRot(i,j) = matrix(i,j);
47 TMatrixD tubeEigen(tubeRot.EigenVectors(values));
49 tubeAxis = std::sqrt(
values(0));
50 tubeRot(0,2) = tubeEigen(0,0);
51 tubeRot(1,2) = tubeEigen(1,0);
52 tubeRot(2,2) = tubeEigen(2,0);
53 tubeMajor = std::sqrt(
values(1));
54 tubeRot(0,0) = tubeEigen(0,1);
55 tubeRot(1,0) = tubeEigen(1,1);
56 tubeRot(2,0) = tubeEigen(2,1);
57 tubeMinor = std::sqrt(
values(2));
58 tubeRot(0,1) = tubeEigen(0,2);
59 tubeRot(1,1) = tubeEigen(1,2);
60 tubeRot(2,1) = tubeEigen(2,2);
63 tubeAxis = std::sqrt(
values(2));
64 tubeRot(0,2) = tubeEigen(0,2);
65 tubeRot(1,2) = tubeEigen(1,2);
66 tubeRot(2,2) = tubeEigen(2,2);
67 tubeMajor = std::sqrt(
values(0));
68 tubeRot(0,0) = tubeEigen(0,0);
69 tubeRot(1,0) = tubeEigen(1,0);
70 tubeRot(2,0) = tubeEigen(2,0);
71 tubeMinor = std::sqrt(
values(1));
72 tubeRot(0,1) = tubeEigen(0,1);
73 tubeRot(1,1) = tubeEigen(1,1);
74 tubeRot(2,1) = tubeEigen(2,1);
79 rot.SetMatrix(tubeRot.GetMatrixArray());
82 TGeoTranslation trans(position.X(), position.Y(), position.Z());
85 TGeoCombiTrans rotTrans(trans,rot);
86 SetTransMatrix(rotTrans);
90 tubeMajor =
std::max(1.5, tubeMajor);
91 tubeMinor =
std::max(1.5, tubeMinor);
98 TGeoManager* saveGeom = gGeoManager;
99 gGeoManager = GetGeoMangeur();
100 TGeoShape* geoShape =
new TGeoEltu(tubeMajor,tubeMinor,tubeAxis);
102 gGeoManager = saveGeom;
void Initialize(const TVector3 &position, const TMatrixD &matrix, bool longAxis)
virtual ~TMatrixElement()
TMatrixElement(const char *name, const TVector3 &position, const TMatrixD &matrix, bool longAxis)
static int max(int a, int b)