Using TMath::Abs instead of fabs
[u/mrichter/AliRoot.git] / HLT / exa / Eval.C
1 // $Id$
2
3 void Eval(char *rootfile="")
4 {
5   AliL3Logger l;
6 //  l.UnSet(AliL3Logger::kDebug);
7 //  l.UnSet(AliL3Logger::kAll);
8   l.Set(AliL3Logger::kError);
9   l.UseStdout();
10   //l.UseStream();
11     
12   int slice[2] = {0,35};
13   e = new AliL3Evaluate(rootfile,slice);
14   e->SetupSlow("tracks.raw",".");
15   //e->SetupFast("tracks.raw","/nfs/david/subatom/alice/data/V3.04/fast/clusters/hg_8k_v0_s1-3_e0_cl.root",".");
16   
17   TNtuple *ntuppel = (TNtuple*)e->EvaluatePoints();
18   file = new TFile("CFeval_nodeconv.root","RECREATE");
19   file->cd();
20   ntuppel->Write();
21   file->Close();
22   delete file;
23 }
24
25 void plotPt(char *rootfile)
26 {
27   gStyle->SetStatColor(10);
28   gStyle->SetOptStat(0);
29   gStyle->SetOptFit(1100);  
30   
31   c = new TCanvas("c","",2);
32   SetCanvasOptions(c);
33   
34   f1 = new TFile(rootfile);
35
36   hist = new TH1F("hist","",50,-10,10);
37   SetTH1Options(hist);
38   fNtuppel->Draw("(pt_found-pt_gen)/pt_gen*100>>hist","nHits>30");
39   hist->GetXaxis()->SetTitle("%");
40   hist->GetYaxis()->SetTitle("Counts");
41
42   float rms = hist->GetRMS();
43   printf("Rms value : %f\n",rms);
44   
45   TF1 *f = new TF1("f","gaus",-rms,rms);
46   hist->Fit("f","R");
47 }
48
49 void plot(char *rootfile)
50 {
51   gStyle->SetStatColor(10);
52   gStyle->SetOptStat(1);
53   gStyle->SetOptFit(1);
54   
55   file = new TFile(rootfile);
56   hist = new TH1F("hist","",100,-0.6,0.6);
57   SetTH1Options(hist);
58   
59   can = new TCanvas("can","Residuals",900,600);
60   can->Divide(2);
61   SetCanvasOptions(can);
62   can->cd(1);
63   //ntuppel->Draw("residual_trans>>hist","zHit < 50 && padrow > 55");//beta < 10*4.1515/180");
64   ntuppel->Draw("resy>>hist","ptgen > 1.0");
65   
66   float rms = hist->GetRMS();
67   printf("Rms value : %f\n",rms);
68   
69   TF1 *f = new TF1("f","gaus",-rms,rms);
70   hist->Fit("f","R");
71     
72   hist->GetXaxis()->SetTitle("#delta_{T} [cm]");
73   hist->GetYaxis()->SetTitle("Counts");
74   
75   f2 = new TFile("results_fast_oldparams.root");
76   hist2 = new TH1F("hist2","",100,-0.6,0.6);
77   SetTH1Options(hist2);
78   can->cd(2);
79   ntuppel_fast->Draw("residual_trans>>hist2","nHits>100 && pt>1.0 && padrow > 0 && zHit < 50");//dipangle < 20*3.1415/180");
80   
81   can->Update();
82 }
83
84