27 gROOT->Macro(
"NimStyle.C");
28 TFile
f(
"calibTime.root");
29 tree = (TTree*)f.Get(
"dcs");
30 tree->SetMarkerStyle(25);
31 tree->SetMarkerSize(0.4);
32 gStyle->SetMarkerSize(0.4);
33 tree->SetAlias(
"isValidITS",
"abs(dits)<3600");
34 tree->SetAlias(
"isValidCE",
"min(abs(dcea),abs(dcec))<3600&&max(tdriftCE.fElements[72],tdriftCE.fElements[73])>100");
35 tree->SetAlias(
"isValidCEB",
"max(abs(dcea),abs(dcec))<3600&&min(tdriftCE.fElements[72],tdriftCE.fElements[73])>100");
36 printf(
"makeTPCTrendPlots.C\n\n");
37 printf(
"Processing DrawDriftTime();\n\n");
39 printf(
"DrawDriftRun();\n\n");
41 printf(
"DrawDriftCorel();\n\n");
51 TCut cutCE=
"(tdriftCE.fElements[72]>100||tdriftCE.fElements[72]>100)&&min(abs(dcea),abs(dcec))<3600";
52 TCut cutITS=
"abs(dits)<3600";
57 Double_t maxT=0,minT=0;
58 Double_t dmaxmin= 200000;
59 TCanvas * canvasDrift =
new TCanvas(
"canvasDriftTime",
"canvasDriftTime",2000,900);
60 canvasDrift->Divide(1,3);
62 entries=
tree->Draw(
"100*ptrel0:time",cutRun,
"goff");
63 TGraph * graphPTA =
new TGraph(entries,
tree->GetV2(),
tree->GetV1());
64 graphPTA->SetTitle(
"P/T correction A side");
65 graphPTA->SetName(
"PTcorrectionAside");
67 entries=
tree->Draw(
"100*ptrel1:time",cutRun,
"goff");
68 TGraph * graphPTC =
new TGraph(entries,
tree->GetV2(),
tree->GetV1());
69 graphPTC->SetTitle(
"P/T correction C side");
70 graphPTC->SetName(
"PTcorrectionCside");
72 entries=
tree->Draw(
"1000*(ptrel0-ptrel1):time",cutRun,
"goff");
73 TGraph * graphPTAMC =
new TGraph(entries,
tree->GetV2(),
tree->GetV1());
74 graphPTAMC->SetTitle(
"P/T correction A-C side");
75 graphPTAMC->SetName(
"PTcorrectionAMCside");
78 entries=
tree->Draw(
"isValidCE*(-tdriftCE.fElements[72]+990)/10:time",cutRun,
"goff");
79 TGraph * graphCEA =
new TGraph(entries,
tree->GetV2(),
tree->GetV1());
80 graphCEA->SetName(
"CEAside");
82 entries=
tree->Draw(
"isValidCE*(-tdriftCE.fElements[73]+990)/10:time",cutRun,
"goff");
83 TGraph * graphCEC =
new TGraph(entries,
tree->GetV2(),
tree->GetV1());
84 graphCEC->SetName(
"CECside");
86 entries=
tree->Draw(
"isValidCE*(tdriftCE.fElements[73]-tdriftCE.fElements[72]):time",cutRun,
"goff");
87 TGraph * graphCEAMC =
new TGraph(entries,
tree->GetV2(),
tree->GetV1());
88 graphCEAMC->SetName(
"CEAMCside");
90 entries=
tree->Draw(
"isValidITS*vdriftITS*100:time",cutRun,
"goff");
91 TGraph * graphITSTPCA =
new TGraph(entries,
tree->GetV2(),
tree->GetV1());
92 graphITSTPCA->SetName(
"ITSTPCAside");
94 entries=
tree->Draw(
"isValidITS*vdriftITS*100:time",cutRun,
"goff");
95 TGraph * graphITSTPCC =
new TGraph(entries,
tree->GetV2(),
tree->GetV1());
96 graphITSTPCC->SetName(
"ITSTPCCside");
102 graphCEA->SetMinimum(min);
103 graphCEA->SetMaximum(max);
104 graphPTA->SetMinimum(min);
105 graphPTA->SetMaximum(max);
106 graphITSTPCA->SetMinimum(min);
107 graphITSTPCA->SetMaximum(max);
108 graphPTA->GetXaxis()->SetRangeUser(minT,maxT);
109 graphCEA->GetXaxis()->SetRangeUser(minT,maxT);
110 graphITSTPCA->GetXaxis()->SetRangeUser(minT,maxT);
114 graphPTA->GetXaxis()->SetTimeDisplay(kTRUE);
115 graphPTA->GetYaxis()->SetTitle(
"#Delta P/T (%)");
116 graphPTA->SetMarkerColor(2);graphPTA->SetMarkerStyle(25);
117 graphPTC->SetMarkerColor(4);graphPTC->SetMarkerStyle(27);
118 graphPTA->Draw(
"alp");
119 graphPTC->Draw(
"lp");
120 graphPTAMC->SetMarkerColor(3);graphPTAMC->SetMarkerStyle(25);
121 graphPTAMC->Draw(
"lp");
122 TLegend *legend =
new TLegend(0.11,0.11,0.4,0.35,
"P/T correction");
123 legend->AddEntry(graphPTA,
"A side (%)");
124 legend->AddEntry(graphPTC,
"C side (%)");
125 legend->AddEntry(graphPTAMC,
"A-C side (0.1%)");
129 graphITSTPCA->GetXaxis()->SetTimeDisplay(kTRUE);
130 graphITSTPCA->GetYaxis()->SetTitle(
"v_{dcorr} (%)");
131 graphITSTPCA->SetMarkerColor(2);graphITSTPCA->SetMarkerStyle(25);
132 graphITSTPCC->SetMarkerColor(4);graphITSTPCC->SetMarkerStyle(27);
133 graphITSTPCA->Draw(
"ap");
134 graphITSTPCC->Draw(
"p");
135 TLegend *legend =
new TLegend(0.11,0.11,0.4,0.35,
"Drift correction (TPC-ITS)");
136 legend->AddEntry(graphITSTPCA,
"A side (%)");
137 legend->AddEntry(graphITSTPCC,
"C side (%)");
141 graphCEA->GetXaxis()->SetTimeDisplay(kTRUE);
142 graphCEA->GetYaxis()->SetTitle(
"(T_{CE0}-T_{CE})/T_{CE0}");
143 graphCEA->SetMarkerColor(2);graphCEA->SetMarkerStyle(25);
144 graphCEC->SetMarkerColor(4);graphCEC->SetMarkerStyle(27);
145 graphCEA->Draw(
"ap");
147 graphCEAMC->SetMarkerColor(3);graphCEAMC->SetMarkerStyle(25);
148 graphCEAMC->Draw(
"p");
149 TLegend *legend =
new TLegend(0.11,0.11,0.4,0.35,
"CE laser time (T_{CE0}=990)");
150 legend->AddEntry(graphCEA,
"A side (%)");
151 legend->AddEntry(graphCEC,
"C side (%)");
152 legend->AddEntry(graphCEAMC,
"A-C side (0.1%)");
155 canvasDrift->SaveAs(
"pic/canvasDriftTime.gif");
163 TCut cutCE=
"(tdriftCE.fElements[72]>100||tdriftCE.fElements[72]>100)&&min(abs(dcea),abs(dcec))<3600";
164 TCut cutITS=
"abs(dits)<3600";
167 Double_t max=-100000;
168 Double_t min= 100000;
169 Double_t maxT=0,minT=0;
170 Double_t dmaxmin= 200000;
171 TCanvas * canvasDrift =
new TCanvas(
"canvasDriftRun",
"canvasDriftRun",2000,900);
172 canvasDrift->Divide(1,3);
176 graphPTA->SetTitle(
"P/T correction A side");
177 graphPTA->SetName(
"PTcorrectionAside");
179 graphPTC->SetTitle(
"P/T correction C side");
180 graphPTC->SetName(
"PTcorrectionCside");
182 graphPTAMC->SetTitle(
"P/T correction A-C side");
183 graphPTAMC->SetName(
"PTcorrectionAMCside");
186 graphCEA->SetTitle(
"P/T correction A side");
187 graphCEA->SetName(
"CEcorrectionAside");
189 graphCEC->SetTitle(
"P/T correction C side");
190 graphCEC->SetName(
"CEcorrectionCside");
192 graphCEAMC->SetTitle(
"P/T correction A-C side");
193 graphCEAMC->SetName(
"CEcorrectionAMCside");
196 graphITSTPCA->SetTitle(
"P/T correction A side");
197 graphITSTPCA->SetName(
"ITSTPCcorrectionAside");
199 graphITSTPCC->SetTitle(
"P/T correction C side");
200 graphITSTPCC->SetName(
"ITSTPCcorrectionCside");
206 graphCEA->SetMinimum(min);
207 graphCEA->SetMaximum(max);
208 graphPTA->SetMinimum(min);
209 graphPTA->SetMaximum(max);
210 graphITSTPCA->SetMinimum(min);
211 graphITSTPCA->SetMaximum(max);
215 graphPTA->GetXaxis()->SetTimeDisplay(kTRUE);
216 graphPTA->GetYaxis()->SetTitle(
"#Delta P/T (%)");
217 graphPTA->SetMarkerColor(2);graphPTA->SetMarkerStyle(25);
218 graphPTC->SetMarkerColor(4);graphPTC->SetMarkerStyle(27);
219 graphPTA->Draw(
"alp");
220 graphPTC->Draw(
"lp");
221 graphPTAMC->SetMarkerColor(3);graphPTAMC->SetMarkerStyle(25);
222 graphPTAMC->Draw(
"lp");
223 TLegend *legend =
new TLegend(0.11,0.11,0.4,0.35,
"P/T correction");
224 legend->AddEntry(graphPTA,
"A side (%)");
225 legend->AddEntry(graphPTC,
"C side (%)");
226 legend->AddEntry(graphPTAMC,
"A-C side (0.1%)");
230 graphITSTPCA->GetXaxis()->SetTimeDisplay(kTRUE);
231 graphITSTPCA->GetYaxis()->SetTitle(
"v_{dcorr} (%)");
232 graphITSTPCA->SetMarkerColor(2);graphITSTPCA->SetMarkerStyle(25);
233 graphITSTPCC->SetMarkerColor(4);graphITSTPCC->SetMarkerStyle(27);
234 graphITSTPCA->Draw(
"ap");
235 graphITSTPCC->Draw(
"p");
236 TLegend *legend =
new TLegend(0.11,0.11,0.4,0.35,
"Drift correction (TPC-ITS)");
237 legend->AddEntry(graphITSTPCA,
"A side (%)");
238 legend->AddEntry(graphITSTPCC,
"C side (%)");
242 graphCEA->GetXaxis()->SetTimeDisplay(kTRUE);
243 graphCEA->GetYaxis()->SetTitle(
"(T_{CE0}-T_{CE})/T_{CE0}");
244 graphCEA->SetMarkerColor(2);graphCEA->SetMarkerStyle(25);
245 graphCEC->SetMarkerColor(4);graphCEC->SetMarkerStyle(27);
246 graphCEA->Draw(
"ap");
248 graphCEAMC->SetMarkerColor(3);graphCEAMC->SetMarkerStyle(25);
249 graphCEAMC->Draw(
"p");
250 TLegend *legend =
new TLegend(0.11,0.11,0.4,0.35,
"CE laser time (T_{CE0}=990)");
251 legend->AddEntry(graphCEA,
"A side (%)");
252 legend->AddEntry(graphCEC,
"C side (%)");
253 legend->AddEntry(graphCEAMC,
"A-C side (0.1%)");
256 canvasDrift->SaveAs(
"pic/canvasDriftRun.gif");
268 Int_t npointsMax=100000;
270 tree->SetAlias(
"tCEB",
"(tdriftCE.fElements[72]+tdriftCE.fElements[73]-2000)/2000");
271 tree->SetAlias(
"tCEA",
"(tdriftCE.fElements[72]-1000)/1000");
272 tree->SetAlias(
"tCEC",
"(tdriftCE.fElements[73]-1000)/1000");
274 tree->SetAlias(
"tCEE",
"1-((1+(ptrel0+ptrel1)*0.5)*(1+vdriftITS))");
275 strDelta=
TStatToolkit::FitPlaneConstrain(
tree,
"tCEB",
"tCEE",
"isValidCEB&&isValidITS", chi2,npoints,param,covar,-1,0, npointsMax, 20);
277 strDelta->Tokenize(
"++")->Print();
278 tree->SetAlias(
"tCEF",strDelta->Data());
283 graphLT->GetYaxis()->SetTitle(
"#Delta (mm)");
284 graphLT->SetMarkerStyle(25);
285 graphLTA->SetMarkerStyle(26); graphLTA->SetMarkerColor(2);
286 graphLTC->SetMarkerStyle(27); graphLTC->SetMarkerColor(4);
287 graphLT->SetMaximum(10);
288 graphLT->SetMinimum(-10);
290 TCanvas * canvasDrift =
new TCanvas(
"canvasDriftDiff",
"canvasDriftDiff",2000,500);
291 graphLT->Draw(
"alp");
292 graphLTA->Draw(
"lp");
293 graphLTC->Draw(
"lp");
294 TLegend *legend =
new TLegend(0.11,0.11,0.4,0.35,
"CE plane - corrected with tracks");
295 legend->AddEntry(graphLT,
"AC side mean (mm)");
296 legend->AddEntry(graphLTA,
"A side (mm)");
297 legend->AddEntry(graphLTC,
"C side (mm)");
300 canvasDrift->SaveAs(
"pic/canvasDriftDiffRun.gif");
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
void makeTPCTrendPlots(Int_t startRun=0, Int_t endRun=1000000)
class TVectorT< Double_t > TVectorD
class TMatrixT< Double_t > TMatrixD