]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCHits2Clusters.C
Fixes for some mem-leaks: most changes where pretty basic (i.e. adding deletes).
[u/mrichter/AliRoot.git] / TPC / AliTPCHits2Clusters.C
1 /*
2   .L AliTPCHits2Clusters.C+
3   Hits2ExactClusters();
4
5 */
6
7 #include "AliRun.h"
8 #include "AliRunLoader.h"
9 #include "AliTPC.h"
10 #include "AliTPCLoader.h"
11 #include "AliTPCFast.h"
12
13
14 AliRunLoader *Init();
15
16 void Hits2ExactClusters(){
17   AliRunLoader * runLoader = Init();
18   AliTPCFast fast;
19   
20   for (Int_t ievent =0; ievent<runLoader->GetNumberOfEvents(); ievent++){
21     runLoader->SetEventNumber(ievent);
22     printf("Event\t%d\n",ievent);
23     fast.Hits2ExactClusters(runLoader);
24   }
25 }
26
27
28
29
30
31 AliRunLoader* Init(){
32   //
33   // initialization
34   //
35   if (gAlice) {
36     delete gAlice->GetRunLoader();
37     delete gAlice;//if everything was OK here it is already NULL
38     gAlice = 0x0;
39   }
40   
41   AliRunLoader* rl = AliRunLoader::Open("galice.root");
42   if (rl == 0x0) {
43     cerr<<"Can not open session"<<endl;
44     return 0;
45   }
46   
47   if (rl->LoadgAlice()) {
48     cerr<<"Error occured while l"<<endl;
49     return 0;
50   }
51    
52   gAlice=rl->GetAliRun();
53   if (!gAlice) {
54     cerr<<"Can't get gAlice !\n";
55     return 0;
56   }
57   return rl;
58 }
59
60
61