]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STRUCT/AliMAG.cxx
VHMPID support added
[u/mrichter/AliRoot.git] / STRUCT / AliMAG.cxx
index f87109c902e82bf09d4ce10d77add6d29f3fda04..76e4c57148c845a6a86f229e35306115de563c7e 100644 (file)
@@ -1,3 +1,20 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 //  L3 Magnet                                                                //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
  
+#include <TVirtualMC.h>
+
 #include "AliMAG.h"
+#include "AliMagF.h"
 #include "AliRun.h"
  
 ClassImp(AliMAG)
@@ -65,8 +85,6 @@ void AliMAG::CreateGeometry()
   */
   //End_Html
   
-  AliMC* pMC = AliMC::GetMC();
-  
   Int_t *idtmed = fIdtmed->GetArray()-299;
   
   Float_t dpar[13];
@@ -87,8 +105,8 @@ void AliMAG::CreateGeometry()
   par[7] = 600.;
   par[8] = 580.;
   par[9] = 790.;
-  pMC->Gsvolu("L3MO", "PGON", idtmed[334], par, 10);
-  pMC->Gspos("L3MO", 1, "ALIC", 0., -30., 0., 0, "ONLY");
+  gMC->Gsvolu("L3MO", "PGON", idtmed[334], par, 10);
+  gMC->Gspos("L3MO", 1, "ALIC", 0., -30., 0., 0, "ONLY");
   
   // Define coils 
   
@@ -96,15 +114,15 @@ void AliMAG::CreateGeometry()
   par[6] = 690.;
   par[8] = 585.;
   par[9] = 690.;
-  pMC->Gsvolu("L3CO", "PGON", idtmed[328], par, 10);
-  pMC->Gspos("L3CO", 1, "L3MO", 0., 0., 0., 0, "ONLY");
+  gMC->Gsvolu("L3CO", "PGON", idtmed[328], par, 10);
+  gMC->Gspos("L3CO", 1, "L3MO", 0., 0., 0., 0, "ONLY");
   
   par[5] = 580.;
   par[6] = 585.;
   par[8] = 580.;
   par[9] = 585.;
-  pMC->Gsvolu("L3C1", "PGON", idtmed[308], par, 10);
-  pMC->Gspos("L3C1", 1, "L3MO", 0., 0., 0., 0, "ONLY");
+  gMC->Gsvolu("L3C1", "PGON", idtmed[308], par, 10);
+  gMC->Gspos("L3C1", 1, "L3MO", 0., 0., 0., 0, "ONLY");
   
   // Define yoke 
   
@@ -112,8 +130,8 @@ void AliMAG::CreateGeometry()
   par[6] = 790.;
   par[8] = 690.;
   par[9] = 790.;
-  pMC->Gsvolu("L3YO", "PGON", idtmed[329], par, 10);
-  pMC->Gspos("L3YO", 1, "L3MO", 0., 0., 0., 0, "ONLY");
+  gMC->Gsvolu("L3YO", "PGON", idtmed[329], par, 10);
+  gMC->Gspos("L3YO", 1, "L3MO", 0., 0., 0., 0, "ONLY");
   
   // Define the return yoke of L3 (DOOR) 
   
@@ -123,7 +141,8 @@ void AliMAG::CreateGeometry()
   par[7] = 700.;
   par[8] = par[5];
   par[9] = par[6];
-  pMC->Gsvolu("L3DO", "PGON", idtmed[334], par, 10);
+  gMC->Gsvolu("L3DO", "PGON", idtmed[334], par, 10);
+  gMC->Gsvolu("L3DX", "PGON", idtmed[334], par, 10);
   
   par[4] = 610.;
   par[5] = 0.;
@@ -131,18 +150,20 @@ void AliMAG::CreateGeometry()
   par[7] = 700.;
   par[8] = par[5];
   par[9] = par[6];
-  pMC->Gsvolu("L3FR", "PGON", idtmed[329], par, 10);
+  gMC->Gsvolu("L3FR", "PGON", idtmed[329], par, 10);
+  gMC->Gsvolu("L3FX", "PGON", idtmed[329], par, 10);
   
   // INNER LAYER 
   
   par[4] = 600.;
   par[7] = 610.;
-  pMC->Gsvolu("L3IR", "PGON", idtmed[309], par, 10);
+  gMC->Gsvolu("L3IR", "PGON", idtmed[309], par, 10);
+  gMC->Gsvolu("L3IX", "PGON", idtmed[309], par, 10);
   
   //     DOOR OPENING 
   
   dpar[0] = 22.5;
-  dpar[1] = 360.;
+  dpar[1] = 360;
   dpar[2] = 8.;
   dpar[3] = 3.;
   dpar[4] = 610.;
@@ -154,28 +175,50 @@ void AliMAG::CreateGeometry()
   dpar[10] = 700.;
   dpar[11] = dpar[5];
   dpar[12] = dpar[6] + 50.;
-  pMC->Gsvolu("L3O1", "PGON", idtmed[314], dpar, 13);
+  gMC->Gsvolu("L3O1", "PGON", idtmed[314], dpar, 13);
+  gMC->Gsvolu("L3O3", "PGON", idtmed[314], dpar, 13);
   par[4] = 600.;
   par[5] = 0.;
   par[6] = 163.5;
   par[7] = 610.;
   par[8] = 0.;
   par[9] = 163.5;
-  pMC->Gsvolu("L3O2", "PGON", idtmed[314], par, 10);
+  gMC->Gsvolu("L3O2", "PGON", idtmed[314], par, 10);
+  gMC->Gsvolu("L3O4", "PGON", idtmed[314], par, 10);
   
   //     THE DOOR OPENING HAS TO BE PLACED WITH 'MANY' SINCE THE REGION 
   //     WILL CONTAIN A MUON CHAMBER, BEAM PIPE AND BEAM SHIELD 
   //     PLACED WITH 'ONLY'. 
   
-  pMC->Gspos("L3O1", 1, "L3FR", 0., 30., 0., 0, "MANY");
-  pMC->Gspos("L3O2", 1, "L3IR", 0., 30., 0., 0, "MANY");
-  
-  pMC->Gspos("L3FR", 1, "L3DO", 0., 0., 0., 0, "MANY");
-  pMC->Gspos("L3IR", 1, "L3DO", 0., 0., 0., 0, "MANY");
-  
-  pMC->Gspos("L3DO", 1, "ALIC", 0., -30., 0., 0, "MANY");
   AliMatrix(idrotm[300], 90., 0., 90., 90., 180., 0.);
-  pMC->Gspos("L3DO", 2, "ALIC", 0., -30., 0., idrotm[300], "MANY");
+
+  gMC->Gspos("L3DO", 1, "ALIC", 0., -30., 0., 0, "MANY");
+  gMC->Gspos("L3FR", 1, "L3DO", 0., 0., 0., 0, "MANY");
+  gMC->Gspos("L3IR", 1, "L3DO", 0., 0., 0., 0, "MANY");
+  
+  gMC->Gspos("L3DX", 1, "ALIC", 0., -30., 0., idrotm[300], "MANY");
+  gMC->Gspos("L3FX", 1, "L3DX", 0., 0., 0., 0, "MANY");
+  gMC->Gspos("L3IX", 1, "L3DX", 0., 0., 0., 0, "MANY");
+
+  if(!strcmp(gMC->GetName(),"TGeant3") || !strcmp(gMC->GetName(),"TFluka")) {
+
+    gMC->Gspos("L3O1", 1, "L3FR", 0., 30., 0., 0, "MANY");
+    gMC->Gspos("L3O2", 1, "L3IR", 0., 30., 0., 0, "MANY");
+    gMC->Gspos("L3O3", 1, "L3FX", 0., 30., 0., 0, "MANY");
+    gMC->Gspos("L3O4", 1, "L3IX", 0., 30., 0., 0, "MANY");
+
+  }
+  else {
+    gMC->Gspos("L3O1", 1, "ALIC", 0., 0., 0., 0, "MANY");
+    gMC->Gspos("L3O2", 1, "ALIC", 0., 0., 0., 0, "MANY");
+    gMC->Gsbool("L3O1", "L3DO");
+    gMC->Gsbool("L3O2", "L3DO");
+  
+    gMC->Gspos("L3O3", 1, "ALIC", 0., 0., 0., idrotm[300], "MANY");
+    gMC->Gspos("L3O4", 1, "ALIC", 0., 0., 0., idrotm[300], "MANY");
+    gMC->Gsbool("L3O3", "L3DX");
+    gMC->Gsbool("L3O4", "L3DX");
+  }      
 }
 
 //_____________________________________________________________________________
@@ -185,12 +228,19 @@ void AliMAG::CreateMaterials()
   // Create materials for L3 magnet
   //
   
-  Int_t   ISXFLD = gAlice->Field()->Integ();
-  Float_t SXMGMX = gAlice->Field()->Max();
-  
+  Int_t   isxfld = gAlice->Field()->Integ();
+  Float_t sxmgmx = gAlice->Field()->Max();
   Float_t epsil, stmin, deemax, tmaxfd, stemax;
+
+
   // --- Define the various materials for GEANT --- 
   
+  Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
+  Float_t zAir[4]={6.,7.,8.,18.};
+  Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
+  Float_t dAir = 1.20479E-3;
+
+
   //     Aluminum 
   AliMaterial(9, "Al$", 26.98, 13., 2.7, 8.9, 37.2);
   AliMaterial(29, "Al$", 26.98, 13., 2.7, 8.9, 37.2);
@@ -200,8 +250,8 @@ void AliMAG::CreateMaterials()
   AliMaterial(30, "Fe$", 55.85, 26., 7.87, 1.76, 17.1);
   
   //     Air 
-  AliMaterial(15, "Air$", 14.61, 7.3, .001205, 30420., 67500);
-  AliMaterial(35, "Air$", 14.61, 7.3, .001205, 30420., 67500);
+  AliMixture(15, "AIR$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(35, "AIR$      ", aAir, zAir, dAir, 4, wAir);
   
   // **************** 
   //     Defines tracking media parameters. 
@@ -216,18 +266,18 @@ void AliMAG::CreateMaterials()
   
   //    IRON 
   
-  AliMedium(10, "FE_C0             ", 10, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
-  AliMedium(30, "FE_C1             ", 30, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium(10, "FE_C0             ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium(30, "FE_C1             ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
   
   //     ALUMINUM 
 
-  AliMedium(9, "ALU_C0            ",  9, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
-  AliMedium(29, "ALU_C1            ", 29, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium(9, "ALU_C0            ",  9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium(29, "ALU_C1            ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
   
   //     AIR 
   
-  AliMedium(15, "AIR_C0            ", 15, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
-  AliMedium(35, "AIR_C1            ", 35, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium(15, "AIR_C0            ", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium(35, "AIR_C1            ", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
 }
 
 //_____________________________________________________________________________
@@ -245,14 +295,16 @@ void AliMAG::Init()
   // Initialise L3 magnet after it has been built
   Int_t i;
   //
-  printf("\n");
-  for(i=0;i<35;i++) printf("*");
-  printf(" MAG_INIT ");
-  for(i=0;i<35;i++) printf("*");
-  printf("\n");
-  //
-  // Here the MAG initialisation code (if any!)
-  for(i=0;i<80;i++) printf("*");
-  printf("\n");
+  if(fDebug) {
+    printf("\n%s: ",ClassName());
+    for(i=0;i<35;i++) printf("*");
+    printf(" MAG_INIT ");
+    for(i=0;i<35;i++) printf("*");
+    printf("\n%s: ",ClassName());
+    //
+    // Here the MAG initialisation code (if any!)
+    for(i=0;i<80;i++) printf("*");
+    printf("\n");
+  }
 }