]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STRUCT/AliFRAMEv2.cxx
totEt updates from Christine
[u/mrichter/AliRoot.git] / STRUCT / AliFRAMEv2.cxx
index d141225040b49719bc09c9407bbf8abe8d182018..761cbcb342b80326fda0e1352be7b7f2aa0282a4 100644 (file)
 //  Author: A.Morsch
 //------------------------------------------------------------------------
 
-#include <TSystem.h>
-#include <TVirtualMC.h>
-#include <TString.h>
-#include <TGeoManager.h>
 #include <TGeoBBox.h>
+#include <TGeoCompositeShape.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
 #include <TGeoMatrix.h>
 #include <TGeoPgon.h>
-#include <TGeoCompositeShape.h>
+#include <TString.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
+
 #include "AliFRAMEv2.h"
 #include "AliMagF.h"
 #include "AliRun.h"
 #include "AliLog.h"
 #include "AliTrackReference.h"
  
+
+#include <TGeoTrd1.h>
+
 ClassImp(AliFRAMEv2)
 
  
 //_____________________________________________________________________________
-AliFRAMEv2::AliFRAMEv2():
+  AliFRAMEv2::AliFRAMEv2():
     fHoles(0)
 {
 // Constructor
@@ -162,16 +167,17 @@ void AliFRAMEv2::CreateGeometry()
 //
   TGeoPgon* shB77A = new TGeoPgon(0., 360., 18, 2);
   shB77A->SetName("shB77A");
-  shB77A->DefineSection( 0, -376., 280., 415.7);
-  shB77A->DefineSection( 1,  376., 280., 415.7);
+  shB77A->DefineSection( 0, -376.5, 280., 415.7);
+  shB77A->DefineSection( 1,  376.5, 280., 415.7);
   TGeoBBox* shB77B = new TGeoBBox(3.42, 2., 375.5);
   shB77B->SetName("shB77B");
-  TGeoTranslation* trB77A = new TGeoTranslation("trB77A", +283.42, 0., 0.);
-  TGeoTranslation* trB77B = new TGeoTranslation("trB77B", -283.42, 0., 0.);
+  TGeoTranslation* trB77A = new TGeoTranslation("trB77A", +283.32, 0., 0.);
+  TGeoTranslation* trB77B = new TGeoTranslation("trB77B", -283.32, 0., 0.);
   trB77A->RegisterYourself();
   trB77B->RegisterYourself();
   TGeoCompositeShape* shB77 = new TGeoCompositeShape("shB77", "shB77A+shB77B:trB77A+shB77B:trB77B");
   TGeoVolume* voB77 = new TGeoVolume("B077", shB77, gGeoManager->GetMedium("FRAME_Air"));
+  voB77->SetName("B077"); // just to avoid a warning
   gMC->Gspos("B077", 1, "ALIC", 0., 0., 0., 0, "ONLY");
 //
 // Reference plane #1 for TRD
@@ -257,7 +263,7 @@ void AliFRAMEv2::CreateGeometry()
   //
   // TPC support
   //
-  pbox[0] =   3.38;
+  pbox[0] =   3.37;
   pbox[1] =   2.0;
   pbox[2] = 375.5;
   gMC->Gsvolu("B080", "BOX", kSteel, pbox, 3);
@@ -272,10 +278,10 @@ void AliFRAMEv2::CreateGeometry()
    pbox[1] =   2.0;
    pbox[2] = 375.5;
    gMC->Gsvolu("BREF2", "BOX", kAir, pbox, 3);
-   gMC->Gspos("BREF2", 1, "B080",  3.38 - 0.05, 0., 0., 0, "ONLY");
+   gMC->Gspos("BREF2", 1, "B080",  3.37 - 0.05, 0., 0., 0, "ONLY");
 
-  gMC->Gspos("B080", 1, "B077",  283.4, 0., 0., 0, "ONLY");
-  gMC->Gspos("B080", 2, "B077", -283.4, 0., 0., idrotm[2087], "ONLY");
+  gMC->Gspos("B080", 1, "B077",  283.3, 0., 0., 0, "ONLY");
+  gMC->Gspos("B080", 2, "B077", -283.3, 0., 0., idrotm[2087], "ONLY");
 
    
 //
@@ -516,12 +522,12 @@ void AliFRAMEv2::CreateGeometry()
 
   ptrd1[0] =  49.8;
   ptrd1[1] =  70.7;
-  ptrd1[2] = 376.0;    
+  ptrd1[2] = 376.5;  
   ptrd1[3] =  iFrH / 2.;  
   
   Float_t r      = 342.0;
   Float_t rout1  = 405.5;
-  Float_t rout2  = 411.5;
+  Float_t rout2  = 411.55;
   TString module[18];
   
   for (i = 0; i < 18; i++) {
@@ -822,23 +828,39 @@ void AliFRAMEv2::CreateGeometry()
     gMC->Gspos(nameCh, 1, nameMo, 0., 0., -12.62, 0, "ONLY"); // CBL 28/6/2006
   }
 
-//
-// TOF  mother volumes
-//
+// 
+// TOF mother volumes as modified by B.Guerzoni
+// to remove overlaps/extrusions in case of aligned TOF SMs
+// 
   ptrd1[0] = 62.2500; 
-  ptrd1[1] = 67.3631; 
-  ptrd1[2] = 373.6; 
-  ptrd1[3] = 14.525; //AdC
+  ptrd1[1] = 64.25; 
+  ptrd1[2] = 372.6; 
+  ptrd1[3] = 14.525/2;
+  char nameChA[16];
+  sprintf(nameChA, "BTOFA");
+  TGeoTrd1 *trd1=new TGeoTrd1(nameChA,ptrd1[0],ptrd1[1],ptrd1[2],ptrd1[3]); 
+  trd1->SetName("BTOFA"); // just to avoid a warning
+  char nameChB[16];
+  sprintf(nameChB, "BTOFB");
+  TGeoBBox *box1 = new TGeoBBox(nameChB,64.25 ,372.6, 14.525/2);
+  box1->SetName("BTOFB"); // just to avoid a warning
+  TGeoTranslation *tr1 = new TGeoTranslation("trnsl1",0, 0, -14.525/2 );
+  tr1->RegisterYourself();
+  TGeoTranslation *tr2 = new TGeoTranslation("trnsl2",0, 0, +14.525/2 );
+  tr2->RegisterYourself();
+  TGeoCompositeShape *Btofcs =new TGeoCompositeShape("Btofcs","(BTOFA:trnsl1)+(BTOFB:trnsl2)");
+
+
   for (i = 0; i < 18; i++) {
     char nameCh[16];
     sprintf(nameCh, "BTOF%d",i);
     char nameMo[16];
     sprintf(nameMo, "BSEGMO%d",i);
-    gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
+    TGeoVolume* btf = new TGeoVolume(nameCh, Btofcs, gGeoManager->GetMedium("FRAME_Air"));
+    btf->SetName(nameCh); 
     gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
-    gMC->Gspos(nameCh, 1, nameMo, 0., 0., 43.525, 0, "ONLY"); //AdC
+    gMC->Gspos(nameCh, 1, nameMo, 0., 0., 43.525, 0, "ONLY"); 
   }
-
 //
 //    Geometry of Rails starts here
 //
@@ -949,7 +971,7 @@ void AliFRAMEv2::CreateGeometry()
 
   //
   // Outer RING
-  tpar[0] =  kBFMRou - kBFRdr;
+  tpar[0] =  kBFMRou - kBFRdr + 0.1;
   tpar[1] =  kBFMRou;
   tpar[2] =  kBFRdz / 2.;
   
@@ -1240,7 +1262,27 @@ void AliFRAMEv2::CreateGeometry()
 
 }
 
+//___________________________________________
+void AliFRAMEv2::AddAlignableVolumes() const
+{
+  // Add the 18 spaceframe sectors as alignable volumes
+  TString basesymname("FRAME/Sector");
+  TString basevolpath("ALIC_1/B077_1/BSEGMO");
+  TString symname;
+  TString volpath;
+  
+  for(Int_t sec=0; sec<18; sec++)
+  {
+      symname = basesymname;
+      symname += sec;
+      volpath = basevolpath;
+      volpath += sec;
+      volpath += "_1";
+      if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
+       AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",
+             symname.Data(),volpath.Data()));
+  }
+}
 
 //___________________________________________
 void AliFRAMEv2::CreateMaterials()
@@ -1253,8 +1295,8 @@ void AliFRAMEv2::CreateMaterials()
   tmaxfd = -20.;      // Maximum angle due to field deflection 
   deemax = -.3;       // Maximum fractional energy loss, DLS 
   stmin  = -.8;
-  Int_t   isxfld = gAlice->Field()->Integ();
-  Float_t sxmgmx = gAlice->Field()->Max();
+  Int_t   isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+  Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
 
 
   Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
@@ -1334,7 +1376,7 @@ void AliFRAMEv2::StepManager()
 
   
 
-void AliFRAMEv2::MakeHeatScreen(char* name, Float_t dyP, Int_t rot1, Int_t rot2)
+void AliFRAMEv2::MakeHeatScreen(const char* name, Float_t dyP, Int_t rot1, Int_t rot2)
 {
     // Heat screen panel
     //
@@ -1414,7 +1456,7 @@ void AliFRAMEv2::MakeHeatScreen(char* name, Float_t dyP, Int_t rot1, Int_t rot2)
 
 
 
-void AliFRAMEv2::WebFrame(char* name, Float_t dHz, Float_t theta0, Float_t phi0)
+void AliFRAMEv2::WebFrame(const char* name, Float_t dHz, Float_t theta0, Float_t phi0)
 {
     //
     // Create a web frame element