]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CORRFW/test/testSlice.C
Revert unwanted changes concerning PID in HLT
[u/mrichter/AliRoot.git] / CORRFW / test / testSlice.C
CommitLineData
9105291d 1
2void testSlice() {
3
4 gStyle->SetPalette(1);
fb494025 5 gStyle->SetOptStat(1111111);
9105291d 6
7 gSystem->Load("libANALYSIS");
8 gSystem->Load("libCORRFW");
9
10 TFile * f = TFile::Open("output.root");
11
12 AliCFContainer * c_in = (AliCFContainer*)f->Get("container");
13
14 printf("====\n");
15 printf("old container properties\n");
16 printf("nvar=%d\t nstep=%d\t nbins[0]=%d\t nbins[1]=%d\n",c_in->GetNVar(),c_in->GetNStep(),c_in->GetNBins(0),c_in->GetNBins(1));
17 printf("====\n");
18
19
20 TCanvas * can = new TCanvas("can","",1300,850);
21 can->Divide(3,2);
22 Short_t iCan=1;
23
24 can->cd(iCan++);
25 TH2D* h_in_step0 = c_in->ShowProjection(0,1,0);
26 h_in_step0->SetTitle("input container - step 0");
27 h_in_step0->Draw("text colz");
28
29 can->cd(iCan++);
30 TH2D* h_in_step1 = c_in->ShowProjection(0,1,1) ;
31 h_in_step1->SetTitle("input container - step 1");
32 h_in_step1->Draw("text colz");
33
34
35 Int_t* vars = new Int_t[1 /*2*/];
36 vars[0]=0;
37 //vars[1]=1;
38
39 Double_t epsilon=1.e-07;
40
fb494025 41 Double_t varMin[2]={0.0 , -1.0-epsilon };
42 Double_t varMax[2]={8.0 , 1.0-epsilon };
9105291d 43
44
45 can->cd(iCan++);
46 TH1D* h_slice_step0 = c_in->ShowSlice(0,varMin,varMax,0);
47 h_slice_step0->SetTitle("test slice - step 0");
48 h_slice_step0->Draw();
49
50 printf("Creating Slice...\n");
51 AliCFContainer* c_out = c_in->MakeSlice(1,vars,varMin,varMax);
52
53 printf("====\n");
54 printf("new container properties\n");
55 printf("nvar=%d\t nstep=%d\t nbins[0]=%d\n",c_out->GetNVar(),c_out->GetNStep(),c_out->GetNBins(0));
56 printf("range = %d -> %d\n",((AliCFGridSparse*)c_out->GetGrid(0))->GetGrid()->GetAxis(0)->GetFirst(),((AliCFGridSparse*)c_out->GetGrid(0))->GetGrid()->GetAxis(0)->GetLast());
57 printf("====\n");
58
59 can->cd(iCan++);
60 TH1D* h_out_step0 = c_out->ShowProjection(0,0);
61 h_out_step0->SetTitle("output container - step 0");
62 h_out_step0->Draw();
63
64 can->cd(iCan++);
65 TH1D* h_out_step1 = c_out->ShowProjection(0,1);
66 h_out_step1->SetTitle("output container - step 1");
67 h_out_step1->Draw();
68
69
70
71 AliCFEffGrid * eff = new AliCFEffGrid("eff","",*c_out);
72 eff->CalculateEfficiency(1,0);
73
74 printf("====\n");
75 printf("efficiency map properties\n");
76 printf("nvar=%d\t nbins[0]=%d\n",eff->GetNVar(),eff->GetNBins(0));
fb494025 77 printf("range = %d -> %d\n",((AliCFGridSparse*)eff->GetNum())->GetGrid()->GetAxis(0)->GetFirst(),((AliCFGridSparse*)eff->GetNum())->GetGrid()->GetAxis(0)->GetLast());
9105291d 78 printf("====\n");
79
80 can->cd(iCan++);
81 eff->Project(0)->Draw();
82
83}