#include <TStopwatch.h>
#include <TSystem.h>
+#include "AliLog.h"
#include "AliDigitizer.h"
#include "AliGenerator.h"
#include "AliModule.h"
fEventsPerFile(),
fBkgrdFileNames(NULL),
fUseBkgrdVertex(kTRUE),
- fRegionOfInterest(kTRUE)
+ fRegionOfInterest(kFALSE)
{
// create simulation object with default parameters
fGAliceFileName = absFileName;
delete[] absFileName;
}
+
+ AliDebug(2, Form("galice file name set to %s", fileName));
}
//_____________________________________________________________________________
// hits -> digits
if (!fMakeDigitsFromHits.IsNull()) {
if (fBkgrdFileNames && (fBkgrdFileNames->GetEntriesFast() > 0)) {
- Warning("Run", "Merging and direct creation of digits from hits "
- "was selected for some detectors. "
- "No merging will be done for the following detectors: %s",
- fMakeDigitsFromHits.Data());
+ AliWarning(Form("Merging and direct creation of digits from hits "
+ "was selected for some detectors. "
+ "No merging will be done for the following detectors: %s",
+ fMakeDigitsFromHits.Data()));
}
if (!RunHitsDigitization(fMakeDigitsFromHits)) {
if (fStopOnError) return kFALSE;
stopwatch.Start();
if (!gAlice) {
- Error("RunSimulation", "no gAlice object. Restart aliroot and try again.");
+ AliError("no gAlice object. Restart aliroot and try again.");
return kFALSE;
}
if (gAlice->Modules()->GetEntries() > 0) {
- Error("RunSimulation",
- "gAlice was already run. Restart aliroot and try again.");
+ AliError("gAlice was already run. Restart aliroot and try again.");
return kFALSE;
}
- Info("RunSimulation", "initializing gAlice with config file %s",
- fConfigFileName.Data());
- gAlice->Init(fConfigFileName.Data());
+ AliInfo(Form("initializing gAlice with config file %s",
+ fConfigFileName.Data()));
+ StdoutToAliInfo(StderrToAliError(
+ gAlice->Init(fConfigFileName.Data());
+ ););
AliRunLoader* runLoader = gAlice->GetRunLoader();
if (!runLoader) {
- Error("RunSimulation", "gAlice has no run loader object. "
- "Check your config file: %s", fConfigFileName.Data());
+ AliError(Form("gAlice has no run loader object. "
+ "Check your config file: %s", fConfigFileName.Data()));
return kFALSE;
}
SetGAliceFile(runLoader->GetFileName());
if (!gAlice->Generator()) {
- Error("RunSimulation", "gAlice has no generator object. "
- "Check your config file: %s", fConfigFileName.Data());
+ AliError(Form("gAlice has no generator object. "
+ "Check your config file: %s", fConfigFileName.Data()));
return kFALSE;
}
if (nEvents <= 0) nEvents = fNEvents;
Int_t signalPerBkgrd = GetNSignalPerBkgrd(nEvents);
const char* fileName = ((TObjString*)
(fBkgrdFileNames->At(0)))->GetName();
- Info("RunSimulation", "The vertex will be taken from the background "
- "file %s with nSignalPerBackground = %d",
- fileName, signalPerBkgrd);
+ AliInfo(Form("The vertex will be taken from the background "
+ "file %s with nSignalPerBackground = %d",
+ fileName, signalPerBkgrd));
AliVertexGenFile* vtxGen = new AliVertexGenFile(fileName, signalPerBkgrd);
gAlice->Generator()->SetVertexGenerator(vtxGen);
}
loaderName += "Loader";
AliLoader* loader = runLoader->GetLoader(loaderName);
if (!loader) {
- Error("RunSimulation", "no loader for %s found\n"
- "Number of events per file not set for %s %s",
- detName, typeName, detName);
+ AliError(Form("RunSimulation", "no loader for %s found\n"
+ "Number of events per file not set for %s %s",
+ detName, typeName, detName));
continue;
}
AliDataLoader* dataLoader =
loader->GetDataLoader(typeName);
if (!dataLoader) {
- Error("RunSimulation", "no data loader for %s found\n"
- "Number of events per file not set for %s %s",
- typeName, detName, typeName);
+ AliError(Form("no data loader for %s found\n"
+ "Number of events per file not set for %s %s",
+ typeName, detName, typeName));
continue;
}
dataLoader->SetNumberOfEventsPerFile(fEventsPerFile[i]->GetUniqueID());
- Info("RunSimulation", "number of events per file set to %d for %s %s",
- fEventsPerFile[i]->GetUniqueID(), detName, typeName);
+ AliDebug(1, Form("number of events per file set to %d for %s %s",
+ fEventsPerFile[i]->GetUniqueID(), detName, typeName));
}
- Info("RunSimulation", "running gAlice");
- gAlice->Run(nEvents);
+ AliInfo("running gAlice");
+ StdoutToAliInfo(StderrToAliError(
+ gAlice->Run(nEvents);
+ ););
delete runLoader;
- Info("RunSimulation", "execution time:");
- stopwatch.Print();
+ AliInfo("execution time:");
+ StdoutToAliInfo(stopwatch.Print(););
return kTRUE;
}
AliModule* det = (AliModule*) detArray->At(iDet);
if (!det || !det->IsActive()) continue;
if (IsSelected(det->GetName(), detStr)) {
- Info("RunSDigitization", "creating summable digits for %s",
- det->GetName());
+ AliInfo(Form("creating summable digits for %s", det->GetName()));
TStopwatch stopwatchDet;
stopwatchDet.Start();
det->Hits2SDigits();
- Info("RunSDigitization", "execution time for %s:", det->GetName());
- stopwatchDet.Print();
+ AliInfo(Form("execution time for %s:", det->GetName()));
+ StdoutToAliInfo(stopwatchDet.Print(););
}
}
if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
- Error("RunSDigitization", "the following detectors were not found: %s",
- detStr.Data());
+ AliError(Form("the following detectors were not found: %s",
+ detStr.Data()));
if (fStopOnError) return kFALSE;
}
delete runLoader;
- Info("RunSDigitization", "execution time:");
- stopwatch.Print();
+ AliInfo("execution time:");
+ StdoutToAliInfo(stopwatch.Print(););
return kTRUE;
}
!IsSelected(det->GetName(), detExcl)) {
AliDigitizer* digitizer = det->CreateDigitizer(manager);
if (!digitizer) {
- Error("RunDigitization", "no digitizer for %s", det->GetName());
+ AliError(Form("no digitizer for %s", det->GetName()));
if (fStopOnError) return kFALSE;
} else {
digitizer->SetRegionOfInterest(fRegionOfInterest);
}
if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
- Error("RunDigitization", "the following detectors were not found: %s",
- detStr.Data());
+ AliError(Form("the following detectors were not found: %s",
+ detStr.Data()));
if (fStopOnError) return kFALSE;
}
if (!manager->GetListOfTasks()->IsEmpty()) {
- Info("RunDigitization", "executing digitization");
+ AliInfo("executing digitization");
manager->Exec("");
}
delete manager;
- Info("RunDigitization", "execution time:");
- stopwatch.Print();
+ AliInfo("execution time:");
+ StdoutToAliInfo(stopwatch.Print(););
return kTRUE;
}
AliModule* det = (AliModule*) detArray->At(iDet);
if (!det || !det->IsActive()) continue;
if (IsSelected(det->GetName(), detStr)) {
- Info("RunHitsDigitization", "creating digits from hits for %s",
- det->GetName());
+ AliInfo(Form("creating digits from hits for %s", det->GetName()));
det->Hits2Digits();
}
}
if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
- Error("RunHitsDigitization", "the following detectors were not found: %s",
- detStr.Data());
+ AliError(Form("the following detectors were not found: %s",
+ detStr.Data()));
if (fStopOnError) return kFALSE;
}
delete runLoader;
- Info("RunHitsDigitization", "execution time:");
- stopwatch.Print();
+ AliInfo("execution time:");
+ StdoutToAliInfo(stopwatch.Print(););
return kTRUE;
}
}
}
- Info("WriteRawData", "execution time:");
- stopwatch.Print();
+ AliInfo("execution time:");
+ StdoutToAliInfo(stopwatch.Print(););
return kTRUE;
}
// write raw data to DDL files
for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) {
- Info("WriteRawFiles", "processing event %d", iEvent);
+ AliInfo(Form("processing event %d", iEvent));
runLoader->GetEvent(iEvent);
TString baseDir = gSystem->WorkingDirectory();
char dirName[256];
sprintf(dirName, "raw%d", iEvent);
gSystem->MakeDirectory(dirName);
if (!gSystem->ChangeDirectory(dirName)) {
- Error("WriteRawData", "couldn't change to directory %s", dirName);
+ AliError(Form("couldn't change to directory %s", dirName));
if (fStopOnError) return kFALSE; else continue;
}
AliModule* det = (AliModule*) detArray->At(iDet);
if (!det || !det->IsActive()) continue;
if (IsSelected(det->GetName(), detStr)) {
- Info("WriteRawData", "creating raw data from digits for %s",
- det->GetName());
+ AliInfo(Form("creating raw data from digits for %s", det->GetName()));
det->Digits2Raw();
}
}
gSystem->ChangeDirectory(baseDir);
if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
- Error("WriteRawData", "the following detectors were not found: %s",
- detStr.Data());
+ AliError(Form("the following detectors were not found: %s",
+ detStr.Data()));
if (fStopOnError) return kFALSE;
}
}
char* path = gSystem->Which(gSystem->Getenv("PATH"), "dateStream");
if (!path) {
- Error("ConvertRawFilesToDate", "the program dateStream was not found");
+ AliError("the program dateStream was not found");
if (fStopOnError) return kFALSE;
} else {
delete[] path;
AliRunLoader* runLoader = LoadRun("READ");
if (!runLoader) return kFALSE;
- Info("ConvertRawFilesToDate",
- "converting raw data DDL files to DATE file %s", dateFileName);
+ AliInfo(Form("converting raw data DDL files to DATE file %s", dateFileName));
char command[256];
sprintf(command, "dateStream -o %s -# %d -C",
dateFileName, runLoader->GetNumberOfEvents());
char* path = gSystem->Which(gSystem->Getenv("PATH"), "alimdc");
if (!path) {
- Error("ConvertDateToRoot", "the program alimdc was not found");
+ AliError("the program alimdc was not found");
if (fStopOnError) return kFALSE;
} else {
delete[] path;
}
- Info("ConvertDateToRoot", "converting DATE file %s to root file %s",
- dateFileName, rootFileName);
+ AliInfo(Form("converting DATE file %s to root file %s",
+ dateFileName, rootFileName));
gSystem->Exec("rm -rf /tmp/mdc1");
gSystem->Exec("rm -rf /tmp/mdc2");
AliRunLoader::Open(fGAliceFileName.Data(),
AliConfig::GetDefaultEventFolderName(), mode);
if (!runLoader) {
- Error("LoadRun", "no run loader found in file %s",
- fGAliceFileName.Data());
+ AliError(Form("no run loader found in file %s", fGAliceFileName.Data()));
return NULL;
}
runLoader->LoadgAlice();
gAlice = runLoader->GetAliRun();
if (!gAlice) {
- Error("LoadRun", "no gAlice object found in file %s",
- fGAliceFileName.Data());
+ AliError(Form("no gAlice object found in file %s",
+ fGAliceFileName.Data()));
return NULL;
}
return runLoader;
if (nSignalPerBkgrd <= 0) {
nSignalPerBkgrd = (nEvents-1) / nBkgrdEvents + 1;
} else if (result && (result != nSignalPerBkgrd)) {
- Info("GetNSignalPerBkgrd", "the number of signal events per "
- "background event will be changed from %d to %d for stream %d",
- nSignalPerBkgrd, result, iBkgrdFile+1);
+ AliInfo(Form("the number of signal events per background event "
+ "will be changed from %d to %d for stream %d",
+ nSignalPerBkgrd, result, iBkgrdFile+1));
nSignalPerBkgrd = result;
}
if (!result) result = nSignalPerBkgrd;
if (nSignalPerBkgrd * nBkgrdEvents < nEvents) {
- Warning("GetNSignalPerBkgrd", "not enough background events (%d) for "
- "%d signal events using %d signal per background events for "
- "stream %d",
- nBkgrdEvents, nEvents, nSignalPerBkgrd, iBkgrdFile+1);
+ AliWarning(Form("not enough background events (%d) for %d signal events "
+ "using %d signal per background events for stream %d",
+ nBkgrdEvents, nEvents, nSignalPerBkgrd, iBkgrdFile+1));
}
}