- void SetAngles(const Double_t rot[3]){// [radians]
- for(Int_t i=0;i<3;i++)frot[i] = rot[i];this->MatrixFromAngle();}
- void SetTranslation(const Double_t tran[3]){
- for(Int_t i=0;i<3;i++) ftran[i] = tran[i];}
- void SetMatrix(const Double_t matrix[3][3]){ for(Int_t i=0;i<3;i++)
- for(Int_t j=0;j<3;j++) fm[i][j]=matrix[i][j];this->AngleFromMatrix();}
- void SetDetectorIndex(const Int_t idt) {fDetectorIndex = idt;}
- void SetIndex(const Int_t id[3]){
- for(Int_t i=0;i<3;i++) fid[i] = id[i];}
- void GetAngles(Double_t rot[3]){// [radians]
- for(Int_t i=0;i<3;i++) rot[i] = frot[i];}
- void GetTranslation(Double_t tran[3]){
- for(Int_t i=0;i<3;i++) tran[i] = ftran[i];}
- void GetMatrix(Double_t matrix[3][3]){for(Int_t i=0;i<3;i++)
- for(Int_t j=0;j<3;j++) matrix[i][j] = fm[i][j];}
- Int_t GetDetectorIndex() {return fDetectorIndex;}
- void GetIndex(Int_t id[3]){for(Int_t i=0;i<3;i++) id[i] = fid[i];}
- void MatrixFromSixAngles(const Double_t *ang);
- void SixAnglesFromMatrix(Double_t *ang);
+class AliITSgeomMatrix : public TObject {
+ public:
+ AliITSgeomMatrix(); // Default constructor
+ // Standard constructor #1
+ AliITSgeomMatrix(Int_t idt,const Int_t id[3],
+ const Double_t rot[3],const Double_t tran[3]);
+ // Standard constructor #2
+ AliITSgeomMatrix(Int_t idt,const Int_t id[3],
+ Double_t matrix[3][3],const Double_t tran[3]);
+ // Standard constructor #3
+ AliITSgeomMatrix(const Double_t rotd[6]/*degrees GEANT angles*/,
+ Int_t idt,const Int_t id[3],
+ const Double_t tran[3]);
+ // Copy constructor
+ AliITSgeomMatrix(const AliITSgeomMatrix &source);
+ // Assignment operator
+ AliITSgeomMatrix& operator=(const AliITSgeomMatrix &source);
+ virtual ~AliITSgeomMatrix(){}; // default constructor.
+ // Prints a line describing the output format of the function Print.
+ void PrintComment(ostream *os) const;
+ // Prints out the content of this class in ASCII format.
+ void Print(ostream *os)const;
+ // Prints out the content of this class in ASCII format but includes
+ // formating and strings that make it more humanly readable.
+ void PrintTitles(ostream *os) const;
+ // Reads in the content of this class in the format of Print
+ void Read(istream *is);
+ virtual void Print(Option_t* const option="") const {
+ TObject::Print(option);}
+ virtual Int_t Read(const char *name) {return TObject::Read(name);}
+
+ // Returns the geometry path corresponding to this transformation
+ TString& GetPath(){return fPath;}
+ // Sets the geometry path
+ void SetPath(const Char_t *p){fPath = p;}
+ void SetPath(const TString &p){fPath = p;}
+ // Given the rotation angles [radians] it fills frot and computes
+ // the rotation matrix fm.
+ void SetAngles(const Double_t rot[3]){// [radians]
+ for(Int_t i=0;i<3;i++)frot[i] = rot[i];this->MatrixFromAngle();}
+ // Sets the translation vector and computes fCylR and fCylPhi.
+ void SetTranslation(const Double_t tran[3]);
+ // sets the rotation matrix and computes the rotation angles [radians]
+ void SetMatrix(const Double_t matrix[3][3]){ for(Int_t i=0;i<3;i++)
+ for(Int_t j=0;j<3;j++) fm[i][j]=matrix[i][j];this->AngleFromMatrix();}
+ // Sets the detector index value
+ void SetDetectorIndex(Int_t idt) {fDetectorIndex = idt;}
+ // Sets the detector layer, ladder, detector (id) values.
+ void SetIndex(const Int_t id[3]){
+ for(Int_t i=0;i<3;i++) fid[i] = id[i];}
+ // Returns the rotation angles [radians]
+ void GetAngles(Double_t rot[3]) const {// [radians]
+ for(Int_t i=0;i<3;i++) rot[i] = frot[i];}
+ // Returns the translation vector [cm]
+ void GetTranslation(Double_t tran[3]) const {
+ for(Int_t i=0;i<3;i++) tran[i] = ftran[i];}
+ // Returns the translation vector in cylindrical
+ // coordinates [cm,radians]
+ void GetTranslationCylinderical (Double_t tran[3]) const {
+ tran[0] = fCylR;
+ tran[1] = fCylPhi;
+ tran[2] = ftran[2];}
+ // Returns the values of the rotation matrix
+ void GetMatrix(Double_t matrix[3][3]) const {for(Int_t i=0;i<3;i++)
+ for(Int_t j=0;j<3;j++) matrix[i][j] = fm[i][j];}
+ // Returns the detector index value.
+ Int_t GetDetectorIndex() const {return fDetectorIndex;}
+ // returns the modules index layer, ladder, detector
+ void GetIndex(Int_t id[3]) const {for(Int_t i=0;i<3;i++) id[i] = fid[i];}
+ // return the x,y,z components (global) of the normalized normal
+ // vector which helps to define the plane the detector is a part of
+ void GetGlobalNormal(Double_t &nx,Double_t &ny,Double_t &nz)const{
+ Double_t ln[3]={0.0,1.0,0.0},gn[3];LtoGMomentum(ln,gn);
+ nx = gn[0];ny=gn[1];nz=gn[2];return;}
+ // Sets the rotation matrix based on the 6 GEANT rotation
+ // angles [radian]
+ void MatrixFromSixAngles(const Double_t *ang);
+ // Returns the 6 GEANT rotation angles [radians] from the
+ // existing rotation matrix.
+ void SixAnglesFromMatrix(Double_t *ang)const;
+ // Set rotation using the Euler's Chi-convention
+ void SetEulerAnglesChi(const Double_t ang[3]);