]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/TPCTestClustering.C
Changed DimuonCombinator into AliDimuCombinator to follow ALICE coding
[u/mrichter/AliRoot.git] / TPC / TPCTestClustering.C
1 //******* Run TPCTestClustering.C(1) for fast simulator data 
2 //******* Run TPCTestClustering.C(2) for slow simulator data 
3 void TPCTestClustering(int fast=1) {
4 // Dynamically link some shared libs
5    if (gClassTable->GetID("AliRun") < 0) {
6       gSystem->Load("libGeant3Dummy.so");      // a dummy version of Geant3
7       gSystem->Load("PHOS/libPHOSdummy.so");   // the standard Alice classes 
8       gSystem->Load("libgalice.so");           // the standard Alice classes 
9    } else {
10       delete gAlice;
11       gAlice=0;
12    }
13
14 // Connect the Root Galice file containing Geometry, Kine and Hits
15    TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
16    if (!file) file = new TFile("galice.root");
17
18 // Get AliRun object from file or create it if not on file
19    if (!gAlice) {
20       gAlice = (AliRun*)file->Get("gAlice");
21       if (gAlice) printf("AliRun object found on file\n");
22       if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
23    }
24
25    gAlice->GetEvent(0);
26
27    AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
28    if (fast==1) {
29       cerr<<"Making clusters...\n";
30       TPC->Hits2Clusters();
31    } else {
32       cerr<<"Looking for clusters...\n";
33       TPC->Digits2Clusters();
34    }
35    TClonesArray *c=TPC->Clusters();
36    int n=c->GetEntriesFast();
37    cerr<<"Number of clusters "<<n<<"                            \n";
38
39    TPolyMarker3D *pm=new TPolyMarker3D(n);
40    for (int i=0; i<n; i++) {
41        AliTPCcluster *cl=(AliTPCcluster *)c->UncheckedAt(i);
42        Double_t x, y, z; cl->GetXYZ(x,y,z);
43        pm->SetPoint(i,x,y,z);
44    }
45
46    c1=new TCanvas("c1", "Cluster display",0,0,575,750);
47    TView *v=new TView(1);
48    v->SetRange(-430,-560,-430,430,560,1710);
49
50    c1->Clear();
51    c1->SetFillColor(1);
52    c1->SetTheta(90.);
53    c1->SetPhi(0.);
54
55    pm->SetMarkerSize(1);
56    pm->SetMarkerColor(2);
57    pm->SetMarkerStyle(1);
58    pm->Draw();
59
60    gAlice->GetGeometry()->Draw("same");
61 }