Macro to Create pulser run data from an LDC
[u/mrichter/AliRoot.git] / TOF / AliTOFtestDigitizer.C
CommitLineData
8e72349e 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:
32bd3eb5 16// char* fileNameSignal ... input file with sdigits
8e72349e 17// TString fileNameDigits ... output file with digits
18// Int_t nEvents ... how many events to process
19//
32bd3eb5 20// Updated to the new I/O: C. Zampolli
21//
22/////////////////////////////////////////////////////////////////////
8e72349e 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
32bd3eb5 32Int_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 gAlice->GetRunLoader();
43 delete gAlice;
44 gAlice=0x0;
45 }
8e72349e 46
32bd3eb5 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);
8e72349e 52
32bd3eb5 53 if (iTOF) AliTOFDigitizer *dTOF = new AliTOFDigitizer(manager);
8e72349e 54
8e72349e 55 TStopwatch timer;
56 timer.Start();
57 manager->Exec("deb all");
58 timer.Stop();
59 timer.Print();
8e72349e 60
32bd3eb5 61// delete manager;
62// manager = 0x0;
63
64 if(gAlice)
65 {
66 delete gAlice->GetRunLoader();
67 delete gAlice;
68 gAlice=0x0;
69 }
8e72349e 70
32bd3eb5 71 return 0;
8e72349e 72
8e72349e 73}