AliRoot Core  3dc7879 (3dc7879)
AliTPCHits2Clusters.C
Go to the documentation of this file.
1 
8 #include "AliRun.h"
9 #include "AliRunLoader.h"
10 #include "AliTPC.h"
11 #include "AliTPCLoader.h"
12 #include "AliTPCFast.h"
13 
14 
16 
18  AliRunLoader * runLoader = Init();
19  AliTPCFast fast;
20 
21  for (Int_t ievent =0; ievent<runLoader->GetNumberOfEvents(); ievent++){
22  runLoader->SetEventNumber(ievent);
23  printf("Event\t%d\n",ievent);
24  fast.Hits2ExactClusters(runLoader);
25  }
26 }
27 
28 
29 
30 
31 
34 
35  if (gAlice) {
36  delete AliRunLoader::Instance();
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 
static AliRunLoader * Instance()
Definition: AliRunLoader.h:176
Int_t LoadgAlice()
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
void Hits2ExactClusters()
AliRunLoader * Init()
static AliRunLoader * Open(const char *filename="galice.root", const char *eventfoldername=AliConfig::GetDefaultEventFolderName(), Option_t *option="READ")
Int_t SetEventNumber(Int_t evno)
AliRun * gAlice
Definition: AliRun.cxx:62
Int_t GetNumberOfEvents()
AliRun * GetAliRun() const