]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STRUCT/AliALIFE.cxx
Another correction for YOUT2.
[u/mrichter/AliRoot.git] / STRUCT / AliALIFE.cxx
index 18bb5480e1518cfbc3a0b4cd461f2b8913c67bb2..43cd60080c68cd14cef5d3d50a7981ff8ce65615 100644 (file)
@@ -25,7 +25,8 @@
 
 ClassImp(AliALIFE)
 
-    AliALIFE::AliALIFE(const char* file1, const char* file2)
+
+AliALIFE::AliALIFE(const char* file1, const char* file2)
 {  
 // Constructor
     fNBodies = 0; 
@@ -40,7 +41,7 @@ ClassImp(AliALIFE)
     fDefaultVolume2 = "DEFAU2";    
 }
 
-    AliALIFE::AliALIFE()
+AliALIFE::AliALIFE()
 {
 // Default constructor
     fBodyFile   = "FlukaBody.inp";  
@@ -77,13 +78,15 @@ void AliALIFE::VolumeHeader()
 void AliALIFE:: Cylinder(Float_t rmin, Float_t rmax, 
                         Float_t zmin, Float_t zmax, 
                         Float_t pos[3], 
-                        char* Material, char* Field, char* Cuts) 
+                        const char* Material,
+                        const char* Field,
+                        const char* Cuts) 
 {
 // Simple cylinder
 //
 // Bodies
 // ^^^^^^
-    char name1[5], name2[5], name3[5], name4[5];
+    char name1[6], name2[6], name3[6], name4[6];
 
 //  outer radius
     sprintf(name1, "R%4.4d", fNBodies++);
@@ -113,8 +116,8 @@ void AliALIFE:: Cylinder(Float_t rmin, Float_t rmax,
 }
 
 void AliALIFE::OnionCylinder(Float_t* r, Int_t nr, Float_t zmin, Float_t zmax,
-                            Float_t pos[3], char** Materials, 
-                            char** Fields, char** Cuts) 
+                            Float_t pos[3], const char** Materials, 
+                            const char** Fields, const char** Cuts) 
 {
 //
 // Concentric cylinders
@@ -173,7 +176,9 @@ void AliALIFE::Cone(Float_t rmin1, Float_t rmin2,
                     Float_t rmax1, Float_t rmax2,
                     Float_t zmin, Float_t zmax, 
                     Float_t pos[3], 
-                    char* Material, char* Field, char* Cuts) 
+                    const char* Material,
+                    const char* Field,
+                    const char* Cuts) 
 {
 // Simple cone 
 
@@ -264,8 +269,8 @@ void AliALIFE::Cone(Float_t rmin1, Float_t rmin2,
 
 void AliALIFE::OnionCone (Float_t* r1, Float_t* r2, Int_t nr, 
                          Float_t zmin, Float_t zmax,
-                         Float_t pos[3], char** Materials, char** Fields,
-                         char** Cuts) 
+                         Float_t pos[3], const char** Materials,
+                         const char** Fields, const char** Cuts) 
 {
 // Concentric cones
 //
@@ -380,7 +385,9 @@ void AliALIFE::OnionCone (Float_t* r1, Float_t* r2, Int_t nr,
 void AliALIFE::PolyCone(Float_t* rmin, Float_t* rmax, Float_t* z, 
                        Int_t nz,
                        Float_t pos[3], 
-                       char* Material, char* Field, char* Cuts) 
+                       const char* Material,
+                       const char* Field,
+                       const char* Cuts) 
 {
 //
 // Equivalent to the Geant3 PCON
@@ -396,7 +403,8 @@ void AliALIFE::PolyCone(Float_t* rmin, Float_t* rmax, Float_t* z,
 void AliALIFE::OnionPolyCone(Float_t** r, Float_t* z,
                             Int_t nr, Int_t nz,
                             Float_t pos[3], 
-                            char** Materials, char** Fields, char** Cuts)
+                            const char** Materials,
+                            const char** Fields,const  char** Cuts)
 {
 //
 // Concentric PCONS
@@ -418,7 +426,7 @@ void AliALIFE::OnionPolyCone(Float_t** r, Float_t* z,
     }
 }
 
-void AliALIFE::Comment(char* Comment)
+void AliALIFE::Comment(const char* Comment)
 {
 // Insert comment line
     fprintf(fFile1,"*%s\n", Comment);        
@@ -426,7 +434,7 @@ void AliALIFE::Comment(char* Comment)
 }
 
 
-void AliALIFE::Finish()
+void AliALIFE::Finish(Bool_t iremove)
 {
 // Finish geometry definition
     char s[BUFSIZ];
@@ -439,8 +447,19 @@ void AliALIFE::Finish()
     
     fclose(fFile1);
     fclose(fFile2);    
+    if (iremove) {
+       remove(fVolumeFile);
+       remove(fBodyFile);
+    }
 }
 
+void AliALIFE::Copy(TObject&) const
+{
+    //
+    // Copy 
+    //
+    Fatal("Copy","Not implemented!\n");
+}