]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/GeneralTest.C
Fix added to take into account of new/changed macros.
[u/mrichter/AliRoot.git] / ITS / GeneralTest.C
CommitLineData
66fd8363 1Int_t GeneralTest(Int_t verpoint=2) {
2 Int_t rc=0;
3
4//Test TPC simulation
5
6 gROOT->LoadMacro("$(ALICE_ROOT)/macros/grun.C");
7 grun();
8
9 Int_t ver=gAlice->GetDetector("TPC")->IsVersion();
10 delete gAlice; gAlice=0;
11
12 if ((ver!=1)&&(ver!=2)) {
13 cerr<<"Invalid TPC version: "<<ver<<" ! (must be 1 or 2)\n";
14 return 12345;
15 }
16
17 if (ver==2) {
18 gROOT->LoadMacro("$(ALICE_ROOT)/TPC/AliTPCHits2Digits.C");
19 if (rc=AliTPCHits2Digits()) return rc;
20
21 }
22
23//Test TPC reconstruction
24 gROOT->LoadMacro("$(ALICE_ROOT)/TPC/AliTPCFindClusters.C");
25 if (rc=AliTPCFindClusters()) return rc;
26
27 gROOT->LoadMacro("$(ALICE_ROOT)/TPC/AliTPCFindTracks.C");
28 if (rc=AliTPCFindTracks()) return rc;
29 gROOT->LoadMacro("$(ALICE_ROOT)/ITS/TPCtracks.C");
30 if (rc=TPCtracks()) return rc;
31
32
33 TFile *file=TFile::Open("galice.root");
34 if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; exit(4);}
35
36 if (!(gAlice=(AliRun*)file->Get("gAlice"))) {
37 cerr<<"gAlice have not been found on galice.root !\n";
38 exit(5);
39 }
40
e00eac39 41 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
66fd8363 42 delete gAlice; gAlice=0;
43
e00eac39 44 if (!gm) {
45 cerr << "This version of the ITS geometry does not have a AliITSgeom"
46 << " defined" << endl;
66fd8363 47 return 12345;
48 }
49cout<<" verpoint = "<<verpoint<<"\n";
50 switch(verpoint){
51 case 1:
52 {
53 printf(" Start Fast Points calculation \n");
54 gROOT->LoadMacro("$(ALICE_ROOT)/ITS/ITSHitsToFastPoints.C");
55 if (rc=ITSHitsToFastPoints()) return rc;
56 }
57 break;
58 case 2:
59 printf("Start digitization \n");
e00eac39 60
61 gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSHits2DigitsDefault.C");
62 if (rc=AliITSHits2Digits()) return rc;
66fd8363 63
64 printf("start reconstruction\n");
65
66//Test ITS reconstruction
67 gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSFindClusters.C");
68 if (rc=AliITSFindClusters()) return rc;
69
70 break;
71 default:
72 cerr<<"Invalid Recpoint version !\n";
73 file->Close();
74 exit(7);
75 }
76
77 file->Close();
78
79
80 printf(" Start ITS tracking \n");
81 gROOT->LoadMacro("$(ALICE_ROOT)/ITS/ITStrackingGeneral.C");
82 if (rc=ITStrackingGeneral()) return rc;
83
84 return rc;
85}