]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STRUCT/AliFRAMEv2.cxx
ZDC scalers (Chiara)
[u/mrichter/AliRoot.git] / STRUCT / AliFRAMEv2.cxx
index b669b73064bcad44c84a7d361d42d5d8ce425927..7a51b4a7f00126fb4390c75d046de26366201aa4 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"
@@ -166,12 +168,13 @@ void AliFRAMEv2::CreateGeometry()
   shB77A->DefineSection( 1,  376., 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
@@ -181,7 +184,7 @@ void AliFRAMEv2::CreateGeometry()
   shBREFA->SetName("shBREFA");
   TGeoCompositeShape* shBREF1 = new TGeoCompositeShape("shBREF1", "shBREFA-(shB77B:trB77A+shB77B:trB77B)");
   TGeoVolume* voBREF = new TGeoVolume("BREF1", shBREF1, gGeoManager->GetMedium("FRAME_Air"));
-  voBREF->SetVisibility(1);
+  voBREF->SetVisibility(0);
   gMC->Gspos("BREF1", 1, "B077", 0., 0., 0., 0, "ONLY");
 //
 //  The outer Frame
@@ -257,7 +260,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 +275,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");
 
    
 //
@@ -521,7 +524,7 @@ void AliFRAMEv2::CreateGeometry()
   
   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++) {
@@ -949,7 +952,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 +1243,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 +1276,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 +1357,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 +1437,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