Fixed bub in BuildGeometry
[u/mrichter/AliRoot.git] / TOF / AliTOFv2FHoles.cxx
index 4ab15c734a0c7dfd6d733083df58b7bc015c7640..a6fd5e5d4bdb9582f2b4213540146dcf16b34850 100644 (file)
@@ -16,9 +16,7 @@
 
 
 ///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-//  Time Of Flight: design of C.Williams                                     
-//                                                                          
+//
 //  This class contains the functions for version 2 of the Time Of Flight    //
 //  detector.                                                                //
 //
@@ -100,10 +98,10 @@ void AliTOFv2FHoles::BuildGeometry()
   //
   TNode *node, *top;
   const int kColorTOF  = 27;
-
+  
   // Find top TNODE
   top = gAlice->GetGeometry()->GetNode("alice");
-
+  
   // Position the different copies
   const Float_t krTof  =(fRmax+fRmin)/2;
   const Float_t khTof  = fRmax-fRmin;
@@ -112,69 +110,79 @@ void AliTOFv2FHoles::BuildGeometry()
   const Float_t kangle = 2*kPi/kNTof;
   Float_t ang;
 
+  // fixing parameters as requested by FRAME v0 (Morsch 16-10-2001)
+  //Float_t zlenA = 124.;  // cm (A module length) original size 106.   enlarged   
+  Float_t zlenB = 154.;  // cm (B module length) original size 141.   enlarged
+  Float_t zlenC = 159.5; // cm (C module length) original size 175.5  reduced
+  Float_t ztof0 = 375.5; // total half-length of a TOF sector original size 371.5cm
+
+  Float_t zOffsetC = ztof0 - zlenC*0.5;
+  Float_t zOffsetB = ztof0 - zlenC - zlenB*0.5;
+  Float_t zOffsetA =    0.00;
+
   // Define TOF basic volume
   
   char nodeName0[6], nodeName1[6], nodeName2[6]; 
   char nodeName3[6], nodeName4[6], rotMatNum[6];
-
+  
   new TBRIK("S_TOF_C","TOF box","void",
-            120*0.5,khTof*0.5,fZlenC*0.5);
+            fStripLn*0.5,khTof*0.5,fZlenC*0.5);
   new TBRIK("S_TOF_B","TOF box","void",
-            120*0.5,khTof*0.5,fZlenB*0.5);
+            fStripLn*0.5,khTof*0.5,fZlenB*0.5);
   new TBRIK("S_TOF_A","TOF box","void",
-            120*0.5,khTof*0.5,fZlenA*0.5);
-
+            fStripLn*0.5,khTof*0.5,fZlenA*0.5);
+  
   for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
-     
-      if (nodeNum<10) {
-           sprintf(rotMatNum,"rot50%i",nodeNum);
-           sprintf(nodeName0,"FTO00%i",nodeNum);
-           sprintf(nodeName1,"FTO10%i",nodeNum);
-           sprintf(nodeName2,"FTO20%i",nodeNum);
-           sprintf(nodeName3,"FTO30%i",nodeNum);
-           sprintf(nodeName4,"FTO40%i",nodeNum);
-      }
-      if (nodeNum>9) {
-           sprintf(rotMatNum,"rot5%i",nodeNum);
-           sprintf(nodeName0,"FTO0%i",nodeNum);
-           sprintf(nodeName1,"FTO1%i",nodeNum);
-           sprintf(nodeName2,"FTO2%i",nodeNum);
-           sprintf(nodeName3,"FTO3%i",nodeNum);
-           sprintf(nodeName4,"FTO4%i",nodeNum);
-      }
-      new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
-      ang = (4.5-nodeNum) * kangle;
-
-      top->cd();
-      node = new TNode(nodeName0,nodeName0,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),299.15,rotMatNum);
-      node->SetLineColor(kColorTOF);
-      fNodes->Add(node); 
-
-      top->cd(); 
-      node = new TNode(nodeName1,nodeName1,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-299.15,rotMatNum);
-      node->SetLineColor(kColorTOF);
-      fNodes->Add(node); 
-if (nodeNum !=1 && nodeNum!=2 && nodeNum !=18)
-    {
-      top->cd();
-      node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),146.45,rotMatNum);
-      node->SetLineColor(kColorTOF);
-      fNodes->Add(node); 
-
-      top->cd();
-      node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-146.45,rotMatNum);
-      node->SetLineColor(kColorTOF);
-      fNodes->Add(node); 
-  } // Holes for RICH detector
-
-if ((nodeNum<8 || nodeNum>12) && nodeNum !=1 && nodeNum!=2 && nodeNum !=18)
-    { 
-      top->cd();
-      node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),0.,rotMatNum);
-      node->SetLineColor(kColorTOF);
-      fNodes->Add(node); 
-     } // Holes for PHOS detector (+ Holes for RICH detector, central part)
+    
+    if (nodeNum<10) {
+      sprintf(rotMatNum,"rot50%i",nodeNum);
+      sprintf(nodeName0,"FTO00%i",nodeNum);
+      sprintf(nodeName1,"FTO10%i",nodeNum);
+      sprintf(nodeName2,"FTO20%i",nodeNum);
+      sprintf(nodeName3,"FTO30%i",nodeNum);
+      sprintf(nodeName4,"FTO40%i",nodeNum);
+    }
+    if (nodeNum>9) {
+      sprintf(rotMatNum,"rot5%i",nodeNum);
+      sprintf(nodeName0,"FTO0%i",nodeNum);
+      sprintf(nodeName1,"FTO1%i",nodeNum);
+      sprintf(nodeName2,"FTO2%i",nodeNum);
+      sprintf(nodeName3,"FTO3%i",nodeNum);
+      sprintf(nodeName4,"FTO4%i",nodeNum);
+    }
+    
+    new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
+    ang = (4.5-nodeNum) * kangle;
+    
+    top->cd();
+    node = new TNode(nodeName0,nodeName0,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetC,rotMatNum);
+    node->SetLineColor(kColorTOF);
+    fNodes->Add(node); 
+    
+    top->cd(); 
+    node = new TNode(nodeName1,nodeName1,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetC,rotMatNum);
+    node->SetLineColor(kColorTOF);
+    fNodes->Add(node); 
+    if (nodeNum !=1 && nodeNum!=17 && nodeNum !=18)
+      {
+       top->cd();
+       node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetB,rotMatNum);
+       node->SetLineColor(kColorTOF);
+       fNodes->Add(node); 
+       
+       top->cd();
+       node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetB,rotMatNum);
+       node->SetLineColor(kColorTOF);
+       fNodes->Add(node); 
+      } // Holes for RICH detector
+    
+    if ((nodeNum<7 || nodeNum>11) && nodeNum !=1 && nodeNum!=17 && nodeNum !=18)
+      
+       top->cd();
+       node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetA,rotMatNum);
+       node->SetLineColor(kColorTOF);
+       fNodes->Add(node); 
+      } // Holes for PHOS detector (+ Holes for RICH detector, central part)
   } // end loop on nodeNum
 }