+ top=gAlice->GetGeometry()->GetNode("alice");
+ AliITSgeom *gm = this->GetITSgeom();
+
+ Int_t lay,lad,det,i;
+ Text_t name[10];
+ Float_t xg[3];
+ Float_t rt[9];
+ Double_t rtd[9];
+ TBRIK *box;
+ TRotMatrix *rm;
+ //TCanvas *c1 = new TCanvas("c1","ITS");
+
+ for(lay=1;lay<=2;lay++)
+ for(lad=1;lad<=gm->GetNladders(lay);lad++)
+ for(det=1;det<=gm->GetNdetectors(lay);det++){
+ try {
+ box = new TBRIK ("ActiveSPD","Active volume of SPD","SPD SI DET",
+ 0.64,0.0075,4.19);
+ } catch (...) {
+ cout << "EXCEPTION in box = new TBRIK" << endl;
+ return;
+ }
+ gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
+ gm->GetRotMatrix(lay,lad,det,rt);
+ //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
+ for(i=0;i<9;i++) rtd[i] = rt[i];
+ try {
+ rm = new TRotMatrix(name,name,rtd);
+ } catch (...) {
+ cout << "EXCEPTION in new TRotMatrix" << endl;
+ return;
+ }
+ top->cd();
+ //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
+ try {
+ nd = new TNode("SPD"," ",box,xg[0],xg[1],xg[2],rm);
+ } catch (...) {
+ cout << "EXCEPTION in new TNode" << endl;
+ return;
+ }
+ nd->SetLineColor(kColorITSSSD);
+ fNodes->Add(nd);
+ }
+
+ for(lay=3;lay<=3;lay++)
+ for(lad=1;lad<=gm->GetNladders(lay);lad++)
+ for(det=1;det<=gm->GetNdetectors(lay);det++){
+ try {
+ box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
+ 3.5,0.014,3.763);
+ } catch (...) {
+ cout << "EXCEPTION in box = new TBRIK" << endl;
+ return;
+ }
+ gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
+ gm->GetRotMatrix(lay,lad,det,rt);
+ //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
+ for(i=0;i<9;i++) rtd[i] = rt[i];
+ try {
+ rm = new TRotMatrix(name,name,rtd);
+ } catch (...) {
+ cout << "EXCEPTION in new TRotMatrix" << endl;
+ return;
+ }
+ top->cd();
+ //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
+ try {
+ nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
+ } catch (...) {
+ cout << "EXCEPTION in new TNode" << endl;
+ return;
+ }
+ nd->SetLineColor(kColorITSSSD);
+ fNodes->Add(nd);
+ }
+
+ for(lay=4;lay<=4;lay++)
+ for(lad=1;lad<=gm->GetNladders(lay);lad++)
+ for(det=1;det<=gm->GetNdetectors(lay);det++){
+ try {
+ box = new TBRIK ("ActiveSDD","Active volume of SDD","SDD SI DET",
+ 3.5,0.014,3.763);
+ } catch (...) {
+ cout << "EXCEPTION in box = new TBRIK" << endl;
+ return;
+ }
+ gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
+ gm->GetRotMatrix(lay,lad,det,rt);
+ //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
+ for(i=0;i<9;i++) rtd[i] = rt[i];
+ try {
+ rm = new TRotMatrix(name,name,rtd);
+ } catch (...) {
+ cout << "EXCEPTION in new TRotMatrix" << endl;
+ return;
+ }
+ top->cd();
+ //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
+ try {
+ nd = new TNode("SDD"," ",box,xg[0],xg[1],xg[2],rm);
+ } catch (...) {
+ cout << "EXCEPTION in new TNode" << endl;
+ return;
+ }
+ nd->SetLineColor(kColorITSSSD);
+ fNodes->Add(nd);
+ }
+ for(lay=5;lay<=5;lay++)
+ for(lad=1;lad<=gm->GetNladders(lay);lad++)
+ for(det=1;det<=gm->GetNdetectors(lay);det++){
+ try {
+ box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
+ 3.65,0.015,2.0);
+ } catch (...) {
+ cout << "EXCEPTION in box = new TBRIK" << endl;
+ return;
+ }
+ gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
+ gm->GetRotMatrix(lay,lad,det,rt);
+ //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
+ for(i=0;i<9;i++) rtd[i] = rt[i];
+ try {
+ rm = new TRotMatrix(name,name,rtd);
+ } catch (...) {
+ cout << "EXCEPTION in new TRotMatrix" << endl;
+ return;
+ }
+ top->cd();
+ //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
+ try {
+ nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
+ } catch (...) {
+ cout << "EXCEPTION in new TNode" << endl;
+ return;
+ }
+ nd->SetLineColor(kColorITSSSD);
+ fNodes->Add(nd);
+ }
+
+ for(lay=6;lay<=6;lay++)
+ for(lad=1;lad<=gm->GetNladders(lay);lad++)
+ for(det=1;det<=gm->GetNdetectors(lay);det++){
+ try {
+ box = new TBRIK ("ActiveSSD","Active volume of SSD","SSD SI DET",
+ 3.65,0.015,2.0);
+ } catch (...) {
+ cout << "EXCEPTION in box = new TBRIK" << endl;
+ return;
+ }
+
+ gm->GetTrans(lay,lad,det,xg[0],xg[1],xg[2]);
+ gm->GetRotMatrix(lay,lad,det,rt);
+ //sprintf(name,"ROT%1.1d2.2d2.2d",lay,lad,det);
+ for(i=0;i<9;i++) rtd[i] = rt[i];
+ try {
+ rm = new TRotMatrix(name,name,rtd);
+ } catch (...) {
+ cout << "EXCEPTION in new TRotMatrix" << endl;
+ return;
+ }
+ top->cd();
+ //sprintf(name,"ND%1.1d2.2d2.2d",lay,lad,det);
+ try {
+ nd = new TNode("SSD"," ",box,xg[0],xg[1],xg[2],rm);
+ } catch (...) {
+ cout << "EXCEPTION in new TNode" << endl;
+ return;
+ }
+ nd->SetLineColor(kColorITSSSD);
+ fNodes->Add(nd);
+ }
+
+
+}
+//_____________________________________________________________________________
+void AliITSv5::CreateMaterials(){
+////////////////////////////////////////////////////////////////////////
+// Read a file containing the materials for the ITS version 5.
+////////////////////////////////////////////////////////////////////////