]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Possibility to store and retrieve TGeo geometry to/from file (R.Grosso)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 20 Jun 2005 00:34:07 +0000 (00:34 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 20 Jun 2005 00:34:07 +0000 (00:34 +0000)
15 files changed:
CRT/AliCRT.cxx
FMD/AliFMDGeoSimulator.cxx
FMD/AliFMDSimulator.cxx
MUON/AliMUONCommonGeometryBuilder.cxx
MUON/AliMUONGeometryBuilder.cxx
START/AliSTARTv1.cxx
STEER/AliMC.cxx
STEER/AliModule.cxx
STEER/AliRun.cxx
STEER/AliRun.h
STRUCT/AliABSO.cxx
STRUCT/AliDIPOv2.cxx
STRUCT/AliHALL.cxx
STRUCT/AliMAG.cxx
ZDC/AliZDCv2.cxx

index 502f411b031152b464de5e579150b86d70716eab..87a430d8e243b18e8d7a066cac777b9e65372a8c 100644 (file)
@@ -119,21 +119,21 @@ void AliCRT::CreateMaterials()
   Float_t epsil, stmin, tmaxfd, deemax, stemax;
   //
   //     Aluminum 
-  AliMaterial(9,  "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-  AliMaterial(29, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-  AliMaterial(49, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(9,  "ALUMINIUM0$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(29, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(49, "ALUMINIUM2$", 26.98, 13., 2.7, 8.9, 37.2);
   //
   //     Iron 
-  AliMaterial(10, "IRON    ", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(30, "IRON    ", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(50, "IRON    ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(10, "IRON0$    ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(30, "IRON1$    ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(50, "IRON2$    ", 55.85, 26., 7.87, 1.76, 17.1);
   //
   //     Air 
-  AliMaterial(15, "AIR     ", 14.61, 7.3, .001205, 30423.24, 67500.);
-  AliMaterial(35, "AIR     ", 14.61, 7.3, .001205, 30423.24, 67500.);
-  AliMaterial(55, "AIR     ", 14.61, 7.3, .001205, 30423.24, 67500.);
-  AliMaterial(75, "AIR     ", 14.61, 7.3, .001205, 30423.24, 67500.);
-  AliMaterial(95, "AIR     ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMaterial(15, "AIR0$     ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMaterial(35, "AIR1$     ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMaterial(55, "AIR2$     ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMaterial(75, "AIR3$     ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMaterial(95, "AIR4$     ", 14.61, 7.3, .001205, 30423.24, 67500.);
 
 
   // Scintillator material polystyrene 
@@ -187,9 +187,9 @@ void AliCRT::CreateMaterials()
 
   // The scintillator of the CPV made of Polystyrene 
   // scintillator -> idtmed[1112]
-  AliMedium(12 , "CPV scint.      ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
-  AliMedium(13 , "CPV scint.      ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
-  AliMedium(14 , "CPV scint.      ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
+  AliMedium(12 , "CPV scint.0     ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
+  AliMedium(13 , "CPV scint.1     ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
+  AliMedium(14 , "CPV scint.2     ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
 
   //     Molasse -> idtmed[1123]
   AliMedium(24 , "Molasse         ", 24, 0, xfield, xfieldm, tmaxfd, stemax, deemax, xepsil, stmin);
index 3799dd52c6e7c03aabe2be26e6d7f8afb7a7483d..cbcdc64c70376e7805b3ee70f8add3ddda375de0 100644 (file)
@@ -157,13 +157,13 @@ AliFMDGeoSimulator::DefineMaterials()
     return;
   }
   AliFMDSimulator::DefineMaterials();
-  fSi      = gGeoManager->GetMedium("FMDSi$");
-  fC       = gGeoManager->GetMedium("FMDCarbon$");
-  fAl      = gGeoManager->GetMedium("FMDAluminum$");
-  fChip    = gGeoManager->GetMedium("FMDChip$");
-  fAir     = gGeoManager->GetMedium("FMDAir$");
-  fPCB     = gGeoManager->GetMedium("FMDPCB$");
-  fPlastic = gGeoManager->GetMedium("FMDPlastic$");
+  fSi      = gGeoManager->GetMedium("FMD_Si$");
+  fC       = gGeoManager->GetMedium("FMD_Carbon$");
+  fAl      = gGeoManager->GetMedium("FMD_Aluminum$");
+  fChip    = gGeoManager->GetMedium("FMD_Chip$");
+  fAir     = gGeoManager->GetMedium("FMD_Air$");
+  fPCB     = gGeoManager->GetMedium("FMD_PCB$");
+  fPlastic = gGeoManager->GetMedium("FMD_Plastic$");
 }
 
 //____________________________________________________________________
index d70ac4591c6a9c064ce99b9e7db664eb8e3ad23a..bdba7b8342654fd68a0cb55027ea9fd42a665744 100644 (file)
@@ -196,9 +196,9 @@ AliFMDSimulator::DefineMaterials()
   precision        = .001;
   minStepSize      = .001;
   id               = kSiId;
-  fFMD->AliMaterial(id, "FMD Si$", 
+  fFMD->AliMaterial(id, "Si$", 
                      a, z, density, radiationLength, absorbtionLength);
-  fFMD->AliMedium(kSiId, "FMD Si$",
+  fFMD->AliMedium(kSiId, "Si$",
                    id,1,fieldType,maxField,maxBending,
                    maxStepSize,maxEnergyLoss,precision,minStepSize);
   
@@ -213,9 +213,9 @@ AliFMDSimulator::DefineMaterials()
   precision        = .003;
   minStepSize      = .003;
   id               = kCarbonId;
-  fFMD->AliMaterial(id, "FMD Carbon$", 
+  fFMD->AliMaterial(id, "Carbon$", 
                      a, z, density, radiationLength, absorbtionLength);
-  fFMD->AliMedium(kCarbonId, "FMD Carbon$",
+  fFMD->AliMedium(kCarbonId, "Carbon$",
                    id,0,fieldType,maxField,maxBending,
                    maxStepSize,maxEnergyLoss,precision,minStepSize);
 
@@ -225,9 +225,9 @@ AliFMDSimulator::DefineMaterials()
   density          = 2.7;
   radiationLength  = 8.9;
   id               = kAlId;
-  fFMD->AliMaterial(id, "FMD Aluminum$", 
+  fFMD->AliMaterial(id, "Aluminum$", 
                      a, z, density, radiationLength, absorbtionLength);
-  fFMD->AliMedium(kAlId, "FMD Aluminum$", 
+  fFMD->AliMedium(kAlId, "Aluminum$", 
                    id, 0, fieldType, maxField, maxBending,
                    maxStepSize, maxEnergyLoss, precision, minStepSize);
   
@@ -246,8 +246,8 @@ AliFMDSimulator::DefineMaterials()
     precision        = .003;
     minStepSize      = .003;
     id = kSiChipId;
-    fFMD->AliMixture(id, "FMD Si Chip$", as, zs, density, 6, ws);
-    fFMD->AliMedium(kSiChipId, "FMD Si Chip$", 
+    fFMD->AliMixture(id, "Si Chip$", as, zs, density, 6, ws);
+    fFMD->AliMedium(kSiChipId, "Si Chip$", 
                      id, 0, fieldType, maxField, maxBending, 
                      maxStepSize, maxEnergyLoss, precision, minStepSize);
   }
@@ -264,8 +264,8 @@ AliFMDSimulator::DefineMaterials()
     precision        = .001;
     minStepSize      = .001;
     id               = KaptionId;
-    fFMD->AliMixture(id, "FMD Kaption$", as, zs, density, 4, ws);
-    fFMD->AliMedium(kAlId, "FMD Kaption$",
+    fFMD->AliMixture(id, "Kaption$", as, zs, density, 4, ws);
+    fFMD->AliMedium(kAlId, "Kaption$",
                      id,0,fieldType,maxField,maxBending,
                      maxStepSize,maxEnergyLoss,precision,minStepSize);
   }
@@ -282,8 +282,8 @@ AliFMDSimulator::DefineMaterials()
     precision    = .001;
     minStepSize  = .001;
     id           = kAirId;
-    fFMD->AliMixture(id, "FMD Air$", as, zs, density, 4, ws);
-    fFMD->AliMedium(kAirId, "FMD Air$", 
+    fFMD->AliMixture(id, "Air$", as, zs, density, 4, ws);
+    fFMD->AliMedium(kAirId, "Air$", 
                      id,0,fieldType,maxField,maxBending,
                      maxStepSize,maxEnergyLoss,precision,minStepSize);
   }
@@ -308,8 +308,8 @@ AliFMDSimulator::DefineMaterials()
     precision    = .001;
     minStepSize  = .001;
     id           = kPcbId;
-    fFMD->AliMixture(id, "FMD PCB$", as, zs, density, 14, ws);
-    fFMD->AliMedium(kPcbId, "FMD PCB$", 
+    fFMD->AliMixture(id, "PCB$", as, zs, density, 14, ws);
+    fFMD->AliMedium(kPcbId, "PCB$", 
                      id,0,fieldType,maxField,maxBending,
                      maxStepSize,maxEnergyLoss,precision,minStepSize);
   }
@@ -325,8 +325,8 @@ AliFMDSimulator::DefineMaterials()
     precision    = .003;
     minStepSize  = .003;
     id           = kPlasticId;
-    fFMD->AliMixture(id, "FMD Plastic$", as, zs, density, -2, ws);
-    fFMD->AliMedium(kPlasticId, "FMD Plastic$", 
+    fFMD->AliMixture(id, "Plastic$", as, zs, density, -2, ws);
+    fFMD->AliMedium(kPlasticId, "Plastic$", 
                      id,0,fieldType,maxField,maxBending,
                      maxStepSize,maxEnergyLoss,precision,minStepSize);
   }
index 1bb97bb0dcd8f967e35e97d762f84f38808ed60f..647af93d23680ebd67c976b1e7398cec6e0f81d2 100644 (file)
@@ -129,8 +129,8 @@ void AliMUONCommonGeometryBuilder::CreateMaterials()
   Float_t sXMGMX = gAlice->Field()->Max();
   //
   // --- Define the various materials for GEANT --- 
-  fMUON->AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-  fMUON->AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+  fMUON->AliMaterial(9, "ALUMINIUM0$", 26.98, 13., 2.7, 8.9, 37.2);
+  fMUON->AliMaterial(10, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2);
   fMUON->AliMaterial(49, "Kapton$", 12.01,6,1.42,-28.6,999);          // from DPG
   fMUON->AliMaterial(42, "Copper$", 63.546,29.,8.96,-1.43,9.6);
   fMUON->AliMaterial(43, "FR4$", 17.749, 8.875, 1.7, -19.4, 999.);    // from DPG
@@ -207,9 +207,9 @@ void AliMUONCommonGeometryBuilder::CreateMaterials()
  
   //
   //    Aluminum 
-  fMUON->AliMedium(4, "ALU_CH_US          ", 9, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, 
+  fMUON->AliMedium(4, "ALU_CH_US0         ", 9, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, 
                   maxDestepAlu, epsil, stmin);
-  fMUON->AliMedium(5, "ALU_CH_US          ", 10, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, 
+  fMUON->AliMedium(5, "ALU_CH_US1         ", 10, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, 
                   maxDestepAlu, epsil, stmin);
   //
   //    Ar-isoC4H10 gas 
index 083884d2bfdf5cccfad0df729806b92ac2653967..2cfd668a431e99b25d62cae87c79187822afbfc2 100644 (file)
@@ -34,6 +34,8 @@
 #include "AliMUONGeometryConstituent.h"        
 #include "AliModule.h"
 #include "AliLog.h"
+#include "AliRun.h"
+
 
 ClassImp(AliMUONGeometryBuilder)
  
@@ -377,9 +379,16 @@ void AliMUONGeometryBuilder::InitGeometry()
     AliMUONVGeometryBuilder* builder
       = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
 
+    // Read alignement data if geometry is read from Root file
+    if (gAlice->IsRootGeometry()) {
+      fAlign = true;
+      builder->ReadTransformations();
+    }
+
     // Set sesitive volumes with each builder
     builder->SetSensitiveVolumes();
     
+
     // Read sensitive volume map from a file
     builder->ReadSVMap();
     if (!fAlign)  builder->FillTransformations();
index 778244b4eedeee8ed4cccbb767dbc333c65649f9..b7cef7a6fc89199bbdd1a7c954aadc19442a68a9 100755 (executable)
@@ -466,9 +466,9 @@ void AliSTARTv1::CreateMaterials()
    Float_t densupport=0.1;
     
 //*** Definition Of avaible START materials ***
-   AliMaterial(0, "START Steel$", 55.850,26.,7.87,1.76,999);
-   AliMaterial(1, "START Vacuum$", 1.e-16,1.e-16,1.e-16,1.e16,999);
-   AliMixture(2, "START Air$", aAir, zAir, dAir,4,wAir);
+   AliMaterial(0, "Steel$", 55.850,26.,7.87,1.76,999);
+   AliMaterial(1, "Vacuum$", 1.e-16,1.e-16,1.e-16,1.e16,999);
+   AliMixture(2, "Air$", aAir, zAir, dAir,4,wAir);
    AliMaterial(10, "CarbonPlastic$", 12.01, 6.0, 2.26, 18.8,999); 
    AliMaterial(11, "Aliminium$", 26.98, 13.0, 2.7, 8.9,999); 
 
index e1bde47e0167bf27dea9bf527f4a21961963adaa..16a642ff6fb24f59d6d93427d12ecab0175e5efa 100644 (file)
@@ -26,6 +26,7 @@
 #include <TStopwatch.h>
 #include <TSystem.h>
 #include <TVirtualMC.h>
+#include <TGeoManager.h>
 #include "TGeant3.h"
 
  
@@ -144,9 +145,24 @@ void AliMC::Copy(TObject &) const
 void  AliMC::ConstructGeometry() 
 {
   //
-  // Create modules, materials, geometry
+  // Either load geometry from file or create it through usual
+  // loop on detectors. In the first case the method
+  // AliModule::CreateMaterials() only builds fIdtmed and is postponed
+  // at InitGeometry().
   //
 
+  if(gAlice->IsRootGeometry()){
+    // Load geometry
+    const char *geomfilename = gAlice->GetGeometryFileName();
+    if(gSystem->ExpandPathName(geomfilename)){
+      AliInfo(Form("Loading geometry from file:\n %40s\n\n",geomfilename));
+      TGeoManager::Import(geomfilename);
+    }else{
+      AliInfo(Form("Geometry file %40s not found!\n",geomfilename));
+      return;
+    }
+  }else{
+    // Create modules, materials, geometry
     TStopwatch stw;
     TIter next(gAlice->Modules());
     AliModule *detector;
@@ -159,6 +175,8 @@ void  AliMC::ConstructGeometry()
       AliInfo(Form("%10s R:%.2fs C:%.2fs",
                   detector->GetName(),stw.RealTime(),stw.CpuTime()));
     }
+  }
+  
 }
 
 //_______________________________________________________________________
@@ -168,19 +186,20 @@ void  AliMC::InitGeometry()
   // Initialize detectors and display geometry
   //
 
-   AliInfo("Initialisation:");
-    TStopwatch stw;
-    TIter next(gAlice->Modules());
-    AliModule *detector;
-    while((detector = dynamic_cast<AliModule*>(next()))) {
-      stw.Start();
-      // Initialise detector and display geometry
-      detector->Init();
-      detector->BuildGeometry();
-      AliInfo(Form("%10s R:%.2fs C:%.2fs",
-                  detector->GetName(),stw.RealTime(),stw.CpuTime()));
-    }
+  AliInfo("Initialisation:");
+  TStopwatch stw;
+  TIter next(gAlice->Modules());
+  AliModule *detector;
+  while((detector = dynamic_cast<AliModule*>(next()))) {
+    stw.Start();
+    // Initialise detector and display geometry
+    if(gAlice->IsRootGeometry()) detector->CreateMaterials();
+    detector->Init();
+    detector->BuildGeometry();
+    AliInfo(Form("%10s R:%.2fs C:%.2fs",
+                detector->GetName(),stw.RealTime(),stw.CpuTime()));
+  }
+  
 }
 
 //_______________________________________________________________________
@@ -480,12 +499,12 @@ void AliMC::ResetHits()
 void AliMC::PostTrack()
 {
   // Posts tracks for each module
-     TObjArray &dets = *gAlice->Modules();
-     AliModule *module;
-
-     for(Int_t i=0; i<=gAlice->GetNdets(); i++)
-       if((module = dynamic_cast<AliModule*>(dets[i])))
-        module->PostTrack();
+  TObjArray &dets = *gAlice->Modules();
+  AliModule *module;
+  
+  for(Int_t i=0; i<=gAlice->GetNdets(); i++)
+    if((module = dynamic_cast<AliModule*>(dets[i])))
+      module->PostTrack();
 }
 
 //_______________________________________________________________________
index 88f641f7bd5ee30e32890fb11e4731c9911ec9c8..15e06c96e2f1dce2c79e071dded009384bc1487f 100644 (file)
@@ -40,6 +40,8 @@
 #include <TSystem.h>
 #include <TDirectory.h>
 #include <TVirtualMC.h>
+#include <TGeoManager.h>
+#include <TString.h>
 
 #include "AliLog.h"
 #include "AliConfig.h"
@@ -242,8 +244,19 @@ void AliModule::AliMaterial(Int_t imat, const char* name, Float_t a,
   // nwbuf       number of user words
   //
   Int_t kmat;
-  gMC->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
-  (*fIdmate)[imat]=kmat;
+  //Build the string uniquename as "DET_materialname"
+  TString uniquename = GetName();
+  uniquename.Append("_");
+  uniquename.Append(name);
+  //if geometry loaded from file only fill fIdmate, else create material too
+  if(gAlice->IsRootGeometry()){
+    TGeoMaterial *mat = gGeoManager->GetMaterial(uniquename.Data());
+    kmat = mat->GetUniqueID();
+    (*fIdmate)[imat]=kmat;
+  }else{
+    gMC->Material(kmat, uniquename.Data(), a, z, dens, radl, absl, buf, nwbuf);
+    (*fIdmate)[imat]=kmat;
+  }
 }
   
 //_______________________________________________________________________
@@ -297,8 +310,19 @@ void AliModule::AliMixture(Int_t imat, const char *name, Float_t *a,
   // wmat        array of concentrations
   //
   Int_t kmat;
-  gMC->Mixture(kmat, name, a, z, dens, nlmat, wmat);
-  (*fIdmate)[imat]=kmat;
+  //Build the string uniquename as "DET_mixturename"
+  TString uniquename = GetName();
+  uniquename.Append("_");
+  uniquename.Append(name);
+  //if geometry loaded from file only fill fIdmate, else create mixture too
+  if(gAlice->IsRootGeometry()){
+    TGeoMaterial *mat = gGeoManager->GetMaterial(uniquename.Data());
+    kmat = mat->GetUniqueID();
+    (*fIdmate)[imat]=kmat;
+  }else{
+    gMC->Mixture(kmat, uniquename.Data(), a, z, dens, nlmat, wmat);
+    (*fIdmate)[imat]=kmat;
+  }
 } 
  
 //_______________________________________________________________________
@@ -330,9 +354,20 @@ void AliModule::AliMedium(Int_t numed, const char *name, Int_t nmat,
   //        =  3       constant magnetic field along z
   //  
   Int_t kmed;
-  gMC->Medium(kmed,name, (*fIdmate)[nmat], isvol, ifield, fieldm,
-                        tmaxfd, stemax, deemax, epsil, stmin, ubuf, nbuf); 
-  (*fIdtmed)[numed]=kmed;
+  //Build the string uniquename as "DET_mediumname"
+  TString uniquename = GetName();
+  uniquename.Append("_");
+  uniquename.Append(name);
+  //if geometry loaded from file only fill fIdtmed, else create medium too
+  if(gAlice->IsRootGeometry()){
+    TGeoMedium *med = gGeoManager->GetMedium(uniquename.Data());
+    kmed = med->GetId();
+    (*fIdtmed)[numed]=kmed;
+  }else{
+    gMC->Medium(kmed, uniquename.Data(), (*fIdmate)[nmat], isvol, ifield,
+                fieldm, tmaxfd, stemax, deemax, epsil, stmin, ubuf, nbuf);
+    (*fIdtmed)[numed]=kmed;
+  }
 } 
  
 //_______________________________________________________________________
index 14a3ac58554a04fb4b705e9403f02ea9a73f877c..481580699d046288aca6a01d1cec846505421f5f 100644 (file)
@@ -49,6 +49,7 @@
 #include <TRandom3.h>
 #include <TSystem.h>
 #include <TVirtualMC.h>
+#include <TGeoManager.h>
 // 
 #include "AliLog.h"
 #include "AliDetector.h"
@@ -89,6 +90,7 @@ AliRun::AliRun():
   fPDGDB(0),  //Particle factory object
   fConfigFunction("\0"),
   fRandom(0),
+  fIsRootGeometry(kFALSE),
   fRunLoader(0x0)
 {
   //
@@ -117,6 +119,7 @@ AliRun::AliRun(const AliRun& arun):
   fPDGDB(0),  //Particle factory object
   fConfigFunction("\0"),
   fRandom(0),
+  fIsRootGeometry(kFALSE),
   fRunLoader(0x0)
 {
   //
@@ -144,6 +147,7 @@ AliRun::AliRun(const char *name, const char *title):
   fPDGDB(TDatabasePDG::Instance()),        //Particle factory object!
   fConfigFunction("Config();"),
   fRandom(new TRandom3()),
+  fIsRootGeometry(kFALSE),
   fRunLoader(0x0)
 {
   //
@@ -280,6 +284,13 @@ void  AliRun::SetField(AliMagF* magField)
   fField->ReadField();
 }
 
+//_______________________________________________________________________
+void AliRun::SetRootGeometry(Bool_t flag)
+{
+// Instruct application that the geometry is to be retreived from a root file.
+   fIsRootGeometry = flag;
+   if (flag) gMC->SetRootGeometry();
+}
 //_______________________________________________________________________
 void AliRun::SetField(Int_t type, Int_t version, Float_t scale,
                      Float_t maxField, const char* filename)
index e97ba7673d760faaf64e4e04001a9819a35e8468..855b1cafede4caa5794dd79c61f0f6ba9e224e73 100644 (file)
@@ -79,7 +79,10 @@ public:
    virtual  void  Init(const char *setup="Config.C") {InitMC(setup);}
    Bool_t         IsFolder() const {return kTRUE;}
    virtual AliLego* Lego() const {return fLego;}
-
+   Bool_t         IsRootGeometry() const {return fIsRootGeometry;}
+   void           SetRootGeometry(Bool_t flag=kTRUE);
+   const char*    GetGeometryFileName() const {return fGeometryFileName.Data();}
+   void           SetGeometryFileName(const char *name) {fGeometryFileName = name;}
    virtual  void  ResetDigits();
    virtual  void  ResetSDigits();
    virtual  void  ResetPoints();
@@ -156,7 +159,8 @@ protected:
   TString        fConfigFunction;    //  Configuration file to be executed
   TRandom       *fRandom;            //  Pointer to the random number generator
   TString        fBaseFileName;      //  Name of the base root file
-
+  Bool_t         fIsRootGeometry;    //! Flag telling if the geometry is loaded from file
+  TString        fGeometryFileName;  //! Name of the geometry file
   AliRunLoader  *fRunLoader;         //!run getter - written as a separate object
 private:
   void Copy(TObject &arun) const;
index 10536f51bb389760c2477a867da505e0976e468d..c24b5251a19b1b3fc9ab06d502c5ab40cfc3a13f 100644 (file)
@@ -144,79 +144,79 @@ void AliABSO::CreateMaterials()
   Float_t epsil, stmin, tmaxfd, deemax, stemax;
   //
   //     Carbon 
-  AliMaterial( 6, "CARBON$   ", 12.01, 6., 1.75, 24.4, 49.9);
-  AliMaterial(26, "CARBON$   ", 12.01, 6., 1.75, 24.4, 49.9);
-  AliMaterial(46, "CARBON$   ", 12.01, 6., 1.75, 24.4, 49.9);
+  AliMaterial( 6, "CARBON0$   ", 12.01, 6., 1.75, 24.4, 49.9);
+  AliMaterial(26, "CARBON1$   ", 12.01, 6., 1.75, 24.4, 49.9);
+  AliMaterial(46, "CARBON2$   ", 12.01, 6., 1.75, 24.4, 49.9);
   //
   //     Aluminum 
-  AliMaterial(9,  "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-  AliMaterial(29, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-  AliMaterial(49, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(9,  "ALUMINIUM0$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(29, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(49, "ALUMINIUM2$", 26.98, 13., 2.7, 8.9, 37.2);
   //
   //     Iron 
-  AliMaterial(10, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(30, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(50, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(10, "IRON0$     ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(30, "IRON1$     ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(50, "IRON2$     ", 55.85, 26., 7.87, 1.76, 17.1);
   //
   //     Copper
-  AliMaterial(11, "COPPER$   ", 63.55, 29., 8.96, 1.43, 15.1);
-  AliMaterial(31, "COPPER$   ", 63.55, 29., 8.96, 1.43, 15.1);
-  AliMaterial(51, "COPPER$   ", 63.55, 29., 8.96, 1.43, 15.1);
+  AliMaterial(11, "COPPER0$   ", 63.55, 29., 8.96, 1.43, 15.1);
+  AliMaterial(31, "COPPER1$   ", 63.55, 29., 8.96, 1.43, 15.1);
+  AliMaterial(51, "COPPER2$   ", 63.55, 29., 8.96, 1.43, 15.1);
   //
   //     Tungsten 
-  AliMaterial(12, "TUNGSTEN$ ", 183.85, 74., 19.3, .35, 10.3);
-  AliMaterial(32, "TUNGSTEN$ ", 183.85, 74., 19.3, .35, 10.3);
-  AliMaterial(52, "TUNGSTEN$ ", 183.85, 74., 19.3, .35, 10.3);
+  AliMaterial(12, "TUNGSTEN0$ ", 183.85, 74., 19.3, .35, 10.3);
+  AliMaterial(32, "TUNGSTEN1$ ", 183.85, 74., 19.3, .35, 10.3);
+  AliMaterial(52, "TUNGSTEN2$ ", 183.85, 74., 19.3, .35, 10.3);
   //
   //     Ni-W-Cu 
-  AliMixture(21, "Ni-W-Cu$", aniwcu, zniwcu, 18.78, 3, wniwcu);
-  AliMixture(41, "Ni-W-Cu$", aniwcu, zniwcu, 18.78, 3, wniwcu);
-  AliMixture(61, "Ni-W-Cu$", aniwcu, zniwcu, 18.78, 3, wniwcu);
+  AliMixture(21, "Ni-W-Cu0$", aniwcu, zniwcu, 18.78, 3, wniwcu);
+  AliMixture(41, "Ni-W-Cu1$", aniwcu, zniwcu, 18.78, 3, wniwcu);
+  AliMixture(61, "Ni-W-Cu2$", aniwcu, zniwcu, 18.78, 3, wniwcu);
   //
   //     Lead 
-  AliMaterial(13, "LEAD$     ", 207.19, 82., 11.35, .56, 18.5);
-  AliMaterial(33, "LEAD$     ", 207.19, 82., 11.35, .56, 18.5);
-  AliMaterial(53, "LEAD$     ", 207.19, 82., 11.35, .56, 18.5);
+  AliMaterial(13, "LEAD0$     ", 207.19, 82., 11.35, .56, 18.5);
+  AliMaterial(33, "LEAD1$     ", 207.19, 82., 11.35, .56, 18.5);
+  AliMaterial(53, "LEAD2$     ", 207.19, 82., 11.35, .56, 18.5);
   //
   //     Air 
-  AliMixture(15, "AIR$      ", aAir, zAir, dAir, 4, wAir);
-  AliMixture(35, "AIR$      ", aAir, zAir, dAir, 4, wAir);
-  AliMixture(55, "AIR$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(15, "AIR0$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(35, "AIR1$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(55, "AIR2$      ", aAir, zAir, dAir, 4, wAir);
   //
   //     Vacuum 
-  AliMixture(16, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
-  AliMixture(36, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
-  AliMixture(56, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
+  AliMixture(16, "VACUUM0$ ", aAir, zAir, dAir1, 4, wAir);
+  AliMixture(36, "VACUUM1$ ", aAir, zAir, dAir1, 4, wAir);
+  AliMixture(56, "VACUUM2$ ", aAir, zAir, dAir1, 4, wAir);
   //
   //     Concrete 
-  AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
-  AliMixture(37, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
-  AliMixture(57, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
+  AliMixture(17, "CONCRETE0$", aconc, zconc, 2.35, 10, wconc);
+  AliMixture(37, "CONCRETE1$", aconc, zconc, 2.35, 10, wconc);
+  AliMixture(57, "CONCRETE2$", aconc, zconc, 2.35, 10, wconc);
   //
   //     Poly CH2 
-  AliMixture(18, "POLYETHYLEN$", apoly, zpoly, .95, -2, wpoly);
+  AliMixture(18, "POLYETHYLEN0$", apoly, zpoly, .95, -2, wpoly);
   //
   // After a call with ratios by number (negative number of elements), 
   // the ratio array is changed to the ratio by weight, so all successive 
   // calls with the same array must specify the number of elements as 
   // positive 
   //
-  AliMixture(38, "POLYETHYLEN$", apoly, zpoly, .95, 2, wpoly);
-  AliMixture(58, "POLYETHYLEN$", apoly, zpoly, .95, 2, wpoly);
+  AliMixture(38, "POLYETHYLEN1$", apoly, zpoly, .95, 2, wpoly);
+  AliMixture(58, "POLYETHYLEN2$", apoly, zpoly, .95, 2, wpoly);
   //
   //     stainless Steel 
-  AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
-  AliMixture(39, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
-  AliMixture(59, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
+  AliMixture(19, "STAINLESS STEEL0$", asteel, zsteel, 7.88, 4, wsteel);
+  AliMixture(39, "STAINLESS STEEL1$", asteel, zsteel, 7.88, 4, wsteel);
+  AliMixture(59, "STAINLESS STEEL2$", asteel, zsteel, 7.88, 4, wsteel);
   //
   //     Insulation powder 
-  AliMixture(14, "INSULATION$", ains, zins, 0.41, 4, wins);
-  AliMixture(34, "INSULATION$", ains, zins, 0.41, 4, wins);
-  AliMixture(54, "INSULATION$", ains, zins, 0.41, 4, wins);
+  AliMixture(14, "INSULATION0$", ains, zins, 0.41, 4, wins);
+  AliMixture(34, "INSULATION1$", ains, zins, 0.41, 4, wins);
+  AliMixture(54, "INSULATION2$", ains, zins, 0.41, 4, wins);
   // Polymere Concrete 
-  AliMixture(20, "Poly Concrete$", aPolyCc, zPolyCc, 3.53, -9, wPolyCc);
-  AliMixture(40, "Poly Concrete$", aPolyCc, zPolyCc, 3.53,  9, wPolyCc);
-  AliMixture(60, "Poly Concrete$", aPolyCc, zPolyCc, 3.53,  9, wPolyCc);
+  AliMixture(20, "Poly Concrete0$", aPolyCc, zPolyCc, 3.53, -9, wPolyCc);
+  AliMixture(40, "Poly Concrete1$", aPolyCc, zPolyCc, 3.53,  9, wPolyCc);
+  AliMixture(60, "Poly Concrete2$", aPolyCc, zPolyCc, 3.53,  9, wPolyCc);
 
   //
   // **************** 
index f3fbbc5c84197f43499ef3677b91ff95ea9d23cc..14f6fdfbd36489eb8e8f8da44173577a0522cb21 100644 (file)
@@ -852,46 +852,46 @@ void AliDIPOv2::CreateMaterials()
   
   // --- Define the various materials for GEANT --- 
   //     Aluminum 
-  AliMaterial( 9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-  AliMaterial(29, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-  AliMaterial(49, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial( 9, "ALUMINIUM0$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(29, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(49, "ALUMINIUM2$", 26.98, 13., 2.7, 8.9, 37.2);
   
   //     Iron 
-  AliMaterial(10, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(30, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(50, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(10, "IRON0$     ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(30, "IRON1$     ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(50, "IRON2$     ", 55.85, 26., 7.87, 1.76, 17.1);
   //     Copper
-  AliMaterial(17, "COPPER$   ", 63.55, 29., 8.96, 1.43, 15.1);
-  AliMaterial(37, "COPPER$   ", 63.55, 29., 8.96, 1.43, 15.1);
-  AliMaterial(57, "COPPER$   ", 63.55, 29., 8.96, 1.43, 15.1);
+  AliMaterial(17, "COPPER0$   ", 63.55, 29., 8.96, 1.43, 15.1);
+  AliMaterial(37, "COPPER1$   ", 63.55, 29., 8.96, 1.43, 15.1);
+  AliMaterial(57, "COPPER2$   ", 63.55, 29., 8.96, 1.43, 15.1);
   //     Air 
-  AliMixture(15, "AIR$      ", aAir, zAir, dAir, 4, wAir);
-  AliMixture(35, "AIR$      ", aAir, zAir, dAir, 4, wAir);
-  AliMixture(55, "AIR$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(15, "AIR0$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(35, "AIR1$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(55, "AIR2$      ", aAir, zAir, dAir, 4, wAir);
   //     Vacuum 
-  AliMixture(16, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
-  AliMixture(36, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
-  AliMixture(56, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
+  AliMixture(16, "VACUUM0$ ", aAir, zAir, dAir1, 4, wAir);
+  AliMixture(36, "VACUUM1$ ", aAir, zAir, dAir1, 4, wAir);
+  AliMixture(56, "VACUUM2$ ", aAir, zAir, dAir1, 4, wAir);
   
   //     stainless Steel 
-  AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
-  AliMixture(39, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
-  AliMixture(59, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
+  AliMixture(19, "STAINLESS STEEL0$", asteel, zsteel, 7.88, 4, wsteel);
+  AliMixture(39, "STAINLESS STEEL1$", asteel, zsteel, 7.88, 4, wsteel);
+  AliMixture(59, "STAINLESS STEEL2$", asteel, zsteel, 7.88, 4, wsteel);
   
   //     Coil 
-  AliMixture(14, "Al$", acoil, zcoil, 2.122, 3, wcoil);
-  AliMixture(34, "Al$", acoil, zcoil, 2.122, 3, wcoil);
-  AliMixture(54, "Al$", acoil, zcoil, 2.122, 3, wcoil);
+  AliMixture(14, "Al0$", acoil, zcoil, 2.122, 3, wcoil);
+  AliMixture(34, "Al1$", acoil, zcoil, 2.122, 3, wcoil);
+  AliMixture(54, "Al2$", acoil, zcoil, 2.122, 3, wcoil);
 
   //RESIN
-  AliMixture(13, "RESIN$", aresi, zresi, 1.05, 3, wresi);
-  AliMixture(33, "RESIN$", aresi, zresi, 1.05, 3, wresi);
-  AliMixture(53, "RESIN$", aresi, zresi, 1.05, 3, wresi);  
+  AliMixture(13, "RESIN0$", aresi, zresi, 1.05, 3, wresi);
+  AliMixture(33, "RESIN1$", aresi, zresi, 1.05, 3, wresi);
+  AliMixture(53, "RESIN2$", aresi, zresi, 1.05, 3, wresi);  
 
   //G10
-  AliMixture(11, "G10$", aG10, zG10, 1.7, 5, wG10);
-  AliMixture(31, "G10$", aG10, zG10, 1.7, 5, wG10);
-  AliMixture(51, "G10$", aG10, zG10, 1.7, 5, wG10); 
+  AliMixture(11, "G100$", aG10, zG10, 1.7, 5, wG10);
+  AliMixture(31, "G101$", aG10, zG10, 1.7, 5, wG10);
+  AliMixture(51, "G102$", aG10, zG10, 1.7, 5, wG10); 
  
   // **************** 
   //     Defines tracking media parameters. 
index bc1cdbb06ade19b0fb2e6a3ffc1a4f78aca51616..fa5216a7704edd75e1a1e8d3fdf8b50438fcec8d 100644 (file)
@@ -299,17 +299,17 @@ void AliHALL::CreateMaterials()
 
   //     FOR CONCRETE 
   
-  AliMaterial(10, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(30, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(50, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1); 
+  AliMaterial(10, "IRON0$     ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(30, "IRON1$     ", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(50, "IRON2$     ", 55.85, 26., 7.87, 1.76, 17.1); 
 
-  AliMixture(15, "AIR$      ", aAir, zAir, dAir, 4, wAir);
-  AliMixture(35, "AIR$      ", aAir, zAir, dAir, 4, wAir);
-  AliMixture(55, "AIR$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(15, "AIR0$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(35, "AIR1$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(55, "AIR2$      ", aAir, zAir, dAir, 4, wAir);
 
-  AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
-  AliMixture(37, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
-  AliMixture(57, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
+  AliMixture(17, "CONCRETE0$", aconc, zconc, 2.35, 10, wconc);
+  AliMixture(37, "CONCRETE1$", aconc, zconc, 2.35, 10, wconc);
+  AliMixture(57, "CONCRETE2$", aconc, zconc, 2.35, 10, wconc);
   
   // **************** 
   //     Defines tracking media parameters. 
index ad8178ffcef0cbbc48ba9e08aab8c2a4d429555d..3145a5dec48dde0216a509ba72bea875d423e6e5 100644 (file)
@@ -242,16 +242,16 @@ void AliMAG::CreateMaterials()
 
 
   //     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);
+  AliMaterial(9, "Al0$", 26.98, 13., 2.7, 8.9, 37.2);
+  AliMaterial(29, "Al1$", 26.98, 13., 2.7, 8.9, 37.2);
   
   //     Iron 
-  AliMaterial(10, "Fe$", 55.85, 26., 7.87, 1.76, 17.1);
-  AliMaterial(30, "Fe$", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(10, "Fe0$", 55.85, 26., 7.87, 1.76, 17.1);
+  AliMaterial(30, "Fe1$", 55.85, 26., 7.87, 1.76, 17.1);
   
   //     Air 
-  AliMixture(15, "AIR$      ", aAir, zAir, dAir, 4, wAir);
-  AliMixture(35, "AIR$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(15, "AIR0$      ", aAir, zAir, dAir, 4, wAir);
+  AliMixture(35, "AIR1$      ", aAir, zAir, dAir, 4, wAir);
   
   // **************** 
   //     Defines tracking media parameters. 
index afabfc84aab30d374292529638dbb7f86ba109be..64a3f33d9495fcaa8341d67bf9af468534ca2bed 100644 (file)
@@ -937,11 +937,11 @@ void AliZDCv2::CreateMaterials()
   
   // --- Iron (energy loss taken into account)
   ubuf[0] = 1.1;
-  AliMaterial(7, "IRON", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
+  AliMaterial(7, "IRON0", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
   
   // --- Iron (no energy loss)
   ubuf[0] = 1.1;
-  AliMaterial(8, "IRON", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
+  AliMaterial(8, "IRON1", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
   
   // ---------------------------------------------------------  
   Float_t aResGas[3]={1.008,12.0107,15.9994};