]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliSimulation.cxx
Correct overloading of virtual functions in the derived classes (icc)
[u/mrichter/AliRoot.git] / STEER / AliSimulation.cxx
index 9bc064aa037330faf41c189c746db73719f1fbeb..676103e31bed903965153c2a9411b35a3a4c977c 100644 (file)
 #include "AliSimulation.h"
 #include "AliVertexGenFile.h"
 
+#include "AliDAQConfig.h"
+
 ClassImp(AliSimulation)
 
 
@@ -143,7 +145,7 @@ AliSimulation::AliSimulation(const char* configFileName,
   fEventsPerFile(),
   fBkgrdFileNames(NULL),
   fUseBkgrdVertex(kTRUE),
-  fRegionOfInterest(kTRUE)
+  fRegionOfInterest(kFALSE)
 {
 // create simulation object with default parameters
 
@@ -334,7 +336,9 @@ Bool_t AliSimulation::RunSimulation(Int_t nEvents)
 
   AliInfo(Form("initializing gAlice with config file %s",
           fConfigFileName.Data()));
-  gAlice->Init(fConfigFileName.Data());
+  StdoutToAliInfo(StderrToAliError(
+    gAlice->Init(fConfigFileName.Data());
+  ););
   AliRunLoader* runLoader = gAlice->GetRunLoader();
   if (!runLoader) {
     AliError(Form("gAlice has no run loader object. "
@@ -395,12 +399,14 @@ Bool_t AliSimulation::RunSimulation(Int_t nEvents)
   }
 
   AliInfo("running gAlice");
-  gAlice->Run(nEvents);
+  StdoutToAliInfo(StderrToAliError(
+    gAlice->Run(nEvents);
+  ););
 
   delete runLoader;
 
-  AliInfo("execution time:");
-  stopwatch.Print();
+  AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
+              stopwatch.RealTime(),stopwatch.CpuTime()));
 
   return kTRUE;
 }
@@ -426,8 +432,8 @@ Bool_t AliSimulation::RunSDigitization(const char* detectors)
       TStopwatch stopwatchDet;
       stopwatchDet.Start();
       det->Hits2SDigits();
-      AliInfo(Form("execution time for %s:", det->GetName()));
-      stopwatchDet.Print();
+      AliInfo(Form("Execution time for %s: R:%.2fs C:%.2fs",
+          det->GetName(),stopwatchDet.RealTime(),stopwatchDet.CpuTime()));
     }
   }
 
@@ -439,8 +445,8 @@ Bool_t AliSimulation::RunSDigitization(const char* detectors)
 
   delete runLoader;
 
-  AliInfo("execution time:");
-  stopwatch.Print();
+  AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
+          stopwatch.RealTime(),stopwatch.CpuTime()));
 
   return kTRUE;
 }
@@ -504,9 +510,9 @@ Bool_t AliSimulation::RunDigitization(const char* detectors,
 
   delete manager;
 
-  AliInfo("execution time:");
-  stopwatch.Print();
-
+  AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
+              stopwatch.RealTime(),stopwatch.CpuTime()));
+  
   return kTRUE;
 }
 
@@ -518,7 +524,7 @@ Bool_t AliSimulation::RunHitsDigitization(const char* detectors)
   TStopwatch stopwatch;
   stopwatch.Start();
 
-  AliRunLoader* runLoader = LoadRun();
+  AliRunLoader* runLoader = LoadRun("READ");
   if (!runLoader) return kFALSE;
 
   TString detStr = detectors;
@@ -539,9 +545,11 @@ Bool_t AliSimulation::RunHitsDigitization(const char* detectors)
   }
 
   delete runLoader;
+  //PH Temporary fix to avoid interference with the PHOS loder/getter
+  //PH The problem has to be solved in more general way 09/06/05
 
-  AliInfo("execution time:");
-  stopwatch.Print();
+  AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
+              stopwatch.RealTime(),stopwatch.CpuTime()));
 
   return kTRUE;
 }
@@ -594,8 +602,8 @@ Bool_t AliSimulation::WriteRawData(const char* detectors,
     }
   }
 
-  AliInfo("execution time:");
-  stopwatch.Print();
+  AliInfo(Form("Execution time: R:%.2fs C:%.2fs",
+              stopwatch.RealTime(),stopwatch.CpuTime()));
 
   return kTRUE;
 }
@@ -649,24 +657,6 @@ Bool_t AliSimulation::ConvertRawFilesToDate(const char* dateFileName)
 {
 // convert raw data DDL files to a DATE file with the program "dateStream"
 
-  // DATE setup
-  const Int_t kNDetectors = 17;
-  const char* kDetectors[kNDetectors] = {"TPC", "ITSSPD", "ITSSDD", "ITSSSD", 
-                                         "TRD", "TOF", "PHOS", "RICH", 
-                                         "EMCAL", "MUON", "MUTR", "ZDC", 
-                                         "PMD", "START", "VZERO", "CRT",
-                                         "FMD"};
-  const Int_t kDetectorDDLs[kNDetectors]   = {216, 20, 12, 16, 
-                                              18, 72, 20, 20, 
-                                              22, 20, 2, 1, 
-                                              6, 1, 1, 1,
-                                              1};
-  const Float_t kDetectorLDCs[kNDetectors] = {46, 2, 2, 1, 
-                                              4, 2, 1, 2, 
-                                              1, 2, 1, 1,
-                                              1, 0.5, 0.5, 1,
-                                              1};
-
   char* path = gSystem->Which(gSystem->Getenv("PATH"), "dateStream");
   if (!path) {
     AliError("the program dateStream was not found");
@@ -706,11 +696,8 @@ Bool_t AliSimulation::ConvertRawFilesToDate(const char* dateFileName)
         if (!file) continue;
         fseek(file, 0, SEEK_END);
         unsigned long size = ftell(file);
-        fseek(file, 0, SEEK_SET);
-        if (!size) {
-          fclose(file);
-          continue;
-        }
+       fclose(file);
+        if (!size) continue;
 
         if (ldcID != prevLDC) {
           fprintf(pipe, " LDC Id %d\n", ldcID);
@@ -735,6 +722,7 @@ Bool_t AliSimulation::ConvertDateToRoot(const char* dateFileName,
 
   // ALIMDC setup
   const Int_t kDBSize = 1000000000;
+  const Int_t kTagDBSize = 1000000000;
   const Bool_t kFilter = kFALSE;
   const Int_t kCompression = 1;
 
@@ -751,9 +739,13 @@ Bool_t AliSimulation::ConvertDateToRoot(const char* dateFileName,
 
   gSystem->Exec("rm -rf /tmp/mdc1");
   gSystem->Exec("rm -rf /tmp/mdc2");
+
+  gSystem->Exec("mkdir /tmp/mdc1");
+  gSystem->Exec("mkdir /tmp/mdc2");
+
   char command[256];
-  sprintf(command, "alimdc %d %d %d %s", 
-         kDBSize, kFilter, kCompression, dateFileName);
+  sprintf(command, "alimdc %d %d %d %d %s", 
+         kDBSize, kTagDBSize, kFilter, kCompression, dateFileName);
   Int_t result = gSystem->Exec(command);
   sprintf(command, "mv /tmp/mdc1/*.root %s", rootFileName);
   gSystem->Exec(command);