]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STRUCT/AliMAG.cxx
Corrections to obey the coding conventions
[u/mrichter/AliRoot.git] / STRUCT / AliMAG.cxx
index df200ba41ff113721d0d5a699056dc4091200da5..f6d176391a90fddd1345957c5b63d8c024085be4 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                                                                //
@@ -19,6 +36,7 @@
  
 #include "AliMAG.h"
 #include "AliRun.h"
+#include "AliMagF.h"
  
 ClassImp(AliMAG)
  
@@ -65,9 +83,7 @@ void AliMAG::CreateGeometry()
   */
   //End_Html
   
-  AliMC* pMC = AliMC::GetMC();
-  
-  Int_t *idtmed = gAlice->Idtmed();
+  Int_t *idtmed = fIdtmed->GetArray()-299;
   
   Float_t dpar[13];
   Int_t idrotm[399];
@@ -87,8 +103,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 +112,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 +128,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 +139,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 +148,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 +173,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")) {
+
+    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,8 +226,8 @@ 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 --- 
@@ -216,18 +257,18 @@ void AliMAG::CreateMaterials()
   
   //    IRON 
   
-  AliMedium(310, "FE_C0             ", 10, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
-  AliMedium(330, "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(309, "ALU_C0            ",  9, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
-  AliMedium(329, "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(315, "AIR_C0            ", 15, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
-  AliMedium(335, "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 +286,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");
+  }
 }