]>
Commit | Line | Data |
---|---|---|
91fd44c9 | 1 | /* |
2 | .x ~/UliStyle.C | |
3 | gSystem->Load("libANALYSIS"); | |
4 | gSystem->Load("libTPCcalib"); | |
5 | .L $ALICE_ROOT/TPC/CalibMacros/CalibCosmic.C | |
6 | // init | |
7 | Init(); | |
8 | SetDefaultCut(); | |
9 | ||
10 | */ | |
11 | AliTPCcalibCosmic * cosmic =0; | |
12 | TObjArray fitArr; | |
13 | ||
14 | void Init(){ | |
15 | // | |
16 | // | |
17 | TFile fcalib("CalibObjects.root"); | |
18 | TObjArray * array = (TObjArray*)fcalib.Get("TPCCalib"); | |
19 | cosmic = ( AliTPCcalibCosmic *)array->FindObject("cosmicTPC"); | |
20 | TString axisName[9]; | |
21 | axisName[0] ="#Delta"; axisName[1] ="N_{cl}"; | |
22 | axisName[3] ="z (cm)"; axisName[4] ="sin(#phi)"; | |
23 | axisName[5] ="tan($theta)"; axisName[6] ="1/p_{t} (1/GeV)"; | |
24 | axisName[7] ="p_{t} (1/GeV)"; axisName[8] ="alpha"; | |
25 | ||
26 | { | |
27 | for (Int_t ivar=0;ivar<6;ivar++){ | |
28 | for (Int_t ivar2=0;ivar2<9;ivar2++){ | |
29 | cosmic->fHistoDelta[ivar]->GetAxis(ivar2)->SetName(axisName[ivar2].Data()); | |
30 | cosmic->fHistoDelta[ivar]->GetAxis(ivar2)->SetTitle(axisName[ivar2].Data()); | |
31 | cosmic->fHistoPull[ivar]->GetAxis(ivar2)->SetName(axisName[ivar2].Data()); | |
32 | cosmic->fHistoPull[ivar]->GetAxis(ivar2)->SetTitle(axisName[ivar2].Data()); | |
33 | } | |
34 | } | |
35 | } | |
36 | } | |
37 | ||
38 | void SetDefaultCut(){ | |
39 | for (Int_t i=0;i<6;i++){ | |
40 | // | |
41 | cosmic->fHistoDelta[i]->GetAxis(1)->SetRangeUser(130,200); | |
42 | cosmic->fHistoPull[i]->GetAxis(1)->SetRangeUser(130,200); | |
43 | cosmic->fHistoDelta[i]->GetAxis(3)->SetRangeUser(0,250); | |
44 | cosmic->fHistoPull[i]->GetAxis(3)->SetRangeUser(0,250); | |
45 | ||
46 | } | |
47 | } | |
48 | ||
49 | TH2 * GetDelta2D(Int_t type, Int_t var){ | |
50 | TH2 * his = cosmic->fHistoDelta[type]->Projection(0,var); | |
51 | his->SetXTitle(cosmic->fHistoDelta[type]->GetAxis(var)->GetName()); | |
52 | his->SetYTitle(cosmic->fHistoDelta[type]->GetAxis(0)->GetName()); | |
53 | return his; | |
54 | } | |
55 | ||
56 | ||
57 | TH1* GetResol2DSigma(Int_t type, Int_t var){ | |
58 | ||
59 | TH2 * his = cosmic->fHistoDelta[type]->Projection(0,var); | |
60 | his->SetXTitle(cosmic->fHistoDelta[type]->GetAxis(var)->GetName()); | |
61 | his->SetYTitle(cosmic->fHistoDelta[type]->GetAxis(0)->GetName()); | |
62 | his->FitSlicesY(0,0,-1,0,"QNR",&fitArr); | |
63 | TH1 * hres = (TH1*)(fitArr.At(2)->Clone()); | |
64 | return hres; | |
65 | } | |
66 | ||
67 | ||
68 | TH1 * GetDelta(Int_t type){ | |
69 | TH1 * his = cosmic->fHistoDelta[type]->Projection(0); | |
70 | his->SetXTitle(cosmic->fHistoDelta[type]->GetAxis(0)->GetName()); | |
71 | return his; | |
72 | } | |
73 | ||
74 | TH2 * GetPull2D(Int_t type, Int_t var){ | |
75 | TH2 * his = cosmic->fHistoPull[type]->Projection(0,var); | |
76 | his->SetXTitle(cosmic->fHistoPull[type]->GetAxis(var)->GetName()); | |
77 | his->SetYTitle(cosmic->fHistoPull[type]->GetAxis(0)->GetName()); | |
78 | return his; | |
79 | } | |
80 | ||
81 | TH1* GetPull2DSigma(Int_t type, Int_t var){ | |
82 | ||
83 | TH2 * his = cosmic->fHistoPull[type]->Projection(0,var); | |
84 | his->SetXTitle(cosmic->fHistoPull[type]->GetAxis(var)->GetName()); | |
85 | his->SetYTitle(cosmic->fHistoPull[type]->GetAxis(0)->GetName()); | |
86 | his->FitSlicesY(0,0,-1,0,"QNR",&fitArr); | |
87 | TH1 * hres = (TH1*)(fitArr.At(2)->Clone()); | |
88 | return hres; | |
89 | } | |
90 | ||
91 | ||
92 | ||
93 | TH1 * GetPull(Int_t type){ | |
94 | TH1 * his = cosmic->fHistoPull[type]->Projection(0); | |
95 | his->SetXTitle(cosmic->fHistoPull[type]->GetAxis(0)->GetName()); | |
96 | return his; | |
97 | } |