]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/FindKrClustersRaw.C
Avoid using of RunLoaders (Marian)
[u/mrichter/AliRoot.git] / TPC / FindKrClustersRaw.C
1 Int_t FindKrClustersRaw(const char *fileName="data.root"){
2
3   //define tree
4   TFile *hfile=new TFile("KryptonCl.root","RECREATE","ADC file");
5   // Create a ROOT Tree
6   TTree *mytree = new TTree("Kr","Krypton cluster tree");
7
8
9   AliRawReader *reader = new AliRawReaderRoot(fileName);
10   //AliRawReader *reader = new AliRawReaderDate(fileName);
11   reader->Reset();
12
13   TStopwatch timer;
14   timer.Start();
15
16   AliAltroRawStreamFast* stream = new AliAltroRawStreamFast(reader);
17   stream->SelectRawData("TPC");
18
19   //one general output
20   AliTPCclustererKr *clusters = new AliTPCclustererKr();
21   clusters->SetOutput(mytree);
22   clusters->SetRecoParam(0);
23
24   //only for geometry parameters loading - temporarly
25   //AliRunLoader* rl = AliRunLoader::Open("galice.root");
26   //AliTPCParam *param=(AliTPCParamSR *)gDirectory->Get("75x40_100x60_150x60");
27   AliTPCParam *param=new AliTPCParam;
28   param->SetTSample(1.00000002337219485e-07);
29   param->Update();
30   //if (!param) {cerr<<"TPC parameters have not been found !\n"; return 4;}
31   clusters->SetParam(param);
32   
33
34   Int_t evtnr=0;
35   while (reader->NextEvent()) {
36     //output for each event
37     cout<<"Evt = "<<evtnr<<endl;
38     clusters->finderIO(reader);
39     evtnr++;
40   }
41
42   //mytree->Print();//print rootuple summary 
43   // Save all objects in this file
44   hfile->Write();
45   // Close the file
46   hfile->Close();
47
48   timer.Stop();
49   timer.Print();
50
51   delete stream;
52
53   return 0;
54 }