]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFhits2sdigits.C
Transition to NewIO
[u/mrichter/AliRoot.git] / TOF / AliTOFhits2sdigits.C
1 void AliTOFhits2sdigits(Int_t firstEvent=0,Int_t nEvents=1) 
2 {
3
4   /////////////////////////////////////////////////////////////////////////
5   //
6   // Creates TOF summable digits from the hit information. 
7   //
8   // Report problems to pierella@bo.infn.it
9   //
10   // Use case:
11   // start root
12   // // load the macro
13   // root[0] .L AliTOFhits2sdigits.C
14   // root[1] AliTOFhits2sdigits()
15   //
16   // Updated to the new I/O: C. Zampolli
17   //
18   /////////////////////////////////////////////////////////////////////////
19
20   // Dynamically link some shared libs
21
22   if (gClassTable->GetID("AliRun") < 0) {
23     gROOT->LoadMacro("loadlibs.C");
24     loadlibs();
25     cout << "Loaded shared libraries" << endl;
26   } 
27   
28   if (gAlice)
29     {
30       delete gAlice->GetRunLoader();
31       delete gAlice;
32       gAlice = 0x0;
33     }
34   
35   // Create the TOF sdigitzer and sdigitize by default the first event
36   // (in fact by default Int_t firstEvent=0,Int_t nEvents=1)
37   AliTOFSDigitizer *sdigitizer = new AliTOFSDigitizer("galice.root",firstEvent,nEvents); // it is the same nevents numbering
38
39   // Activate this line if you want to print the parameters
40   // used in sdigitization
41   // sdigitizer->PrintParameters();
42
43   // e.g. Activate this line if you want to sdigitize only hits from plate 3
44   // in sector 15
45   // pay attention that sector must be in the range [1,18]
46   //                and plate  must be in the range [1,5]
47   // by default we sdigitize hits of all plates in all sectors
48   // sdigitizer->SelectSectorAndPlate(15,3);
49
50
51   // performs sdigitization of the above events with "all" verbose option
52   // "tim" option is also available for benchmarking only
53   //sdigitizer->Exec("all");  
54
55   // N.B.: in order to maintain the functionality to sdigitize 
56   // all events in current file add a second option
57    sdigitizer->Exec("all","all");
58   // the second "all" option overrides the previous settings for 
59   // lower and upper  bounds for event to sdigitize and allow
60   // the sdigitization for ALL events in fileNameHits
61
62    sdigitizer = 0x0;
63    delete sdigitizer;
64    
65    if (gAlice)
66      {
67        delete gAlice->GetRunLoader();
68        delete gAlice;
69        gAlice = 0x0;
70      }
71    
72 }