FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairGeoTransform.h
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 #ifndef FAIRGEOTRANSFORM_H
9 #define FAIRGEOTRANSFORM_H
10 
11 #include "FairGeoRotation.h" // for FairGeoRotation
12 #include "FairGeoVector.h" // for FairGeoVector
13 
14 #include <Rtypes.h> // for Double_t, etc
15 #include <TObject.h> // for TObject
16 
20 class FairGeoTransform : public TObject
21 {
22  protected:
27  public:
29  inline FairGeoTransform(const FairGeoTransform& t);
32  const FairGeoRotation& getRotMatrix() const { return rot; }
33  const FairGeoVector& getTransVector() const { return trans; }
34  void setRotMatrix(const FairGeoRotation& r) { rot = r; }
35  void setRotMatrix(const Double_t* a) { rot.setMatrix(a); }
36  void setRotMatrix(const Float_t* a) { rot.setMatrix(a); }
37  void setTransVector(const FairGeoVector& t) { trans = t; }
38  void setTransVector(const Double_t* a) { trans.setVector(a); }
39  void setTransVector(const Float_t* a) { trans.setVector(a); }
40  FairGeoVector transFrom(const FairGeoVector& p) const;
41  FairGeoVector transTo(const FairGeoVector& p) const;
42  void transFrom(const FairGeoTransform&);
43  void transTo(const FairGeoTransform&);
44  void invert(void);
45  void clear();
46  void print();
48  {
49  const double fac = 10.;
50  trans_cm = trans;
51  return (trans_cm /= fac);
52  }
53 
54  const FairGeoRotation& getRotation() const { return rot; }
55 
56  inline void setTransform(const FairGeoTransform& t);
58 };
59 
61  : TObject(t)
62  , rot(t.getRotMatrix())
63  , trans(t.getTransVector())
64  , trans_cm(FairGeoVector(0, 0, 0))
65 {}
66 
68 {
69  rot = t.getRotMatrix();
70  trans = t.getTransVector();
71 }
72 
73 #endif /* !FAIRGEOTRANSFORM_H */
void setTransVector(const FairGeoVector &t)
FairGeoRotation rot
void setVector(const Double_t *a)
ClassDef(FairGeoTransform, 1)
void setMatrix(const Double_t *)
void setTransVector(const Float_t *a)
FairGeoTransform & operator=(const FairGeoTransform &t)
const FairGeoVector & getTransVector() const
FairGeoVector transFrom(const FairGeoVector &p) const
const FairGeoRotation & getRotMatrix() const
FairGeoVector transTo(const FairGeoVector &p) const
const FairGeoVector & getTranslation()
FairGeoVector trans_cm
FairGeoVector trans
void setRotMatrix(const FairGeoRotation &r)
void setRotMatrix(const Double_t *a)
void setRotMatrix(const Float_t *a)
const FairGeoRotation & getRotation() const
void setTransform(const FairGeoTransform &t)
void setTransVector(const Double_t *a)