+ // Inputs:
+ // TBuffer &R__b The output buffer to stream data on.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+
+ if (R__b.IsReading()) {
+ AliITSgeomMatrix::Class()->ReadBuffer(R__b, this);
+ fCylR = TMath::Sqrt(ftran[0]*ftran[0]+ftran[1]*ftran[1]);
+ fCylPhi = TMath::ATan2(ftran[1],ftran[0]);
+ this->AngleFromMatrix();
+ if(fCylPhi<0.0) fCylPhi += 2.*TMath::Pi();
+ } else {
+ AliITSgeomMatrix::Class()->WriteBuffer(R__b, this);
+ } // end if
+}
+//______________________________________________________________________
+void AliITSgeomMatrix::SetTranslation(const Double_t tran[3]){
+ // Sets the translation vector and computes fCylR and fCylPhi.
+ // Inputs:
+ // Double_t trans[3] The translation vector to be used
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+ for(Int_t i=0;i<3;i++) ftran[i] = tran[i];
+ fCylR = TMath::Sqrt(ftran[0]*ftran[0]+ftran[1]*ftran[1]);
+ fCylPhi = TMath::ATan2(ftran[1],ftran[0]);
+ if(fCylPhi<0.0) fCylPhi += 2.*TMath::Pi();
+}
+//----------------------------------------------------------------------
+TPolyLine3D* AliITSgeomMatrix::CreateLocalAxis() const {
+ // This class is used as part of the documentation of this class
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // A pointer to a new TPolyLine3D object showing the 3 line
+ // segments that make up the this local axis in the global
+ // reference system.
+ Float_t gf[15];
+ Double_t g[5][3];
+ Double_t l[5][3]={{1.0,0.0,0.0},{0.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,0.0},
+ {0.0,0.0,1.0}};
+ Int_t i;
+
+ for(i=0;i<5;i++) {
+ LtoGPosition(l[i],g[i]);
+ gf[3*i]=(Float_t)g[i][0];
+ gf[3*i+1]=(Float_t)g[i][1];
+ gf[3*i+2]=(Float_t)g[i][2];
+ } // end for i
+ return new TPolyLine3D(5,gf);
+}
+//----------------------------------------------------------------------
+TPolyLine3D* AliITSgeomMatrix::CreateLocalAxisTracking() const {
+ // This class is used as part of the documentation of this class
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // A pointer to a new TPolyLine3D object showing the 3 line
+ // segments that make up the this local axis in the global
+ // reference system.
+ Float_t gf[15];
+ Double_t g[5][3];
+ Double_t l[5][3]={{1.0,0.0,0.0},{0.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,0.0},
+ {0.0,0.0,1.0}};
+ Int_t i;
+
+ for(i=0;i<5;i++) {
+ LtoGPositionTracking(l[i],g[i]);
+ gf[3*i]=(Float_t)g[i][0];
+ gf[3*i+1]=(Float_t)g[i][1];
+ gf[3*i+2]=(Float_t)g[i][2];
+ } // end for i
+ return new TPolyLine3D(5,gf);
+}
+//----------------------------------------------------------------------
+TNode* AliITSgeomMatrix::CreateNode(const Char_t *nodeName,
+ const Char_t *nodeTitle,TNode *mother,
+ TShape *shape,Bool_t axis) const {
+ // Creates a node inside of the node mother out of the shape shape
+ // in the position, with respect to mother, indecated by "this". If axis
+ // is ture, it will insert an axis within this node/shape.
+ // Inputs:
+ // Char_t *nodeName This name of this node
+ // Char_t *nodeTitle This node title
+ // TNode *mother The node this node will be inside of/with respect to
+ // TShape *shape The shape of this node
+ // Bool_t axis If ture, a set of x,y,z axis will be included
+ // Outputs:
+ // none.
+ // Return:
+ // A pointer to "this" node.
+ Double_t trans[3],matrix[3][3],*matr;
+ TRotMatrix *rot = new TRotMatrix();
+ TString name,title;
+
+ matr = &(matrix[0][0]);
+ this->GetTranslation(trans);
+ this->GetMatrix(matrix);
+ rot->SetMatrix(matr);
+ //
+ name = nodeName;
+ title = nodeTitle;
+ //
+ mother->cd();
+ TNode *node1 = new TNode(name.Data(),title.Data(),shape,
+ trans[0],trans[1],trans[2],rot);
+ if(axis){
+ Int_t i,j;
+ const Float_t kScale=0.5,kLw=0.2;
+ Float_t xchar[13][2]={
+ {0.5*kLw,1.},{0.,0.5*kLw},{0.5-0.5*kLw,0.5},
+ {0.,0.5*kLw},{0.5*kLw,0.},{0.5,0.5-0.5*kLw},
+ {1-0.5*kLw,0.},{1.,0.5*kLw},{0.5+0.5*kLw,0.5},
+ {1.,1.-0.5*kLw},{1.-0.5*kLw,1.},{0.5,0.5+0.5*kLw},
+ {0.5*kLw,1.}};
+ Float_t ychar[10][2]={
+ {.5-0.5*kLw,0.},{.5+0.5*kLw,0.},{.5+0.5*kLw,0.5-0.5*kLw},
+ {1.,1.-0.5*kLw},{1.-0.5*kLw,1.},{0.5+0.5*kLw,0.5},
+ {0.5*kLw,1.} ,{0.,1-0.5*kLw} ,{0.5-0.5*kLw,0.5},
+ {.5-0.5*kLw,0.}};
+ Float_t zchar[11][2]={
+ {0.,1.},{0,1.-kLw},{1.-kLw,1.-kLw},{0.,kLw} ,{0.,0.},
+ {1.,0.},{1.,kLw} ,{kLw,kLw} ,{1.,1.-kLw},{1.,1.},
+ {0.,1.}};
+ for(i=0;i<13;i++)for(j=0;j<2;j++){
+ if(i<13) xchar[i][j] = kScale*xchar[i][j];
+ if(i<10) ychar[i][j] = kScale*ychar[i][j];
+ if(i<11) zchar[i][j] = kScale*zchar[i][j];
+ } // end for i,j
+ TXTRU *axisxl = new TXTRU("x","x","text",12,2);
+ for(i=0;i<12;i++) axisxl->DefineVertex(i,xchar[i][0],xchar[i][1]);
+ axisxl->DefineSection(0,-0.5*kLw);axisxl->DefineSection(1,0.5*kLw);
+ TXTRU *axisyl = new TXTRU("y","y","text",9,2);
+ for(i=0;i<9;i++) axisyl->DefineVertex(i,ychar[i][0],ychar[i][1]);
+ axisyl->DefineSection(0,-0.5*kLw);axisyl->DefineSection(1,0.5*kLw);
+ TXTRU *axiszl = new TXTRU("z","z","text",10,2);
+ for(i=0;i<10;i++) axiszl->DefineVertex(i,zchar[i][0],zchar[i][1]);
+ axiszl->DefineSection(0,-0.5*kLw);axiszl->DefineSection(1,0.5*kLw);
+ Float_t lxy[13][2]={
+ {-0.5*kLw,-0.5*kLw},{0.8,-0.5*kLw},{0.8,-0.1},{1.0,0.0},
+ {0.8,0.1},{0.8,0.5*kLw},{0.5*kLw,0.5*kLw},{0.5*kLw,0.8},
+ {0.1,0.8},{0.0,1.0},{-0.1,0.8},{-0.5*kLw,0.8},
+ {-0.5*kLw,-0.5*kLw}};
+ TXTRU *axisxy = new TXTRU("axisxy","axisxy","text",13,2);
+ for(i=0;i<13;i++) axisxy->DefineVertex(i,lxy[i][0],lxy[i][1]);
+ axisxy->DefineSection(0,-0.5*kLw);axisxy->DefineSection(1,0.5*kLw);
+ Float_t lz[8][2]={
+ {0.5*kLw,-0.5*kLw},{0.8,-0.5*kLw},{0.8,-0.1},{1.0,0.0},
+ {0.8,0.1},{0.8,0.5*kLw},{0.5*kLw,0.5*kLw},
+ {0.5*kLw,-0.5*kLw}};
+ TXTRU *axisz = new TXTRU("axisz","axisz","text",8,2);
+ for(i=0;i<8;i++) axisz->DefineVertex(i,lz[i][0],lz[i][1]);
+ axisz->DefineSection(0,-0.5*kLw);axisz->DefineSection(1,0.5*kLw);
+ //TRotMatrix *xaxis90= new TRotMatrix("xaixis90","",90.0, 0.0, 0.0);
+ TRotMatrix *yaxis90= new TRotMatrix("yaixis90","", 0.0,90.0, 0.0);
+ TRotMatrix *zaxis90= new TRotMatrix("zaixis90","", 0.0, 0.0,90.0);
+ //
+ node1->cd();
+ title = name.Append("axisxy");
+ TNode *nodeaxy = new TNode(title.Data(),title.Data(),axisxy);
+ title = name.Append("axisz");
+ TNode *nodeaz = new TNode(title.Data(),title.Data(),axisz,
+ 0.,0.,0.,yaxis90);
+ TNode *textboxX0 = new TNode("textboxX0","textboxX0",axisxl,
+ lxy[3][0],lxy[3][1],0.0);
+ TNode *textboxX1 = new TNode("textboxX1","textboxX1",axisxl,
+ lxy[3][0],lxy[3][1],0.0,yaxis90);
+ TNode *textboxX2 = new TNode("textboxX2","textboxX2",axisxl,
+ lxy[3][0],lxy[3][1],0.0,zaxis90);
+ TNode *textboxY0 = new TNode("textboxY0","textboxY0",axisyl,
+ lxy[9][0],lxy[9][1],0.0);
+ TNode *textboxY1 = new TNode("textboxY1","textboxY1",axisyl,
+ lxy[9][0],lxy[9][1],0.0,yaxis90);
+ TNode *textboxY2 = new TNode("textboxY2","textboxY2",axisyl,
+ lxy[9][0],lxy[9][1],0.0,zaxis90);
+ TNode *textboxZ0 = new TNode("textboxZ0","textboxZ0",axiszl,
+ 0.0,0.0,lz[3][0]);
+ TNode *textboxZ1 = new TNode("textboxZ1","textboxZ1",axiszl,
+ 0.0,0.0,lz[3][0],yaxis90);
+ TNode *textboxZ2 = new TNode("textboxZ2","textboxZ2",axiszl,
+ 0.0,0.0,lz[3][0],zaxis90);
+ nodeaxy->Draw();
+ nodeaz->Draw();
+ textboxX0->Draw();
+ textboxX1->Draw();
+ textboxX2->Draw();
+ textboxY0->Draw();
+ textboxY1->Draw();
+ textboxY2->Draw();
+ textboxZ0->Draw();
+ textboxZ1->Draw();
+ textboxZ2->Draw();
+ } // end if
+ mother->cd();
+ return node1;
+}
+//----------------------------------------------------------------------
+void AliITSgeomMatrix::MakeFigures() const {
+ // make figures to help document this class
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+ const Double_t kDx0=550.,kDy0=550.,kDz0=550.; // cm
+ const Double_t kDx=1.0,kDy=0.300,kDz=3.0,kRmax=0.1; // cm
+ Float_t l[5][3]={{1.0,0.0,0.0},{0.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,0.0},
+ {0.0,0.0,1.0}};
+ TCanvas *c = new TCanvas(kFALSE);// create a batch mode canvas.
+#if ROOT_VERSION_CODE>= 331523
+ Double_t rmin[]={-1,-1,-1};
+ Double_t rmax[]={ 1, 1, 1};
+ TView *view = new TView3D(1,rmin,rmax);
+#else
+ TView *view = new TView(1); // Create Cartesian coordiante view
+#endif
+ TBRIK *mother = new TBRIK("Mother","Mother","void",kDx0,kDy0,kDz0);
+ TBRIK *det = new TBRIK("Detector","","Si",kDx,kDy,kDz);
+ TPolyLine3D *axis = new TPolyLine3D(5,&(l[0][0]));
+ TPCON *arrow = new TPCON("arrow","","air",0.0,360.,2);
+ TRotMatrix *xarrow= new TRotMatrix("xarrow","",90.,0.0,0.0);
+ TRotMatrix *yarrow= new TRotMatrix("yarrow","",0.0,90.,0.0);