]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/fastSimul/AliTPCclusterAnalysis.C
Make a Makechain function static
[u/mrichter/AliRoot.git] / TPC / fastSimul / AliTPCclusterAnalysis.C
1 /*
2 //
3 // 0. Load libraries
4 //
5 gSystem->Load("libSTAT.so");
6 .x ~/NimStyle.C
7 .L $ALICE_ROOT/TPC/fastSimul/AliTPCclusterFast.cxx+
8 .L $ALICE_ROOT/TPC/fastSimul/AliTPCclusterAnalysis.C
9 //
10 // 1. load tree
11 //
12 LoadTree();
13 LoadTrack();
14 //
15 //
16 //
17
18 */
19 TChain * treeCluster=0;
20 TChain * treeTrack=0;
21 AliTPCfastTrack * track =0;
22
23 void LoadTree(const char* fname="cluterSimul.root"){
24   //
25   //
26   //
27   treeCluster = new TChain("simul","simul");
28   treeCluster->AddFile(fname);
29 }
30
31 void LoadTrack(const char* fname="trackerSimul.root"){
32   //
33   //
34   //
35   treeTrack = new TChain("simulTrack","simulTrack");
36   treeTrack->AddFile(fname);
37   TFile f(fname);
38   
39 }
40
41
42
43
44
45
46 void MakeQNormalization(Int_t maxPoints){
47   //
48   // Normalize Q to the diffusion and angular effect 
49   //
50   
51   TStatToolkit toolkit;
52   Double_t chi2;
53   TVectorD fitParam;
54   TMatrixD covMatrix;
55   Int_t npoints;
56   TString fstringQ="";
57   fstringQ+="fDiff++";
58   fstringQ+="abs(fAngleY)++";
59   fstringQ+="abs(fAngleZ)++";
60   TString *strQmax=0;
61   TString *strQtot=0;
62   //
63   strQmax = toolkit.FitPlane(treeCluster,"s.GetQmax(0.33,2.5,1,1,1)/s.fNtot",fstringQ.Data(), "", chi2,npoints,fitParam,covMatrix,-1,0,50000);
64   printf("Qmax norm\t%f\n",TMath::Sqrt(chi2/npoints));
65   strQmax->Tokenize("++")->Print();
66   treeCluster->SetAlias("qMaxCorr",strQmax->Data());
67   //
68   strQtot = toolkit.FitPlane(treeCluster,"s.GetQtot(0.33,2.5,1,1,1)/s.fNtot",fstringQ.Data(),"", chi2,npoints,fitParam,covMatrix,-1,0,50000);
69   printf("Qmax norm\t%f\n",TMath::Sqrt(chi2/npoints));
70   strQtot->Tokenize("++")->Print();
71   treeCluster->SetAlias("qTotCorr",strQtot->Data());    
72   //
73   //
74 }
75
76
77
78
79 //
80 // Correction tests - normalization of response functions
81 //
82
83 void sum(){
84   TF2 f2("f2","AliTPCclusterFast::GaussConvolution(x,y,2,0.5,0.5,0.5)",-3,3,-3,3);
85   Float_t sumg=0;
86   for (Float_t x=-5; x<5; x+=0.5)  for (Float_t y=-5; y<5; y+=0.5) sumg+=f2->Eval(x,y);
87   printf("%f\n", sumg);
88 }
89
90
91
92 Double_t testSumGaus(Float_t k0,Float_t k1, Float_t s0, Float_t s1){
93   TF2 f2("f2",Form("AliTPCclusterFast::GaussConvolution(x,y,%f,%f,%f,%f)",k0,k1,s0,s1),-2,2,-2,2);
94   Float_t sumg=0;
95   for (Float_t x=-5; x<5; x+=0.2)  for (Float_t y=-5; y<5; y+=0.2) sumg+=f2.Eval(x,y);
96   sumg*=0.2*0.2;
97   printf("%f\t%f\t%f\t%f\t%f\n",k0,k1,s0,s1, sumg);
98   return sumg;
99 }
100
101 Double_t testSumExp(Float_t s0, Float_t k1){
102   TF1 f1("f1",Form("AliTPCclusterFast::GaussExpConvolution(x,%f,%f)",s0,k1),-2,2);
103   Float_t sumg=0;
104   for (Float_t x=-5; x<5; x+=0.2)  sumg+=f1.Eval(x);
105   sumg*=0.2;
106   printf("%f\t%f\t%f\t%f\t%f\n",s0,k1, sumg);
107   return sumg;
108 }
109
110
111
112