]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliModule.cxx
Introduction of the Copyright and cvs Log
[u/mrichter/AliRoot.git] / STEER / AliModule.cxx
index 0c431c7d7f5c520980f7a074b28b13ff79239a87..a9531f1cb9b88b86f050542b11039b7bba3e4b35 100644 (file)
@@ -1,3 +1,22 @@
+/**************************************************************************
+ * 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.                  *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 // Base class for ALICE modules. Both sensitive modules (Modules) and      //
@@ -10,7 +29,7 @@
 //                                                                           //
 //Begin_Html
 /*
-<img src="gif/AliModuleClass.gif">
+<img src="picts/AliModuleClass.gif">
 */
 //End_Html
 //                                                                           //
@@ -52,14 +71,14 @@ AliModule::AliModule(const char* name,const char *title):TNamed(name,title)
   //  
   // Get the Module numeric ID
   Int_t id = gAlice->GetModuleID(name);
-  if (id < 0) {
-    // Unknown Module !
-     Warning("AliRun::Ctor","ERROR Unknown Module: %s\n",name);
+  if (id>=0) {
+    // Module already added !
+     Warning("Ctor","Module: %s already present at %d\n",name,id);
      return;
   }
   //
   // Add this Module to the list of Modules
-  gAlice->Modules()->AddAtAndExpand(this,id);
+  gAlice->Modules()->Add(this);
   //
   //
   SetMarkerColor(3);
@@ -154,10 +173,35 @@ void AliModule::AliMaterial(Int_t imat, const char* name, Float_t a,
   // nwbuf       number of user words
   //
   Int_t kmat;
-  AliMC::GetMC()->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
+  gMC->Material(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
   (*fIdmate)[imat]=kmat;
 }
   
+//_____________________________________________________________________________
+void AliModule::AliGetMaterial(Int_t imat, char* name, Float_t &a, 
+                             Float_t &z, Float_t &dens, Float_t &radl,
+                             Float_t &absl)
+{
+  //
+  // Store the parameters for a material
+  //
+  // imat        the material index will be stored in (*fIdmate)[imat]
+  // name        material name
+  // a           atomic mass
+  // z           atomic number
+  // dens        density
+  // radl        radiation length
+  // absl        absorbtion length
+  // buf         adress of an array user words
+  // nwbuf       number of user words
+  //
+
+  Float_t buf[10];
+  Int_t nwbuf, kmat;
+  kmat=(*fIdmate)[imat];
+  gMC->Gfmate(kmat, name, a, z, dens, radl, absl, buf, nwbuf);
+}
+  
 
 //_____________________________________________________________________________
 void AliModule::AliMixture(Int_t imat, const char *name, Float_t *a,
@@ -184,7 +228,7 @@ void AliModule::AliMixture(Int_t imat, const char *name, Float_t *a,
   // wmat        array of concentrations
   //
   Int_t kmat;
-  AliMC::GetMC()->Mixture(kmat, name, a, z, dens, nlmat, wmat);
+  gMC->Mixture(kmat, name, a, z, dens, nlmat, wmat);
   (*fIdmate)[imat]=kmat;
 } 
  
@@ -217,10 +261,9 @@ void AliModule::AliMedium(Int_t numed, const char *name, Int_t nmat,
   //        =  3       constant magnetic field along z
   //  
   Int_t kmed;
-  Int_t *idtmed = gAlice->Idtmed();
-  AliMC::GetMC()->Medium(kmed,name, (*fIdmate)[nmat], isvol, ifield, fieldm,
+  gMC->Medium(kmed,name, (*fIdmate)[nmat], isvol, ifield, fieldm,
                         tmaxfd, stemax, deemax, epsil, stmin, ubuf, nbuf); 
-  idtmed[numed-1]=kmed;
+  (*fIdtmed)[numed]=kmed;
 } 
  
 //_____________________________________________________________________________
@@ -239,7 +282,7 @@ void AliModule::AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
   // theta3      polar angle for axis III
   // phi3        azimuthal angle for axis III
   //
-  AliMC::GetMC()->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3); 
+  gMC->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3); 
 } 
 
 //_____________________________________________________________________________