]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliSDigits2Digits.C
Additional/optional data members to investigate the reconstruction algorithms (M...
[u/mrichter/AliRoot.git] / STEER / AliSDigits2Digits.C
index a1322db85656c4affe3017e947175d8e27c4a0ab..37adc0ce84f5ffebd1b90db099ebc719d6286c59 100644 (file)
@@ -8,18 +8,16 @@
 //
 // 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
 // 
 ////////////////////////////////////////////////////////////////////////
@@ -29,6 +27,7 @@
 #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
@@ -55,15 +49,12 @@ Int_t AliSDigits2Digits(TString fileNameDigits="digits.root",
     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) AliITSDigitizer *dITS  = new AliITSDigitizer(manager);
+  if (iITS == 1) AliITSDigitizer *dITS  = new AliITSDigitizer(manager);
+  if (iITS == 2) AliITSFDigitizer *dITS  = new AliITSFDigitizer(manager);
   if (iTPC) AliTPCDigitizer *dTPC  = new AliTPCDigitizer(manager);
   if (iTRD) AliTRDdigitizer *dTRD  = new AliTRDdigitizer(manager);
   if (iPHOS) AliPHOSDigitizer *dPHOS  = new AliPHOSDigitizer(manager);
@@ -77,24 +68,3 @@ Int_t AliSDigits2Digits(TString fileNameDigits="digits.root",
   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;
-}
-////////////////////////////////////////////////////////////////////////