1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.7 2001/02/03 00:00:30 nilsen
19 New version of AliITSgeom and related files. Now uses automatic streamers,
20 set up for new formatted .det file which includes detector information.
21 Additional smaller modifications are still to come.
23 Revision 1.5 2000/10/02 16:32:35 barbera
24 Forward declaration added
26 Revision 1.1.2.6 2000/10/02 15:52:05 barbera
27 Forward declaration added
29 Revision 1.4 2000/09/07 17:30:45 nilsen
30 fixed a bug in SixAnglesFromMatrix.
32 Revision 1.3 2000/09/05 14:25:50 nilsen
33 Made fixes for HP compiler. All function parameter default values placed
34 in .h file. Fixed the usual problem with HP comilers and the "for(Int_t i..."
35 business. Replaced casting (Double_t [3][3]) to (Double_t (*)[3]) for HP.
36 Lastly removed all "const" before function parameters which were 2 dim. arrays,
37 because on HP root generates some strange code (?). Thanks Peter for the
40 Revision 1.2 2000/08/29 20:16:50 nilsen
41 New class for ITS coordiante transformations used by AliITSgeom nearly
44 Revision 1.1.2.1 2000/06/04 16:32:31 Nilsen
45 A new class to hold the matrix information needed by AliITSgeom.
53 #include "AliITSgeomMatrix.h"
55 ClassImp(AliITSgeomMatrix)
56 //----------------------------------------------------------------------
57 AliITSgeomMatrix::AliITSgeomMatrix(){
58 ////////////////////////////////////////////////////////////////////////
59 // The Default constructor for the AliITSgeomMatrix class. By Default
60 // the angles of rotations are set to zero, meaning that the rotation
61 // matrix is the unit matrix. The translation vector is also set to zero
62 // as are the module id number. The detector type is set to -1 (an undefined
63 // value). The full rotation matrix is kept so that the evaluation
64 // of a coordinate transformation can be done quickly and with a minimum
65 // of CPU overhead. The basic coordinate systems are the ALICE global
66 // coordinate system and the detector local coordinate system. In general
67 // this structure is not limited to just those two coordinate systems.
70 <img src="picts/ITS/AliISgeomMatrix_L1.gif">
73 ////////////////////////////////////////////////////////////////////////
76 fDetectorIndex = -1; // a value never defined.
79 frot[i] = ftran[i] = 0.0;
80 for(j=0;j<3;j++) fm[i][j] = 0.0;
82 fm[0][0] = fm[1][1] = fm[2][2] = 1.0;
84 //----------------------------------------------------------------------
85 AliITSgeomMatrix::AliITSgeomMatrix(const AliITSgeomMatrix &sourse){
86 ////////////////////////////////////////////////////////////////////////
87 // The standard copy constructor. This make a full / proper copy of
89 ////////////////////////////////////////////////////////////////////////
92 this->fDetectorIndex = sourse.fDetectorIndex;
94 this->fid[i] = sourse.fid[i];
95 this->frot[i] = sourse.frot[i];
96 this->ftran[i] = sourse.ftran[i];
97 for(j=0;j<3;j++) this->fm[i][j] = sourse.fm[i][j];
100 //----------------------------------------------------------------------
101 void AliITSgeomMatrix::operator=(const AliITSgeomMatrix &sourse){
102 ////////////////////////////////////////////////////////////////////////
103 // The standard = operator. This make a full / proper copy of
105 ////////////////////////////////////////////////////////////////////////
108 this->fDetectorIndex = sourse.fDetectorIndex;
110 this->fid[i] = sourse.fid[i];
111 this->frot[i] = sourse.frot[i];
112 this->ftran[i] = sourse.ftran[i];
113 for(j=0;j<3;j++) this->fm[i][j] = sourse.fm[i][j];
116 //----------------------------------------------------------------------
117 AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
118 const Double_t rot[3],const Double_t tran[3]){
119 ////////////////////////////////////////////////////////////////////////
120 // This is a constructor for the AliITSgeomMatrix class. The matrix is
121 // defined by 3 standard rotation angles [radians], and the translation
122 // vector tran [cm]. In addition the layer, ladder, and detector number
123 // for this particular module and the type of module must be given.
124 // The full rotation matrix is kept so that the evaluation
125 // of a coordinate transformation can be done quickly and with a minimum
126 // of CPU overhead. The basic coordinate systems are the ALICE global
127 // coordinate system and the detector local coordinate system. In general
128 // this structure is not limited to just those two coordinate systems.
131 <img src="picts/ITS/AliISgeomMatrix_L1.gif">
134 ////////////////////////////////////////////////////////////////////////
137 fDetectorIndex = idt; // a value never defined.
143 this->MatrixFromAngle();
145 //----------------------------------------------------------------------
146 AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt, const Int_t id[3],
147 Double_t matrix[3][3],
148 const Double_t tran[3]){
149 ////////////////////////////////////////////////////////////////////////
150 // This is a constructor for the AliITSgeomMatrix class. The rotation matrix
151 // is given as one of the inputs, and the translation vector tran [cm]. In
152 // addition the layer, ladder, and detector number for this particular
153 // module and the type of module must be given. The full rotation matrix
154 // is kept so that the evaluation of a coordinate transformation can be
155 // done quickly and with a minimum of CPU overhead. The basic coordinate
156 // systems are the ALICE global coordinate system and the detector local
157 // coordinate system. In general this structure is not limited to just
158 // those two coordinate systems.
161 <img src="picts/ITS/AliISgeomMatrix_L1.gif">
164 ////////////////////////////////////////////////////////////////////////
167 fDetectorIndex = idt; // a value never defined.
171 for(j=0;j<3;j++) fm[i][j] = matrix[i][j];
173 this->AngleFromMatrix();
175 //----------------------------------------------------------------------
176 void AliITSgeomMatrix::SixAnglesFromMatrix(Double_t *ang){
177 ////////////////////////////////////////////////////////////////////////
178 // This function returns the 6 GEANT 3.21 rotation angles [degrees] in
179 // the array ang which must be at least [6] long.
180 ////////////////////////////////////////////////////////////////////////
181 Double_t si,c=180./TMath::Pi();
183 ang[1] = TMath::ATan2(fm[0][1],fm[0][0]);
184 if(TMath::Cos(ang[1])!=0.0) si = fm[0][0]/TMath::Cos(ang[1]);
185 else si = fm[0][1]/TMath::Sin(ang[1]);
186 ang[0] = TMath::ATan2(si,fm[0][2]);
188 ang[3] = TMath::ATan2(fm[1][1],fm[1][0]);
189 if(TMath::Cos(ang[3])!=0.0) si = fm[1][0]/TMath::Cos(ang[3]);
190 else si = fm[1][1]/TMath::Sin(ang[3]);
191 ang[2] = TMath::ATan2(si,fm[1][2]);
193 ang[5] = TMath::ATan2(fm[2][1],fm[2][0]);
194 if(TMath::Cos(ang[5])!=0.0) si = fm[2][0]/TMath::Cos(ang[5]);
195 else si = fm[2][1]/TMath::Sin(ang[5]);
196 ang[4] = TMath::ATan2(si,fm[2][2]);
198 for(Int_t i=0;i<6;i++) {ang[i] *= c; if(ang[i]<0.0) ang[i] += 360.;}
200 //----------------------------------------------------------------------
201 void AliITSgeomMatrix::MatrixFromSixAngles(const Double_t *ang){
202 ////////////////////////////////////////////////////////////////////////
203 // Given the 6 GEANT 3.21 rotation angles [degree], this will compute and
204 // set the rotations matrix and 3 standard rotation angles [radians].
205 // These angles and rotation matrix are overwrite the existing values in
207 ////////////////////////////////////////////////////////////////////////
209 Double_t si,lr[9],c=TMath::Pi()/180.;
211 si = TMath::Sin(c*ang[0]);
212 if(ang[0]== 90.0) si = +1.0;
213 if(ang[0]==270.0) si = -1.0;
214 if(ang[0]== 0.0||ang[0]==180.) si = 0.0;
215 lr[0] = si * TMath::Cos(c*ang[1]);
216 lr[1] = si * TMath::Sin(c*ang[1]);
217 lr[2] = TMath::Cos(c*ang[0]);
218 if(ang[0]== 90.0||ang[0]==270.) lr[2] = 0.0;
219 if(ang[0]== 0.0) lr[2] = +1.0;
220 if(ang[0]==180.0) lr[2] = -1.0;
222 si = TMath::Sin(c*ang[2]);
223 if(ang[2]== 90.0) si = +1.0;
224 if(ang[2]==270.0) si = -1.0;
225 if(ang[2]== 0.0||ang[2]==180.) si = 0.0;
226 lr[3] = si * TMath::Cos(c*ang[3]);
227 lr[4] = si * TMath::Sin(c*ang[3]);
228 lr[5] = TMath::Cos(c*ang[2]);
229 if(ang[2]== 90.0||ang[2]==270.) lr[5] = 0.0;
230 if(ang[2]== 0.0) lr[5] = +1.0;
231 if(ang[2]==180.0) lr[5] = -1.0;
233 si = TMath::Sin(c*ang[4]);
234 if(ang[4]== 90.0) si = +1.0;
235 if(ang[4]==270.0) si = -1.0;
236 if(ang[4]== 0.0||ang[4]==180.) si = 0.0;
237 lr[6] = si * TMath::Cos(c*ang[5]);
238 lr[7] = si * TMath::Sin(c*ang[5]);
239 lr[8] = TMath::Cos(c*ang[4]);
240 if(ang[4]== 90.0||ang[4]==270.0) lr[8] = 0.0;
241 if(ang[4]== 0.0) lr[8] = +1.0;
242 if(ang[4]==180.0) lr[8] = -1.0;
243 // Normalize these elements and fill matrix fm.
244 for(i=0;i<3;i++){// reuse si.
246 for(j=0;j<3;j++) si += lr[3*i+j]*lr[3*i+j];
247 si = TMath::Sqrt(1./si);
248 for(j=0;j<3;j++) fm[i][j] = si*lr[3*i+j];
250 this->AngleFromMatrix();
252 //----------------------------------------------------------------------
253 AliITSgeomMatrix::AliITSgeomMatrix(const Double_t rotd[6]/*degrees*/,
254 const Int_t idt,const Int_t id[3],
255 const Double_t tran[3]){
256 ////////////////////////////////////////////////////////////////////////
257 // This is a constructor for the AliITSgeomMatrix class. The matrix is
258 // defined by the 6 GEANT 3.21 rotation angles [degrees], and the translation
259 // vector tran [cm]. In addition the layer, ladder, and detector number
260 // for this particular module and the type of module must be given.
261 // The full rotation matrix is kept so that the evaluation
262 // of a coordinate transformation can be done quickly and with a minimum
263 // of CPU overhead. The basic coordinate systems are the ALICE global
264 // coordinate system and the detector local coordinate system. In general
265 // this structure is not limited to just those two coordinate systems.
268 <img src="picts/ITS/AliISgeomMatrix_L1.gif">
271 ////////////////////////////////////////////////////////////////////////
274 fDetectorIndex = idt; // a value never defined.
279 this->MatrixFromSixAngles(rotd);
281 //----------------------------------------------------------------------
282 void AliITSgeomMatrix::AngleFromMatrix(){
283 ////////////////////////////////////////////////////////////////////////
284 // Computes the angles from the rotation matrix up to a phase of 180 degrees.
285 ////////////////////////////////////////////////////////////////////////
287 // get angles from matrix up to a phase of 180 degrees.
289 rx = TMath::ATan2(fm[2][1],fm[2][2]);if(rx<0.0) rx += 2.0*TMath::Pi();
290 ry = TMath::ASin(fm[0][2]); if(ry<0.0) ry += 2.0*TMath::Pi();
291 rz = TMath::ATan2(fm[1][1],fm[0][0]);if(rz<0.0) rz += 2.0*TMath::Pi();
297 //----------------------------------------------------------------------
298 void AliITSgeomMatrix::MatrixFromAngle(){
299 ////////////////////////////////////////////////////////////////////////
300 // Computes the Rotation matrix from the angles [radians] kept in this
302 ////////////////////////////////////////////////////////////////////////
303 Double_t sx,sy,sz,cx,cy,cz;
305 sx = TMath::Sin(frot[0]); cx = TMath::Cos(frot[0]);
306 sy = TMath::Sin(frot[1]); cy = TMath::Cos(frot[1]);
307 sz = TMath::Sin(frot[2]); cz = TMath::Cos(frot[2]);
308 fm[0][0] = cz*cy; // fr[0]
309 fm[0][1] = -cz*sy*sx - sz*cx; // fr[1]
310 fm[0][2] = -cz*sy*cx + sz*sx; // fr[2]
311 fm[1][0] = sz*cy; // fr[3]
312 fm[1][1] = -sz*sy*sx + cz*cx; // fr[4]
313 fm[1][2] = -sz*sy*cx - cz*sx; // fr[5]
314 fm[2][0] = sy; // fr[6]
315 fm[2][1] = cy*sx; // fr[7]
316 fm[2][2] = cy*cx; // fr[8]
319 //----------------------------------------------------------------------
320 void AliITSgeomMatrix::GtoLPosition(const Double_t g0[3],Double_t l[3]){
321 ////////////////////////////////////////////////////////////////////////
322 // Returns the local coordinates given the global coordinates [cm].
323 ////////////////////////////////////////////////////////////////////////
327 for(i=0;i<3;i++) g[i] = g0[i] - ftran[i];
330 for(j=0;j<3;j++) l[i] += fm[i][j]*g[j];
331 // g = R l + translation
335 //----------------------------------------------------------------------
336 void AliITSgeomMatrix::LtoGPosition(const Double_t l[3],Double_t g[3]){
337 ////////////////////////////////////////////////////////////////////////
338 // Returns the global coordinates given the local coordinates [cm].
339 ////////////////////////////////////////////////////////////////////////
344 for(j=0;j<3;j++) g[i] += fm[j][i]*l[j];
346 // g = R^t l + translation
350 //----------------------------------------------------------------------
351 void AliITSgeomMatrix::GtoLMomentum(const Double_t g[3],Double_t l[3]){
352 ////////////////////////////////////////////////////////////////////////
353 // Returns the local coordinates of the momentum given the global
354 // coordinates of the momentum. It transforms just like GtoLPosition
355 // except that the translation vector is zero.
356 ////////////////////////////////////////////////////////////////////////
361 for(j=0;j<3;j++) l[i] += fm[i][j]*g[j];
366 //----------------------------------------------------------------------
367 void AliITSgeomMatrix::LtoGMomentum(const Double_t l[3],Double_t g[3]){
368 ////////////////////////////////////////////////////////////////////////
369 // Returns the Global coordinates of the momentum given the local
370 // coordinates of the momentum. It transforms just like LtoGPosition
371 // except that the translation vector is zero.
372 ////////////////////////////////////////////////////////////////////////
377 for(j=0;j<3;j++) g[i] += fm[j][i]*l[j];
382 //----------------------------------------------------------------------
383 void AliITSgeomMatrix::GtoLPositionError(Double_t g[3][3],
385 ////////////////////////////////////////////////////////////////////////
386 // Given an Uncertainty matrix in Global coordinates it is rotated so that
387 // its representation in local coordinates can be returned. There is no
388 // effect due to the translation vector or its uncertainty.
389 ////////////////////////////////////////////////////////////////////////
392 for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)for(m=0;m<3;m++)
393 l[i][m] = fm[j][i]*g[j][k]*fm[k][m];
397 //----------------------------------------------------------------------
398 void AliITSgeomMatrix::LtoGPositionError(Double_t l[3][3],
400 ////////////////////////////////////////////////////////////////////////
401 // Given an Uncertainty matrix in Local coordinates it is rotated so that
402 // its representation in global coordinates can be returned. There is no
403 // effect due to the translation vector or its uncertainty.
404 ////////////////////////////////////////////////////////////////////////
407 for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)for(m=0;m<3;m++)
408 g[i][m] = fm[i][j]*l[j][k]*fm[m][k];
412 //----------------------------------------------------------------------
413 void AliITSgeomMatrix::GtoLPositionTracking(const Double_t g0[3],
415 ////////////////////////////////////////////////////////////////////////
416 // A slightly different coordinate system is used when tracking.
417 // This coordinate system is only relevant when the geometry represents
418 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
419 // alone but X -> -Y and Y -> X such that X always points out of the
420 // ITS Cylinder for every layer including layer 1 (where the detector
421 // are mounted upside down).
424 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
427 ////////////////////////////////////////////////////////////////////////
430 this->GtoLPosition(g0,l0);
431 if(fid[0]==1){ // for layer 1 the detector are flipped upside down
432 // with respect to the others.
443 //----------------------------------------------------------------------
444 void AliITSgeomMatrix::LtoGPositionTracking(const Double_t l[3],
446 ////////////////////////////////////////////////////////////////////////
447 // A slightly different coordinate system is used when tracking.
448 // This coordinate system is only relevant when the geometry represents
449 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
450 // alone but X -> -Y and Y -> X such that X always points out of the
451 // ITS Cylinder for every layer including layer 1 (where the detector
452 // are mounted upside down).
455 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
458 ////////////////////////////////////////////////////////////////////////
461 if(fid[0]==1){ // for layer 1 the detector are flipped upside down
462 // with respect to the others.
471 this->LtoGPosition(l0,g);
474 //----------------------------------------------------------------------
475 void AliITSgeomMatrix::GtoLMomentumTracking(const Double_t g[3],
477 ////////////////////////////////////////////////////////////////////////
478 // A slightly different coordinate system is used when tracking.
479 // This coordinate system is only relevant when the geometry represents
480 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
481 // alone but X -> -Y and Y -> X such that X always points out of the
482 // ITS Cylinder for every layer including layer 1 (where the detector
483 // are mounted upside down).
486 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
489 ////////////////////////////////////////////////////////////////////////
492 this->GtoLMomentum(g,l0);
493 if(fid[0]==1){ // for layer 1 the detector are flipped upside down
494 // with respect to the others.
506 //----------------------------------------------------------------------
507 void AliITSgeomMatrix::LtoGMomentumTracking(const Double_t l[3],
509 ////////////////////////////////////////////////////////////////////////
510 // A slightly different coordinate system is used when tracking.
511 // This coordinate system is only relevant when the geometry represents
512 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
513 // alone but X -> -Y and Y -> X such that X always points out of the
514 // ITS Cylinder for every layer including layer 1 (where the detector
515 // are mounted upside down).
518 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
521 ////////////////////////////////////////////////////////////////////////
524 if(fid[0]==1){ // for layer 1 the detector are flipped upside down
525 // with respect to the others.
534 this->LtoGMomentum(l0,g);
537 //----------------------------------------------------------------------
538 void AliITSgeomMatrix::GtoLPositionErrorTracking(Double_t g[3][3],
540 ////////////////////////////////////////////////////////////////////////
541 // A slightly different coordinate system is used when tracking.
542 // This coordinate system is only relevant when the geometry represents
543 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
544 // alone but X -> -Y and Y -> X such that X always points out of the
545 // ITS Cylinder for every layer including layer 1 (where the detector
546 // are mounted upside down).
549 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
552 ////////////////////////////////////////////////////////////////////////
555 Double_t A0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
556 Double_t A1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
558 if(fid[0]==1) for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
559 Rt[i][k] = A0[i][j]*fm[j][k];
560 else for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
561 Rt[i][k] = A1[i][j]*fm[j][k];
562 for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)for(m=0;m<3;m++)
563 l[i][m] = Rt[j][i]*g[j][k]*Rt[k][m];
567 //----------------------------------------------------------------------
568 void AliITSgeomMatrix::LtoGPositionErrorTracking(Double_t l[3][3],
570 ////////////////////////////////////////////////////////////////////////
571 // A slightly different coordinate system is used when tracking.
572 // This coordinate system is only relevant when the geometry represents
573 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
574 // alone but X -> -Y and Y -> X such that X always points out of the
575 // ITS Cylinder for every layer including layer 1 (where the detector
576 // are mounted upside down).
579 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
582 ////////////////////////////////////////////////////////////////////////
585 Double_t A0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
586 Double_t A1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
588 if(fid[0]==1) for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
589 Rt[i][k] = A0[i][j]*fm[j][k];
590 else for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
591 Rt[i][k] = A1[i][j]*fm[j][k];
592 for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)for(m=0;m<3;m++)
593 g[i][m] = Rt[i][j]*l[j][k]*Rt[m][k];
597 //----------------------------------------------------------------------
598 void AliITSgeomMatrix::PrintTitles(ostream *os){
599 ////////////////////////////////////////////////////////////////////////
600 // Standard output format for this class but it includes variable
601 // names and formatting that makes it easer to read.
602 ////////////////////////////////////////////////////////////////////////
605 *os << "fDetectorIndex=" << fDetectorIndex << " fid[3]={";
606 for(i=0;i<3;i++) *os << fid[i] << " ";
607 *os << "} frot[3]={";
608 for(i=0;i<3;i++) *os << frot[i] << " ";
609 *os << "} ftran[3]={";
610 for(i=0;i<3;i++) *os << ftran[i] << " ";
611 *os << "} fm[3][3]={";
612 for(i=0;i<3;i++){for(j=0;j<3;j++){ *os << fm[i][j] << " ";} *os <<"}{";}
616 //----------------------------------------------------------------------
617 void AliITSgeomMatrix::PrintComment(ostream *os){
618 ////////////////////////////////////////////////////////////////////////
619 // output format used by Print..
620 ////////////////////////////////////////////////////////////////////////
621 *os << "fDetectorIndex fid[0] fid[1] fid[2] ftran[0] ftran[1] ftran[2] ";
622 *os << "fm[0][0] fm[0][1] fm[0][2] fm[1][0] fm[1][1] fm[1][2] ";
623 *os << "fm[2][0] fm[2][1] fm[2][2] ";
626 //----------------------------------------------------------------------
627 void AliITSgeomMatrix::Print(ostream *os){
628 ////////////////////////////////////////////////////////////////////////
629 // Standard output format for this class.
630 ////////////////////////////////////////////////////////////////////////
634 fmt = os->setf(ios::scientific); // set scientific floating point output
635 *os << fDetectorIndex << " ";
636 for(i=0;i<3;i++) *os << fid[i] << " ";
637 // for(i=0;i<3;i++) *os << frot[i] << " "; // Redundant with fm[][].
638 for(i=0;i<3;i++) *os << setprecision(16) << ftran[i] << " ";
639 for(i=0;i<3;i++)for(j=0;j<3;j++) *os << setprecision(16) <<
642 os->flags(fmt); // reset back to old formating.
645 //----------------------------------------------------------------------
646 void AliITSgeomMatrix::Read(istream *is){
647 ////////////////////////////////////////////////////////////////////////
648 // Standard input format for this class.
649 ////////////////////////////////////////////////////////////////////////
652 *is >> fDetectorIndex;
653 for(i=0;i<3;i++) *is >> fid[i];
654 // for(i=0;i<3;i++) *is >> frot[i]; // Redundant with fm[][].
655 for(i=0;i<3;i++) *is >> ftran[i];
656 for(i=0;i<3;i++)for(j=0;j<3;j++) *is >> fm[i][j];
657 AngleFromMatrix(); // compute angles frot[].
660 //----------------------------------------------------------------------
661 ostream &operator<<(ostream &os,AliITSgeomMatrix &p){
662 ////////////////////////////////////////////////////////////////////////
663 // Standard output streaming function.
664 ////////////////////////////////////////////////////////////////////////
669 //----------------------------------------------------------------------
670 istream &operator>>(istream &is,AliITSgeomMatrix &r){
671 ////////////////////////////////////////////////////////////////////////
672 // Standard input streaming function.
673 ////////////////////////////////////////////////////////////////////////
678 //----------------------------------------------------------------------