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.5 2000/10/02 16:32:35 barbera
19 Forward declaration added
21 Revision 1.1.2.6 2000/10/02 15:52:05 barbera
22 Forward declaration added
24 Revision 1.4 2000/09/07 17:30:45 nilsen
25 fixed a bug in SixAnglesFromMatrix.
27 Revision 1.3 2000/09/05 14:25:50 nilsen
28 Made fixes for HP compiler. All function parameter default values placed
29 in .h file. Fixed the usual problem with HP comilers and the "for(Int_t i..."
30 business. Replaced casting (Double_t [3][3]) to (Double_t (*)[3]) for HP.
31 Lastly removed all "const" before function parameters which were 2 dim. arrays,
32 because on HP root generates some strange code (?). Thanks Peter for the
35 Revision 1.2 2000/08/29 20:16:50 nilsen
36 New class for ITS coordiante transformations used by AliITSgeom nearly
39 Revision 1.1.2.1 2000/06/04 16:32:31 Nilsen
40 A new class to hold the matrix information needed by AliITSgeom.
48 #include "AliITSgeomMatrix.h"
50 ClassImp(AliITSgeomMatrix)
51 //----------------------------------------------------------------------
52 AliITSgeomMatrix::AliITSgeomMatrix(){
53 ////////////////////////////////////////////////////////////////////////
54 // The Default constructor for the AliITSgeomMatrix class. By Default
55 // the angles of rotations are set to zero, meaning that the rotation
56 // matrix is the unit matrix. The translation vector is also set to zero
57 // as are the module id number. The detector type is set to -1 (an undefined
58 // value). The full rotation matrix is kept so that the evaluation
59 // of a coordinate transformation can be done quickly and with a minimum
60 // of CPU overhead. The basic coordinate systems are the ALICE global
61 // coordinate system and the detector local coordinate system. In general
62 // this structure is not limited to just those two coordinate systems.
65 <img src="picts/ITS/AliISgeomMatrix_L1.gif">
68 ////////////////////////////////////////////////////////////////////////
71 fDetectorIndex = -1; // a value never defined.
74 frot[i] = ftran[i] = 0.0;
75 for(j=0;j<3;j++) fm[i][j] = 0.0;
77 fm[0][0] = fm[1][1] = fm[2][2] = 1.0;
79 //----------------------------------------------------------------------
80 AliITSgeomMatrix::AliITSgeomMatrix(const AliITSgeomMatrix &sourse){
81 ////////////////////////////////////////////////////////////////////////
82 // The standard copy constructor. This make a full / proper copy of
84 ////////////////////////////////////////////////////////////////////////
87 this->fDetectorIndex = sourse.fDetectorIndex;
89 this->fid[i] = sourse.fid[i];
90 this->frot[i] = sourse.frot[i];
91 this->ftran[i] = sourse.ftran[i];
92 for(j=0;j<3;j++) this->fm[i][j] = sourse.fm[i][j];
95 //----------------------------------------------------------------------
96 void AliITSgeomMatrix::operator=(const AliITSgeomMatrix &sourse){
97 ////////////////////////////////////////////////////////////////////////
98 // The standard = operator. This make a full / proper copy of
100 ////////////////////////////////////////////////////////////////////////
103 this->fDetectorIndex = sourse.fDetectorIndex;
105 this->fid[i] = sourse.fid[i];
106 this->frot[i] = sourse.frot[i];
107 this->ftran[i] = sourse.ftran[i];
108 for(j=0;j<3;j++) this->fm[i][j] = sourse.fm[i][j];
111 //----------------------------------------------------------------------
112 AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
113 const Double_t rot[3],const Double_t tran[3]){
114 ////////////////////////////////////////////////////////////////////////
115 // This is a constructor for the AliITSgeomMatrix class. The matrix is
116 // defined by 3 standard rotation angles [radians], and the translation
117 // vector tran [cm]. In addition the layer, ladder, and detector number
118 // for this particular module and the type of module must be given.
119 // The full rotation matrix is kept so that the evaluation
120 // of a coordinate transformation can be done quickly and with a minimum
121 // of CPU overhead. The basic coordinate systems are the ALICE global
122 // coordinate system and the detector local coordinate system. In general
123 // this structure is not limited to just those two coordinate systems.
126 <img src="picts/ITS/AliISgeomMatrix_L1.gif">
129 ////////////////////////////////////////////////////////////////////////
132 fDetectorIndex = idt; // a value never defined.
138 this->MatrixFromAngle();
140 //----------------------------------------------------------------------
141 AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt, const Int_t id[3],
142 Double_t matrix[3][3],
143 const Double_t tran[3]){
144 ////////////////////////////////////////////////////////////////////////
145 // This is a constructor for the AliITSgeomMatrix class. The rotation matrix
146 // is given as one of the inputs, and the translation vector tran [cm]. In
147 // addition the layer, ladder, and detector number for this particular
148 // module and the type of module must be given. The full rotation matrix
149 // is kept so that the evaluation of a coordinate transformation can be
150 // done quickly and with a minimum of CPU overhead. The basic coordinate
151 // systems are the ALICE global coordinate system and the detector local
152 // coordinate system. In general this structure is not limited to just
153 // those two coordinate systems.
156 <img src="picts/ITS/AliISgeomMatrix_L1.gif">
159 ////////////////////////////////////////////////////////////////////////
162 fDetectorIndex = idt; // a value never defined.
166 for(j=0;j<3;j++) fm[i][j] = matrix[i][j];
168 this->AngleFromMatrix();
170 //----------------------------------------------------------------------
171 void AliITSgeomMatrix::SixAnglesFromMatrix(Double_t *ang){
172 ////////////////////////////////////////////////////////////////////////
173 // This function returns the 6 GEANT 3.21 rotation angles [degrees] in
174 // the array ang which must be at least [6] long.
175 ////////////////////////////////////////////////////////////////////////
176 Double_t si,c=180./TMath::Pi();
178 ang[1] = TMath::ATan2(fm[0][1],fm[0][0]);
179 if(TMath::Cos(ang[1])!=0.0) si = fm[0][0]/TMath::Cos(ang[1]);
180 else si = fm[0][1]/TMath::Sin(ang[1]);
181 ang[0] = TMath::ATan2(si,fm[0][2]);
183 ang[3] = TMath::ATan2(fm[1][1],fm[1][0]);
184 if(TMath::Cos(ang[3])!=0.0) si = fm[1][0]/TMath::Cos(ang[3]);
185 else si = fm[1][1]/TMath::Sin(ang[3]);
186 ang[2] = TMath::ATan2(si,fm[1][2]);
188 ang[5] = TMath::ATan2(fm[2][1],fm[2][0]);
189 if(TMath::Cos(ang[5])!=0.0) si = fm[2][0]/TMath::Cos(ang[5]);
190 else si = fm[2][1]/TMath::Sin(ang[5]);
191 ang[4] = TMath::ATan2(si,fm[2][2]);
193 for(Int_t i=0;i<6;i++) {ang[i] *= c; if(ang[i]<0.0) ang[i] += 360.;}
195 //----------------------------------------------------------------------
196 void AliITSgeomMatrix::MatrixFromSixAngles(const Double_t *ang){
197 ////////////////////////////////////////////////////////////////////////
198 // Given the 6 GEANT 3.21 rotation angles [degree], this will compute and
199 // set the rotations matrix and 3 standard rotation angles [radians].
200 // These angles and rotation matrix are overwrite the existing values in
202 ////////////////////////////////////////////////////////////////////////
204 Double_t si,lr[9],c=TMath::Pi()/180.;
206 si = TMath::Sin(c*ang[0]);
207 if(ang[0]== 90.0) si = +1.0;
208 if(ang[0]==270.0) si = -1.0;
209 if(ang[0]== 0.0||ang[0]==180.) si = 0.0;
210 lr[0] = si * TMath::Cos(c*ang[1]);
211 lr[1] = si * TMath::Sin(c*ang[1]);
212 lr[2] = TMath::Cos(c*ang[0]);
213 if(ang[0]== 90.0||ang[0]==270.) lr[2] = 0.0;
214 if(ang[0]== 0.0) lr[2] = +1.0;
215 if(ang[0]==180.0) lr[2] = -1.0;
217 si = TMath::Sin(c*ang[2]);
218 if(ang[2]== 90.0) si = +1.0;
219 if(ang[2]==270.0) si = -1.0;
220 if(ang[2]== 0.0||ang[2]==180.) si = 0.0;
221 lr[3] = si * TMath::Cos(c*ang[3]);
222 lr[4] = si * TMath::Sin(c*ang[3]);
223 lr[5] = TMath::Cos(c*ang[2]);
224 if(ang[2]== 90.0||ang[2]==270.) lr[5] = 0.0;
225 if(ang[2]== 0.0) lr[5] = +1.0;
226 if(ang[2]==180.0) lr[5] = -1.0;
228 si = TMath::Sin(c*ang[4]);
229 if(ang[4]== 90.0) si = +1.0;
230 if(ang[4]==270.0) si = -1.0;
231 if(ang[4]== 0.0||ang[4]==180.) si = 0.0;
232 lr[6] = si * TMath::Cos(c*ang[5]);
233 lr[7] = si * TMath::Sin(c*ang[5]);
234 lr[8] = TMath::Cos(c*ang[4]);
235 if(ang[4]== 90.0||ang[4]==270.0) lr[8] = 0.0;
236 if(ang[4]== 0.0) lr[8] = +1.0;
237 if(ang[4]==180.0) lr[8] = -1.0;
238 // Normalize these elements and fill matrix fm.
239 for(i=0;i<3;i++){// reuse si.
241 for(j=0;j<3;j++) si += lr[3*i+j]*lr[3*i+j];
242 si = TMath::Sqrt(1./si);
243 for(j=0;j<3;j++) fm[i][j] = si*lr[3*i+j];
245 this->AngleFromMatrix();
247 //----------------------------------------------------------------------
248 AliITSgeomMatrix::AliITSgeomMatrix(const Double_t rotd[6]/*degrees*/,
249 const Int_t idt,const Int_t id[3],
250 const Double_t tran[3]){
251 ////////////////////////////////////////////////////////////////////////
252 // This is a constructor for the AliITSgeomMatrix class. The matrix is
253 // defined by the 6 GEANT 3.21 rotation angles [degrees], and the translation
254 // vector tran [cm]. In addition the layer, ladder, and detector number
255 // for this particular module and the type of module must be given.
256 // The full rotation matrix is kept so that the evaluation
257 // of a coordinate transformation can be done quickly and with a minimum
258 // of CPU overhead. The basic coordinate systems are the ALICE global
259 // coordinate system and the detector local coordinate system. In general
260 // this structure is not limited to just those two coordinate systems.
263 <img src="picts/ITS/AliISgeomMatrix_L1.gif">
266 ////////////////////////////////////////////////////////////////////////
269 fDetectorIndex = idt; // a value never defined.
274 this->MatrixFromSixAngles(rotd);
276 //----------------------------------------------------------------------
277 void AliITSgeomMatrix::AngleFromMatrix(){
278 ////////////////////////////////////////////////////////////////////////
279 // Computes the angles from the rotation matrix up to a phase of 180 degrees.
280 ////////////////////////////////////////////////////////////////////////
282 // get angles from matrix up to a phase of 180 degrees.
284 rx = TMath::ATan2(fm[2][1],fm[2][2]);if(rx<0.0) rx += 2.0*TMath::Pi();
285 ry = TMath::ASin(fm[0][2]); if(ry<0.0) ry += 2.0*TMath::Pi();
286 rz = TMath::ATan2(fm[1][1],fm[0][0]);if(rz<0.0) rz += 2.0*TMath::Pi();
292 //----------------------------------------------------------------------
293 void AliITSgeomMatrix::MatrixFromAngle(){
294 ////////////////////////////////////////////////////////////////////////
295 // Computes the Rotation matrix from the angles [radians] kept in this
297 ////////////////////////////////////////////////////////////////////////
298 Double_t sx,sy,sz,cx,cy,cz;
300 sx = TMath::Sin(frot[0]); cx = TMath::Cos(frot[0]);
301 sy = TMath::Sin(frot[1]); cy = TMath::Cos(frot[1]);
302 sz = TMath::Sin(frot[2]); cz = TMath::Cos(frot[2]);
303 fm[0][0] = cz*cy; // fr[0]
304 fm[0][1] = -cz*sy*sx - sz*cx; // fr[1]
305 fm[0][2] = -cz*sy*cx + sz*sx; // fr[2]
306 fm[1][0] = sz*cy; // fr[3]
307 fm[1][1] = -sz*sy*sx + cz*cx; // fr[4]
308 fm[1][2] = -sz*sy*cx - cz*sx; // fr[5]
309 fm[2][0] = sy; // fr[6]
310 fm[2][1] = cy*sx; // fr[7]
311 fm[2][2] = cy*cx; // fr[8]
314 //----------------------------------------------------------------------
315 void AliITSgeomMatrix::GtoLPosition(const Double_t g0[3],Double_t l[3]){
316 ////////////////////////////////////////////////////////////////////////
317 // Returns the local coordinates given the global coordinates [cm].
318 ////////////////////////////////////////////////////////////////////////
322 for(i=0;i<3;i++) g[i] = g0[i] - ftran[i];
325 for(j=0;j<3;j++) l[i] += fm[i][j]*g[j];
326 // g = R l + translation
330 //----------------------------------------------------------------------
331 void AliITSgeomMatrix::LtoGPosition(const Double_t l[3],Double_t g[3]){
332 ////////////////////////////////////////////////////////////////////////
333 // Returns the global coordinates given the local coordinates [cm].
334 ////////////////////////////////////////////////////////////////////////
339 for(j=0;j<3;j++) g[i] += fm[j][i]*l[j];
341 // g = R^t l + translation
345 //----------------------------------------------------------------------
346 void AliITSgeomMatrix::GtoLMomentum(const Double_t g[3],Double_t l[3]){
347 ////////////////////////////////////////////////////////////////////////
348 // Returns the local coordinates of the momentum given the global
349 // coordinates of the momentum. It transforms just like GtoLPosition
350 // except that the translation vector is zero.
351 ////////////////////////////////////////////////////////////////////////
356 for(j=0;j<3;j++) l[i] += fm[i][j]*g[j];
361 //----------------------------------------------------------------------
362 void AliITSgeomMatrix::LtoGMomentum(const Double_t l[3],Double_t g[3]){
363 ////////////////////////////////////////////////////////////////////////
364 // Returns the Global coordinates of the momentum given the local
365 // coordinates of the momentum. It transforms just like LtoGPosition
366 // except that the translation vector is zero.
367 ////////////////////////////////////////////////////////////////////////
372 for(j=0;j<3;j++) g[i] += fm[j][i]*l[j];
377 //----------------------------------------------------------------------
378 void AliITSgeomMatrix::GtoLPositionError(Double_t g[3][3],
380 ////////////////////////////////////////////////////////////////////////
381 // Given an Uncertainty matrix in Global coordinates it is rotated so that
382 // its representation in local coordinates can be returned. There is no
383 // effect due to the translation vector or its uncertainty.
384 ////////////////////////////////////////////////////////////////////////
387 for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)for(m=0;m<3;m++)
388 l[i][m] = fm[j][i]*g[j][k]*fm[k][m];
392 //----------------------------------------------------------------------
393 void AliITSgeomMatrix::LtoGPositionError(Double_t l[3][3],
395 ////////////////////////////////////////////////////////////////////////
396 // Given an Uncertainty matrix in Local coordinates it is rotated so that
397 // its representation in global coordinates can be returned. There is no
398 // effect due to the translation vector or its uncertainty.
399 ////////////////////////////////////////////////////////////////////////
402 for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)for(m=0;m<3;m++)
403 g[i][m] = fm[i][j]*l[j][k]*fm[m][k];
407 //----------------------------------------------------------------------
408 void AliITSgeomMatrix::GtoLPositionTracking(const Double_t g0[3],
410 ////////////////////////////////////////////////////////////////////////
411 // A slightly different coordinate system is used when tracking.
412 // This coordinate system is only relevant when the geometry represents
413 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
414 // alone but X -> -Y and Y -> X such that X always points out of the
415 // ITS Cylinder for every layer including layer 1 (where the detector
416 // are mounted upside down).
419 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
422 ////////////////////////////////////////////////////////////////////////
425 this->GtoLPosition(g0,l0);
426 if(fid[0]==1){ // for layer 1 the detector are flipped upside down
427 // with respect to the others.
438 //----------------------------------------------------------------------
439 void AliITSgeomMatrix::LtoGPositionTracking(const Double_t l[3],
441 ////////////////////////////////////////////////////////////////////////
442 // A slightly different coordinate system is used when tracking.
443 // This coordinate system is only relevant when the geometry represents
444 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
445 // alone but X -> -Y and Y -> X such that X always points out of the
446 // ITS Cylinder for every layer including layer 1 (where the detector
447 // are mounted upside down).
450 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
453 ////////////////////////////////////////////////////////////////////////
456 if(fid[0]==1){ // for layer 1 the detector are flipped upside down
457 // with respect to the others.
466 this->LtoGPosition(l0,g);
469 //----------------------------------------------------------------------
470 void AliITSgeomMatrix::GtoLMomentumTracking(const Double_t g[3],
472 ////////////////////////////////////////////////////////////////////////
473 // A slightly different coordinate system is used when tracking.
474 // This coordinate system is only relevant when the geometry represents
475 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
476 // alone but X -> -Y and Y -> X such that X always points out of the
477 // ITS Cylinder for every layer including layer 1 (where the detector
478 // are mounted upside down).
481 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
484 ////////////////////////////////////////////////////////////////////////
487 this->GtoLMomentum(g,l0);
488 if(fid[0]==1){ // for layer 1 the detector are flipped upside down
489 // with respect to the others.
501 //----------------------------------------------------------------------
502 void AliITSgeomMatrix::LtoGMomentumTracking(const Double_t l[3],
504 ////////////////////////////////////////////////////////////////////////
505 // A slightly different coordinate system is used when tracking.
506 // This coordinate system is only relevant when the geometry represents
507 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
508 // alone but X -> -Y and Y -> X such that X always points out of the
509 // ITS Cylinder for every layer including layer 1 (where the detector
510 // are mounted upside down).
513 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
516 ////////////////////////////////////////////////////////////////////////
519 if(fid[0]==1){ // for layer 1 the detector are flipped upside down
520 // with respect to the others.
529 this->LtoGMomentum(l0,g);
532 //----------------------------------------------------------------------
533 void AliITSgeomMatrix::GtoLPositionErrorTracking(Double_t g[3][3],
535 ////////////////////////////////////////////////////////////////////////
536 // A slightly different coordinate system is used when tracking.
537 // This coordinate system is only relevant when the geometry represents
538 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
539 // alone but X -> -Y and Y -> X such that X always points out of the
540 // ITS Cylinder for every layer including layer 1 (where the detector
541 // are mounted upside down).
544 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
547 ////////////////////////////////////////////////////////////////////////
550 Double_t A0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
551 Double_t A1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
553 if(fid[0]==1) for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
554 Rt[i][k] = A0[i][j]*fm[j][k];
555 else for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
556 Rt[i][k] = A1[i][j]*fm[j][k];
557 for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)for(m=0;m<3;m++)
558 l[i][m] = Rt[j][i]*g[j][k]*Rt[k][m];
562 //----------------------------------------------------------------------
563 void AliITSgeomMatrix::LtoGPositionErrorTracking(Double_t l[3][3],
565 ////////////////////////////////////////////////////////////////////////
566 // A slightly different coordinate system is used when tracking.
567 // This coordinate system is only relevant when the geometry represents
568 // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
569 // alone but X -> -Y and Y -> X such that X always points out of the
570 // ITS Cylinder for every layer including layer 1 (where the detector
571 // are mounted upside down).
574 <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
577 ////////////////////////////////////////////////////////////////////////
580 Double_t A0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
581 Double_t A1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
583 if(fid[0]==1) for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
584 Rt[i][k] = A0[i][j]*fm[j][k];
585 else for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
586 Rt[i][k] = A1[i][j]*fm[j][k];
587 for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)for(m=0;m<3;m++)
588 g[i][m] = Rt[i][j]*l[j][k]*Rt[m][k];
592 //----------------------------------------------------------------------
593 void AliITSgeomMatrix::PrintTitles(ostream *os){
594 ////////////////////////////////////////////////////////////////////////
595 // Standard output format for this class but it includes variable
596 // names and formatting that makes it easer to read.
597 ////////////////////////////////////////////////////////////////////////
600 *os << "fDetectorIndex=" << fDetectorIndex << " fid[3]={";
601 for(i=0;i<3;i++) *os << fid[i] << " ";
602 *os << "} frot[3]={";
603 for(i=0;i<3;i++) *os << frot[i] << " ";
604 *os << "} ftran[3]={";
605 for(i=0;i<3;i++) *os << ftran[i] << " ";
606 *os << "} fm[3][3]={";
607 for(i=0;i<3;i++){for(j=0;j<3;j++){ *os << fm[i][j] << " ";} *os <<"}{";}
611 //----------------------------------------------------------------------
612 void AliITSgeomMatrix::PrintComment(ostream *os){
613 ////////////////////////////////////////////////////////////////////////
614 // output format used by Print..
615 ////////////////////////////////////////////////////////////////////////
616 *os << "fDetectorIndex fid[0] fid[1] fid[2] ftran[0] ftran[1] ftran[2] ";
617 *os << "fm[0][0] fm[0][1] fm[0][2] fm[1][0] fm[1][1] fm[1][2] ";
618 *os << "fm[2][0] fm[2][1] fm[2][2] ";
621 //----------------------------------------------------------------------
622 void AliITSgeomMatrix::Print(ostream *os){
623 ////////////////////////////////////////////////////////////////////////
624 // Standard output format for this class.
625 ////////////////////////////////////////////////////////////////////////
629 fmt = os->setf(ios::scientific); // set scientific floating point output
630 *os << fDetectorIndex << " ";
631 for(i=0;i<3;i++) *os << fid[i] << " ";
632 // for(i=0;i<3;i++) *os << frot[i] << " "; // Redundant with fm[][].
633 for(i=0;i<3;i++) *os << setprecision(16) << ftran[i] << " ";
634 for(i=0;i<3;i++)for(j=0;j<3;j++) *os << setprecision(16) <<
637 os->flags(fmt); // reset back to old formating.
640 //----------------------------------------------------------------------
641 void AliITSgeomMatrix::Read(istream *is){
642 ////////////////////////////////////////////////////////////////////////
643 // Standard input format for this class.
644 ////////////////////////////////////////////////////////////////////////
647 *is >> fDetectorIndex;
648 for(i=0;i<3;i++) *is >> fid[i];
649 // for(i=0;i<3;i++) *is >> frot[i]; // Redundant with fm[][].
650 for(i=0;i<3;i++) *is >> ftran[i];
651 for(i=0;i<3;i++)for(j=0;j<3;j++) *is >> fm[i][j];
652 AngleFromMatrix(); // compute angles frot[].
655 //----------------------------------------------------------------------
656 ostream &operator<<(ostream &os,AliITSgeomMatrix &p){
657 ////////////////////////////////////////////////////////////////////////
658 // Standard output streaming function.
659 ////////////////////////////////////////////////////////////////////////
664 //----------------------------------------------------------------------
665 istream &operator>>(istream &is,AliITSgeomMatrix &r){
666 ////////////////////////////////////////////////////////////////////////
667 // Standard input streaming function.
668 ////////////////////////////////////////////////////////////////////////
673 //----------------------------------------------------------------------