]>
Commit | Line | Data |
---|---|---|
2be25cc9 | 1 | |
2 | ||
3 | gSystem->Load("libANALYSIS"); | |
4 | gSystem->Load("libSTAT"); | |
5 | gSystem->Load("libTPCcalib"); | |
6 | ||
7 | ||
8 | TFile f("CalibObjects.root"); | |
9 | AliTPCcalibTime *calibTime = (AliTPCcalibTime *)f->Get("TPCCalib")->FindObject("calibTime"); | |
10 | ||
11 | ||
12 | TPair * addPair= calibTime->GetMapDz()->FindObject(" D0SCO "); | |
13 | THnSparse* addHist=dynamic_cast<THnSparseF*>(addPair->Value()); | |
14 | ||
15 | ||
16 | // | |
17 | TGraph * gr = AliTPCcalibBase::FitSlices(addHist,2,0,100,100); | |
18 | gr->SetMarkerColor(2); | |
19 | gr->Draw("same*"); | |
20 | //Make Fit | |
21 | ||
22 | AliSplineFit fit; | |
23 | fit.SetGraph(gr) | |
24 | fit->SetMinPoints(gr->GetN()+1); | |
25 | fit->InitKnots(gr,2,0,0.001) | |
26 | fit.SplineFit(0) | |
27 | TGraph * grfit = fit.MakeGraph(gr->GetX()[0],gr->GetX()[gr->GetN()-1],50000,0); | |
28 | gr->SetMarkerStyle(25); | |
29 | //gr->Draw("alp"); | |
30 | grfit->SetLineColor(2); | |
31 | grfit->Draw("lu"); | |
32 | ||
33 | ||
34 | ||
35 | ||
36 | ||
37 | ||
38 | ||
39 | ||
40 | ||
41 | ||
42 | /* | |
43 | ||
44 | Macro to visualize and analyze time dependent variables | |
45 | // | |
46 | .L $ALICE_ROOT/TPC/CalibMacros/CalibTime.C | |
47 | // | |
48 | // 1. Init - Load libraries tools | |
49 | Init() | |
50 | // 2. Load debug streamers | |
51 | InitChains() | |
52 | ||
53 | */ | |
54 | ||
55 | ||
56 | // | |
57 | // Chain Based analysis | |
58 | // | |
59 | ||
60 | ||
61 | TChain * chainLaser=0, *chainDz=0, *chaindEdx=0; | |
62 | ||
63 | void Init(){ | |
64 | // Load neccesary libraries | |
65 | gSystem->Load("libANALYSIS"); | |
66 | gSystem->Load("libSTAT"); | |
67 | gSystem->Load("libTPCcalib"); | |
68 | gROOT->Macro("~/NimStyle.C"); | |
69 | gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros"); | |
70 | gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+"); | |
71 | } | |
72 | ||
73 | void InitChains(){ | |
74 | AliXRDPROOFtoolkit tool; | |
75 | //load debug streams | |
76 | chainLaser = tool.MakeChain("time.txt","laserInfo",0,10200); | |
77 | chainLaser->Lookup(); | |
78 | // cosmic dZ - drfit velocity part | |
79 | chainDz = tool.MakeChain("time.txt","cosmicDz",0,10200); | |
80 | chainDz->Lookup(); | |
81 | // | |
82 | // cosmic dE - drift velocity part | |
83 | chaindEdx = tool.MakeChain("time.txt","cosmicdEdx",0,10200); | |
84 | chaindEdx->Lookup(); | |
85 | // | |
86 | // Set Alias | |
87 | // | |
88 | chaindEdx->SetAlias("side","(-1+(p0.fP[1]>0)*2)"); | |
89 | chaindEdx->SetAlias("der","side*(dedx0-dedx1)/(dedx0+dedx1)"); | |
90 | chaindEdx->SetAlias("derIO","side*(dedx0Out-dedx0In)/(dedx0In+dedx0Out)"); | |
91 | chaindEdx->SetAlias("dr","(1-abs(p0.fP[1]/250))"); | |
92 | chaindEdx->SetAlias("isOK","dedx0In>0&&dedx0Out>0&&dedx1In>0&&dedx1Out>0"); | |
93 | chaindEdx->SetAlias("dedxM","(dedx0+dedx1)*0.5"); | |
94 | ||
95 | } | |
96 | ||
97 | ||
98 | void MakeTglFitCosmic(){ | |
99 | // Fit the z correction factor | |
100 | TStatToolkit toolkit; | |
101 | Double_t chi2=0; | |
102 | Int_t npoints=0; | |
103 | TVectorD fitParamC,fitParamIO; | |
104 | TMatrixD covMatrix; | |
105 | // | |
106 | // dedx delta | |
107 | // | |
108 | TString fstring=""; | |
109 | fstring+="side++"; | |
110 | fstring+="p0.fP[3]++"; | |
111 | //fstring+="p0.fP[3]*dr++"; | |
112 | TString *strTheta = toolkit.FitPlane(chaindEdx,"der",fstring->Data(), "isOK", chi2,npoints,fitParamC,covMatrix); | |
113 | chaindEdx->SetAlias("derc",strTheta.Data()); | |
114 | strTheta->Tokenize("+")->Print(); | |
115 | // | |
116 | // dedx delta | |
117 | // | |
118 | fstring=""; | |
119 | fstring+="side++"; | |
120 | fstring+="p0.fP[3]++"; | |
121 | //fstring+="p0.fP[3]*dr++"; | |
122 | TString *strTheta = toolkit.FitPlane(chaindEdx,"derIO",fstring->Data(), "isOK", chi2,npoints,fitParamIO,covMatrix); | |
123 | chaindEdx->SetAlias("derIOc",strTheta.Data()); | |
124 | strTheta->Tokenize("+")->Print(); | |
125 | // | |
126 | // Make Plot | |
127 | // | |
128 | chaindEdx->Draw("der:p0.fP[3]>>his(20,-0.5,0.5)","","prof"); | |
129 | chaindEdx->Draw("der-derc:p0.fP[3]>>hisC(20,-0.5,0.5)","","prof"); | |
130 | his->SetXTitle("tan(#theta)"); | |
131 | his->SetYTitle("(Q_{u}-Q_{d})/(Q_{u}+Q_{d})"); | |
132 | his->Draw(""); | |
133 | hisC->Draw("same"); | |
134 | } | |
135 | ||
136 | ||
137 | void MakeTglFitCosmic(){ | |
138 | // | |
139 | // | |
140 | // | |
141 | TStatToolkit toolkit; | |
142 | Double_t chi2=0; | |
143 | Int_t npoints=0; | |
144 | TVectorD fitParamC,fitParamIO; | |
145 | TMatrixD covMatrix; | |
146 | TString fstring=""; | |
147 | fstring=""; | |
148 | fstring+="ppit++"; | |
149 | fstring+="(trigger==1)++"; | |
150 | fstring+="(trigger==2)++"; | |
151 | fstring+="(trigger==4)++"; | |
152 | fstring+="(trigger==8)++"; | |
153 | TString *strPress = toolkit.FitPlane(chaindEdx,"(dedx0+dedx1)*0.5",fstring->Data(), "isOK", chi2,npoints,fitParamIO,covMatrix); | |
154 | // | |
155 | // | |
156 | chaindEdx->SetAlias("de",strTheta.Data()); | |
157 | strTheta->Tokenize("+")->Print(); | |
158 | ||
159 | ||
160 | } |