]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/AliZDCv3.cxx
Using At instead of UncheckedAt (Marian)
[u/mrichter/AliRoot.git] / ZDC / AliZDCv3.cxx
index e7fa9ee06346c8a900c03f38bd289651f98fd00d..98785d7a6e9dddc741ab6613492ceb2dd6ede19b 100644 (file)
@@ -1907,105 +1907,6 @@ void AliZDCv3::CreateZDC()
   
 }
  
-//_____________________________________________________________________________
-void AliZDCv3::DrawModule() const
-{
-  //
-  // Draw a shaded view of the Zero Degree Calorimeter version 1
-  //
-
-  // Set everything unseen
-  gMC->Gsatt("*", "seen", -1);
-  // 
-  // Set ALIC mother transparent
-  gMC->Gsatt("ALIC","SEEN",0);
-  //
-  // Set the volumes visible
-  gMC->Gsatt("ZDCC","SEEN",0);
-  gMC->Gsatt("QT01","SEEN",1);
-  gMC->Gsatt("QT02","SEEN",1);
-  gMC->Gsatt("QT03","SEEN",1);
-  gMC->Gsatt("QT04","SEEN",1);
-  gMC->Gsatt("QT05","SEEN",1);
-  gMC->Gsatt("QT06","SEEN",1);
-  gMC->Gsatt("QT07","SEEN",1);
-  gMC->Gsatt("QT08","SEEN",1);
-  gMC->Gsatt("QT09","SEEN",1);
-  gMC->Gsatt("QT10","SEEN",1);
-  gMC->Gsatt("QT11","SEEN",1);
-  gMC->Gsatt("QT12","SEEN",1);
-  gMC->Gsatt("QT13","SEEN",1);
-  gMC->Gsatt("QC01","SEEN",1);
-  gMC->Gsatt("QC02","SEEN",1);
-  gMC->Gsatt("QC03","SEEN",1);
-  gMC->Gsatt("QC04","SEEN",1);
-  gMC->Gsatt("QC05","SEEN",1);
-  gMC->Gsatt("QC06","SEEN",1);
-  gMC->Gsatt("QC07","SEEN",1);
-  gMC->Gsatt("QC08","SEEN",1);
-  gMC->Gsatt("QC09","SEEN",1);
-  gMC->Gsatt("QC10","SEEN",1);
-  gMC->Gsatt("MQXL","SEEN",1);
-  gMC->Gsatt("YMQL","SEEN",1);
-  gMC->Gsatt("MQX ","SEEN",1);
-  gMC->Gsatt("YMQ ","SEEN",1);
-  gMC->Gsatt("ZQYX","SEEN",1);
-  gMC->Gsatt("MD1 ","SEEN",1);
-  gMC->Gsatt("MD1V","SEEN",1);
-  gMC->Gsatt("YD1 ","SEEN",1);
-  gMC->Gsatt("MD2 ","SEEN",1);
-  gMC->Gsatt("YD2 ","SEEN",1);
-  gMC->Gsatt("ZNEU","SEEN",0);
-  gMC->Gsatt("ZNF1","SEEN",0);
-  gMC->Gsatt("ZNF2","SEEN",0);
-  gMC->Gsatt("ZNF3","SEEN",0);
-  gMC->Gsatt("ZNF4","SEEN",0);
-  gMC->Gsatt("ZNG1","SEEN",0);
-  gMC->Gsatt("ZNG2","SEEN",0);
-  gMC->Gsatt("ZNG3","SEEN",0);
-  gMC->Gsatt("ZNG4","SEEN",0);
-  gMC->Gsatt("ZNTX","SEEN",0);
-  gMC->Gsatt("ZN1 ","COLO",4); 
-  gMC->Gsatt("ZN1 ","SEEN",1);
-  gMC->Gsatt("ZNSL","SEEN",0);
-  gMC->Gsatt("ZNST","SEEN",0);
-  gMC->Gsatt("ZPRO","SEEN",0);
-  gMC->Gsatt("ZPF1","SEEN",0);
-  gMC->Gsatt("ZPF2","SEEN",0);
-  gMC->Gsatt("ZPF3","SEEN",0);
-  gMC->Gsatt("ZPF4","SEEN",0);
-  gMC->Gsatt("ZPG1","SEEN",0);
-  gMC->Gsatt("ZPG2","SEEN",0);
-  gMC->Gsatt("ZPG3","SEEN",0);
-  gMC->Gsatt("ZPG4","SEEN",0);
-  gMC->Gsatt("ZPTX","SEEN",0);
-  gMC->Gsatt("ZP1 ","COLO",6); 
-  gMC->Gsatt("ZP1 ","SEEN",1);
-  gMC->Gsatt("ZPSL","SEEN",0);
-  gMC->Gsatt("ZPST","SEEN",0);
-  gMC->Gsatt("ZEM ","COLO",7); 
-  gMC->Gsatt("ZEM ","SEEN",1);
-  gMC->Gsatt("ZEMF","SEEN",0);
-  gMC->Gsatt("ZETR","SEEN",0);
-  gMC->Gsatt("ZEL0","SEEN",0);
-  gMC->Gsatt("ZEL1","SEEN",0);
-  gMC->Gsatt("ZEL2","SEEN",0);
-  gMC->Gsatt("ZEV0","SEEN",0);
-  gMC->Gsatt("ZEV1","SEEN",0);
-  gMC->Gsatt("ZES0","SEEN",0);
-  gMC->Gsatt("ZES1","SEEN",0);
-  //
-  gMC->Gdopt("hide", "on");
-  gMC->Gdopt("shad", "on");
-  gMC->Gsatt("*", "fill", 7);
-  gMC->SetClipBox(".");
-  gMC->SetClipBox("*", 0, 100, -100, 100, 12000, 16000);
-  gMC->DefaultRange();
-  gMC->Gdraw("alic", 40, 30, 0, 488, 220, .07, .07);
-  gMC->Gdhead(1111, "Zero Degree Calorimeter Version 3");
-  gMC->Gdman(18, 4, "MAN");
-}
-
 //_____________________________________________________________________________
 void AliZDCv3::CreateMaterials()
 {
@@ -2199,6 +2100,7 @@ void AliZDCv3::InitTables()
  //
 
   Int_t k, j;
+  int read=1;
 
   //  --- Reading light tables for ZN 
   char *lightfName1 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362207s");
@@ -2207,43 +2109,61 @@ void AliZDCv3::InitTables()
      printf("Cannot open file fp1 \n");
      return;
   }
+  else{
+    for(k=0; k<fNalfan; k++){
+      for(j=0; j<fNben; j++){
+       read = fscanf(fp1,"%f",&fTablen[0][k][j]);
+       if(read==0) AliDebug(3, " Error in reading light table 1");
+      }
+    }
+    fclose(fp1);
+  }
   char *lightfName2 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362208s");
   FILE *fp2 = fopen(lightfName2,"r");
   if(fp2 == NULL){
      printf("Cannot open file fp2 \n");
      return;
   }  
+  else{
+    for(k=0; k<fNalfan; k++){
+      for(j=0; j<fNben; j++){
+       read = fscanf(fp2,"%f",&fTablen[1][k][j]);
+       if(read==0) AliDebug(3, " Error in reading light table 2");
+      }
+    }
+    fclose(fp2);
+  }
   char *lightfName3 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362209s");
   FILE *fp3 = fopen(lightfName3,"r");
   if(fp3 == NULL){
      printf("Cannot open file fp3 \n");
      return;
   }
+  else{
+    for(k=0; k<fNalfan; k++){
+      for(j=0; j<fNben; j++){
+       read = fscanf(fp3,"%f",&fTablen[2][k][j]);
+       if(read==0) AliDebug(3, " Error in reading light table 3");
+      }
+    }
+    fclose(fp3);
+  }
   char *lightfName4 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362210s");
   FILE *fp4 = fopen(lightfName4,"r");
   if(fp4 == NULL){
      printf("Cannot open file fp4 \n");
      return;
   }
-  
-  int read=1;
-  for(k=0; k<fNalfan; k++){
-     for(j=0; j<fNben; j++){
-       read = fscanf(fp1,"%f",&fTablen[0][k][j]);
-       if(read==0) AliDebug(3, " Error in reading light table 1");
-       read = fscanf(fp2,"%f",&fTablen[1][k][j]);
-       if(read==0) AliDebug(3, " Error in reading light table 2");
-       read = fscanf(fp3,"%f",&fTablen[2][k][j]);
-       if(read==0) AliDebug(3, " Error in reading light table 3");
+  else{
+    for(k=0; k<fNalfan; k++){
+      for(j=0; j<fNben; j++){
        read = fscanf(fp4,"%f",&fTablen[3][k][j]);
        if(read==0) AliDebug(3, " Error in reading light table 4");
-     } 
+      }
+    }
+    fclose(fp4);
   }
-  fclose(fp1);
-  fclose(fp2);
-  fclose(fp3);
-  fclose(fp4);
-  
+    
   //  --- Reading light tables for ZP and ZEM
   char *lightfName5 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552207s");
   FILE *fp5 = fopen(lightfName5,"r");
@@ -2251,41 +2171,61 @@ void AliZDCv3::InitTables()
      printf("Cannot open file fp5 \n");
      return;
   }
+  else{
+    for(k=0; k<fNalfap; k++){
+      for(j=0; j<fNbep; j++){
+       read = fscanf(fp5,"%f",&fTablep[0][k][j]);
+       if(read==0) AliDebug(3, " Error in reading light table 5");
+      }
+    }
+    fclose(fp5);
+  }
   char *lightfName6 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552208s");
   FILE *fp6 = fopen(lightfName6,"r");
   if(fp6 == NULL){
      printf("Cannot open file fp6 \n");
      return;
   }
+  else{
+    for(k=0; k<fNalfap; k++){
+      for(j=0; j<fNbep; j++){
+       read = fscanf(fp6,"%f",&fTablep[1][k][j]);
+       if(read==0) AliDebug(3, " Error in reading light table 6");
+      }
+    }
+    fclose(fp6);
+  }
   char *lightfName7 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552209s");
   FILE *fp7 = fopen(lightfName7,"r");
   if(fp7 == NULL){
      printf("Cannot open file fp7 \n");
      return;
   }
+  else{
+    for(k=0; k<fNalfap; k++){
+      for(j=0; j<fNbep; j++){
+       read = fscanf(fp7,"%f",&fTablep[2][k][j]);
+       if(read==0) AliDebug(3, " Error in reading light table 7");
+      }
+    }
+   fclose(fp7);
+  }
   char *lightfName8 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552210s");
   FILE *fp8 = fopen(lightfName8,"r");
   if(fp8 == NULL){
      printf("Cannot open file fp8 \n");
      return;
   }
-  
-  for(k=0; k<fNalfap; k++){
-     for(j=0; j<fNbep; j++){
-       read = fscanf(fp5,"%f",&fTablep[0][k][j]);
-       if(read==0) AliDebug(3, " Error in reading light table 5");
-       read = fscanf(fp6,"%f",&fTablep[1][k][j]);
-       if(read==0) AliDebug(3, " Error in reading light table 6");
-       read = fscanf(fp7,"%f",&fTablep[2][k][j]);
-       if(read==0) AliDebug(3, " Error in reading light table 7");
+  else{
+    for(k=0; k<fNalfap; k++){
+      for(j=0; j<fNbep; j++){
        read = fscanf(fp8,"%f",&fTablep[3][k][j]);
        if(read==0) AliDebug(3, " Error in reading light table 8");
-     } 
+      }
+    }
+   fclose(fp8);
   }
-  fclose(fp5);
-  fclose(fp6);
-  fclose(fp7);
-  fclose(fp8);
+
 }
 //_____________________________________________________________________________
 void AliZDCv3::StepManager()