X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliSimulation.cxx;h=6306067d5c144133595faa9377af8e5f6c46d2f3;hb=f7ce7a372c80bb893d8bab14717fdf0293b98156;hp=619ad91e439a0192f93c065a22b033afbce6fe5a;hpb=c134270c349c4d3548f6d2483186b61b520171c1;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliSimulation.cxx b/STEER/AliSimulation.cxx index 619ad91e439..6306067d5c1 100644 --- a/STEER/AliSimulation.cxx +++ b/STEER/AliSimulation.cxx @@ -1381,7 +1381,7 @@ Bool_t AliSimulation::WriteRawData(const char* detectors, if (runLoader) for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) { char command[256]; - sprintf(command, "rm -r raw%d", iEvent); + snprintf(command, 256, "rm -r raw%d", iEvent); gSystem->Exec(command); } delete runLoader; @@ -1427,7 +1427,7 @@ Bool_t AliSimulation::WriteRawFiles(const char* detectors) runLoader->GetEvent(iEvent); TString baseDir = gSystem->WorkingDirectory(); char dirName[256]; - sprintf(dirName, "raw%d", iEvent); + snprintf(dirName, 256, "raw%d", iEvent); gSystem->MakeDirectory(dirName); if (!gSystem->ChangeDirectory(dirName)) { AliError(Form("couldn't change to directory %s", dirName)); @@ -1497,7 +1497,7 @@ Bool_t AliSimulation::ConvertRawFilesToDate(const char* dateFileName, char command[256]; // Note the option -s. It is used in order to avoid // the generation of SOR/EOR events. - sprintf(command, "dateStream -c -s -D -o %s -# %d -C -run %d", + snprintf(command, 256, "dateStream -c -s -D -o %s -# %d -C -run %d", dateFileName, runLoader->GetNumberOfEvents(),runLoader->GetHeader()->GetRun()); FILE* pipe = gSystem->OpenPipe(command, "w"); @@ -1540,7 +1540,7 @@ Bool_t AliSimulation::ConvertRawFilesToDate(const char* dateFileName, ldc += AliDAQ::NumberOfLdcs(iDet) / AliDAQ::NumberOfDdls(iDet); char rawFileName[256]; - sprintf(rawFileName, "raw%d/%s", + snprintf(rawFileName, 256, "raw%d/%s", iEvent, AliDAQ::DdlFileName(iDet,iDDL)); // check existence and size of raw data file @@ -1569,7 +1569,7 @@ Bool_t AliSimulation::ConvertRawFilesToDate(const char* dateFileName, AliInfo(Form("converting selected by trigger cluster raw data DDL files to DATE file %s", selDateFileName)); - sprintf(command, "dateStream -c -s -D -o %s -# %d -C -run %d", + snprintf(command, 256, "dateStream -c -s -D -o %s -# %d -C -run %d", selDateFileName,selEvents,runLoader->GetHeader()->GetRun()); FILE* pipe2 = gSystem->OpenPipe(command, "w"); @@ -1604,7 +1604,7 @@ Bool_t AliSimulation::ConvertRawFilesToDate(const char* dateFileName, ldc += AliDAQ::NumberOfLdcs(iDet) / AliDAQ::NumberOfDdls(iDet); char rawFileName[256]; - sprintf(rawFileName, "raw%d/%s", + snprintf(rawFileName, 256, "raw%d/%s", iEvent, AliDAQ::DdlFileName(iDet,iDDL)); // check existence and size of raw data file @@ -1896,7 +1896,6 @@ Bool_t AliSimulation::ConvertRaw2SDigits(const char* rawDirectory, const char* e runLoader->SetEventNumber(nev); runLoader->GetHeader()->Reset(rawReader->GetRunNumber(), nev, nev); - runLoader->TreeE()->Fill(); runLoader->GetEvent(nev); AliInfo(Form("We are at event %d",nev)); // @@ -1931,6 +1930,7 @@ Bool_t AliSimulation::ConvertRaw2SDigits(const char* rawDirectory, const char* e } // // Finish the event + runLoader->TreeE()->Fill(); AliInfo(Form("Finished event %d",nev)); nev++; if (N>0&&nev>=N)