FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairGeoMatrix.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 //*-- Author : M. Sanchez
9 //*-- Modified : 07.03.2001
10 
11 #include "FairGeoMatrix.h"
12 
14 // FairGeoMatrix
15 //
16 // Simple 3D matrix interface for use with FairGeoVector.
17 //
18 // Note:
19 // This class is completely incomplete. Features will be
20 // added as needed
22 
24  : TObject()
25 {
26  // Initializes the matrix to 0
27  for (int i = 0; i < 9; i++) {
28  fM[i] = 0.0;
29  }
30 }
31 
33 
34 Double_t FairGeoMatrix::det(void)
35 {
36  // Computes de determinat of the 3D matrix
37  return (fM[0] * fM[4] * fM[8] + fM[1] * fM[5] * fM[6] + fM[3] * fM[7] * fM[2] - fM[2] * fM[4] * fM[6]
38  - fM[1] * fM[3] * fM[8] - fM[5] * fM[7] * fM[0]);
39 }
40 
42 {
43  // Matrix multiplication
44  FairGeoVector vo;
45  vo.setX(fM[0] * v.getX() + fM[1] * v.getY() + fM[2] * v.getZ());
46  vo.setY(fM[3] * v.getX() + fM[4] * v.getY() + fM[5] * v.getZ());
47  vo.setZ(fM[6] * v.getX() + fM[7] * v.getY() + fM[8] * v.getZ());
48  return vo;
49 }
50 
52 {
53  // Matrix division by a constant. Divides each element on the
54  // matrix by the constant "d"
55  for (int i = 0; i < 9; i++) {
56  fM[i] /= d;
57  }
58  return *this;
59 }
60 
void setX(const Double_t a)
Definition: FairGeoVector.h:71
Double_t det(void)
FairGeoMatrix & operator/=(Double_t d)
ClassImp(FairEventBuilder)
void setZ(const Double_t a)
Definition: FairGeoVector.h:73
FairGeoVector operator*(FairGeoVector &v)
Double_t getX() const
Definition: FairGeoVector.h:44
void setY(const Double_t a)
Definition: FairGeoVector.h:72
Double_t getZ() const
Definition: FairGeoVector.h:46
Double_t fM[9]
Definition: FairGeoMatrix.h:22
Double_t getY() const
Definition: FairGeoVector.h:45