]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFhits2sdigits.C
Safer distructor - some checks added.
[u/mrichter/AliRoot.git] / TOF / AliTOFhits2sdigits.C
1 void AliTOFhits2sdigits(Int_t evNumber1=-1, Int_t numberOfEvents=0)
2 {
3
4   /////////////////////////////////////////////////////////////////////////
5   //
6   // Creates TOF summable digits from the hits for all event in the header file
7   //
8   // Use case:
9   // start root
10   // // load the macro
11   // root[0] .L AliTOFhits2sdigits.C
12   // root[1] AliTOFhits2sdigits()
13   //
14   // By default, it creates sdigits for all the events in the header file.
15   //
16   // If you want create sdigits only the 3th event (existing in the header file)
17   // you can use the following line:
18   //
19   // root[0] .L AliTOFhits2sdigits.C
20   // root[1] AliTOFhits2sdigits(3,1)
21   //
22   // Created by: F. Pierella
23   // Updated to the new I/O: C. Zampolli
24   //
25   // Report problems to decaro@sa.infn.it
26   //
27   /////////////////////////////////////////////////////////////////////////
28
29   // Dynamically link some shared libs
30
31   if (gClassTable->GetID("AliRun") < 0) {
32     gROOT->LoadMacro("loadlibs.C");
33     loadlibs();
34     cout << "Loaded shared libraries" << endl;
35   } 
36   
37   if (gAlice)
38     {
39       delete gAlice->GetRunLoader();
40       delete gAlice;
41       gAlice = 0x0;
42     }
43   
44   // Create the TOF sdigitzer and sdigitize all events by default
45   AliTOFSDigitizer *sdigitizer = new AliTOFSDigitizer("galice.root",evNumber1,numberOfEvents);
46
47   // Activate this line if you want to print the parameters
48   // used in sdigitization
49   // sdigitizer->PrintParameters();
50
51   // e.g. Activate this line if you want to sdigitize only hits 
52   // with the plate number 3 and the sector number 15
53   // pay attention that sector must be in the range [0,17]
54   //                and plate  must be in the range [0,4]
55   // by default we sdigitize hits of all plates in all sectors
56   // sdigitizer->SelectSectorAndPlate(15,3);
57
58   // performs sdigitization with "all" verbose option
59   // "tim" option is also available for benchmarking only
60
61   sdigitizer->Exec("all");
62
63   sdigitizer = 0x0;
64   delete sdigitizer;
65
66   if (gAlice)
67     {
68       delete gAlice->GetRunLoader();
69       delete gAlice;
70       gAlice = 0x0;
71     }
72
73 }