]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCFindClusters.C
Removing old classes from LinkDef
[u/mrichter/AliRoot.git] / TPC / AliTPCFindClusters.C
CommitLineData
c2b0eaa4 1/****************************************************************************
2 * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
3 ****************************************************************************/
4
b9de75e1 5#ifndef __CINT__
6 #include <iostream.h>
7 #include "AliRun.h"
8 #include "AliTPCv1.h"
9 #include "AliTPCv2.h"
10 #include "AliTPCParam.h"
11
12 #include "TFile.h"
13 #include "TStopwatch.h"
14#endif
15
0bc5ae87 16Int_t AliTPCFindClusters(Int_t n=1) {
73042f01 17 TFile *out=TFile::Open("AliTPCclusters.root","new");
18 if (!out->IsOpen()) {cerr<<"Delete old AliTPCclusters.root !\n"; return 1;}
106ea0fc 19 TFile *in=TFile::Open("rfio:galice.root");
73042f01 20 if (!in->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 2;}
21
22 if (!(gAlice=(AliRun*)in->Get("gAlice"))) {
23 cerr<<"gAlice have not been found on galice.root !\n";
24 return 3;
25 }
26
2ab0c725 27 TDirectory *cwd = gDirectory;
28
73042f01 29 AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
30 Int_t ver = TPC->IsVersion();
31 cerr<<"TPC version "<<ver<<" has been found !\n";
32
c2b0eaa4 33 AliTPCParam *dig=(AliTPCParam *)in->Get("75x40_100x60_150x60");
73042f01 34 if (!dig) {cerr<<"TPC parameters have not been found !\n"; return 4;}
35
36 TStopwatch timer;
37
38 switch (ver) {
39 case 1:
40 cerr<<"Making clusters...\n";
41 {
42 AliTPCv1 &tpc=*((AliTPCv1*)TPC);
afc42102 43 tpc.SetParam(dig); timer.Start(); cwd->cd();
44 for(Int_t i=0;i<n;i++){
45 printf("Processing event %d\n",i);
46 gAlice->GetEvent(i);
47 tpc.Hits2Clusters(out,i);
48 }
73042f01 49 }
50 break;
51 case 2:
52 cerr<<"Looking for clusters...\n";
53 {
afc42102 54 // delete gAlice; gAlice=0;
73042f01 55 AliTPCv2 tpc;
afc42102 56 tpc.SetParam(dig); timer.Start(); cwd->cd();
57 for (Int_t i=0;i<n;i++){
58 printf("Processing event %d\n",i);
59 tpc.Digits2Clusters(out,i);
60 // AliTPCclusterer::Digits2Clusters(dig, out, i);
61 }
73042f01 62 }
63 break;
64 default:
65 cerr<<"Invalid TPC version !\n";
66 return 5;
67 }
68
69 timer.Stop(); timer.Print();
70
71 delete gAlice; gAlice=0;
72
73 out->Close();
f38c8ae5 74
73042f01 75 in->Close();
76
77 return 0;
78}