]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFtestDigitizer.C
Add a task to a train
[u/mrichter/AliRoot.git] / TOF / AliTOFtestDigitizer.C
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // name: AliTOFtestDigitizer
4 // date: 11-VI-2002
5 // last update: 11-VI-2002
6 // author: F. Pierella | pierella@bo.infn.it
7 // version: 1.0
8 //
9 // description: 
10 //       creates digits from sdigits for TOF detector
11 //       stores sdigits in separate file (or in the source file
12 //       with sdigits). Stores gAlice object and copies TE to the
13 //       file with digits
14 //
15 // input:
16 //       char* fileNameSignal ... input file with sdigits
17 //       TString fileNameDigits ... output file with digits
18 //       Int_t nEvents  ... how many events to process
19 //
20 // Updated to the new I/O: C. Zampolli
21 //
22 /////////////////////////////////////////////////////////////////////
23
24 #if !defined(__CINT__) || defined(__MAKECINT__)
25 #include "iostream.h"
26 #include "AliTOFDigitizer.h"
27 #include "../STEER/AliRunDigitizer.h"
28 #include "../STEER/AliDigitizer.h"
29 #include "TStopwatch.h"
30 #endif
31
32 Int_t AliTOFtestDigitizer(const char* fileNameSignal = "galice.root",
33                           /*const char* fileNameSignal = "signal/galice.root",
34                             const char* fileNameBkgrd = "bkgrd/galice.root",*/
35                           Int_t nEvents = -1, Int_t signalPerBkgrd = 1,
36                           Int_t iTOF = 1)
37 {
38   
39 // delete the current gAlice object, the one from input file will be used
40   if(gAlice)
41     {
42       delete AliRunLoader::Instance();
43       delete gAlice;
44       gAlice=0x0;
45     }
46
47   AliRunDigitizer * manager = new AliRunDigitizer(1/*2*/,signalPerBkgrd);
48   manager->SetInputStream(0, fileNameSignal);
49   //manager->SetInputStream(1, fileNameBkgrd);
50   //manager->SetOutputFile(fileNameSignal);
51   if (nEvents >= 0) manager->SetNrOfEventsToWrite(nEvents);
52
53   if (iTOF) AliTOFDigitizer *dTOF = new AliTOFDigitizer(manager);
54
55   TStopwatch timer;
56   timer.Start();
57   manager->Exec("deb all");
58   timer.Stop(); 
59   timer.Print();
60
61 //  delete manager;
62 //  manager = 0x0;
63   
64   if(gAlice)
65     {
66       delete AliRunLoader::Instance();
67       delete gAlice;
68       gAlice=0x0;
69     }
70
71   return 0;
72
73 }