//
// description:
// creates digits from sdigits for several detectors
-// stores sdigits in separate file (or in the source file
-// with sdigits). Stores gAlice object and copies TE to the
-// file with digits
//
// input:
-// TString fileNameSDigits ... input file with sdigits
-// TString fileNameDigits ... output file with digits
+// TString input ... galice input file
// Int_t nEvents ... how many events to process
// Int_t ITS, TPC, ... many flags for diff. detectors
//
// History:
//
+// 21.07.03 - changes for NewIO
+//
// 04.04.02 - first version
//
////////////////////////////////////////////////////////////////////////
#include "STEER/AliRun.h"
#include "STEER/AliRunDigitizer.h"
#include "ITS/AliITSDigitizer.h"
+#include "ITS/AliITSFDigitizer.h"
#include "TPC/AliTPCDigitizer.h"
#include "TRD/AliTRDdigitizer.h"
#include "PHOS/AliPHOSDigitizer.h"
#include "TStopwatch.h"
#endif
-#include "AliHits2SDigits.C"
-
-void AliCopyN(TString inputFile, TString outputFile);
-
-Int_t AliSDigits2Digits(TString fileNameDigits="digits.root",
- TString fileNameSDigits="rfio:sdigits.root",
- Int_t nEvents = 1, Int_t iITS = 0, Int_t iTPC = 0,
- Int_t iTRD = 0, Int_t iPHOS = 0, Int_t iMUON = 0,
- Int_t iRICH = 0, Int_t iCopy = 1)
+Int_t AliSDigits2Digits(TString input="galice.root",
+ Int_t nEvents = 1, Int_t iITS = 0, Int_t iTPC = 0,
+ Int_t iTRD = 0, Int_t iPHOS = 0, Int_t iMUON = 0,
+ Int_t iRICH = 0)
{
// delete the current gAlice object, the one from input file
// will be used
gAlice = 0;
} // end if gAlice
AliRunDigitizer * manager = new AliRunDigitizer(1,1);
- manager->SetInputStream(0,fileNameSDigits.Data());
- if (fileNameDigits != "") {
- if (iCopy) {
- AliCopyN(fileNameSDigits,fileNameDigits);
- }
- manager->SetOutputFile(fileNameDigits);
- }
+ manager->SetDebug(1000);
+ manager->SetInputStream(0,input);
+
manager->SetNrOfEventsToWrite(nEvents);
if (iITS == 1) AliITSDigitizer *dITS = new AliITSDigitizer(manager);
if (iITS == 2) AliITSFDigitizer *dITS = new AliITSFDigitizer(manager);
delete manager;
}
-
-////////////////////////////////////////////////////////////////////////
-void AliCopyN(TString inputFileName, TString outputFileName) {
-// copy some objects
-
- TFile *inputFile = OpenFile(inputFileName);
- if (!inputFile) return;
-
- TFile *outputFile = TFile::Open(outputFileName.Data(),"update");
- if (!outputFile->IsOpen()) {
- cerr<<"Can't open "<<outputFileName.Data()<<" !\n";
- return;
- }
- if (!ImportgAlice(inputFile)) return;
- AliCopy(inputFile, outputFile);
- inputFile->Close();
- delete inputFile;
- outputFile->Close();
- delete outputFile;
-}
-////////////////////////////////////////////////////////////////////////