]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCcalibLaser.cxx
Using GRP instead of local setters.
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibLaser.cxx
CommitLineData
c6914c83 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
2b35e8e6 17 //
18 // FUNCTIONALITY:
19 //
20 // 1. The laser track is associated with the mirror
21 // see function FindMirror
22 //
23 // 2. The laser track is accepted for the analysis under certain condition
24 // (see function Accpet laser)
263d466a 25 //
2b35e8e6 26 // 3. The drift velocity and jitter is calculated event by event
263d466a 27 // (see function drift velocity)
2b35e8e6 28 //
be113f6e 29 // 4. The tracks are refitted at different sectors
30 // Fit model
31 // 4.a) line
32 // 4.b) parabola
33 // 4.c) parabola with common P2 for inner and outer
2b35e8e6 34 //
1fd56785 35 // To make laser scan the user interaction neccessary
36 //
37 .x ~/UliStyle.C
2b35e8e6 38 gSystem->Load("libANALYSIS");
39 gSystem->Load("libTPCcalib");
40 TFile fcalib("CalibObjects.root");
41 TObjArray * array = (TObjArray*)fcalib.Get("TPCCalib");
42 AliTPCcalibLaser * laser = ( AliTPCcalibLaser *)array->FindObject("laserTPC");
57dc06f2 43 laser->DumpMeanInfo(-0,0)
2b35e8e6 44 TFile fmean("laserMean.root")
1fd56785 45 //
2b35e8e6 46 // laser track clasification;
1fd56785 47 //
7b18d067 48 TCut cutT("cutT","abs(Tr.fP[3])<0.06");
49 TCut cutPt("cutPt","abs(Tr.fP[4])<0.1");
c18f4385 50 TCut cutN("cutN","fTPCncls>70");
51 TCut cutP("cutP","abs(atan2(x1,x0)-atan2(lx1,lx0))<0.03")
52 TCut cutA = cutT+cutPt+cutP;
e5c59218 53 TChain * chainTrL = tool.MakeChain("laser.txt","Track",0,10200);
54
1fd56785 55 //
56 //
57 // Analyze LASER scan
58 //
e5c59218 59
2b35e8e6 60 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
61 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
0728a4f6 62 AliXRDPROOFtoolkit tool;
2b35e8e6 63 TChain * chain = tool.MakeChain("laserScan.txt","Mean",0,10200);
64 chain->Lookup();
1fd56785 65 AliTPCcalibLaser::DumpScanInfo(chain)
66 TFile fscan("laserScan.root")
67 TTree * treeT = (TTree*)fscan.Get("Mean")
95a0e09b 68 //
69 // Analyze laser
70 //
71 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
72 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
73 AliXRDPROOFtoolkit tool;
57dc06f2 74 TChain * chainDrift = tool.MakeChain("laser.txt","driftv",0,10200);
75 chainDrift->Lookup();
76
95a0e09b 77 TChain * chain = tool.MakeChain("laser.txt","Residuals",0,10200);
78 chain->Lookup();
e5c59218 79 TChain * chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
80 chainFit->Lookup();
95a0e09b 81
c6914c83 82*/
83
84
85
86#include "TLinearFitter.h"
87#include "AliTPCcalibLaser.h"
88#include "AliExternalTrackParam.h"
e9f38a4b 89#include "AliESDEvent.h"
90#include "AliESDfriend.h"
c6914c83 91#include "AliESDtrack.h"
92#include "AliTPCTracklet.h"
93#include "TH1D.h"
ecb7e705 94#include "TH1F.h"
95a0e09b 95#include "TProfile.h"
c6914c83 96#include "TVectorD.h"
97#include "TTreeStream.h"
98#include "TFile.h"
99#include "TF1.h"
100#include "TGraphErrors.h"
101#include "AliTPCclusterMI.h"
102#include "AliTPCseed.h"
103#include "AliTracker.h"
263d466a 104#include "AliLog.h"
c6914c83 105#include "TClonesArray.h"
1fd56785 106#include "TPad.h"
e5c59218 107#include "TSystem.h"
108#include "TCut.h"
109#include "TChain.h"
110#include "TH2F.h"
111#include "TStatToolkit.h"
112#include "TROOT.h"
c6914c83 113
114
115#include "TTreeStream.h"
116#include <iostream>
117#include <sstream>
7b18d067 118#include "AliTPCLaserTrack.h"
108953e9 119#include "AliTPCcalibDB.h"
120#include "AliTPCParam.h"
3ac724f0 121#include "TTimeStamp.h"
31aa7c5c 122#include "AliDCSSensorArray.h"
123#include "AliDCSSensor.h"
7b18d067 124
c6914c83 125using namespace std;
126
127ClassImp(AliTPCcalibLaser)
128
129AliTPCcalibLaser::AliTPCcalibLaser():
e9f38a4b 130 AliTPCcalibBase(),
131 fESD(0),
132 fESDfriend(),
c18f4385 133 fTracksMirror(336),
134 fTracksEsd(336),
135 fTracksEsdParam(336),
136 fTracksTPC(336),
3ac724f0 137 fFullCalib(kTRUE),
263d466a 138 fDeltaZ(336),
e5c59218 139 fDeltaP3(336),
140 fDeltaP4(336),
263d466a 141 fDeltaPhi(336),
142 fDeltaPhiP(336),
95a0e09b 143 fSignals(336),
be113f6e 144 //
145 fHisNclIn(0), //->Number of clusters inner
146 fHisNclOut(0), //->Number of clusters outer
147 fHisNclIO(0), //->Number of cluster inner outer
148 fHisLclIn(0), //->Level arm inner
149 fHisLclOut(0), //->Level arm outer
150 fHisLclIO(0), //->Number of cluster inner outer
151 fHisdEdx(0), //->dEdx histo
152 fHisdZfit(0), //->distance to the mirror after linear fit
153 //
154 //
155 fHisChi2YIn1(0), //->chi2 y inner - line
156 fHisChi2YOut1(0), //->chi2 y inner - line
157 fHisChi2YIn2(0), //->chi2 y inner - parabola
158 fHisChi2YOut2(0), //->chi2 y inner - parabola
159 fHisChi2YIO1(0), //->chi2 y IO - common
160 fHisChi2ZIn1(0), //->chi2 z inner - line
161 fHisChi2ZOut1(0), //->chi2 z inner - line
162 fHisChi2ZIn2(0), //->chi2 z inner - parabola
163 fHisChi2ZOut2(0), //->chi2 z inner - parabola
164 fHisChi2ZIO1(0), //->chi2 z IO - common
165 //
166 //
167 fHisPy1vP0(0), //-> delta y P0outer-P0inner - line
168 fHisPy2vP0(0), //-> delta y P0outer-P0inner - parabola
169 fHisPy3vP0(0), //-> delta y P0outer-P0inner - common parabola
170 fHisPy1vP1(0), //-> delta ky P1outer-P1inner - line
171 fHisPy2vP1(0), //-> delta ky P1outer-P1inner - parabola
172 fHisPy3vP1(0), //-> delta ky P1outer-P1inner - common parabola
173 fHisPy2vP2In(0), //-> Curv P2inner - parabola
174 fHisPy2vP2Out(0), //-> Curv P2outer - parabola
175 fHisPy3vP2IO(0), //-> Curv P2outerinner - common parabola
176 //
177 //
178 fHisPz1vP0(0), //-> delta z P0outer-P0inner - line
179 fHisPz2vP0(0), //-> delta z P0outer-P0inner - parabola
180 fHisPz3vP0(0), //-> delta z P0outer-P0inner - common parabola
181 fHisPz1vP1(0), //-> delta kz P1outer-P1inner - line
182 fHisPz2vP1(0), //-> delta kz P1outer-P1inner - parabola
183 fHisPz3vP1(0), //-> delta kz P1outer-P1inner - common parabola
184 fHisPz2vP2In(0), //-> Curv P2inner - parabola
185 fHisPz2vP2Out(0), //-> Curv P2outer - parabola
186 fHisPz3vP2IO(0), //-> Curv P2outerinner - common parabola
187 //
108953e9 188 fDeltaYres(336), //->2D histo of residuals
189 fDeltaZres(336), //->2D histo fo residuals
190 fDeltaYres2(336), //->2D histo of residuals
191 fDeltaZres2(336), //->2D histo fo residuals
192 //fDeltaYres3(336), //->2D histo of residuals
193 //fDeltaZres3(336), //->2D histo fo residuals
ecb7e705 194 fFitAside(new TVectorD(3)),
263d466a 195 fFitCside(new TVectorD(3)),
108953e9 196 fFitACside(new TVectorD(4)),
be113f6e 197 fEdgeXcuts(3),
198 fEdgeYcuts(3),
263d466a 199 fNClCuts(5),
108953e9 200 fNcuts(0)
c6914c83 201{
202 //
203 // Constructor
204 //
e9f38a4b 205 fTracksEsdParam.SetOwner(kTRUE);
c6914c83 206}
207
3ac724f0 208AliTPCcalibLaser::AliTPCcalibLaser(const Text_t *name, const Text_t *title, Bool_t full):
e9f38a4b 209 AliTPCcalibBase(),
210 fESD(0),
211 fESDfriend(0),
c18f4385 212 fTracksMirror(336),
213 fTracksEsd(336),
214 fTracksEsdParam(336),
215 fTracksTPC(336),
3ac724f0 216 fFullCalib(full),
be113f6e 217 //
c18f4385 218 fDeltaZ(336), // array of histograms of delta z for each track
e5c59218 219 fDeltaP3(336), // array of histograms of delta z for each track
220 fDeltaP4(336), // array of histograms of P3 for each track
221 fDeltaPhi(336), // array of histograms of P4 for each track
c18f4385 222 fDeltaPhiP(336), // array of histograms of delta z for each track
2b35e8e6 223 fSignals(336), // array of dedx signals
be113f6e 224 //
225 //
226 fHisNclIn(0), //->Number of clusters inner
227 fHisNclOut(0), //->Number of clusters outer
228 fHisNclIO(0), //->Number of cluster inner outer
229 fHisLclIn(0), //->Level arm inner
230 fHisLclOut(0), //->Level arm outer
231 fHisLclIO(0), //->Number of cluster inner outer
232 fHisdEdx(0), //->dEdx histo
233 fHisdZfit(0), //->distance to the mirror after linear fit
234 //
235 //
236 fHisChi2YIn1(0), //->chi2 y inner - line
237 fHisChi2YOut1(0), //->chi2 y inner - line
238 fHisChi2YIn2(0), //->chi2 y inner - parabola
239 fHisChi2YOut2(0), //->chi2 y inner - parabola
240 fHisChi2YIO1(0), //->chi2 y IO - common
241 fHisChi2ZIn1(0), //->chi2 z inner - line
242 fHisChi2ZOut1(0), //->chi2 z inner - line
243 fHisChi2ZIn2(0), //->chi2 z inner - parabola
244 fHisChi2ZOut2(0), //->chi2 z inner - parabola
245 fHisChi2ZIO1(0), //->chi2 z IO - common
246 //
247 //
248 fHisPy1vP0(0), //-> delta y P0outer-P0inner - line
249 fHisPy2vP0(0), //-> delta y P0outer-P0inner - parabola
250 fHisPy3vP0(0), //-> delta y P0outer-P0inner - common parabola
251 fHisPy1vP1(0), //-> delta ky P1outer-P1inner - line
252 fHisPy2vP1(0), //-> delta ky P1outer-P1inner - parabola
253 fHisPy3vP1(0), //-> delta ky P1outer-P1inner - common parabola
254 fHisPy2vP2In(0), //-> Curv P2inner - parabola
255 fHisPy2vP2Out(0), //-> Curv P2outer - parabola
256 fHisPy3vP2IO(0), //-> Curv P2outerinner - common parabola
257 //
258 //
259 fHisPz1vP0(0), //-> delta z P0outer-P0inner - line
260 fHisPz2vP0(0), //-> delta z P0outer-P0inner - parabola
261 fHisPz3vP0(0), //-> delta z P0outer-P0inner - common parabola
262 fHisPz1vP1(0), //-> delta kz P1outer-P1inner - line
263 fHisPz2vP1(0), //-> delta kz P1outer-P1inner - parabola
264 fHisPz3vP1(0), //-> delta kz P1outer-P1inner - common parabola
265 fHisPz2vP2In(0), //-> Curv P2inner - parabola
266 fHisPz2vP2Out(0), //-> Curv P2outer - parabola
267 fHisPz3vP2IO(0), //-> Curv P2outerinner - common parabola
268 //
269 //
270 //
95a0e09b 271 fDeltaYres(336),
272 fDeltaZres(336),
108953e9 273 fDeltaYres2(336),
274 fDeltaZres2(336),
275 // fDeltaYres3(336),
276 //fDeltaZres3(336),
c18f4385 277 fFitAside(new TVectorD(3)), // drift fit - A side
278 fFitCside(new TVectorD(3)), // drift fit - C- side
108953e9 279 fFitACside(new TVectorD(4)), // drift fit - AC- side
be113f6e 280 fEdgeXcuts(3), // cuts in local x direction; used in the refit of the laser tracks
281 fEdgeYcuts(3), // cuts in local y direction; used in the refit of the laser tracks
263d466a 282 fNClCuts(5), // cuts on the number of clusters per tracklet; used in the refit of the laser tracks
108953e9 283 fNcuts(0) // number of cuts
c6914c83 284{
285 SetName(name);
286 SetTitle(title);
287 //
288 // Constructor
289 //
263d466a 290 fTracksEsdParam.SetOwner(kTRUE);
c6914c83 291}
292
be113f6e 293AliTPCcalibLaser::AliTPCcalibLaser(const AliTPCcalibLaser& calibLaser):
294 AliTPCcalibBase(calibLaser),
295 fESD(0),
296 fESDfriend(0),
297 fTracksMirror(336),
298 fTracksEsd(336),
299 fTracksEsdParam(336),
300 fTracksTPC(336),
3ac724f0 301 fFullCalib(calibLaser.fFullCalib),
be113f6e 302 //
303 fDeltaZ(calibLaser.fDeltaZ), // array of histograms of delta z for each track
304 fDeltaP3(((calibLaser.fDeltaP3))), // array of histograms of delta z for each track
305 fDeltaP4(((calibLaser.fDeltaP4))), // array of histograms of P3 for each track
306 fDeltaPhi(((calibLaser.fDeltaPhi))), // array of histograms of P4 for each track
307 fDeltaPhiP(((calibLaser.fDeltaPhiP))), // array of histograms of delta z for each track
308 fSignals(((calibLaser.fSignals))), // array of dedx signals
309 //
310 //
311 fHisNclIn(new TH2F(*(calibLaser.fHisNclIn))), //->Number of clusters inner
312 fHisNclOut(new TH2F(*(calibLaser.fHisNclOut))), //->Number of clusters outer
313 fHisNclIO(new TH2F(*(calibLaser.fHisNclIO))), //->Number of cluster inner outer
314 fHisLclIn(new TH2F(*(calibLaser.fHisLclIn))), //->Level arm inner
315 fHisLclOut(new TH2F(*(calibLaser.fHisLclOut))), //->Level arm outer
316 fHisLclIO(new TH2F(*(calibLaser.fHisLclIO))), //->Number of cluster inner outer
317 fHisdEdx(new TH2F(*(calibLaser.fHisdEdx))), //
318 fHisdZfit(new TH2F(*(calibLaser.fHisdZfit))), //->distance to the mirror after linear fit
319 //
320 //
321 fHisChi2YIn1(new TH2F(*(calibLaser.fHisChi2YIn1))), //->chi2 y inner - line
322 fHisChi2YOut1(new TH2F(*(calibLaser.fHisChi2YOut1))), //->chi2 y inner - line
323 fHisChi2YIn2(new TH2F(*(calibLaser.fHisChi2YIn2))), //->chi2 y inner - parabola
324 fHisChi2YOut2(new TH2F(*(calibLaser.fHisChi2YOut2))), //->chi2 y inner - parabola
325 fHisChi2YIO1(new TH2F(*(calibLaser.fHisChi2YIO1))), //->chi2 y IO - common
326 fHisChi2ZIn1(new TH2F(*(calibLaser.fHisChi2ZIn1))), //->chi2 z inner - line
327 fHisChi2ZOut1(new TH2F(*(calibLaser.fHisChi2ZOut1))), //->chi2 z inner - line
328 fHisChi2ZIn2(new TH2F(*(calibLaser.fHisChi2ZIn2))), //->chi2 z inner - parabola
329 fHisChi2ZOut2(new TH2F(*(calibLaser.fHisChi2ZOut2))), //->chi2 z inner - parabola
330 fHisChi2ZIO1(new TH2F(*(calibLaser.fHisChi2ZIO1))), //->chi2 z IO - common
331 //
332 //
333 fHisPy1vP0(new TH2F(*(calibLaser.fHisPy1vP0))), //-> delta y P0outer-P0inner - line
334 fHisPy2vP0(new TH2F(*(calibLaser.fHisPy2vP0))), //-> delta y P0outer-P0inner - parabola
335 fHisPy3vP0(new TH2F(*(calibLaser.fHisPy3vP0))), //-> delta y P0outer-P0inner - common parabola
336 fHisPy1vP1(new TH2F(*(calibLaser.fHisPy1vP1))), //-> delta ky P1outer-P1inner - line
337 fHisPy2vP1(new TH2F(*(calibLaser.fHisPy2vP1))), //-> delta ky P1outer-P1inner - parabola
338 fHisPy3vP1(new TH2F(*(calibLaser.fHisPy3vP1))), //-> delta ky P1outer-P1inner - common parabola
339 fHisPy2vP2In(new TH2F(*(calibLaser.fHisPy2vP2In))), //-> Curv P2inner - parabola
340 fHisPy2vP2Out(new TH2F(*(calibLaser.fHisPy2vP2Out))), //-> Curv P2outer - parabola
341 fHisPy3vP2IO(new TH2F(*(calibLaser.fHisPy3vP2IO))), //-> Curv P2outerinner - common parabola
342 //
343 //
344 fHisPz1vP0(new TH2F(*(calibLaser.fHisPz1vP0))), //-> delta z P0outer-P0inner - line
345 fHisPz2vP0(new TH2F(*(calibLaser.fHisPz2vP0))), //-> delta z P0outer-P0inner - parabola
346 fHisPz3vP0(new TH2F(*(calibLaser.fHisPz3vP0))), //-> delta z P0outer-P0inner - common parabola
347 fHisPz1vP1(new TH2F(*(calibLaser. fHisPz1vP1))), //-> delta kz P1outer-P1inner - line
348 fHisPz2vP1(new TH2F(*(calibLaser.fHisPz2vP1))), //-> delta kz P1outer-P1inner - parabola
349 fHisPz3vP1(new TH2F(*(calibLaser.fHisPz3vP1))), //-> delta kz P1outer-P1inner - common parabola
350 fHisPz2vP2In(new TH2F(*(calibLaser.fHisPz2vP2In))), //-> Curv P2inner - parabola
351 fHisPz2vP2Out(new TH2F(*(calibLaser. fHisPz2vP2Out))), //-> Curv P2outer - parabola
352 fHisPz3vP2IO(new TH2F(*(calibLaser.fHisPz3vP2IO))), //-> Curv P2outerinner - common parabola
353 //
354 //
355 fDeltaYres(((calibLaser.fDeltaYres))),
356 fDeltaZres(((calibLaser.fDeltaZres))),
108953e9 357 fDeltaYres2(((calibLaser.fDeltaYres))),
358 fDeltaZres2(((calibLaser.fDeltaZres))),
359 // fDeltaYres3(((calibLaser.fDeltaYres))),
360 //fDeltaZres3(((calibLaser.fDeltaZres))),
be113f6e 361 fFitAside(new TVectorD(3)), // drift fit - A side
362 fFitCside(new TVectorD(3)), // drift fit - C- side
108953e9 363 fFitACside(new TVectorD(4)), // drift fit - C- side
be113f6e 364 fEdgeXcuts(3), // cuts in local x direction; used in the refit of the laser tracks
365 fEdgeYcuts(3), // cuts in local y direction; used in the refit of the laser tracks
366 fNClCuts(5), // cuts on the number of clusters per tracklet; used in the refit of the laser tracks
108953e9 367 fNcuts(0) // number of cuts
be113f6e 368{
369 //
370 // copy constructor
371 //
372}
373
374
375
376AliTPCcalibLaser & AliTPCcalibLaser::operator=(const AliTPCcalibLaser& calibLaser){
377 //
378 // assgnment operator
379 //
380 if (this != &calibLaser) {
381 new (this) AliTPCcalibLaser(calibLaser);
382 }
383 return *this;
384
385}
386
387
388
389
c6914c83 390AliTPCcalibLaser::~AliTPCcalibLaser() {
391 //
392 // destructor
393 //
be113f6e 394 if ( fHisNclIn){
395 delete fHisNclIn; //->Number of clusters inner
396 delete fHisNclOut; //->Number of clusters outer
397 delete fHisNclIO; //->Number of cluster inner outer
398 delete fHisLclIn; //->Level arm inner
399 delete fHisLclOut; //->Level arm outer
400 delete fHisLclIO; //->Number of cluster inner outer
401 delete fHisdEdx;
402 delete fHisdZfit;
403 //
404 //
405 delete fHisChi2YIn1; //->chi2 y inner - line
406 delete fHisChi2YOut1; //->chi2 y inner - line
407 delete fHisChi2YIn2; //->chi2 y inner - parabola
408 delete fHisChi2YOut2; //->chi2 y inner - parabola
409 delete fHisChi2YIO1; //->chi2 y IO - common
410 delete fHisChi2ZIn1; //->chi2 z inner - line
411 delete fHisChi2ZOut1; //->chi2 z inner - line
412 delete fHisChi2ZIn2; //->chi2 z inner - parabola
413 delete fHisChi2ZOut2; //->chi2 z inner - parabola
414 delete fHisChi2ZIO1; //->chi2 z IO - common
415 //
416 //
417 delete fHisPy1vP0; //-> delta y P0outer-P0inner - line
418 delete fHisPy2vP0; //-> delta y P0outer-P0inner - parabola
419 delete fHisPy3vP0; //-> delta y P0outer-P0inner - common parabola
420 delete fHisPy1vP1; //-> delta ky P1outer-P1inner - line
421 delete fHisPy2vP1; //-> delta ky P1outer-P1inner - parabola
422 delete fHisPy3vP1; //-> delta ky P1outer-P1inner - common parabola
423 delete fHisPy2vP2In; //-> Curv P2inner - parabola
424 delete fHisPy2vP2Out; //-> Curv P2outer - parabola
425 delete fHisPy3vP2IO; //-> Curv P2outerinner - common parabola
426 //
427 //
428 delete fHisPz1vP0; //-> delta z P0outer-P0inner - line
429 delete fHisPz2vP0; //-> delta z P0outer-P0inner - parabola
430 delete fHisPz3vP0; //-> delta z P0outer-P0inner - common parabola
431 delete fHisPz1vP1; //-> delta kz P1outer-P1inner - line
432 delete fHisPz2vP1; //-> delta kz P1outer-P1inner - parabola
433 delete fHisPz3vP1; //-> delta kz P1outer-P1inner - common parabola
434 delete fHisPz2vP2In; //-> Curv P2inner - parabola
435 delete fHisPz2vP2Out; //-> Curv P2outer - parabola
436 delete fHisPz3vP2IO; //-> Curv P2outerinner - common parabola
437 }
c6914c83 438}
439
e9f38a4b 440
441
442void AliTPCcalibLaser::Process(AliESDEvent * event) {
c6914c83 443 //
263d466a 444 //
e9f38a4b 445 // Loop over tracks and call Process function
446 //
108953e9 447 Int_t kMinTracks=20;
e9f38a4b 448 fESD = event;
449 if (!fESD) {
450 return;
451 }
452 fESDfriend=static_cast<AliESDfriend*>(fESD->FindListObject("AliESDfriend"));
453 if (!fESDfriend) {
454 return;
455 }
108953e9 456 if (fESD->GetNumberOfTracks()<kMinTracks) return; //not enough tracks
263d466a 457 AliDebug(4,Form("Event number in current file: %d",event->GetEventNumberInFile()));
e9f38a4b 458 fTracksTPC.Clear();
459 fTracksEsd.Clear();
460 fTracksEsdParam.Delete();
be113f6e 461 for (Int_t id=0; id<336;id++) {
462 fCounter[id]=0;
463 fClusterCounter[id]=0;
464 fClusterSatur[id]=0;
465 }
466 static Bool_t init=kFALSE;
467 if (!init){
468 init = kTRUE; // way around for PROOF - to be investigated
469 MakeFitHistos();
470 }
e9f38a4b 471 //
472 Int_t n=fESD->GetNumberOfTracks();
108953e9 473 Int_t counter=0;
e9f38a4b 474 for (Int_t i=0;i<n;++i) {
475 AliESDfriendTrack *friendTrack=fESDfriend->GetTrack(i);
476 AliESDtrack *track=fESD->GetTrack(i);
477 TObject *calibObject=0;
478 AliTPCseed *seed=0;
479 for (Int_t j=0;(calibObject=friendTrack->GetCalibObject(j));++j)
480 if ((seed=dynamic_cast<AliTPCseed*>(calibObject)))
481 break;
be113f6e 482 if (track&&seed) {
108953e9 483 Int_t id = FindMirror(track,seed);
484 if (id>0) counter++;
be113f6e 485 }
e9f38a4b 486 //
be113f6e 487 }
108953e9 488 if (counter<kMinTracks) return;
489
e9f38a4b 490 FitDriftV();
3ac724f0 491 if (!fFullCalib) return;
e9f38a4b 492 //
be113f6e 493 for (Int_t id=0; id<336; id++){
e9f38a4b 494 //
495 if (!fTracksEsdParam.At(id)) continue;
be113f6e 496 if (fClusterSatur[id]>0.3) continue; // tracks in saturation
e9f38a4b 497 DumpLaser(id);
be113f6e 498 if ( AcceptLaser(id) && fFitZ[id]<0.5){
499 RefitLaserJW(id);
500 MakeDistHisto(id);
501 }
c18f4385 502 }
be113f6e 503
c18f4385 504}
505
be113f6e 506void AliTPCcalibLaser::MakeDistHisto(Int_t id){
c18f4385 507 //
508 //
509 //
be113f6e 510 // for (Int_t id=0; id<336; id++){
c18f4385 511 //
512 //
be113f6e 513 if (!fTracksEsdParam.At(id)) return;
514 if (!AcceptLaser(id)) return;
c18f4385 515 //
516 //
517 TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
108953e9 518 if (!hisdz) MakeFitHistos();
519 hisdz = (TH1F*)fDeltaZ.At(id);
e5c59218 520 TH1F * hisP3 = (TH1F*)fDeltaP3.At(id);
521 TH1F * hisP4 = (TH1F*)fDeltaP4.At(id);
c18f4385 522 TH1F * hisdphi = (TH1F*)fDeltaPhi.At(id);
523 TH1F * hisdphiP = (TH1F*)fDeltaPhiP.At(id);
2b35e8e6 524 TH1F * hisSignal = (TH1F*)fSignals.At(id);
108953e9 525 //
c18f4385 526
527 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
528 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
2b35e8e6 529 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
c03e3250 530 if (!param) return;
531 if (!ltrp) return;
532 if (!track) return;
c18f4385 533 Double_t xyz[3];
534 Double_t pxyz[3];
535 Double_t lxyz[3];
536 Double_t lpxyz[3];
537 param->GetXYZ(xyz);
538 param->GetPxPyPz(pxyz);
539 ltrp->GetXYZ(lxyz);
540 ltrp->GetPxPyPz(lpxyz);
541 //
542 Float_t dz = param->GetZ()-ltrp->GetZ();
543 Float_t dphi = (TMath::ATan2(xyz[1],xyz[0])- TMath::ATan2(lxyz[1],lxyz[0]))*254.;
544 Float_t dphiP = param->GetParameter()[2]-ltrp->GetParameter()[2];
c03e3250 545 if (hisdz) hisdz->Fill(dz);
e5c59218 546 if (hisP3) hisP3->Fill(param->GetParameter()[3]);
547 if (hisP4) hisP4->Fill(param->GetParameter()[4]);
c03e3250 548 if (hisdphi) hisdphi->Fill(dphi);
263d466a 549 if (hisdphiP) hisdphiP->Fill(dphiP);
e5c59218 550 if (hisSignal) hisSignal->Fill(TMath::Sqrt(TMath::Abs(track->GetTPCsignal())));
be113f6e 551 // }
c18f4385 552}
553
554void AliTPCcalibLaser::FitDriftV(){
555 //
108953e9 556 // Fit corrections to the drift velocity - linear approximation in the z and global y
557 //The transfromatiom from the drift time to the z position done in AliTPCTracnsform class
558 //
559 /*
560 Formulas:
561
562 z = s* (z0 - vd*(t-t0))
563
564 s - side -1 and +1
565 t0 - time 0
566 vd - nominal drift velocity
567 zs - miscalibrated position
568
569 zs = s*(z0 - vd*(1+vr)*(t-(t0+dt))
570 vr - relative change of the drift velocity
571 dzt - vd*dt
572 dr = zz0-s*z
573 ..
574 ==>
575 zs ~ z - s*vr*(z0-s*z)+s*dzt
576 --------------------------------
577 1. Correction function vr constant:
578
579
580 dz = zs-z = -s*vr *(z0-s*z)+s*dzt
581 dzs/dl = dz/dl +s*s*vr*dz/dl
582 d(dz/dl) = vr*dz/dl
583 */
584
585 const Float_t kZCut = 240; // remove the closest laser beam
be113f6e 586 const Float_t kSaturCut = 0.05; // remove saturated lasers - cut on fraction of saturated
108953e9 587 const Float_t kDistCut = 3; // distance sigma cut
588 const Float_t kDistCutAbs = 0.25;
be113f6e 589 const Float_t kMinClusters = 60; // minimal amount of the clusters
590 const Float_t kMinSignal = 16; // minimal mean height of the signal
591 const Float_t kChi2Cut = 0.1; // chi2 cut to accept drift fit
c18f4385 592 static TLinearFitter fdriftA(3,"hyp2");
593 static TLinearFitter fdriftC(3,"hyp2");
108953e9 594 static TLinearFitter fdriftAC(4,"hyp3");
595 TVectorD fitA(3),fitC(3),fitAC(4);
596
597 AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
598 AliTPCParam * tpcparam = calib->GetParameters();
599
600 //
be113f6e 601 for (Int_t id=0; id<336; id++) fFitZ[id]=0;
602
108953e9 603 Float_t chi2A = 10;
604 Float_t chi2C = 10;
605 Float_t chi2AC = 10;
606 Int_t npointsA=0;
607 Int_t npointsC=0;
608 Int_t npointsAC=0;
be113f6e 609
108953e9 610
611 for (Int_t iter=0; iter<3; iter++){
be113f6e 612 fdriftA.ClearPoints();
613 fdriftC.ClearPoints();
108953e9 614 fdriftAC.ClearPoints();
be113f6e 615 //
616 for (Int_t id=0; id<336; id++){
617 if (!fTracksEsdParam.At(id)) continue;
618 if (!AcceptLaser(id)) continue;
be113f6e 619 if ( fClusterSatur[id]>kSaturCut) continue;
620 if ( fClusterCounter[id]<kMinClusters) continue;
108953e9 621 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
622 if (track->GetTPCsignal()<kMinSignal) continue;
be113f6e 623 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
624 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
108953e9 625
be113f6e 626 Double_t xyz[3];
627 Double_t pxyz[3];
628 Double_t lxyz[3];
629 Double_t lpxyz[3];
630 param->GetXYZ(xyz);
631 param->GetPxPyPz(pxyz);
632 ltrp->GetXYZ(lxyz);
633 ltrp->GetPxPyPz(lpxyz);
634 if (TMath::Abs(lxyz[2])>kZCut) continue;
108953e9 635 Float_t sz = (ltrp->GetSide()==0) ? TMath::Sqrt(chi2A): TMath::Sqrt(chi2C);
636 if (npointsAC>0) sz =TMath::Sqrt(chi2AC);
637 if (TMath::Abs(fFitZ[id])>sz*kDistCut) continue;
638 if (iter>0 && TMath::Abs(fFitZ[id])>kDistCutAbs) continue;
639
640 // drift distance
641 Double_t zlength = tpcparam->GetZLength(0);
642 Double_t ldrift = zlength-TMath::Abs(lxyz[2]);
643 Double_t mdrift = zlength-TMath::Abs(xyz[2]);
644 Double_t xxx[2] = {ldrift,lxyz[1]*ldrift/(zlength*250.)};
be113f6e 645 if (ltrp->GetSide()==0){
108953e9 646 fdriftA.AddPoint(xxx,mdrift,1);
be113f6e 647 }else{
108953e9 648 fdriftC.AddPoint(xxx,mdrift,1);
be113f6e 649 }
108953e9 650 Double_t xxx2[3] = {ltrp->GetSide(), ldrift,lxyz[1]*ldrift/(zlength*250.)};
651 fdriftAC.AddPoint(xxx2,mdrift,1);
be113f6e 652 }
be113f6e 653 //
654 if (fdriftA.GetNpoints()>10){
108953e9 655 //
be113f6e 656 fdriftA.Eval();
108953e9 657 if (iter==0) fdriftA.EvalRobust(0.7);
658 else fdriftA.EvalRobust(0.8);
be113f6e 659 fdriftA.GetParameters(fitA);
660 npointsA= fdriftA.GetNpoints();
661 chi2A = fdriftA.GetChisquare()/fdriftA.GetNpoints();
662 if (chi2A<kChi2Cut ||(*fFitAside)[0]==0 ) (*fFitAside) = fitA;
663 }
664 if (fdriftC.GetNpoints()>10){
665 fdriftC.Eval();
108953e9 666 if (iter==0) fdriftC.EvalRobust(0.7);
667 else fdriftC.EvalRobust(0.8);
668 //
be113f6e 669 fdriftC.GetParameters(fitC);
670 npointsC= fdriftC.GetNpoints();
671 chi2C = fdriftC.GetChisquare()/fdriftC.GetNpoints();
672 if (chi2C<kChi2Cut||(*fFitCside)[0]==0) (*fFitCside) = fitC;
673 }
108953e9 674
675 if (fdriftAC.GetNpoints()>10&&fdriftC.GetNpoints()>10&&fdriftA.GetNpoints()>10){
676 fdriftAC.Eval();
677 if (iter==0) fdriftAC.EvalRobust(0.7);
678 else fdriftAC.EvalRobust(0.8);
679 //
680 fdriftAC.GetParameters(fitAC);
681 npointsAC= fdriftAC.GetNpoints();
682 chi2AC = fdriftAC.GetChisquare()/fdriftAC.GetNpoints();
683 if (chi2AC<kChi2Cut||(*fFitACside)[0]==0) (*fFitACside) = fitAC;
684 }
be113f6e 685
686 for (Int_t id=0; id<336; id++){
687 if (!fTracksEsdParam.At(id)) continue;
688 //
689 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
690 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
691 Double_t xyz[3];
692 Double_t pxyz[3];
693 Double_t lxyz[3];
694 Double_t lpxyz[3];
695 param->GetXYZ(xyz);
696 param->GetPxPyPz(pxyz);
697 ltrp->GetXYZ(lxyz);
108953e9 698 ltrp->GetPxPyPz(lpxyz);
699 Double_t zlength = tpcparam->GetZLength(0);
700 Double_t ldrift = zlength-TMath::Abs(lxyz[2]);
701 Double_t mdrift = zlength-TMath::Abs(xyz[2]);
702
be113f6e 703 Float_t fz =0;
704 if (ltrp->GetSide()==0){
108953e9 705 fz = (fitA)[0]+(fitA)[1]*ldrift+(fitA)[2]*lxyz[1]*ldrift/(zlength*250.);
be113f6e 706 }else{
108953e9 707 fz = (fitC)[0]+(fitC)[1]*ldrift+(fitC)[2]*lxyz[1]*ldrift/(zlength*250.);
be113f6e 708 }
108953e9 709 if (npointsAC>10){
710 fz = (fitAC)[0]+(fitAC)[1]*ltrp->GetSide()+(fitAC)[2]*ldrift+(fitAC)[3]*lxyz[1]*ldrift/(zlength*250.);
711 }
712 fFitZ[id]=mdrift-fz;
be113f6e 713 }
714 if (fStreamLevel>0){
715 TTreeSRedirector *cstream = GetDebugStreamer();
3ac724f0 716 TTimeStamp tstamp(fTime);
717 Float_t valuePressure0 = AliTPCcalibDB::GetPressure(tstamp,fRun,0);
718 Float_t valuePressure1 = AliTPCcalibDB::GetPressure(tstamp,fRun,1);
719 Double_t ptrelative0 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,0);
720 Double_t ptrelative1 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,1);
721 Double_t temp0 = AliTPCcalibDB::GetTemperature(tstamp,fRun,0);
722 Double_t temp1 = AliTPCcalibDB::GetTemperature(tstamp,fRun,1);
31aa7c5c 723 TVectorD vecGoofie(20);
724 AliDCSSensorArray* goofieArray = AliTPCcalibDB::Instance()->GetGoofieSensors(fRun);
725 if (goofieArray)
726 for (Int_t isensor=0; isensor<goofieArray->NumSensors();isensor++){
727 AliDCSSensor *gsensor = goofieArray->GetSensor(isensor);
728 if (gsensor) vecGoofie[isensor]=gsensor->GetValue(tstamp);
729 }
3ac724f0 730
be113f6e 731 if (cstream){
108953e9 732 (*cstream)<<"driftv"<<
733 "run="<<fRun<< // run number
734 "event="<<fEvent<< // event number
735 "time="<<fTime<< // time stamp of event
736 "trigger="<<fTrigger<< // trigger
737 "mag="<<fMagF<< // magnetic field
3ac724f0 738 // Environment values
739 "press0="<<valuePressure0<<
740 "press1="<<valuePressure1<<
741 "pt0="<<ptrelative0<<
742 "pt1="<<ptrelative1<<
743 "temp0="<<temp0<<
744 "temp1="<<temp1<<
31aa7c5c 745 "vecGoofie.="<<&vecGoofie<<
3ac724f0 746 //
747 //
be113f6e 748 "iter="<<iter<<
749 "driftA.="<<fFitAside<<
750 "driftC.="<<fFitCside<<
108953e9 751 "driftAC.="<<fFitACside<<
be113f6e 752 "chi2A="<<chi2A<<
753 "chi2C="<<chi2C<<
108953e9 754 "chi2AC="<<chi2AC<<
be113f6e 755 "nA="<<npointsA<<
756 "nC="<<npointsC<<
108953e9 757 "nAC="<<npointsAC<<
be113f6e 758 "\n";
759 }
c18f4385 760 }
761 }
be113f6e 762}
263d466a 763
be113f6e 764Float_t AliTPCcalibLaser::GetDistance(AliExternalTrackParam *param, AliTPCLaserTrack *ltrp){
765 //
766 // get distance between mirror and laser track
767 //
768 //
769 Double_t xyz[3];
770 Double_t lxyz[3];
771 param->GetXYZ(xyz);
772 ltrp->GetXYZ(lxyz);
773 //
774 //
775 Double_t dist = 0;
776 //radial distance
777 dist+=TMath::Abs((TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*param->GetX());
778 //
779 // z distance
780 // apply drift correction if already exist
781 //
782 Float_t dz = 0;
783 if (ltrp->GetSide()==0){
784 if ((*fFitAside)[1]>0.) dz = ((*fFitAside)[0]+(*fFitAside)[1]*lxyz[2]+(*fFitAside)[2]*lxyz[1])-xyz[2];
785 }else{
786 if ((*fFitCside)[1]>0.) dz = ((*fFitCside)[0]+(*fFitCside)[1]*lxyz[2]+(*fFitCside)[2]*lxyz[1])-xyz[2];
c18f4385 787 }
be113f6e 788 if (TMath::Abs(dz)>3*(TMath::Abs(lxyz[2]-xyz[2])+1)) dz= TMath::Abs(lxyz[2]-xyz[2]);
789 dist+=TMath::Abs(dz);
790 //
791 // phi dist - divergence on 50 cm
c18f4385 792 //
be113f6e 793 dist = TMath::Abs((param->GetParameter()[2]-ltrp->GetParameter()[2])*50);
794 return dist;
c18f4385 795}
796
797
798Bool_t AliTPCcalibLaser::AcceptLaser(Int_t id){
799 //
800 //
801 //
802 /*
be113f6e 803 TCut cutP0("cutP0","abs((atan2(x1,x0)-atan2(lx1,lx0))*254)<1.5");
e5c59218 804 TCut cutP1("cutP1","abs(LTr.fP[1]-Tr.fP[1])<30");
805 TCut cutP2("cutP2","abs(LTr.fP[2]-Tr.fP[2])<0.03");
806 TCut cutP3("cutP3","abs(Tr.fP[3])<0.05");
807 TCut cutP4("cutPt","abs(Tr.fP[4])<0.1");
808
809 TCut cutA = cutP0+cutP1+cutP2+cutP3+cutP4;
c18f4385 810 */
811 AliExternalTrackParam *param =(AliExternalTrackParam*)fTracksEsdParam.At(id);
812 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
43ad9d4c 813 //AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
e5c59218 814 Double_t xyz[3];
815 Double_t lxyz[3];
816 param->GetXYZ(xyz);
817 ltrp->GetXYZ(lxyz);
be113f6e 818 if (TMath::Abs((TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*254)>1.5) return kFALSE; //cut y- P0
e5c59218 819 if (TMath::Abs(param->GetParameter()[1]-ltrp->GetParameter()[1])>30) return kFALSE; // cutZ -P1
820 if (TMath::Abs(param->GetParameter()[2]-ltrp->GetParameter()[2])>0.03) return kFALSE; // cut -P2
821 if (TMath::Abs(param->GetParameter()[3])>0.05) return kFALSE; // cut Tl -P3
822 if (TMath::Abs(param->GetParameter()[4])>0.1) return kFALSE; // cut Pt -P4
c18f4385 823 //
c18f4385 824 //
e5c59218 825
263d466a 826 return kTRUE;
e9f38a4b 827}
828
829Int_t AliTPCcalibLaser::FindMirror(AliESDtrack *track, AliTPCseed *seed){
830 //
831 // Find corresponding mirror
832 // add the corresponding tracks
108953e9 833
834
835 Float_t kRadius0 = 252;
836 Float_t kRadius = 253.4;
837
e9f38a4b 838 if (!track->GetOuterParam()) return -1;
c6914c83 839 AliExternalTrackParam param(*(track->GetOuterParam()));
1bd37cc0 840 AliTracker::PropagateTrackTo(&param,kRadius0,0.10566,3,kTRUE);
841 AliTracker::PropagateTrackTo(&param,kRadius,0.10566,0.1,kTRUE);
7b18d067 842 AliTPCLaserTrack ltr;
843 AliTPCLaserTrack *ltrp=0x0;
5732d662 844 // AliTPCLaserTrack *ltrpjw=0x0;
1bd37cc0 845 //
263d466a 846 Int_t id = AliTPCLaserTrack::IdentifyTrack(&param);
847 // Int_t idjw = AliTPCLaserTrack::IdentifyTrackJW(&param);
848 //AliDebug(4,Form("Identified Track: %03d (%03d)",id,idjw));
849
850 if (id!=-1 && (AliTPCLaserTrack::GetTracks()->UncheckedAt(id)))
1bd37cc0 851 ltrp=(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
263d466a 852 else
1bd37cc0 853 ltrp=&ltr;
263d466a 854
be113f6e 855 if (id<0) return id;
856 fCounter[id]++;
857 //
858 //
859 //
860 Int_t countercl=0;
861 Float_t counterSatur=0;
862 for (Int_t irow=158;irow>-1;--irow) {
863 AliTPCclusterMI *c=seed->GetClusterPointer(irow);
864 if (!c) continue;
865 Double_t pedgeY = c->GetX()*TMath::DegToRad()*(10)-TMath::Abs(c->GetY());
866 Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
867 if (pedgeY<3) continue;
868 if (pedgeX<3) continue;
869 countercl++;
870 if (c->GetMax()>900) counterSatur++;
871 }
872 counterSatur/=(countercl+1);
873 //
874 if (counterSatur>fClusterSatur[id]) fClusterSatur[id]=counterSatur;
875 //
876 //
877 Float_t radius=TMath::Abs(ltrp->GetX());
878 AliTracker::PropagateTrackTo(&param,radius,0.10566,0.01,kTRUE);
879 //
880 if (!fTracksMirror.At(id)) fTracksMirror.AddAt(ltrp,id);
881 Bool_t accept=kTRUE;
882 //
883 // choose closer track
884 //
885 AliExternalTrackParam * param0 = (AliExternalTrackParam *)fTracksEsdParam.At(id);
886 if (param0){
887 Float_t dist0=GetDistance(param0,ltrp);
888 Float_t dist1=GetDistance(&param,ltrp);
889 if (dist0<dist1) accept=kFALSE;
890 }
891
892 if (accept){
893 fClusterCounter[id]=countercl;
e9f38a4b 894 fTracksEsdParam.AddAt(param.Clone(),id);
895 fTracksEsd.AddAt(track,id);
896 fTracksTPC.AddAt(seed,id);
897 }
898 return id;
899}
900
901
902
903void AliTPCcalibLaser::DumpLaser(Int_t id) {
904 //
905 // Dump Laser info to the tree
906 //
907 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
908 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
909 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
1bd37cc0 910 //
911 // Fast laser ID
912 //
913 Double_t xyz[3];
914 Double_t pxyz[3];
c18f4385 915 Double_t lxyz[3];
916 Double_t lpxyz[3];
e9f38a4b 917 param->GetXYZ(xyz);
918 param->GetPxPyPz(pxyz);
c18f4385 919 ltrp->GetXYZ(lxyz);
920 ltrp->GetPxPyPz(lpxyz);
be113f6e 921 Float_t dist3D = GetDistance(param,ltrp);
922 Float_t dist0 = (TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*param->GetX();
923 Float_t distphi = (param->GetParameter()[2]-ltrp->GetParameter()[2])*50;
924
925
c6914c83 926 if (fStreamLevel>0){
927 TTreeSRedirector *cstream = GetDebugStreamer();
c18f4385 928 Int_t time = fESD->GetTimeStamp();
929 Bool_t accept = AcceptLaser(id);
c6914c83 930 if (cstream){
931 (*cstream)<<"Track"<<
108953e9 932 //
933 "run="<<fRun<< // run number
934 "event="<<fEvent<< // event number
935 "time="<<fTime<< // time stamp of event
936 "trigger="<<fTrigger<< // trigger
937 "mag="<<fMagF<< // magnetic field
938
7b18d067 939 "id="<<id<<
c18f4385 940 "accept="<<accept<<
941 "driftA.="<<fFitAside<<
942 "driftC.="<<fFitCside<<
943 "time="<<time<<
be113f6e 944 "dist3D="<<dist3D<<
945 "dist0="<<dist0<<
946 "distphi="<<distphi<<
947 //
948 //
949 "counter="<<fCounter[id]<<
950 "clcounter="<<fClusterCounter[id]<<
951 "satur="<<fClusterSatur[id]<<
952 "fz="<<fFitZ[id]<<
7b18d067 953 //
954 "LTr.="<<ltrp<<
955 "Esd.="<<track<<
e9f38a4b 956 "Tr.="<<param<<
c6914c83 957 "x0="<<xyz[0]<<
958 "x1="<<xyz[1]<<
959 "x2="<<xyz[2]<<
960 "px0="<<pxyz[0]<<
961 "px1="<<pxyz[1]<<
962 "px2="<<pxyz[2]<<
c18f4385 963 //
964 "lx0="<<lxyz[0]<<
965 "lx1="<<lxyz[1]<<
966 "lx2="<<lxyz[2]<<
967 "lpx0="<<lpxyz[0]<<
968 "lpx1="<<lpxyz[1]<<
969 "lpx2="<<lpxyz[2]<<
c6914c83 970 "\n";
971 }
972 }
973}
974
263d466a 975void AliTPCcalibLaser::RefitLaserJW(Int_t id){
976 //
977 // Refit the track with different tracklet models:
978 // 1. Per ROC using the kalman filter, different edge cuts
979 // 2. Per ROC linear in y and z
980 // 3. Per ROC quadratic in y and z
981 // 4. Per track offset for each sector, linear for each sector, common quadratic
982 // store x, y, z information for all models and the cluster to calculate the residuals
983 //
be113f6e 984
108953e9 985 // The clusters which do not fulfill given criteria are skipped
986 //
987 // Cluters removed from fit
988 // 1. Extended shape > kShapeCut
989 // 2. In saturation Max > kMax
990 // 3. Distance to edge < cutEdge
991 //
992 // Clusters not used for the calibration:
993 //
994 // 1. Extended shape > kShapeCut
995 // 2. In saturation Max > kMax
996
997
263d466a 998 AliTPCseed *track = (AliTPCseed*)fTracksTPC.At(id);
999 AliExternalTrackParam *extparam=(AliExternalTrackParam*)fTracksEsdParam.At(id);
1000 AliTPCLaserTrack *ltrp = (AliTPCLaserTrack*)fTracksMirror.At(id);
1001
1002 AliTPCclusterMI dummyCl;
1003
1004 //two tracklets
108953e9 1005 Int_t kMaxTracklets=2;
1006 Float_t kShapeCut = 1.3;
1007 Float_t kRatioCut = 2.;
1008
1009 Float_t kMax = 900.;
1010
1011
0728a4f6 1012 //=============================================//
1013 // Linear Fitters for the Different Approaches //
1014 //=============================================//
1015 //linear fit model in y and z; inner - outer sector
1016 static TLinearFitter fy1I(2,"hyp1");
1017 static TLinearFitter fy1O(2,"hyp1");
1018 static TLinearFitter fz1I(2,"hyp1");
1019 static TLinearFitter fz1O(2,"hyp1");
1020 //quadratic fit model in y and z; inner - sector
1021 static TLinearFitter fy2I(3,"hyp2");
1022 static TLinearFitter fy2O(3,"hyp2");
1023 static TLinearFitter fz2I(3,"hyp2");
1024 static TLinearFitter fz2O(3,"hyp2");
263d466a 1025 //common quadratic fit for IROC and OROC in y and z
1026 static TLinearFitter fy4(5,"hyp4");
1027 static TLinearFitter fz4(5,"hyp4");
1028
1029
1030 //set standard cuts
1031 if ( fNcuts==0 ){
1032 fNcuts=1;
1033 fEdgeXcuts[0]=4;
1034 fEdgeYcuts[0]=3;
1035 fNClCuts[0]=20;
1036 }
0728a4f6 1037 //=============================//
1038 // Loop over all Tracklet Cuts //
1039 //=============================//
263d466a 1040 for (Int_t icut=0; icut<fNcuts; icut++){
108953e9 1041 Float_t xinMin = 2500, xinMax=-90;
1042 Float_t xoutMin=2500, xoutMax=-90;
1043 Float_t msigmaYIn=0;
1044 Float_t msigmaYOut=0;
1045 Float_t mqratioIn=0;
1046 Float_t mqratioOut=0;
be113f6e 1047
1048
263d466a 1049 AliDebug(4,Form("Processing cut %d for track with ID %d",icut,id));
1050 //cut parameters
1051 Double_t edgeCutX = fEdgeXcuts[icut];
1052 Double_t edgeCutY = fEdgeYcuts[icut];
e5c59218 1053 Int_t nclCut = (Int_t)fNClCuts[icut];
0728a4f6 1054 //=========================//
1055 // Parameters to calculate //
1056 //=========================//
1057 //fit parameter inner, outer tracklet and combined fit
1058 TVectorD vecy1resInner(2),vecz1resInner(2); //pol1 fit parameters inner
1059 TVectorD vecy2resInner(3),vecz2resInner(3); //pol2 fit parameters inner
263d466a 1060 //
0728a4f6 1061 TVectorD vecy1resOuter(2),vecz1resOuter(2); //pol1 fit parameters outer
1062 TVectorD vecy2resOuter(3),vecz2resOuter(3); //pol2 fit parameters outer
263d466a 1063 TVectorD vecy4res(5),vecz4res(5);
1064 // cluster and track positions for each row - used for residuals
108953e9 1065 TVectorD vecgX(159); // global X
1066 TVectorD vecgY(159); // global Y
1067 TVectorD vecgZ(159); // global Z
1068
263d466a 1069 TVectorD vecX(159); // x is the same for all (row center)
1070 TVectorD vecYkalman(159); // y from kalman fit
1071 TVectorD vecZkalman(159); // z from kalman fit
1072 TVectorD vecY1(159); // y from pol1 fit per ROC
1073 TVectorD vecZ1(159); // z from pol1 fit per ROC
1074 TVectorD vecY2(159); // y from pol2 fit per ROC
1075 TVectorD vecZ2(159); // z from pol2 fit per ROC
1076 TVectorD vecY4(159); // y from sector fit
1077 TVectorD vecZ4(159); // z from sector fit
1078 TVectorD vecClY(159); // y cluster position
1079 TVectorD vecClZ(159); // z cluster position
1080 TVectorD vecSec(159); // sector for each row
108953e9 1081 TVectorD isReject(159); // flag - cluster to be rejected
0728a4f6 1082 //chi2 of fits
be113f6e 1083 Double_t chi2I1z=0; // chi2 of pol1 fit in z (inner)
1084 Double_t chi2I1y=0; // chi2 of pol1 fit in y (inner)
1085 Double_t chi2O1z=0; // chi2 of pol1 fit in z (outer)
1086 Double_t chi2O1y=0; // chi2 of pol1 fit in y (outer)
1087 Double_t chi2I2z=0; // chi2 of pol2 fit in z (inner)
1088 Double_t chi2I2y=0; // chi2 of pol2 fit in y (inner)
1089 Double_t chi2O2z=0; // chi2 of pol2 fit in z (outer)
1090 Double_t chi2O2y=0; // chi2 of pol2 fit in y (outer)
1091 Double_t chi2IOz=0; // chi2 of hyp4 fit in z (inner+outer)
1092 Double_t chi2IOy=0; // chi2 of hyp4 fit in y (inner+outer)
0728a4f6 1093 //more
1094 Int_t innerSector = -1; // number of inner sector
1095 Int_t outerSector = -1; // number of outer sector
263d466a 1096 Int_t nclI=0; // number of clusters (inner)
1097 Int_t nclO=0; // number of clusters (outer)
0728a4f6 1098 //=================================================//
1099 // Perform the Kalman Fit using the Tracklet Class //
1100 //=================================================//
263d466a 1101 AliTPCTracklet::SetEdgeCut(edgeCutX,edgeCutY);
1102 TObjArray tracklets=
1103 AliTPCTracklet::CreateTracklets(track,AliTPCTracklet::kKalman,
1104 kFALSE,nclCut,kMaxTracklets);
263d466a 1105 // tracklet pointers
263d466a 1106 AliTPCTracklet *trInner = (AliTPCTracklet*)tracklets.At(0);
1107 AliTPCTracklet *trOuter = (AliTPCTracklet*)tracklets.At(1);
0728a4f6 1108 AliTPCTracklet *tr=0x0;
1109 AliTPCTracklet dummy;
1110 //continue if we didn't find a tracklet
263d466a 1111 if ( !trInner && !trOuter ) continue;
0728a4f6 1112 //================================================================================//
1113 // Swap Inner and Outer if necessary (inner sector is definde by smaller local x) //
1114 //================================================================================//
263d466a 1115 if ( trInner && trOuter ){
1116 if ( !trInner->GetInner() || !trOuter->GetInner() ) continue;
1117 if ( trInner->GetInner()->GetX() > trOuter->GetInner()->GetX() ){
1118 tr = trInner;
1119 trInner=trOuter;
1120 trOuter=tr;
1121 AliDebug(5,Form("Swapped Sectors: %02d (%f) <-> %02d (%f)", trOuter->GetSector(), trOuter->GetInner()->GetX(), trInner->GetSector(), trInner->GetInner()->GetX()));
1122 }
1123 } else {
1124 if ( trInner ){
1125 if ( !trInner->GetInner() ) continue;
1126 trOuter=&dummy;
1127 if ( trInner->GetSector()>35 ){
1128 trOuter=trInner;
1129 trInner=&dummy;
1130 }
1131 } else { //trOuter
1132 if ( !trOuter->GetInner() ) continue;
1133 trInner=&dummy;
1134 if ( trOuter->GetSector()<36 ){
1135 trInner=trOuter;
1136 trOuter=&dummy;
1137 }
1138 }
1139 }
1140 innerSector = trInner->GetSector();
1141 if ( innerSector>=0 ) AliDebug(5,Form("Found inner Sector %02d at X %.2f", innerSector, trInner->GetInner()->GetX()));
1142 outerSector = trOuter->GetSector();
1143 if ( outerSector>=0 ) AliDebug(5,Form("Found outer Sector %02d at X %.2f", outerSector, trOuter->GetInner()->GetX()));
1144
263d466a 1145 // array of clusters
1146 TClonesArray arrCl("AliTPCclusterMI",159);
1147 arrCl.ExpandCreateFast(159);
0728a4f6 1148 //=======================================//
1149 // fill fitters with cluster information //
1150 //=======================================//
1151 AliDebug(3,"Filing Cluster Information");
108953e9 1152
1153 //
1154 //
1155
263d466a 1156 for (Int_t irow=158;irow>-1;--irow) {
1157 AliTPCclusterMI *c=track->GetClusterPointer(irow);
0728a4f6 1158 AliTPCclusterMI &cl = (AliTPCclusterMI&) (*arrCl[irow]);
1159 cl=dummyCl;
be113f6e 1160 vecX[irow] = 0;
1161 vecClY[irow] = 0;
1162 vecClZ[irow] = 0;
1163 Float_t meanY=0, sumY=0;
1164 for (Int_t drow=-1;drow<=1;drow++) {
1165 if (irow+drow<0) continue;
1166 if (irow+drow>158) continue;
57dc06f2 1167 AliTPCclusterMI *ccurrent=track->GetClusterPointer(irow);
1168 if (!ccurrent) continue;
1169 Int_t roc = static_cast<Int_t>(ccurrent->GetDetector());
be113f6e 1170 if ( roc!=innerSector && roc!=outerSector ) continue;
57dc06f2 1171 if (ccurrent->GetX()<10) continue;
1172 if (ccurrent->GetY()==0) continue;
1173 meanY+=ccurrent->GetY();
be113f6e 1174 sumY++;
1175 }
1176 if (sumY>0) meanY/=sumY;
1177
0728a4f6 1178 //
263d466a 1179 vecSec[irow]=-1;
1180 if (!c) continue;
108953e9 1181 Double_t pedgeY = c->GetX()*TMath::Tan(TMath::DegToRad()*(10))-TMath::Abs(meanY);
e5c59218 1182 Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
1183
0728a4f6 1184 //
1185 Int_t roc = static_cast<Int_t>(c->GetDetector());
1186 if ( roc!=innerSector && roc!=outerSector ) continue;
1187 vecSec[irow]=roc;
263d466a 1188 //store clusters in clones array
be113f6e 1189 cl=*c;
1190 //
1191 if (c->GetMax()<4) continue; // noise cluster?
1192 if (TMath::Abs(c->GetY())<0.0001) continue; // noise cluster?
263d466a 1193 //cluster position
1194 vecX[irow] = c->GetX();
1195 vecClY[irow] = c->GetY();
1196 vecClZ[irow] = c->GetZ();
108953e9 1197 //
31aa7c5c 1198// Float_t gxyz[3];
1199// c->GetGlobalXYZ(gxyz);
1200// vecgX[irow] = gxyz[0];
1201// vecgY[irow] = gxyz[1];
1202// vecgZ[irow] = gxyz[2];
263d466a 1203 //
0728a4f6 1204 Double_t x = vecX[irow]-133.4; //reference is between IROC and OROC
1205 Double_t y = vecClY[irow];
1206 Double_t z = vecClZ[irow];
1207 //
1208 Double_t x2[2]={x,x*x}; //linear and parabolic parameters
1209 Double_t x4[4]={0,0,0,0}; //hyp4 parameters
263d466a 1210 if ( roc == innerSector ) {
0728a4f6 1211 x4[0]=1; //offset inner - outer sector
1212 x4[1]=x; //slope parameter inner sector
263d466a 1213 } else {
0728a4f6 1214 x4[2]=x; //slope parameter outer sector
263d466a 1215 }
0728a4f6 1216 x4[3]=x*x; //common parabolic shape
e5c59218 1217 if (pedgeX < fEdgeXcuts[icut]) continue;
1218 if (pedgeY < fEdgeYcuts[icut]) continue;
be113f6e 1219 if (c->GetMax()>900) continue; // cluster in saturation
263d466a 1220 //
0728a4f6 1221 if ( roc==innerSector ){
1222 fy1I.AddPoint(x2,y);
1223 fz1I.AddPoint(x2,z);
1224 fy2I.AddPoint(x2,y);
1225 fz2I.AddPoint(x2,z);
1226 ++nclI;
108953e9 1227 if (c->GetX()<xinMin) xinMin=c->GetX();
1228 if (c->GetX()>xinMax) xinMax=c->GetX();
1229
1230 msigmaYIn +=TMath::Sqrt(c->GetSigmaY2());
1231 mqratioIn +=c->GetMax()/c->GetQ();
1232
0728a4f6 1233 }
1234 if ( roc==outerSector ){
1235 fy1O.AddPoint(x2,y);
1236 fz1O.AddPoint(x2,z);
1237 fy2O.AddPoint(x2,y);
1238 fz2O.AddPoint(x2,z);
1239 ++nclO;
108953e9 1240 if (c->GetX()<xoutMin) xoutMin=c->GetX();
1241 if (c->GetX()>xoutMax) xoutMax=c->GetX();
1242 msigmaYOut +=TMath::Sqrt(c->GetSigmaY2());
1243 mqratioOut +=c->GetMax()/c->GetQ();
1244
0728a4f6 1245 }
263d466a 1246 fy4.AddPoint(x4,y);
1247 fz4.AddPoint(x4,z);
1248 }
108953e9 1249 if (nclI>0) {
1250 msigmaYIn/=nclI;
1251 mqratioIn/=nclI;
1252 }
1253 if (nclO>0) {
1254 msigmaYOut/=nclO;
1255 mqratioOut/=nclO;
1256 }
0728a4f6 1257 //======================================//
1258 // Evaluate and retrieve fit parameters //
1259 //======================================//
1260 AliDebug(5,Form("Evaluating fits with inner (outer) Sec: %02d (%02d)",innerSector,outerSector));
1261 //inner sector
1262 if ( (innerSector>-1) && (fy1I.GetNpoints()>0) ){
1263 fy1I.Eval();
1264 fz1I.Eval();
1265 fy2I.Eval();
1266 fz2I.Eval();
1267 fy1I.GetParameters(vecy1resInner);
1268 fz1I.GetParameters(vecz1resInner);
1269 fy2I.GetParameters(vecy2resInner);
1270 fz2I.GetParameters(vecz2resInner);
1271 chi2I1y=fy1I.GetChisquare()/(fy1I.GetNpoints()-2);
1272 chi2I1z=fz1I.GetChisquare()/(fz1I.GetNpoints()-2);
1273 chi2I2y=fy2I.GetChisquare()/(fy2I.GetNpoints()-3);
1274 chi2I2z=fz2I.GetChisquare()/(fz2I.GetNpoints()-3);
1275 }
1276 //outer sector
1277 if ( (outerSector>-1) && (fy1O.GetNpoints()>0) ){
1278 fy1O.Eval();
1279 fz1O.Eval();
1280 fy2O.Eval();
1281 fz2O.Eval();
1282 fy1O.GetParameters(vecy1resOuter);
1283 fz1O.GetParameters(vecz1resOuter);
1284 fy2O.GetParameters(vecy2resOuter);
1285 fz2O.GetParameters(vecz2resOuter);
1286 chi2O1y=fy1O.GetChisquare()/(fy1O.GetNpoints()-2);
1287 chi2O1z=fz1O.GetChisquare()/(fz1O.GetNpoints()-2);
1288 chi2O2y=fy2O.GetChisquare()/(fy2O.GetNpoints()-3);
1289 chi2O2z=fz2O.GetChisquare()/(fz2O.GetNpoints()-3);
1290 }
1291 //combined hyp4 fit
263d466a 1292 if ( innerSector>0 && outerSector>0 ){
0728a4f6 1293 if (fy4.GetNpoints()>0) {
1294 fy4.Eval();
1295 fy4.GetParameters(vecy4res);
1296 chi2IOy=fy4.GetChisquare()/(fy4.GetNpoints()-5);
1297 }
1298 if (fz4.GetNpoints()>0) {
1299 fz4.Eval();
1300 fz4.GetParameters(vecz4res);
1301 chi2IOz=fz4.GetChisquare()/(fz4.GetNpoints()-5);
1302 }
263d466a 1303 }
0728a4f6 1304 //clear points
1305 fy4.ClearPoints(); fz4.ClearPoints();
1306 fy1I.ClearPoints(); fy1O.ClearPoints();
1307 fz1I.ClearPoints(); fz1O.ClearPoints();
1308 fy2I.ClearPoints(); fy2O.ClearPoints();
1309 fz2I.ClearPoints(); fz2O.ClearPoints();
1310 //==============================//
1311 // calculate tracklet positions //
1312 //==============================//
263d466a 1313 AliDebug(4,"Calculate tracklet positions");
1314 for (Int_t irow=158;irow>-1;--irow) {
108953e9 1315 isReject[irow]=0;
1316 AliTPCclusterMI *c=track->GetClusterPointer(irow);
1317 if ( vecSec[irow]!=innerSector && vecSec[irow]!=outerSector ) { // no cluster in given sectors
1318 isReject[irow]+=1;
1319 }
1320
1321 if (!c) { //no cluster
1322 isReject[irow]+=2;
1323 }else{
1324 if (c->GetMax()>kMax){ //saturation
1325 isReject[irow]+=4;
1326 }
1327 if ( vecSec[irow] == outerSector ) { //extended shape
1328 if (c->GetMax()/c->GetQ()> mqratioOut*kRatioCut) isReject[irow]+=8;
1329 if (TMath::Sqrt(c->GetSigmaY2())>msigmaYOut*kShapeCut) isReject[irow]+=16;
1330 }else{
1331 if (c->GetMax()/c->GetQ()> mqratioIn*kRatioCut) isReject[irow]+=8;
1332 if (TMath::Sqrt(c->GetSigmaY2())>msigmaYIn*kShapeCut) isReject[irow]+=16;
1333 }
1334 }
1335
1336
1337
0728a4f6 1338 if ( vecSec[irow]==-1 ) continue; //no cluster info
263d466a 1339 if ( vecSec[irow]!=innerSector && vecSec[irow]!=outerSector ) continue;
1340 tr=&dummy;
1341 Double_t x=vecX[irow];
0728a4f6 1342 Double_t xref=x-133.4;
1343 //
263d466a 1344 Double_t yoffInner=0;
1345 Double_t zoffInner=0;
1346 Double_t yslopeInner=0;
1347 Double_t yslopeOuter=0;
1348 Double_t zslopeInner=0;
0728a4f6 1349 Double_t zslopeOuter=0;
1350 //positions of hyperplane fits
263d466a 1351 if ( vecSec[irow] == outerSector ) {
1352 tr=trOuter;
1353 vecY1[irow]=vecy1resOuter[0]+vecy1resOuter[1]*xref;
1354 vecZ1[irow]=vecz1resOuter[0]+vecz1resOuter[1]*xref;
1355 vecY2[irow]=vecy2resOuter[0]+vecy2resOuter[1]*xref+vecy2resOuter[2]*xref*xref;
1356 vecZ2[irow]=vecz2resOuter[0]+vecz2resOuter[1]*xref+vecz2resOuter[2]*xref*xref;
1357 yslopeOuter=vecy4res[3];
1358 zslopeOuter=vecz4res[3];
263d466a 1359 } else {
1360 tr=trInner;
1361 vecY1[irow]=vecy1resInner[0]+vecy1resInner[1]*xref;
1362 vecZ1[irow]=vecz1resInner[0]+vecz1resInner[1]*xref;
1363 vecY2[irow]=vecy2resInner[0]+vecy2resInner[1]*xref+vecy2resInner[2]*xref*xref;
1364 vecZ2[irow]=vecz2resInner[0]+vecz2resInner[1]*xref+vecz2resInner[2]*xref*xref;
1365 yoffInner=vecy4res[1];
1366 zoffInner=vecz4res[1];
1367 yslopeInner=vecy4res[2];
1368 zslopeInner=vecz4res[2];
263d466a 1369 }
1370 vecY4[irow]=vecy4res[0]+yoffInner+yslopeInner*xref+yslopeOuter*xref+vecy4res[4]*xref*xref;
1371 vecZ4[irow]=vecz4res[0]+zoffInner+zslopeInner*xref+zslopeOuter*xref+vecz4res[4]*xref*xref;
0728a4f6 1372 //positions of kalman fits
263d466a 1373 Double_t gxyz[3],xyz[3];
1374 AliExternalTrackParam *param = 0x0;
0728a4f6 1375 //
263d466a 1376 param=tr->GetInner();
1377 if (param){
1378 param->GetXYZ(gxyz);
1379 Float_t bz = AliTracker::GetBz(gxyz);
1380 param->GetYAt(x, bz, xyz[1]);
1381 param->GetZAt(x, bz, xyz[2]);
1382 vecYkalman[irow]=xyz[1];
1383 vecZkalman[irow]=xyz[2];
1384 }
108953e9 1385 //
1386 //
1387 //
1388
263d466a 1389 }
0728a4f6 1390 //=====================================================================//
1391 // write results from the different tracklet fits with debug streamers //
1392 //=====================================================================//
263d466a 1393 if (fStreamLevel>4){
1394 TTreeSRedirector *cstream = GetDebugStreamer();
1395 if (cstream){
be113f6e 1396 Float_t dedx = track->GetdEdx();
1397 (*cstream)<<"FitModels"<<
108953e9 1398 "run="<<fRun<< // run number
1399 "event="<<fEvent<< // event number
1400 "time="<<fTime<< // time stamp of event
1401 "trigger="<<fTrigger<< // trigger
1402 "mag="<<fMagF<< // magnetic field
1403 //
be113f6e 1404 "cutNr=" << icut <<
1405 "edgeCutX=" << edgeCutX <<
1406 "edgeCutY=" << edgeCutY <<
1407 "nclCut=" << nclCut <<
1408 "innerSector="<< innerSector <<
1409 "outerSector="<< outerSector <<
1410 "dEdx=" << dedx <<
1411 "LTr.=" << ltrp <<
1412 "Tr.=" << extparam <<
1413 "yPol1In.=" << &vecy1resInner <<
1414 "zPol1In.=" << &vecz1resInner <<
1415 "yPol2In.=" << &vecy2resInner <<
1416 "zPol2In.=" << &vecz2resInner <<
1417 "yPol1Out.=" << &vecy1resOuter <<
1418 "zPol1Out.=" << &vecz1resOuter <<
1419 "yPol2Out.=" << &vecy2resOuter <<
1420 "zPol2Out.=" << &vecz2resOuter <<
1421 "yInOut.=" << &vecy4res <<
1422 "zInOut.=" << &vecz4res <<
1423 "chi2y1In=" << chi2I1y <<
1424 "chi2z1In=" << chi2I1z <<
1425 "chi2y1Out=" << chi2O1y <<
1426 "chi2z1Out=" << chi2O1z <<
1427 "chi2y2In=" << chi2I2y <<
1428 "chi2z2In=" << chi2I2z <<
1429 "chi2y2Out=" << chi2O2y <<
1430 "chi2z2Out=" << chi2O2z <<
1431 "chi2yInOut=" << chi2IOy <<
1432 "chi2zInOut=" << chi2IOz <<
1433 "trletIn.=" << trInner <<
1434 "trletOut.=" << trOuter <<
1435 "nclI=" << nclI <<
1436 "nclO=" << nclO <<
1437 "xinMin=" << xinMin<<
1438 "xinMax=" << xinMax<<
1439 "xoutMin=" << xoutMin<<
1440 "xoutMax=" << xoutMax<<
108953e9 1441 "msigmaYIn=" <<msigmaYIn<<
1442 "msigmaYOut=" <<msigmaYOut<<
1443 "mqratioIn=" <<mqratioIn<<
1444 "mqratioOut=" << mqratioOut <<
be113f6e 1445 "\n";
263d466a 1446 }
1447 }
1448
1449 // wirte residuals information
1450 if (fStreamLevel>5){
1451 TTreeSRedirector *cstream = GetDebugStreamer();
1452 if (cstream){
be113f6e 1453 Float_t dedx = track->GetdEdx();
1454 (*cstream)<<"Residuals"<<
108953e9 1455 "run="<<fRun<< // run number
1456 "event="<<fEvent<< // event number
1457 "time="<<fTime<< // time stamp of event
1458 "trigger="<<fTrigger<< // trigger
1459 "mag="<<fMagF<< // magnetic field
1460 //
be113f6e 1461 "cutNr=" << icut <<
1462 "edgeCutX=" << edgeCutX <<
1463 "edgeCutY=" << edgeCutY <<
1464 "nclCut=" << nclCut <<
1465 "LTr.=" << ltrp <<
1466 "Tr.=" << extparam<<
1467 "dEdx=" << dedx <<
1468 "Cl.=" << &arrCl <<
108953e9 1469 "vX.=" << &vecgX<< // global x
1470 "vY.=" << &vecgY<< // global y
1471 "vZ.=" << &vecgZ<< // global z
be113f6e 1472 "TrX.=" << &vecX <<
1473 "TrYpol1.=" << &vecY1 <<
1474 "TrZpol1.=" << &vecZ1 <<
1475 "TrYpol2.=" << &vecY2 <<
1476 "TrZpol2.=" << &vecZ2 <<
1477 "TrYInOut.=" << &vecY4 <<
1478 "TrZInOut.=" << &vecZ4 <<
1479 "ClY.=" << &vecClY <<
1480 "ClZ.=" << &vecClZ <<
108953e9 1481 "isReject.=" << &isReject<<
be113f6e 1482 "sec.=" << &vecSec <<
1483 "nclI=" << nclI <<
1484 "nclO=" << nclO <<
1485 "xinMin=" << xinMin<<
1486 "xinMax=" << xinMax<<
1487 "xoutMin=" << xoutMin<<
1488 "xoutMax=" << xoutMax<<
108953e9 1489 "msigmaYIn=" <<msigmaYIn<<
1490 "msigmaYOut=" <<msigmaYOut<<
1491 "mqratioIn=" <<mqratioIn<<
1492 "mqratioOut=" << mqratioOut <<
be113f6e 1493 "yInOut.=" << &vecy4res <<
1494 "zInOut.=" << &vecz4res <<
108953e9 1495 //chi2s
be113f6e 1496 "chi2y1In=" << chi2I1y << //
1497 "chi2z1In=" << chi2I1z <<
1498 "chi2y1Out=" << chi2O1y <<
1499 "chi2z1Out=" << chi2O1z <<
1500 "chi2y2In=" << chi2I2y <<
1501 "chi2z2In=" << chi2I2z <<
1502 "chi2y2Out=" << chi2O2y <<
1503 "chi2z2Out=" << chi2O2z <<
1504 "chi2yInOut=" << chi2IOy <<
1505 "chi2zInOut=" << chi2IOz <<
108953e9 1506 // fit parameters
1507 "yPol1In.=" << &vecy1resInner <<
1508 "zPol1In.=" << &vecz1resInner <<
1509 "yPol2In.=" << &vecy2resInner <<
1510 "zPol2In.=" << &vecz2resInner <<
1511 "yPol1Out.=" << &vecy1resOuter <<
1512 "zPol1Out.=" << &vecz1resOuter <<
1513 "yPol2Out.=" << &vecy2resOuter <<
1514 "zPol2Out.=" << &vecz2resOuter <<
1515
be113f6e 1516 "\n";
263d466a 1517
1518 }
1519 }
95a0e09b 1520 //==========================//
1521 // Fill Residual Histograms //
1522 //==========================//
108953e9 1523 if (!fHisNclIn) MakeFitHistos();
1524
1525 TH2F *profy = (TH2F*)fDeltaYres.UncheckedAt(id);
1526 TH2F *profz = (TH2F*)fDeltaZres.UncheckedAt(id);
1527 TH2F *profy2 = (TH2F*)fDeltaYres2.UncheckedAt(id);
1528 TH2F *profz2 = (TH2F*)fDeltaZres2.UncheckedAt(id);
1529 // TH2F *profy3 = (TH2F*)fDeltaYres3.UncheckedAt(id);
1530 //TH2F *profz3 = (TH2F*)fDeltaZres3.UncheckedAt(id);
1531 //
95a0e09b 1532 for (Int_t irow=158;irow>-1;--irow) {
108953e9 1533 if (vecSec[irow]==-1)continue; // no cluster info
1534 if (isReject[irow]>0.5) continue; //
43ad9d4c 1535 //Double_t x = vecX[irow];
95a0e09b 1536 Double_t ycl = vecClY[irow];
1537 Double_t yfit = vecY1[irow];
108953e9 1538 Double_t yfit2 = vecY2[irow];
43ad9d4c 1539 // Double_t yfit3 = vecY2[irow];
95a0e09b 1540 Double_t zcl = vecClZ[irow];
1541 Double_t zfit = vecZ1[irow];
108953e9 1542 Double_t zfit2 = vecZ2[irow];
43ad9d4c 1543 //Double_t zfit3 = vecZ2[irow];
108953e9 1544
be113f6e 1545 if (TMath::Abs(yfit-ycl)<2&&TMath::Abs(zfit-zcl)<2){
108953e9 1546 if (profy){
1547 profy->Fill(irow,ycl-yfit);
1548 profy2->Fill(irow,ycl-yfit2);
1549 // profy3->Fill(irow,ycl-yfit3);
1550 }
1551 if (profz) {
1552 profz->Fill(irow,zcl-zfit);
1553 profz2->Fill(irow,zcl-zfit2);
1554 //profz3->Fill(irow,zcl-zfit3);
1555 }
be113f6e 1556 }
95a0e09b 1557 }
be113f6e 1558 //
1559 //
1560 // Fill laser fit histograms
1561 //
be113f6e 1562 Float_t dedx = track->GetdEdx();
1563 if (nclI>20&&nclO>20){
1564 fHisNclIn->Fill(id,nclI); //->Number of clusters inner
1565 fHisNclOut->Fill(id,nclO); //->Number of clusters outer
1566 fHisNclIO->Fill(id,nclI+nclO); //->Number of cluster inner outer
1567 //
1568 fHisLclIn->Fill(id,xinMax-xinMin); //->Level arm inner
1569 fHisLclOut->Fill(id,xoutMax-xoutMin); //->Level arm outer
1570 fHisLclIO->Fill(id,xoutMax-xinMin); //->Number of cluster inner outer
1571 //
1572 fHisdEdx->Fill(id,TMath::Sqrt(TMath::Abs(dedx)));
1573 fHisdZfit->Fill(id,fFitZ[id]);
1574 //
1575 //
1576 fHisChi2YIn1->Fill(id,TMath::Sqrt(chi2I1y)); //->chi2 y inner - line
1577 fHisChi2YOut1->Fill(id,TMath::Sqrt(chi2O1y)); //->chi2 y inner - line
1578 fHisChi2YIn2->Fill(id,TMath::Sqrt(chi2I2y)); //->chi2 y inner - parabola
1579 fHisChi2YOut2->Fill(id,TMath::Sqrt(chi2O2y)); //->chi2 y inner - parabola
1580 fHisChi2YIO1->Fill(id,TMath::Sqrt(chi2IOy)); //->chi2 y IO - common
1581
1582
1583 fHisChi2ZIn1->Fill(id,TMath::Sqrt(chi2I1z)); //->chi2 z inner - line
1584 fHisChi2ZOut1->Fill(id,TMath::Sqrt(chi2O1z)); //->chi2 z inner - line
1585 fHisChi2ZIn2->Fill(id,TMath::Sqrt(chi2O2y)); //->chi2 z inner - parabola
1586 fHisChi2ZOut2->Fill(id,TMath::Sqrt(chi2O2z)); //->chi2 z inner - parabola
1587 fHisChi2ZIO1->Fill(id,TMath::Sqrt(chi2IOz)); //->chi2 z IO - common
1588 //
1589 //
1590 fHisPy1vP0->Fill(id,vecy1resOuter[0]-vecy1resInner[0]); //-> delta y P0outer-P0inner - line
1591 fHisPy2vP0->Fill(id,vecy2resOuter[0]-vecy2resInner[0]); //-> delta y P0outer-P0inner - parabola
1592 fHisPy3vP0->Fill(id,vecy4res[1]); //-> delta y P0outer-P0inner - common parabola
1593 //
1594 fHisPy1vP1->Fill(id,vecy1resOuter[1]-vecy1resInner[1]); //-> delta ky P1outer-P1inner - line
1595 fHisPy2vP1->Fill(id,vecy2resOuter[1]-vecy2resInner[1]); //-> delta ky P1outer-P1inner - parabola
1596 fHisPy3vP1->Fill(id,vecy4res[3]-vecy4res[2]); //-> delta ky P1outer-P1inner - common parabola
e9f38a4b 1597 //
be113f6e 1598 fHisPy3vP2IO->Fill(id,vecy4res[4]); //-> Curv P2outerinner - common parabola
1599 fHisPz1vP0->Fill(id,vecz1resOuter[0]-vecz1resInner[0]); //-> delta z P0outer-P0inner - line
1600 fHisPz2vP0->Fill(id,vecz2resOuter[0]-vecz2resInner[0]); //-> delta z P0outer-P0inner - parabola
1601 fHisPz3vP0->Fill(id,vecz4res[1]); //-> delta z P0outer-P0inner - common parabola
1602 //
1603 fHisPz1vP1->Fill(id,vecz1resOuter[1]-vecz1resInner[1]); //-> delta kz P1outer-P1inner - line
1604 fHisPz2vP1->Fill(id,vecz2resOuter[1]-vecz2resInner[1]); //-> delta kz P1outer-P1inner - parabola
1605 fHisPz3vP1->Fill(id,vecz4res[3]-vecz4res[2]); //-> delta kz P1outer-P1inner - common parabola
1606 fHisPz3vP2IO->Fill(id,vecz4res[4]); //-> Curv P2outerinner - common parabola
e9f38a4b 1607 }
be113f6e 1608 if(nclI>20){
1609 fHisPy2vP2In->Fill(id,vecy2resInner[2]); //-> Curv P2inner - parabola
1610 fHisPz2vP2In->Fill(id,vecz2resInner[2]); //-> Curv P2inner - parabola
e9f38a4b 1611 }
be113f6e 1612 //
1613 if (nclO>20){
1614 fHisPz2vP2Out->Fill(id,vecz2resOuter[2]); //-> Curv P2outer - parabola
1615 fHisPy2vP2Out->Fill(id,vecy2resOuter[2]); //-> Curv P2outer - parabola
1616 }
1617
e9f38a4b 1618 }
e9f38a4b 1619}
1620
1621
be113f6e 1622
57dc06f2 1623void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run){
2b35e8e6 1624 //
1fd56785 1625 // Dump information about laser beams
1626 // isOK variable indicates usability of the beam
1627 // Beam is not usable if:
1628 // a. No entries in range (krmsCut0)
1629 // b. Big sperad (krmscut1)
1630 // c. RMSto fit sigma bigger then (kmultiCut)
1631 // d. Too big angular spread
1632 //
1633
1634 const Float_t krmsCut0=0.001;
1635 const Float_t krmsCut1=0.16;
1636 const Float_t kmultiCut=2;
1637 const Float_t kcutP0=0.002;
2b35e8e6 1638 //
1639 AliTPCcalibLaser *laser = this;
1640 TTreeSRedirector *pcstream = new TTreeSRedirector("laserMean.root");
1641 TF1 fg("fg","gaus");
1642 //
1643 //
1644 for (Int_t id=0; id<336; id++){
1fd56785 1645 Bool_t isOK=kTRUE;
2b35e8e6 1646 TH1F * hisphi = (TH1F*)laser->fDeltaPhi.At(id);
1647 TH1F * hisphiP = (TH1F*)laser->fDeltaPhiP.At(id);
1648 TH1F * hisZ = (TH1F*)laser->fDeltaZ.At(id);
e5c59218 1649 TH1F * hisP3 = (TH1F*)laser->fDeltaP3.At(id);
1650 TH1F * hisP4 = (TH1F*)laser->fDeltaP4.At(id);
1fd56785 1651 TH1F * hisS = (TH1F*)laser->fSignals.At(id);
be113f6e 1652 //if (!hisphi) continue;
108953e9 1653 Double_t entries = (hisphi==0)? 0: hisphi->GetEntries();
be113f6e 1654 //if (entries<minEntries) continue;
2b35e8e6 1655 //
1656 AliTPCLaserTrack *ltrp = (AliTPCLaserTrack*)fTracksMirror.At(id);
1657 if (!ltrp) {
1658 AliTPCLaserTrack::LoadTracks();
1659 ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
1660 }
e5c59218 1661 pcstream->GetFile()->cd();
1662 if (hisphi) hisphi->Write();
1663 if (hisphiP) hisphiP->Write();
1664 if (hisZ) hisZ->Write();
1665 if (hisP3) hisP3->Write();
1666 if (hisP4) hisP4->Write();
1667
2b35e8e6 1668 Float_t meanphi = hisphi->GetMean();
1669 Float_t rmsphi = hisphi->GetRMS();
1fd56785 1670 //
2b35e8e6 1671 Float_t meanphiP = hisphiP->GetMean();
1672 Float_t rmsphiP = hisphiP->GetRMS();
1673 Float_t meanZ = hisZ->GetMean();
1674 Float_t rmsZ = hisZ->GetRMS();
1675 hisphi->Fit(&fg,"","",hisphi->GetMean()-4*hisphi->GetRMS(),hisphi->GetMean()+4*hisphi->GetRMS());
263d466a 1676 Double_t gphi1 = fg.GetParameter(1);
1677 Double_t gphi2 = fg.GetParameter(2);
2b35e8e6 1678 hisphiP->Fit(&fg,"","",hisphiP->GetMean()-4*hisphiP->GetRMS(),hisphiP->GetMean()+4*hisphiP->GetRMS());
263d466a 1679 Double_t gphiP1 = fg.GetParameter(1);
1680 Double_t gphiP2 = fg.GetParameter(2);
e5c59218 1681 //
2b35e8e6 1682 hisZ->Fit(&fg,"","",hisZ->GetMean()-4*hisZ->GetRMS(),hisZ->GetMean()+4*hisZ->GetRMS());
263d466a 1683 Double_t gz1 = fg.GetParameter(1);
1684 Double_t gz2 = fg.GetParameter(2);
1fd56785 1685 //
e5c59218 1686 hisP3->Fit(&fg,"","",hisP3->GetMean()-4*hisP3->GetRMS(),hisP3->GetMean()+4*hisP3->GetRMS());
1687 Double_t gp31 = fg.GetParameter(1);
1688 Double_t gp32 = fg.GetParameter(2);
1689 //
1690 hisP4->Fit(&fg,"","",hisP4->GetMean()-4*hisP4->GetRMS(),hisP4->GetMean()+4*hisP4->GetRMS());
1691 Double_t gp41 = fg.GetParameter(1);
1692 Double_t gp42 = fg.GetParameter(2);
1693 //
1fd56785 1694 Float_t meanS=hisS->GetMean();
2b35e8e6 1695 //
1696 Double_t lxyz[3];
1697 Double_t lpxyz[3];
1698 ltrp->GetXYZ(lxyz);
1699 ltrp->GetPxPyPz(lpxyz);
1fd56785 1700
1701 if (rmsphi<krmsCut0) isOK=kFALSE; // empty in range - not entries inside
1702 if (rmsphi>krmsCut1) isOK=kFALSE; // empty in range - not entries inside
1703 if (rmsphi>krmsCut0) if (gphi2/rmsphi>kmultiCut) isOK=kFALSE; // multi peak structure
1704 if (gphiP2>kcutP0) isOK=kFALSE;
be113f6e 1705 //
1706 //
1707 //
1708 TH1 *his =0;
1709 //
1710 his = fHisNclIn->ProjectionY("aaa",id+1,id+1);
1711 Float_t mnclIn = his->GetMean();
1712 delete his;
1713 his = fHisNclOut->ProjectionY("aaa",id+1,id+1);
1714 Float_t mnclOut = his->GetMean();
1715 delete his;
1716 his = fHisNclIO->ProjectionY("aaa",id+1,id+1);
1717 Float_t mnclIO = his->GetMean();
1718 delete his;
1719 his = fHisLclIn->ProjectionY("aaa",id+1,id+1);
1720 Float_t mLclIn = his->GetMean();
1721 delete his;
1722 his = fHisLclOut->ProjectionY("aaa",id+1,id+1);
1723 Float_t mLclOut = his->GetMean();
1724 delete his;
1725 his = fHisLclIO->ProjectionY("aaa",id+1,id+1);
1726 Float_t mLclIO = his->GetMean();
1727 delete his;
1728 //
1729 his = fHisdEdx->ProjectionY("aaa",id+1,id+1);
1730 Float_t mdEdx = his->GetMean();
1731 delete his;
1732 //
be113f6e 1733 //
1734 //
1735 //
1736 his = fHisChi2YIn1->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - line
1737 Float_t mChi2YIn1= his->GetMean();
1738 delete his;
1739 his = fHisChi2YOut1->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - line
1740 Float_t mChi2YOut1 = his->GetMean();
1741 delete his;
1742 his = fHisChi2YIn2->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - parabola
1743 Float_t mChi2YIn2 = his->GetMean();
1744 delete his;
1745 his = fHisChi2YOut2->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - parabola
1746 Float_t mChi2YOut2 = his->GetMean();
1747 delete his;
1748 his = fHisChi2YIO1->ProjectionY("aaa",id+1,id+1); //->chi2 y IO - common
1749 Float_t mChi2YIO1 = his->GetMean();
1750 delete his;
1751 his = fHisChi2ZIn1->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - line
1752 Float_t mChi2ZIn1 = his->GetMean();
1753 delete his;
1754 his = fHisChi2ZOut1->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - line
1755 Float_t mChi2ZOut1 = his->GetMean();
1756 delete his;
1757 his = fHisChi2ZIn2->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - parabola
1758 Float_t mChi2ZIn2 = his->GetMean();
1759 delete his;
1760 his = fHisChi2ZOut2->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - parabola
1761 Float_t mChi2ZOut2 = his->GetMean();
1762 delete his;
1763 his = fHisChi2ZIO1->ProjectionY("aaa",id+1,id+1); //->chi2 z IO - common
1764 Float_t mChi2ZIO1 = his->GetMean();
1765 delete his;
1766 //
1767 // fit res. histos
1768 //
108953e9 1769 his = fHisdZfit->ProjectionY("aaa",id+1,id+1);
1770 Float_t edZfit = his->GetEntries();
1771 Float_t mdZfit = his->GetMean();
1772 Float_t rdZfit = his->GetRMS();
1773 delete his;
1774
be113f6e 1775 his = fHisPy1vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - line
1776 Float_t ePy1vP0 = his->GetEntries();
1777 Float_t mPy1vP0 = his->GetMean();
1778 Float_t rPy1vP0 = his->GetRMS();
1779 delete his;
1780
1781 his = fHisPy2vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - parabola
1782 Float_t ePy2vP0 = his->GetEntries();
1783 Float_t mPy2vP0 = his->GetMean();
1784 Float_t rPy2vP0 = his->GetRMS();
1785 delete his;
1786
1787 his = fHisPy3vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - common parabola
1788 Float_t ePy3vP0 = his->GetEntries();
1789 Float_t mPy3vP0 = his->GetMean();
1790 Float_t rPy3vP0 = his->GetRMS();
1791 delete his;
1792
1793 his = fHisPy1vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - line
1794 Float_t ePy1vP1 = his->GetEntries();
1795 Float_t mPy1vP1 = his->GetMean();
1796 Float_t rPy1vP1 = his->GetRMS();
1797 delete his;
1798
1799 his = fHisPy2vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - parabola
1800 Float_t ePy2vP1 = his->GetEntries();
1801 Float_t mPy2vP1 = his->GetMean();
1802 Float_t rPy2vP1 = his->GetRMS();
1803 delete his;
1804
1805 his = fHisPy3vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - common parabola
1806 Float_t ePy3vP1 = his->GetEntries();
1807 Float_t mPy3vP1 = his->GetMean();
1808 Float_t rPy3vP1 = his->GetRMS();
1809 delete his;
1810
1811 his = fHisPy2vP2In->ProjectionY("aaa",id+1,id+1); //-> Curv P2inner - parabola
1812 Float_t ePy2vP2In = his->GetEntries();
1813 Float_t mPy2vP2In = his->GetMean();
1814 Float_t rPy2vP2In = his->GetRMS();
1815 delete his;
1816
1817 his = fHisPy2vP2Out->ProjectionY("aaa",id+1,id+1); //-> Curv P2outer - parabola
1818 Float_t ePy2vP2Out = his->GetEntries();
1819 Float_t mPy2vP2Out = his->GetMean();
1820 Float_t rPy2vP2Out = his->GetRMS();
1821 delete his;
1822
1823 his = fHisPy3vP2IO->ProjectionY("aaa",id+1,id+1); //-> Curv P2outerinner - common parabola
1824 Float_t ePy3vP2IO = his->GetEntries();
1825 Float_t mPy3vP2IO = his->GetMean();
1826 Float_t rPy3vP2IO = his->GetRMS();
1827 delete his;
1828
1829 //
1830 //
1831 his = fHisPz1vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - line
1832 Float_t ePz1vP0 = his->GetEntries();
1833 Float_t mPz1vP0 = his->GetMean();
1834 Float_t rPz1vP0 = his->GetRMS();
1835 delete his;
1836
1837 his = fHisPz2vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - parabola
1838 Float_t ePz2vP0 = his->GetEntries();
1839 Float_t mPz2vP0 = his->GetMean();
1840 Float_t rPz2vP0 = his->GetRMS();
1841 delete his;
1842
1843 his = fHisPz3vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - common parabola
1844 Float_t ePz3vP0 = his->GetEntries();
1845 Float_t mPz3vP0 = his->GetMean();
1846 Float_t rPz3vP0 = his->GetRMS();
1847 delete his;
1848
1849 his = fHisPz1vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - line
1850 Float_t ePz1vP1 = his->GetEntries();
1851 Float_t mPz1vP1 = his->GetMean();
1852 Float_t rPz1vP1 = his->GetRMS();
1853 delete his;
1854
1855 his = fHisPz2vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - parabola
1856 Float_t ePz2vP1 = his->GetEntries();
1857 Float_t mPz2vP1 = his->GetMean();
1858 Float_t rPz2vP1 = his->GetRMS();
1859 delete his;
1860
1861 his = fHisPz3vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - common parabola
1862 Float_t ePz3vP1 = his->GetEntries();
1863 Float_t mPz3vP1 = his->GetMean();
1864 Float_t rPz3vP1 = his->GetRMS();
1865 delete his;
1866
1867 his = fHisPz2vP2In->ProjectionY("aaa",id+1,id+1); //-> Curv P2inner - parabola
1868 Float_t ePz2vP2In = his->GetEntries();
1869 Float_t mPz2vP2In = his->GetMean();
1870 Float_t rPz2vP2In = his->GetRMS();
1871 delete his;
1872
1873 his = fHisPz2vP2Out->ProjectionY("aaa",id+1,id+1); //-> Curv P2outer - parabola
1874 Float_t ePz2vP2Out = his->GetEntries();
1875 Float_t mPz2vP2Out = his->GetMean();
1876 Float_t rPz2vP2Out = his->GetRMS();
1877 delete his;
1878
1879 his = fHisPz3vP2IO->ProjectionY("aaa",id+1,id+1); //-> Curv P2outerinner - common parabola
1880 Float_t ePz3vP2IO = his->GetEntries();
1881 Float_t mPz3vP2IO = his->GetMean();
1882 Float_t rPz3vP2IO = his->GetRMS();
1883 delete his;
1884
2b35e8e6 1885 //
1886 (*pcstream)<<"Mean"<<
be113f6e 1887 "run="<<run<< //
1888 "isOK="<<isOK<< //
1889 "id="<<id<< // track id
1890 "entries="<<entries<< // number of entries
1891 "bz="<<bfield<< // bfield
2b35e8e6 1892 "LTr.="<<ltrp<< // refernece track
1fd56785 1893 //
be113f6e 1894 "mnclIn="<<mnclIn<< // mean number of clusters in inner
1895 "mnclOut="<<mnclOut<< // mean number of clusters in outer
1896 "mnclIO="<<mnclIO<< // mean number of clusters in inner+outer
1897 "mLclIn="<<mLclIn<< // mean number of clusters in inner
1898 "mLclOut="<<mLclOut<< // mean number of clusters in outer
1899 "mLclIO="<<mLclIO<< // mean number of clusters in inner+outer
1900 "mdEdx="<<mdEdx<< // mean dEdx
108953e9 1901 "edZfit="<<edZfit<< // entries z fit
be113f6e 1902 "mdZfit="<<mdZfit<< // mean z fit
108953e9 1903 "rdZfit="<<rdZfit<< // RMS z fit
be113f6e 1904 //
1905 //
1906 "mChi2YIn1="<<mChi2YIn1<< //->chi2 y inner - line
1907 "mChi2YOut1="<<mChi2YOut1<< //->chi2 y inner - line
1908 "mChi2YIn2="<<mChi2YIn2<< //->chi2 y inner - parabola
1909 "mChi2YOut2="<<mChi2YOut2<< //->chi2 y inner - parabola
1910 "mChi2YIO1="<<mChi2YIO1<< //->chi2 y IO - common
1911 "mChi2ZIn1="<<mChi2ZIn1<< //->chi2 z inner - line
1912 "mChi2ZOut1="<<mChi2ZOut1<< //->chi2 z inner - line
1913 "mChi2ZIn2="<<mChi2ZIn2<< //->chi2 z inner - parabola
1914 "mChi2ZOut2="<<mChi2ZOut2<< //->chi2 z inner - parabola
1915 "mChi2ZIO1="<<mChi2ZIO1<< //->chi2 z IO - common
1916 //
1917 //
1918 "ePy1vP0="<<ePy1vP0<<
1919 "mPy1vP0="<<mPy1vP0<<
1920 "rPy1vP0="<<rPy1vP0<<
1921 "ePy2vP0="<<ePy2vP0<<
1922 "mPy2vP0="<<mPy2vP0<<
1923 "rPy2vP0="<<rPy2vP0<<
1924 "ePy3vP0="<<ePy3vP0<<
1925 "mPy3vP0="<<mPy3vP0<<
1926 "rPy3vP0="<<rPy3vP0<<
1927 "ePy1vP1="<<ePy1vP1<<
1928 "mPy1vP1="<<mPy1vP1<<
1929 "rPy1vP1="<<rPy1vP1<<
1930 "ePy2vP1="<<ePy2vP1<<
1931 "mPy2vP1="<<mPy2vP1<<
1932 "rPy2vP1="<<rPy2vP1<<
1933 "ePy3vP1="<<ePy3vP1<<
1934 "mPy3vP1="<<mPy3vP1<<
1935 "rPy3vP1="<<rPy3vP1<<
1936 "ePy2vP2In="<<ePy2vP2In<<
1937 "mPy2vP2In="<<mPy2vP2In<<
1938 "rPy2vP2In="<<rPy2vP2In<<
1939 "ePy2vP2Out="<<ePy2vP2Out<<
1940 "mPy2vP2Out="<<mPy2vP2Out<<
1941 "rPy2vP2Out="<<rPy2vP2Out<<
1942 "ePy3vP2IO="<<ePy3vP2IO<<
1943 "mPy3vP2IO="<<mPy3vP2IO<<
1944 "rPy3vP2IO="<<rPy3vP2IO<<
1945 //
1946 //
1947 "ePz1vP0="<<ePz1vP0<<
1948 "mPz1vP0="<<mPz1vP0<<
1949 "rPz1vP0="<<rPz1vP0<<
1950 "ePz2vP0="<<ePz2vP0<<
1951 "mPz2vP0="<<mPz2vP0<<
1952 "rPz2vP0="<<rPz2vP0<<
1953 "ePz3vP0="<<ePz3vP0<<
1954 "mPz3vP0="<<mPz3vP0<<
1955 "rPz3vP0="<<rPz3vP0<<
1956 "ePz1vP1="<<ePz1vP1<<
1957 "mPz1vP1="<<mPz1vP1<<
1958 "rPz1vP1="<<rPz1vP1<<
1959 "ePz2vP1="<<ePz2vP1<<
1960 "mPz2vP1="<<mPz2vP1<<
1961 "rPz2vP1="<<rPz2vP1<<
1962 "ePz3vP1="<<ePz3vP1<<
1963 "mPz3vP1="<<mPz3vP1<<
1964 "rPz3vP1="<<rPz3vP1<<
1965 "ePz2vP2In="<<ePz2vP2In<<
1966 "mPz2vP2In="<<mPz2vP2In<<
1967 "rPz2vP2In="<<rPz2vP2In<<
1968 "ePz2vP2Out="<<ePz2vP2Out<<
1969 "mPz2vP2Out="<<mPz2vP2Out<<
1970 "rPz2vP2Out="<<rPz2vP2Out<<
1971 "ePz3vP2IO="<<ePz3vP2IO<<
1972 "mPz3vP2IO="<<mPz3vP2IO<<
1973 "rPz3vP2IO="<<rPz3vP2IO<<
1974 //
1975 //
1976 //
1977 "lx0="<<lxyz[0]<< // reference x
1978 "lx1="<<lxyz[1]<< // reference y
1979 "lx2="<<lxyz[2]<< // refernece z
1980 "lpx0="<<lpxyz[0]<< // reference x
2b35e8e6 1981 "lpx1="<<lpxyz[1]<< // reference y
263d466a 1982 "lpx2="<<lpxyz[2]<< // refernece z
1fd56785 1983 //
1984 "msig="<<meanS<<
1985 //
2b35e8e6 1986 "mphi="<<meanphi<< //
1987 "rmsphi="<<rmsphi<< //
1988 "gphi1="<<gphi1<<
1989 "gphi2="<<gphi2<<
1fd56785 1990 //
2b35e8e6 1991 "mphiP="<<meanphiP<< //
1992 "rmsphiP="<<rmsphiP<< //
1993 "gphiP1="<<gphiP1<<
1994 "gphiP2="<<gphiP2<<
1fd56785 1995 //
2b35e8e6 1996 "meanZ="<<meanZ<<
1997 "rmsZ="<<rmsZ<<
1998 "gz1="<<gz1<<
1999 "gz2="<<gz2<<
e5c59218 2000 //
2001 "gp31="<<gp31<< //gaus mean - tgl
2002 "gp32="<<gp32<< //gaus rms -tgl
2003 "gp41="<<gp41<< //gaus mean - P4
2004 "gp42="<<gp42<< //gaus rms - P4
2b35e8e6 2005
2006 "\n";
2007 }
2008 delete pcstream;
be113f6e 2009 /*
2010 Browse the content
2011 TFile fmean("laserMean.root");
2012
2013
2014 */
2015
2016
2b35e8e6 2017}
2018
1fd56785 2019
2020
2021void AliTPCcalibLaser::DumpScanInfo(TTree * chain){
2022 //
2023 //
2024 //
2025 TTreeSRedirector *pcstream = new TTreeSRedirector("laserScan.root");
2026 TFile * f = pcstream->GetFile();
2027 f->mkdir("dirphi");
2028 f->mkdir("dirphiP");
2029 f->mkdir("dirZ");
2030 TF1 fp("p1","pol1");
2031 //
2032 //
2033 char cut[1000];
2034 char grname[1000];
2035 char grnamefull[1000];
2036
2037 Double_t mphi[100];
2038 Double_t mphiP[100];
2039 Double_t smphi[100];
2040 Double_t smphiP[100];
2041 Double_t mZ[100];
2042 Double_t smZ[100];
2043 Double_t bz[100];
2044 Double_t sbz[100];
2045 // fit parameters
2046 Double_t pphi[3];
2047 Double_t pphiP[3];
2048 Double_t pmZ[3];
2049 //
2050 for (Int_t id=0; id<336; id++){
2051 // id =205;
2052 sprintf(cut,"isOK&&fId==%d",id);
2053 Int_t entries = chain->Draw("bz",cut,"goff");
2054 if (entries<3) continue;
e5c59218 2055 AliTPCLaserTrack *ltrp = 0;
1fd56785 2056 if (!AliTPCLaserTrack::GetTracks()) AliTPCLaserTrack::LoadTracks();
2057 ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
2058 Double_t lxyz[3];
2059 Double_t lpxyz[3];
2060 ltrp->GetXYZ(lxyz);
2061 ltrp->GetPxPyPz(lpxyz);
2062
2063 chain->Draw("bz",cut,"goff");
2064 memcpy(bz, chain->GetV1(), entries*sizeof(Double_t));
2065 chain->Draw("0.01*abs(bz)+0.02",cut,"goff");
2066 memcpy(sbz, chain->GetV1(), entries*sizeof(Double_t));
2067 //
2068 chain->Draw("gphi1",cut,"goff");
2069 memcpy(mphi, chain->GetV1(), entries*sizeof(Double_t));
2070 chain->Draw("0.05*abs(mphi)+gphi2",cut,"goff");
2071 memcpy(smphi, chain->GetV1(), entries*sizeof(Double_t));
2072 //
2073 chain->Draw("gphiP1",cut,"goff");
2074 memcpy(mphiP, chain->GetV1(), entries*sizeof(Double_t));
2075 chain->Draw("0.05*abs(mphiP)+gphiP2",cut,"goff");
2076 memcpy(smphiP, chain->GetV1(), entries*sizeof(Double_t));
2077 //
2078 chain->Draw("gz1",cut,"goff");
2079 memcpy(mZ, chain->GetV1(), entries*sizeof(Double_t));
2080 chain->Draw("0.01*abs(meanZ)+gz2",cut,"goff");
2081 memcpy(smZ, chain->GetV1(), entries*sizeof(Double_t));
2082 //
2083 //
2084 sprintf(grnamefull,"Side_%d_Bundle_%d_Rod_%d_Beam_%d",
2085 ltrp->GetSide(), ltrp->GetBundle(), ltrp->GetRod(), ltrp->GetBeam());
2086 // store data
2087 // phi
2088 f->cd("dirphi");
2089 TGraphErrors *grphi = new TGraphErrors(entries,bz,mphi,sbz,smphi);
2090 grphi->Draw("a*");
2091 grphi->Fit(&fp);
2092 pphi[0] = fp.GetParameter(0); // offset
2093 pphi[1] = fp.GetParameter(1); // slope
2094 pphi[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
2095 sprintf(grname,"phi_id%d",id);
2096 grphi->SetName(grname); grphi->SetTitle(grnamefull);
2097 grphi->GetXaxis()->SetTitle("b_{z} (T)");
2098 grphi->GetYaxis()->SetTitle("#Delta r#phi (cm)");
ae69f16f 2099 grphi->SetMaximum(1.2);
2100 grphi->SetMinimum(-1.2);
1fd56785 2101 grphi->Draw("a*");
2102
2103 grphi->Write();
2104 gPad->SaveAs(Form("pic/phi/phi_%s.gif",grnamefull));
2105 // phiP
2106 f->cd("dirphiP)");
2107 TGraphErrors *grphiP = new TGraphErrors(entries,bz,mphiP,sbz,smphiP);
2108 grphiP->Draw("a*");
2109 grphiP->Fit(&fp);
2110 pphiP[0] = fp.GetParameter(0); // offset
2111 pphiP[1] = fp.GetParameter(1); // slope
2112 pphiP[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
2113 sprintf(grname,"phiP_id%d",id);
2114 grphiP->SetName(grname); grphiP->SetTitle(grnamefull);
2115 grphiP->GetXaxis()->SetTitle("b_{z} (T)");
2116 grphiP->GetYaxis()->SetTitle("#Delta #phi (rad)");
ae69f16f 2117 grphiP->SetMaximum(pphiP[0]+0.005);
2118 grphiP->SetMinimum(pphiP[0]-0.005);
1fd56785 2119
2120 gPad->SaveAs(Form("pic/phiP/phiP_%s.gif",grnamefull));
2121 grphiP->Write();
2122 //
2123 //Z
2124 f->cd("dirZ");
2125 TGraphErrors *grmZ = new TGraphErrors(entries,bz,mZ,sbz,smZ);
2126 grmZ->Draw("a*");
2127 grmZ->Fit(&fp);
2128 pmZ[0] = fp.GetParameter(0); // offset
2129 pmZ[1] = fp.GetParameter(1); // slope
2130 pmZ[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
2131 sprintf(grname,"mZ_id%d",id);
2132 grmZ->SetName(grname); grmZ->SetTitle(grnamefull);
2133 grmZ->GetXaxis()->SetTitle("b_{z} (T)");
2134 grmZ->GetYaxis()->SetTitle("#Delta z (cm)");
2135
2136 gPad->SaveAs(Form("pic/z/z_%s.gif",grnamefull));
2137 grmZ->Write();
2138
2139
2140 for (Int_t ientry=0; ientry<entries; ientry++){
2141 (*pcstream)<<"Mean"<<
2142 "id="<<id<<
2143 "LTr.="<<ltrp<<
2144 "entries="<<entries<<
2145 "bz="<<bz[ientry]<<
2146 "lx0="<<lxyz[0]<< // reference x
2147 "lx1="<<lxyz[1]<< // reference y
2148 "lx2="<<lxyz[2]<< // refernece z
2149 "lpx0="<<lpxyz[0]<< // reference x
2150 "lpx1="<<lpxyz[1]<< // reference y
2151 "lpx2="<<lpxyz[2]<< // refernece z
2152 //values
2153 "gphi1="<<mphi[ientry]<< // mean - from gaus fit
2154 "pphi0="<<pphi[0]<< // offset
2155 "pphi1="<<pphi[1]<< // mean
2156 "pphi2="<<pphi[2]<< // norm chi2
2157 //
2158 "gphiP1="<<mphiP[ientry]<< // mean - from gaus fit
2159 "pphiP0="<<pphiP[0]<< // offset
2160 "pphiP1="<<pphiP[1]<< // mean
2161 "pphiP2="<<pphiP[2]<< // norm chi2
2162 //
2163 "gz1="<<mZ[ientry]<<
2164 "pmZ0="<<pmZ[0]<< // offset
2165 "pmZ1="<<pmZ[1]<< // mean
2166 "pmZ2="<<pmZ[2]<< // norm chi2
2167 "\n";
2168 }
2169 }
2170
2171 delete pcstream;
2172
2173}
2174
2175
c6914c83 2176void AliTPCcalibLaser::Analyze(){
2177 //
2178 //
2179 //
2180}
2181
2182
c03e3250 2183Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
c6914c83 2184
c03e3250 2185 TIterator* iter = li->MakeIterator();
2186 AliTPCcalibLaser* cal = 0;
108953e9 2187 static Int_t counter0=0;
c03e3250 2188 while ((cal = (AliTPCcalibLaser*)iter->Next())) {
2189 if (!cal->InheritsFrom(AliTPCcalibLaser::Class())) {
2190 Error("Merge","Attempt to add object of class %s to a %s", cal->ClassName(), this->ClassName());
2191 return -1;
2192 }
108953e9 2193 printf("Marging number %d\n", counter0);
2194 counter0++;
c03e3250 2195 //
be113f6e 2196 MergeFitHistos(cal);
c03e3250 2197 TH1F *h=0x0;
2198 TH1F *hm=0x0;
108953e9 2199 TH2F *h2=0x0;
2200 TH2F *h2m=0x0;
2201 // TProfile *hp=0x0;
2202 //TProfile *hpm=0x0;
c03e3250 2203
2204 for (Int_t id=0; id<336; id++){
2205 // merge fDeltaZ histograms
263d466a 2206 hm = (TH1F*)cal->fDeltaZ.At(id);
c03e3250 2207 h = (TH1F*)fDeltaZ.At(id);
2208 if (!h) {
2209 h=new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
5732d662 2210 h->SetDirectory(0);
c03e3250 2211 fDeltaZ.AddAt(h,id);
2212 }
2213 if (hm) h->Add(hm);
e5c59218 2214 // merge fP3 histograms
2215 hm = (TH1F*)cal->fDeltaP3.At(id);
2216 h = (TH1F*)fDeltaP3.At(id);
2217 if (!h) {
2218 h=new TH1F(Form("hisPar3v%d",id),Form("hisPar3v%d",id),400,-0.06,0.06);
2219 h->SetDirectory(0);
2220 fDeltaP3.AddAt(h,id);
2221 }
2222 if (hm) h->Add(hm);
2223 // merge fP4 histograms
2224 hm = (TH1F*)cal->fDeltaP4.At(id);
2225 h = (TH1F*)fDeltaP4.At(id);
2226 if (!h) {
2227 h=new TH1F(Form("hisPar4v%d",id),Form("hisPar4v%d",id),200,-0.06,0.06);
2228 h->SetDirectory(0);
2229 fDeltaP4.AddAt(h,id);
2230 }
2231 if (hm) h->Add(hm);
2232
2233 //
c03e3250 2234 // merge fDeltaPhi histograms
263d466a 2235 hm = (TH1F*)cal->fDeltaPhi.At(id);
c03e3250 2236 h = (TH1F*)fDeltaPhi.At(id);
2237 if (!h) {
2238 h= new TH1F(Form("hisdphi%d",id),Form("hisdphi%d",id),1000,-1,1);
5732d662 2239 h->SetDirectory(0);
c03e3250 2240 fDeltaPhi.AddAt(h,id);
2241 }
2242 if (hm) h->Add(hm);
2243 // merge fDeltaPhiP histograms
263d466a 2244 hm = (TH1F*)cal->fDeltaPhiP.At(id);
c03e3250 2245 h = (TH1F*)fDeltaPhiP.At(id);
2246 if (!h) {
2247 h=new TH1F(Form("hisdphiP%d",id),Form("hisdphiP%d",id),1000,-0.01,0.01);
5732d662 2248 h->SetDirectory(0);
c03e3250 2249 fDeltaPhiP.AddAt(h,id);
2250 }
2251 if (hm) h->Add(hm);
2252 // merge fSignals histograms
263d466a 2253 hm = (TH1F*)cal->fSignals.At(id);
c03e3250 2254 h = (TH1F*)fSignals.At(id);
2255 if (!h) {
e5c59218 2256 h=new TH1F(Form("hisSignal%d",id),Form("hisSignal%d",id),100,0,300);
5732d662 2257 h->SetDirectory(0);
c03e3250 2258 fSignals.AddAt(h,id);
2259 }
263d466a 2260 if (hm) h->Add(hm);
95a0e09b 2261 //
2262 //
108953e9 2263 // merge ProfileY histograms -0
2264 h2m = (TH2F*)cal->fDeltaYres.At(id);
2265 h2 = (TH2F*)fDeltaYres.At(id);
2266 if (h2m) h2->Add(h2m);
95a0e09b 2267 //
108953e9 2268 h2m = (TH2F*)cal->fDeltaZres.At(id);
2269 h2 = (TH2F*)fDeltaZres.At(id);
2270 if (h2m) h->Add(h2m);
2271 // merge ProfileY histograms - 2
2272 h2m = (TH2F*)cal->fDeltaYres2.At(id);
2273 h2 = (TH2F*)fDeltaYres2.At(id);
2274 if (h2m) h2->Add(h2m);
2275 //
2276 h2m = (TH2F*)cal->fDeltaZres2.At(id);
2277 h2 = (TH2F*)fDeltaZres2.At(id);
2278 if (h2m) h->Add(h2m);
2279 // merge ProfileY histograms - 3
2280 //h2m = (TH2F*)cal->fDeltaYres3.At(id);
2281 //h2 = (TH2F*)fDeltaYres3.At(id);
2282 //if (h2m) h2->Add(h2m);
2283 //
2284 //h2m = (TH2F*)cal->fDeltaZres3.At(id);
2285 //h2 = (TH2F*)fDeltaZres3.At(id);
2286 //if (h2m) h->Add(h2m);
95a0e09b 2287 //
2288 //
c03e3250 2289 }
2290 }
2291 return 0;
2292}
2293
be113f6e 2294void AliTPCcalibLaser::MakeFitHistos(){
2295 //
2296 // Make a fit histograms
2297 //
2298 // Number of clusters
2299 //
2300 //TH2F *fHisNclIn; //->Number of clusters inner
2301 //TH2F *fHisNclOut; //->Number of clusters outer
2302 //TH2F *fHisNclIO; //->Number of cluster inner outer
2303 // TH2F *fHisdEdx; //->dEdx histo
2304 fHisNclIn = new TH2F("HisNclIn","HisNclIn",336,0,336,64,10,64);
2305 fHisNclOut = new TH2F("HisNclOut","HisNclOut",336,0,336,100,10,100);
2306 fHisNclIO = new TH2F("HisNclIO","HisNclIO",336,0,336,160,10,160);
2307 //
2308 fHisLclIn = new TH2F("HisLclIn","HisLclIn",336,0,336,64,10,64);
2309 fHisLclOut = new TH2F("HisLclOut","HisLclOut",336,0,336,100,10,150);
2310 fHisLclIO = new TH2F("HisLclIO","HisLclIO",336,0,336,160,10,160);
2311 //
2312 fHisdEdx = new TH2F("HisdEdx","HisdEdx",336,0,336,160,1,50);
108953e9 2313 fHisdZfit = new TH2F("HisdZfit","HisdZfit",336,0,336,300,-0.3,0.3);
be113f6e 2314
2315 //
2316 // Chi2
2317 //
2318 // TH2F *fHisChi2YIn1; //->chi2 y inner - line
2319 // TH2F *fHisChi2YOut1; //->chi2 y inner - line
2320 // TH2F *fHisChi2YIn2; //->chi2 y inner - parabola
2321 // TH2F *fHisChi2YOut2; //->chi2 y inner - parabola
2322 // TH2F *fHisChi2YIO1; //->chi2 y IO - common
2323 fHisChi2YIn1 = new TH2F("Chi2YIn1","Chi2YIn1",336,0,336,500,0.001,0.5);
2324 fHisChi2YOut1 = new TH2F("Chi2YOut1","Chi2YOut1",336,0,336,500,0.001,0.5);
2325 fHisChi2YIn2 = new TH2F("Chi2YIn2","Chi2YIn2",336,0,336,500,0.001,0.5);
2326 fHisChi2YOut2 = new TH2F("Chi2YOut2","Chi2YOut2",336,0,336,500,0.001,0.5);
2327 fHisChi2YIO1 = new TH2F("Chi2YIO1","Chi2YIO1",336,0,336,500,0.001,0.5);
2328 // TH2F *fHisChi2ZIn1; //->chi2 z inner - line
2329 // TH2F *fHisChi2ZOut1; //->chi2 z inner - line
2330 // TH2F *fHisChi2ZIn2; //->chi2 z inner - parabola
2331 // TH2F *fHisChi2ZOut2; //->chi2 z inner - parabola
2332 // TH2F *fHisChi2ZIO1; //->chi2 z IO - common
2333 fHisChi2ZIn1 = new TH2F("Chi2ZIn1","Chi2ZIn1",336,0,336,500,0.001,0.5);
2334 fHisChi2ZOut1 = new TH2F("Chi2ZOut1","Chi2ZOut1",336,0,336,500,0.001,0.5);
2335 fHisChi2ZIn2 = new TH2F("Chi2ZIn2","Chi2ZIn2",336,0,336,500,0.001,0.5);
2336 fHisChi2ZOut2 = new TH2F("Chi2ZOut2","Chi2ZOut2",336,0,336,500,0.001,0.5);
2337 fHisChi2ZIO1 = new TH2F("Chi2ZIO1","Chi2ZIO1",336,0,336,500,0.001,0.5);
2338 //
2339 // Fit
2340 //
2341 //
2342 // TH2F *fHisPy1vP0; //-> delta y P0outer-P0inner - line
2343 // TH2F *fHisPy2vP0; //-> delta y P0outer-P0inner - parabola
2344 // TH2F *fHisPy3vP0; //-> delta y P0outer-P0inner - common parabola
2345 // TH2F *fHisPy1vP1; //-> delta ky P1outer-P1inner - line
2346 // TH2F *fHisPy2vP1; //-> delta ky P1outer-P1inner - parabola
2347 // TH2F *fHisPy3vP1; //-> delta ky P1outer-P1inner - common parabola
2348 // TH2F *fHisPy2vP2In; //-> Curv P2inner - parabola
2349 // TH2F *fHisPy2vP2Out; //-> Curv P2outer - parabola
2350 // TH2F *fHisPy3vP2IO; //-> Curv P2outerinner - common parabola
2351 fHisPy1vP0 = new TH2F("HisPy1vP0", "HisPy1vP0",336,0,336,500,-0.3,0.3);
2352 fHisPy2vP0 = new TH2F("HisPy2vP0", "HisPy2vP0",336,0,336,500,-0.3,0.3);
2353 fHisPy3vP0 = new TH2F("HisPy3vP0", "HisPy3vP0",336,0,336,500,-0.3,0.3);
2354 fHisPy1vP1 = new TH2F("HisPy1vP1", "HisPy1vP1",336,0,336,500,-0.01,0.01);
2355 fHisPy2vP1 = new TH2F("HisPy2vP1", "HisPy2vP1",336,0,336,500,-0.01,0.01);
2356 fHisPy3vP1 = new TH2F("HisPy3vP1", "HisPy3vP1",336,0,336,500,-0.01,0.01);
2357 fHisPy2vP2In = new TH2F("HisPy2vP2In", "HisPy2vP2In",336,0,336,500,-0.0003,0.0003);
2358 fHisPy2vP2Out= new TH2F("HisPy2vP2Out","HisPy2vP2Out",336,0,336,500,-0.0003,0.0003);
2359 fHisPy3vP2IO = new TH2F("HisPy3vP2IO", "HisPy3vP2IO",336,0,336,500,-0.0003,0.0003);
2360 //
2361 //
2362 // TH2F *fHisPz1vP0; //-> delta z P0outer-P0inner - line
2363 // TH2F *fHisPz2vP0; //-> delta z P0outer-P0inner - parabola
2364 // TH2F *fHisPz3vP0; //-> delta z P0outer-P0inner - common parabola
2365 // TH2F *fHisPz1vP1; //-> delta kz P1outer-P1inner - line
2366 // TH2F *fHisPz2vP1; //-> delta kz P1outer-P1inner - parabola
2367 // TH2F *fHisPz3vP1; //-> delta kz P1outer-P1inner - common parabola
2368 // TH2F *fHisPz2vP2In; //-> Curv P2inner - parabola
2369 // TH2F *fHisPz2vP2Out; //-> Curv P2outer - parabola
2370 // TH2F *fHisPz3vP2IO; //-> Curv P2outerinner - common parabola
2371 fHisPz1vP0 = new TH2F("HisPz1vP0", "HisPz1vP0",336,0,336,500,-0.3,0.3);
2372 fHisPz2vP0 = new TH2F("HisPz2vP0", "HisPz2vP0",336,0,336,500,-0.3,0.3);
2373 fHisPz3vP0 = new TH2F("HisPz3vP0", "HisPz3vP0",336,0,336,500,-0.3,0.3);
2374 fHisPz1vP1 = new TH2F("HisPz1vP1", "HisPz1vP1",336,0,336,500,-0.01,0.01);
2375 fHisPz2vP1 = new TH2F("HisPz2vP1", "HisPz2vP1",336,0,336,500,-0.01,0.01);
2376 fHisPz3vP1 = new TH2F("HisPz3vP1", "HisPz3vP1",336,0,336,500,-0.01,0.01);
2377 fHisPz2vP2In = new TH2F("HisPz2vP2In", "HisPz2vP2In",336,0,336,500,-0.0003,0.0003);
2378 fHisPz2vP2Out= new TH2F("HisPz2vP2Out","HisPz2vP2Out",336,0,336,500,-0.0002,0.0002);
2379 fHisPz3vP2IO = new TH2F("HisPz3vP2IO", "HisPz3vP2IO",336,0,336,500,-0.0002,0.0002);
2380
2381 fHisNclIn->SetDirectory(0); //->Number of clusters inner
2382 fHisNclOut->SetDirectory(0); //->Number of clusters outer
2383 fHisNclIO->SetDirectory(0); //->Number of cluster inner outer
2384 fHisLclIn->SetDirectory(0); //->Level arm inner
2385 fHisLclOut->SetDirectory(0); //->Level arm outer
2386 fHisLclIO->SetDirectory(0); //->Number of cluster inner outer
2387 fHisdEdx->SetDirectory(0); //->Number of cluster inner outer
2388 fHisdZfit->SetDirectory(0); //->Number of cluster inner outer
2389 //
2390 //
2391 fHisChi2YIn1->SetDirectory(0); //->chi2 y inner - line
2392 fHisChi2YOut1->SetDirectory(0); //->chi2 y inner - line
2393 fHisChi2YIn2->SetDirectory(0); //->chi2 y inner - parabola
2394 fHisChi2YOut2->SetDirectory(0); //->chi2 y inner - parabola
2395 fHisChi2YIO1->SetDirectory(0); //->chi2 y IO - common
2396 fHisChi2ZIn1->SetDirectory(0); //->chi2 z inner - line
2397 fHisChi2ZOut1->SetDirectory(0); //->chi2 z inner - line
2398 fHisChi2ZIn2->SetDirectory(0); //->chi2 z inner - parabola
2399 fHisChi2ZOut2->SetDirectory(0); //->chi2 z inner - parabola
2400 fHisChi2ZIO1->SetDirectory(0); //->chi2 z IO - common
2401 //
2402 //
2403 fHisPy1vP0->SetDirectory(0); //-> delta y P0outer-P0inner - line
2404 fHisPy2vP0->SetDirectory(0); //-> delta y P0outer-P0inner - parabola
2405 fHisPy3vP0->SetDirectory(0); //-> delta y P0outer-P0inner - common parabola
2406 fHisPy1vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - line
2407 fHisPy2vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - parabola
2408 fHisPy3vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - common parabola
2409 fHisPy2vP2In->SetDirectory(0); //-> Curv P2inner - parabola
2410 fHisPy2vP2Out->SetDirectory(0); //-> Curv P2outer - parabola
2411 fHisPy3vP2IO->SetDirectory(0); //-> Curv P2outerinner - common parabola
2412 //
2413 //
2414 fHisPz1vP0->SetDirectory(0); //-> delta z P0outer-P0inner - line
2415 fHisPz2vP0->SetDirectory(0); //-> delta z P0outer-P0inner - parabola
2416 fHisPz3vP0->SetDirectory(0); //-> delta z P0outer-P0inner - common parabola
2417 fHisPz1vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - line
2418 fHisPz2vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - parabola
2419 fHisPz3vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - common parabola
2420 fHisPz2vP2In->SetDirectory(0); //-> Curv P2inner - parabola
2421 fHisPz2vP2Out->SetDirectory(0); //-> Curv P2outer - parabola
2422 fHisPz3vP2IO->SetDirectory(0); //-> Curv P2outerinner - common parabola
2423
2424
108953e9 2425 //
2426 //
2427 //
2428 for (Int_t id=0; id<336;id++){
2429 TH2F *profy = (TH2F*)fDeltaYres.UncheckedAt(id);
2430 TH2F *profz = (TH2F*)fDeltaZres.UncheckedAt(id);
2431 TH2F *profy2 = (TH2F*)fDeltaYres2.UncheckedAt(id);
2432 TH2F *profz2 = (TH2F*)fDeltaZres2.UncheckedAt(id);
2433 // TH2F *profy3 = (TH2F*)fDeltaYres3.UncheckedAt(id);
2434 //TH2F *profz3 = (TH2F*)fDeltaZres3.UncheckedAt(id);
2435 if (!profy){
2436 profy=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d -Linear",id),160,0,160,50,-0.5,0.5);
2437 profy->SetDirectory(0);
2438 fDeltaYres.AddAt(profy,id);
2439 profy2=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d -Parabolic",id),160,0,160,50,-0.5,0.5);
2440 profy2->SetDirectory(0);
2441 fDeltaYres2.AddAt(profy2,id);
2442 //profy3=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d- Parabolic2",id),160,0,160,100,-0.5,0.5);
2443 //profy3->SetDirectory(0);
2444 //fDeltaYres3.AddAt(profy3,id);
2445 }
2446 if (!profz){
2447 profz=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d Linear",id),160,0,160,50,-0.5,0.5);
2448 profz->SetDirectory(0);
2449 fDeltaZres.AddAt(profz,id);
2450 profz2=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d - Parabolic",id),160,0,160,50,-0.5,0.5);
2451 profz2->SetDirectory(0);
2452 fDeltaZres2.AddAt(profz2,id);
2453 //profz3=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d- Parabolic2",id),160,0,160,100,-0.5,0.5);
2454 //profz3->SetDirectory(0);
2455 //fDeltaZres3.AddAt(profz3,id);
2456 }
2457 }
2458 //
2459 //
2460 for (Int_t id=0; id<336;id++){
2461 TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
2462 TH1F * hisP3 = (TH1F*)fDeltaP3.At(id);
2463 TH1F * hisP4 = (TH1F*)fDeltaP4.At(id);
2464
2465 TH1F * hisdphi = (TH1F*)fDeltaPhi.At(id);
2466 TH1F * hisdphiP = (TH1F*)fDeltaPhiP.At(id);
2467 TH1F * hisSignal = (TH1F*)fSignals.At(id);
2468
2469 if (!hisdz){
2470 hisdz = new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
2471 hisdz->SetDirectory(0);
2472 fDeltaZ.AddAt(hisdz,id);
2473
2474 hisP3 = new TH1F(Form("hisPar3v%d",id),Form("hisPar3v%d",id),400,-0.06,0.06);
2475 hisP3->SetDirectory(0);
2476 fDeltaP3.AddAt(hisP3,id);
2477 //
2478 hisP4 = new TH1F(Form("hisPar4v%d",id),Form("hisPar4v%d",id),200,-0.06,0.06);
2479 hisP4->SetDirectory(0);
2480 fDeltaP4.AddAt(hisP4,id);
be113f6e 2481
108953e9 2482 //
2483 hisdphi = new TH1F(Form("hisdphi%d",id),Form("hisdphi%d",id),1000,-1,1);
2484 hisdphi->SetDirectory(0);
2485 fDeltaPhi.AddAt(hisdphi,id);
2486 //
2487 hisdphiP = new TH1F(Form("hisdphiP%d",id),Form("hisdphiP%d",id),1000,-0.01,0.01);
2488 hisdphiP->SetDirectory(0);
2489 fDeltaPhiP.AddAt(hisdphiP,id);
2490 hisSignal = new TH1F(Form("hisSignal%d",id),Form("hisSignal%d",id),100,0,300);
2491 hisSignal->SetDirectory(0);
2492 fSignals.AddAt(hisSignal,id);
2493 }
2494 }
be113f6e 2495}
2496
2497void AliTPCcalibLaser::MergeFitHistos(AliTPCcalibLaser * laser){
2498 //
2499 // Merge content of histograms
2500 //
2501 // Only first histogram is checked - all other should be the same
2502 if (!laser->fHisNclIn) return; // empty histograms
2503 if (!fHisNclIn) MakeFitHistos();
2504 //
2505
2506 fHisNclIn->Add(laser->fHisNclIn ); //->Number of clusters inner
2507 fHisNclOut->Add(laser->fHisNclOut ); //->Number of clusters outer
2508 fHisNclIO->Add(laser->fHisNclIO ); //->Number of cluster inner outer
2509 fHisLclIn->Add(laser->fHisLclIn ); //->Level arm inner
2510 fHisLclOut->Add(laser->fHisLclOut ); //->Level arm outer
2511 fHisLclIO->Add(laser->fHisLclIO ); //->Number of cluster inner outer
2512 fHisdEdx->Add(laser->fHisdEdx ); //->dedx
2513 fHisdZfit->Add(laser->fHisdZfit ); //->dedx
2514 //
2515 //
2516 fHisChi2YIn1->Add(laser->fHisChi2YIn1 ); //->chi2 y inner - line
2517 fHisChi2YOut1->Add(laser->fHisChi2YOut1 ); //->chi2 y inner - line
2518 fHisChi2YIn2->Add(laser->fHisChi2YIn2 ); //->chi2 y inner - parabola
2519 fHisChi2YOut2->Add(laser->fHisChi2YOut2 ); //->chi2 y inner - parabola
2520 fHisChi2YIO1->Add(laser->fHisChi2YIO1 ); //->chi2 y IO - common
2521 fHisChi2ZIn1->Add(laser->fHisChi2ZIn1 ); //->chi2 z inner - line
2522 fHisChi2ZOut1->Add(laser->fHisChi2ZOut1 ); //->chi2 z inner - line
2523 fHisChi2ZIn2->Add(laser->fHisChi2ZIn2 ); //->chi2 z inner - parabola
2524 fHisChi2ZOut2->Add(laser->fHisChi2ZOut2 ); //->chi2 z inner - parabola
2525 fHisChi2ZIO1->Add(laser->fHisChi2ZIO1 ); //->chi2 z IO - common
2526 //
2527 //
2528 fHisPy1vP0->Add(laser->fHisPy1vP0 ); //-> delta y P0outer-P0inner - line
2529 fHisPy2vP0->Add(laser->fHisPy2vP0 ); //-> delta y P0outer-P0inner - parabola
2530 fHisPy3vP0->Add(laser->fHisPy3vP0 ); //-> delta y P0outer-P0inner - common parabola
2531 fHisPy1vP1->Add(laser->fHisPy1vP1 ); //-> delta ky P1outer-P1inner - line
2532 fHisPy2vP1->Add(laser->fHisPy2vP1 ); //-> delta ky P1outer-P1inner - parabola
2533 fHisPy3vP1->Add(laser->fHisPy3vP1 ); //-> delta ky P1outer-P1inner - common parabola
2534 fHisPy2vP2In->Add(laser-> fHisPy2vP2In ); //-> Curv P2inner - parabola
2535 fHisPy2vP2Out->Add(laser->fHisPy2vP2Out ); //-> Curv P2outer - parabola
2536 fHisPy3vP2IO->Add(laser->fHisPy3vP2IO ); //-> Curv P2outerinner - common parabola
2537 //
2538 //
2539 fHisPz1vP0->Add(laser->fHisPz1vP0 ); //-> delta z P0outer-P0inner - line
2540 fHisPz2vP0->Add(laser->fHisPz2vP0 ); //-> delta z P0outer-P0inner - parabola
2541 fHisPz3vP0->Add(laser->fHisPz3vP0 ); //-> delta z P0outer-P0inner - common parabola
2542 fHisPz1vP1->Add(laser->fHisPz1vP1 ); //-> delta kz P1outer-P1inner - line
2543 fHisPz2vP1->Add(laser->fHisPz2vP1 ); //-> delta kz P1outer-P1inner - parabola
2544 fHisPz3vP1->Add(laser->fHisPz3vP1 ); //-> delta kz P1outer-P1inner - common parabola
2545 fHisPz2vP2In->Add(laser->fHisPz2vP2In ); //-> Curv P2inner - parabola
2546 fHisPz2vP2Out->Add(laser->fHisPz2vP2Out ); //-> Curv P2outer - parabola
2547 fHisPz3vP2IO->Add(laser->fHisPz3vP2IO ); //-> Curv P2outerinner - common parabola
2548 //
2549 //
2550 //
2551
2552
2553
2554
2555}
2556
2557
2558
2559
e5c59218 2560void AliTPCcalibLaser::DumpFitInfo(TTree * chainFit,Int_t id){
2561 //
2562 // Dump fit information - collect information from the streamers
2563 //
2564 /*
2565 TChain * chainFit=0;
2566 TChain * chainTrack=0;
2567 TChain * chain=0;
2568 //
2569 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
2570 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+");
2571 AliXRDPROOFtoolkit tool;
2572 chainTrack = tool.MakeChain("laser.txt","Track",0,10200);
2573 chainTrack->Lookup();
2574 chainTrack->SetProof(kTRUE);
be113f6e 2575 chainDrift = tool.MakeChain("laser.txt","driftv",0,10200);
2576 chainDrift->Lookup();
2577 chainDrift->SetProof(kTRUE);
2578
e5c59218 2579 chain = tool.MakeChain("laser.txt","Residuals",0,10200);
2580 chain->Lookup();
2581 chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
2582 chainFit->Lookup();
2583 chainFit->SetProof(kTRUE);
2584 chain->SetProof(kTRUE);
2585 AliTPCLaserTrack::LoadTracks();
2586 //AliTPCcalibLaser::DumpFitInfo(chainFit,0);
2587
2588 */
2589 //
2590 // Fit cuts
2591 //
2592 TCut cutP3("abs(Tr.fP[3])<0.1");
2593 TCut cutP4("abs(Tr.fP[4])<0.5");
2594 TCut cutPx = cutP3+cutP4;
2595 TCut cutChi2YOut("sqrt(chi2y2Out*dEdx)<5&&chi2y2Out>0");
2596 TCut cutChi2ZOut("sqrt(chi2z2Out*dEdx)<5&&chi2z2Out>0");
2597 TCut cutChi2YIn("sqrt(chi2y2In*dEdx)<5&&chi2y2In>0");
2598 TCut cutChi2ZIn("sqrt(chi2z2In*dEdx)<5&&chi2z2In>0");
2599 //
2600 TCut cutdEdx("sqrt(dEdx)>3");
2601 TCut cutDY("abs(yPol2In.fElements[2]*nclI*nclI/4.)<3");
2602 TCut cutN("nclO>20&&nclI>20");
be113f6e 2603 TCut cutA = cutChi2YOut+cutChi2ZOut+cutChi2YIn+cutChi2ZIn+cutN+cutdEdx+cutPx+"accept";
e5c59218 2604 //
2605 // Cluster cuts
2606 //
2607 TCut cutClY("abs(Cl[].fY-TrYpol2.fElements)<0.15");
2608 TCut cutClZ("abs(Cl[].fZ-TrZpol2.fElements)<0.15");
2609 TCut cutClX("abs(Cl[].fX)>10");
2610 TCut cutE("abs(Cl[].fY/Cl[].fX)<0.14");
2611 TCut cutSY("sqrt(Cl[].fSigmaY2)>0.05");
2612 TCut cutSZ("sqrt(Cl[].fSigmaZ2)>0.05");
2613 TCut cutQ("sqrt(Cl[].fMax)>4");
2614 TCut cutCl=cutClY+cutClZ+cutClX+cutE+cutSY+cutSZ+cutQ;
2615
2616
2617 TH1F * phisAl = 0;
2618 TH1F * phisAccept = 0;
2619 TH1F * phisOut = 0;
2620 TProfile * pdEdx = 0;
2621
2622 TProfile * pP0 = 0;
2623 TProfile * pP1 = 0;
2624 TProfile * pP2 = 0;
2625 TProfile * pP3 = 0;
2626 TProfile * pP4 = 0;
2627 //
2628 TProfile * pNclI = 0;
2629 TProfile * pNclO = 0;
2630 //
2631 TProfile * pchi2YIn =0;
2632 TProfile * pchi2ZIn =0;
2633 TProfile * pchi2YOut =0;
2634 TProfile * pchi2ZOut =0;
2635 TProfile * pchi2YInOut =0;
2636 TProfile * pchi2ZInOut =0;;
2637 // laser counters
2638 chainFit->Draw("LTr.fId>>hisAl(350,0,350)","LTr.fId<350");
2639 phisAl = (TH1F*)gROOT->FindObject("hisAl");
2640 chainFit->Draw("LTr.fId>>hisAccept(350,0,350)","LTr.fId<350"+cutA);
2641 phisAccept = (TH1F*)gROOT->FindObject("hisAccept");
2642 chainFit->Draw("LTr.fId>>hisOut(350,0,350)","LTr.fId<350"+!cutA);
2643 phisOut = (TH1F*)gROOT->FindObject("hisOut");
2644 //
2645 chainFit->Draw("sqrt(dEdx):LTr.fId>>hdEdx(350,0,350)","","prof");
2646 pdEdx = (TProfile*)gROOT->FindObject("hdEdx");
2647 // track param
2648 //
2649 chainFit->Draw("Tr.fP[0]:LTr.fId>>hP0(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2650 pP0 = (TProfile*)gROOT->FindObject("hP0");
2651 chainFit->Draw("Tr.fP[1]:LTr.fId>>hP1(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2652 pP1 = (TProfile*)gROOT->FindObject("hP1");
2653 chainFit->Draw("Tr.fP[2]:LTr.fId>>hP2(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2654 pP2 = (TProfile*)gROOT->FindObject("hP2");
2655 chainFit->Draw("Tr.fP[3]:LTr.fId>>hP3(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2656 pP3 = (TProfile*)gROOT->FindObject("hP3");
2657 chainFit->Draw("Tr.fP[4]:LTr.fId>>hP4(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2658 pP4 = (TProfile*)gROOT->FindObject("hP4");
2659 //
2660 chainFit->Draw("nclI:LTr.fId>>hNclI(350,0,350)","","prof");
2661 pNclI = (TProfile*)gROOT->FindObject("hNclI");
2662 chainFit->Draw("nclO:LTr.fId>>hNclO(350,0,350)","","prof");
2663 pNclO = (TProfile*)gROOT->FindObject("hNclO");
2664 //
2665 //
2666 chainFit->Draw("sqrt(chi2y2In):LTr.fId>>hChi2YIn(350,0,350)",cutA+"","prof");
2667 pchi2YIn = (TProfile*)gROOT->FindObject("hChi2YIn");
2668 chainFit->Draw("sqrt(chi2y2Out):LTr.fId>>hChi2YOut(350,0,350)",cutA+"","prof");
2669 pchi2YOut = (TProfile*)gROOT->FindObject("hChi2YOut");
2670 chainFit->Draw("sqrt(chi2yInOut):LTr.fId>>hChi2YInOut(350,0,350)",cutA+"","prof");
2671 pchi2YInOut = (TProfile*)gROOT->FindObject("hChi2YInOut");
2672 chainFit->Draw("sqrt(chi2z2In):LTr.fId>>hChi2ZIn(350,0,350)",cutA+"","prof");
2673 pchi2ZIn = (TProfile*)gROOT->FindObject("hChi2ZIn");
2674 chainFit->Draw("sqrt(chi2z2Out):LTr.fId>>hChi2ZOut(350,0,350)",cutA+"","prof");
2675 pchi2ZOut = (TProfile*)gROOT->FindObject("hChi2ZOut");
2676 chainFit->Draw("sqrt(chi2zInOut):LTr.fId>>hChi2ZInOut(350,0,350)",cutA+"","prof");
2677 pchi2ZInOut = (TProfile*)gROOT->FindObject("hChi2ZInOut");
2678 //
2679 // second derivatives
2680 //
2681 TH2F * phisPy2In = new TH2F("Py2Inner","Py2Inner",350,0,350,100,-0.001,0.001);
2682 chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>Py2Inner",cutA,"");
2683 TH2F * phisPy2Out = new TH2F("Py2Outer","Py2Outer",350,0,350,200,-0.0005,0.0005);
2684 chainFit->Draw("yPol2Out.fElements[2]:LTr.fId>>Py2Outer",cutA,"");
2685 TH2F * phisPy2InOut = new TH2F("Py2InOut","Py2InOut",350,0,350,200,-0.0005,0.0005);
2686 chainFit->Draw("yInOut.fElements[4]:LTr.fId>>Py2InOut",cutA,"");
2687 //
2688 phisPy2In->FitSlicesY();
2689 TH1D * phisPy2InEntries = (TH1D*)gROOT->FindObject("Py2Inner_0");
2690 TH1D * phisPy2InMean = (TH1D*)gROOT->FindObject("Py2Inner_1");
2691 TH1D * phisPy2InSigma = (TH1D*)gROOT->FindObject("Py2Inner_2");
2692 //
2693 phisPy2Out->FitSlicesY();
2694 TH1D * phisPy2OutEntries = (TH1D*)gROOT->FindObject("Py2Outer_0");
2695 TH1D * phisPy2OutMean = (TH1D*)gROOT->FindObject("Py2Outer_1");
2696 TH1D * phisPy2OutSigma = (TH1D*)gROOT->FindObject("Py2Outer_2");
2697 //
2698 phisPy2InOut->FitSlicesY();
2699 TH1D * phisPy2InOutEntries = (TH1D*)gROOT->FindObject("Py2InOut_0");
2700 TH1D * phisPy2InOutMean = (TH1D*)gROOT->FindObject("Py2InOut_1");
2701 TH1D * phisPy2InOutSigma = (TH1D*)gROOT->FindObject("Py2InOut_2");
2702 //
2703 TH2F * phisPz2In = new TH2F("Pz2Inner","Pz2Inner",350,0,350,100,-0.001,0.001);
2704 chainFit->Draw("zPol2In.fElements[2]:LTr.fId>>Pz2Inner",cutA,"");
2705 TH2F * phisPz2Out = new TH2F("Pz2Outer","Pz2Outer",350,0,350,200,-0.0005,0.0005);
2706 chainFit->Draw("zPol2Out.fElements[2]:LTr.fId>>Pz2Outer",cutA,"");
2707 TH2F * phisPz2InOut = new TH2F("Pz2InOut","Pz2InOut",350,0,350,200,-0.0005,0.0005);
2708 chainFit->Draw("zInOut.fElements[4]:LTr.fId>>Pz2InOut",cutA,"");
2709 //
2710 phisPz2In->FitSlicesY();
2711 TH1D * phisPz2InEntries = (TH1D*)gROOT->FindObject("Pz2Inner_0");
2712 TH1D * phisPz2InMean = (TH1D*)gROOT->FindObject("Pz2Inner_1");
2713 TH1D * phisPz2InSigma = (TH1D*)gROOT->FindObject("Pz2Inner_2");
2714 //
2715 phisPz2Out->FitSlicesY();
2716 TH1D * phisPz2OutEntries = (TH1D*)gROOT->FindObject("Pz2Outer_0");
2717 TH1D * phisPz2OutMean = (TH1D*)gROOT->FindObject("Pz2Outer_1");
2718 TH1D * phisPz2OutSigma = (TH1D*)gROOT->FindObject("Pz2Outer_2");
2719 //
2720 phisPz2InOut->FitSlicesY();
2721 TH1D * phisPz2InOutEntries = (TH1D*)gROOT->FindObject("Pz2InOut_0");
2722 TH1D * phisPz2InOutMean = (TH1D*)gROOT->FindObject("Pz2InOut_1");
2723 TH1D * phisPz2InOutSigma = (TH1D*)gROOT->FindObject("Pz2InOut_2");
2724 //
2725 //
2726 //
2727
2728
2729 {
2730 TTreeSRedirector *pcstream = new TTreeSRedirector("vscan.root");
2731 for (Int_t ilaser=0; ilaser<336; ilaser++){
2732 Float_t all=phisAl->GetBinContent(ilaser+1);
2733 Float_t accept=phisAccept->GetBinContent(ilaser+1);
2734 Float_t out=phisOut->GetBinContent(ilaser+1);
2735 Float_t sdedx = pdEdx->GetBinContent(ilaser+1);
2736 Float_t mP0 = pP0->GetBinContent(ilaser+1);
2737 Float_t mP1 = pP1->GetBinContent(ilaser+1);
2738 Float_t mP2 = pP2->GetBinContent(ilaser+1);
2739 Float_t mP3 = pP3->GetBinContent(ilaser+1);
2740 Float_t mP4 = pP4->GetBinContent(ilaser+1);
2741
2742
2743 Float_t nclI = pNclI->GetBinContent(ilaser+1);
2744 Float_t nclO = pNclO->GetBinContent(ilaser+1);
2745 //
2746 Float_t chi2YIn=pchi2YIn->GetBinContent(ilaser+1);
2747 Float_t chi2YOut=pchi2YOut->GetBinContent(ilaser+1);
2748 Float_t chi2YInOut=pchi2YInOut->GetBinContent(ilaser+1);
2749 Float_t chi2ZIn=pchi2ZIn->GetBinContent(ilaser+1);
2750 Float_t chi2ZOut=pchi2ZOut->GetBinContent(ilaser+1);
2751 Float_t chi2ZInOut=pchi2ZInOut->GetBinContent(ilaser+1);
2752 //
2753 Float_t entriesPy2In = phisPy2InEntries->GetBinContent(ilaser+1);
2754 Float_t meanPy2In = phisPy2InMean->GetBinContent(ilaser+1);
2755 Float_t sigmaPy2In = phisPy2InSigma->GetBinContent(ilaser+1);
2756 //
2757 Float_t entriesPy2Out = phisPy2OutEntries->GetBinContent(ilaser+1);
2758 Float_t meanPy2Out = phisPy2OutMean->GetBinContent(ilaser+1);
2759 Float_t sigmaPy2Out = phisPy2OutSigma->GetBinContent(ilaser+1);
2760 //
2761 Float_t entriesPy2InOut = phisPy2InOutEntries->GetBinContent(ilaser+1);
2762 Float_t meanPy2InOut = phisPy2InOutMean->GetBinContent(ilaser+1);
2763 Float_t sigmaPy2InOut = phisPy2InOutSigma->GetBinContent(ilaser+1);
2764 //
2765 Float_t entriesPz2In = phisPz2InEntries->GetBinContent(ilaser+1);
2766 Float_t meanPz2In = phisPz2InMean->GetBinContent(ilaser+1);
2767 Float_t sigmaPz2In = phisPz2InSigma->GetBinContent(ilaser+1);
2768 //
2769 Float_t entriesPz2Out = phisPz2OutEntries->GetBinContent(ilaser+1);
2770 Float_t meanPz2Out = phisPz2OutMean->GetBinContent(ilaser+1);
2771 Float_t sigmaPz2Out = phisPz2OutSigma->GetBinContent(ilaser+1);
2772 //
2773 Float_t entriesPz2InOut = phisPz2InOutEntries->GetBinContent(ilaser+1);
2774 Float_t meanPz2InOut = phisPz2InOutMean->GetBinContent(ilaser+1);
2775 Float_t sigmaPz2InOut = phisPz2InOutSigma->GetBinContent(ilaser+1);
2776
2777 AliTPCLaserTrack* ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(ilaser);
2778 (*pcstream)<<"Scan"<<
2779 "Run="<<id<<
2780 "LTr.="<<ltrp<<
2781 "all="<<all<<
2782 "accept="<<accept<<
2783 "out="<<out<<
2784 "sdedx="<<sdedx<<
2785 "mP0="<<mP0<<
2786 "mP1="<<mP1<<
2787 "mP2="<<mP2<<
2788 "mP3="<<mP3<<
2789 "mP4="<<mP4<<
2790 "nclI="<<nclI<<
2791 "nclO="<<nclO<<
2792 "chi2YIn="<<chi2YIn<<
2793 "chi2YOut="<<chi2YOut<<
2794 "chi2YInOut="<<chi2YInOut<<
2795 "chi2ZIn="<<chi2ZIn<<
2796 "chi2ZOut="<<chi2ZOut<<
2797 "chi2ZInOut="<<chi2ZInOut<<
2798 //
2799 "nPy2In="<<entriesPy2In<<
2800 "mPy2In="<<meanPy2In<<
2801 "sPy2In="<<sigmaPy2In<<
2802 //
2803 "nPy2Out="<<entriesPy2Out<<
2804 "mPy2Out="<<meanPy2Out<<
2805 "sPy2Out="<<sigmaPy2Out<<
2806 //
2807 "nPy2InOut="<<entriesPy2InOut<<
2808 "mPy2InOut="<<meanPy2InOut<<
2809 "sPy2InOut="<<sigmaPy2InOut<<
2810 //
2811 "nPz2In="<<entriesPz2In<<
2812 "mPz2In="<<meanPz2In<<
2813 "sPz2In="<<sigmaPz2In<<
2814 //
2815 "nPz2Out="<<entriesPz2Out<<
2816 "mPz2Out="<<meanPz2Out<<
2817 "sPz2Out="<<sigmaPz2Out<<
2818 //
2819 "nPz2InOut="<<entriesPz2InOut<<
2820 "mPz2InOut="<<meanPz2InOut<<
2821 "sPz2InOut="<<sigmaPz2InOut<<
2822 "\n";
2823 }
2824
2825 delete pcstream;
2826 }
2827 /*
2828 TFile f("vscan.root");
2829 */
2830
2831 /*
2832 pad binning effect
2833 chain->Draw("Cl[].fPad-int(Cl[].fPad)",cutA+cutCl+"Cl[].fZ>0&&Cl[].fPad>1","",10000);
2834 //
2835 chain->Draw("Cl[].fY-TrYpol1.fElements:Cl[].fPad-int(Cl[].fPad)",cutA+cutCl+"Cl[].fZ>0&&Cl[].fPad>1","prof",10000);
2836 //
2837
2838chain->Draw("Cl.fY-TrYpol1.fElements-AliTPCClusterParam::SPosCorrection(0,1,Cl[].fPad,Cl[].fTimeBin,Cl[].fZ,Cl[].fSigmaY2,Cl[].fSigmaZ2,Cl[].fMax):Cl[].fPad-int(Cl[].fPad)",cutA+cutCl+"Cl[].fZ>0&&Cl[].fPad>1","prof",10000);
2839
2840
2841chain->Draw("Cl[].fZ-TrZpol1.fElements-0*AliTPCClusterParam::SPosCorrection(1,1,Cl[].fPad,Cl[].fTimeBin,Cl[].fZ,Cl[].fSigmaY2,Cl[].fSigmaZ2,Cl[].fMax):Cl[].fTimeBin-int(Cl[].fTimeBin)",cutA+cutCl+"Cl[].fZ>0","prof",10000)
2842
2843 */
2844
2845
2846
2847
2848
2849 /*
2850 // check edge effects
2851 chain->Draw("Cl.fY-TrYpol1.fElements:Cl.fY/Cl.fX",""+cutA+cutCl,"prof",10000)
2852 //
2853 chain->Draw("Cl.fY-TrYpol2.fElements:Cl.fPad-int(Cl.fPad)","Cl.fZ>0"+cutA+cutCl+cutE,"prof",100000)
2854
2855 chain->Draw("Cl.fY-TrYpol2.fElements:Cl.fPad-int(Cl.fPad)","Cl.fX>80&&Cl.fZ>0&&Cl.fDetector>35"+cutA+cutCl+cutE,"prof",100000)
2856
2857
2858
2859 chainFit->Draw("yInOut.fElements[4]:LTr.fP[2]","LTr.fP[1]<0"+cutA,"prof",1000);
2860 chainFit->Draw("yPol2In.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&&LTr.fP[1]<0"+cutA+cutD,"prof")
2861
2862*/
2863
2864
2865
2866
2867
2868 /*
2869 Edge y effect
2870
2871 dedge = sign(Cl.fY)*(Cl.fX*tan(pi/18)-abs(Cl.fY))
2872
2873
2874 chain->Draw("sign(Cl.fY)*(Cl.fY-TrYpol1.fElements):pi/18-abs(Cl.fY/Cl.fX)>>hisYdphi(100,0,0.03)",""+cutA+cutCl,"prof",10000)
2875
2876 chain->Draw("sign(Cl.fY)*(Cl.fY-TrYpol1.fElements):Cl.fX*(pi/18-abs(Cl.fY/Cl.fX))>>hisYdy(100,0,5)",""+cutA+cutCl,"prof",10000)
2877
2878
2879
2880
2881
2882 chain->Draw("sign(Cl.fY)*(Cl.fY-TrYpol1.fElements):Cl.fX*(pi/18-abs(Cl.fY/Cl.fX))>>hisYdyIROC(100,0,5)","Cl.fDetector<36"+cutA+cutCl,"prof",100000)
2883
2884 chain->Draw("sign(Cl.fY)*(Cl.fY-TrYpol1.fElements):Cl.fX*(pi/18-abs(Cl.fY/Cl.fX))>>hisYdyOROC(100,0,5)","Cl.fDetector>36"+cutA+cutCl,"prof",100000)
2885
2886
2887
2888 chain->Draw("Cl.fY-TrYpol1.fElements:sign(Cl.fY)*(Cl.fX*tan(pi/18)-abs(Cl.fY))>>his(100,-5,5)",""+cutA+cutCl,"prof",100000)
2889
2890 chain->Draw("Cl.fY-TrYpol1.fElements:sign(Cl.fY)*(Cl.fX*tan(pi/18)-abs(Cl.fY))>>hisdyInner(100,-5,5)","Cl.fDetector<36"+cutA+cutCl,"prof",100000)
2891
2892
2893
2894*/
2895
2896
2897/*
2898
2899chainFit->Draw("yPol2Out.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&&LTr.fP[1]<0"+cutA+cutDY,"prof")
2900
2901chainFit->Draw("yPol2In.fElements[2]*64*64/4.:LTr.fP[2]","nclI>20&&LTr.fP[1]<0"+cutA+cutDY,"prof")
2902
2903
2904
2905chainFit->Draw("LTr.fId","nclI>10",100000)
2906
2907chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>his(350,0,350,100,-0.002,0.002)","nclI>20","")
2908
2909chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>hisPy2In0(350,0,350,100,-0.002,0.002)","nclI>20","");
2910
2911TH2 * phisPy2In = (TH2*) gROOT->FindObject("hisPy2In0")
2912
2913*/
2914
2915}
2916
2917
2918
c03e3250 2919
2920
263d466a 2921
c03e3250 2922/*
2923 gSystem->Load("libSTAT.so")
2924 TStatToolkit toolkit;
2925 Double_t chi2;
2926 TVectorD fitParam;
2927 TMatrixD covMatrix;
2928 Int_t npoints;
e5c59218 2929
ae69f16f 2930 TCut cutA("entries>2&&pphi2<3&&abs(gphiP1-pphiP0)<0.003&&abs(gz1)<6");
c03e3250 2931
2932
2933TString fstring="";
1fd56785 2934//
2935fstring+="(abs(LTr.fP[1]/250)^3-1)*bz++"; //1
2936fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*LTr.fP[2]++"; //2
2937fstring+="(abs(LTr.fP[1]/250)^1-1)*bz++"; //3
2938fstring+="(abs(LTr.fP[1]/250)-1)*bz*LTr.fP[2]++"; //4
2939//
2940fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*sin(atan2(lx1,lx0))++" //5
2941fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*sin(atan2(lx1,lx0))*LTr.fP[2]++" //6
2942fstring+="(abs(LTr.fP[1]/250)-1)*bz*sin(atan2(lx1,lx0))++" //7
2943fstring+="(abs(LTr.fP[1]/250)-1)*bz*sin(atan2(lx1,lx0))*LTr.fP[2]++" //8
2944//
2945fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*cos(atan2(lx1,lx0))++" //9
2946fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*cos(atan2(lx1,lx0))*LTr.fP[2]++" //10
2947fstring+="(abs(LTr.fP[1]/250)-1)*bz*cos(atan2(lx1,lx0))++" //11
2948fstring+="(abs(LTr.fP[1]/250)-1)*bz*cos(atan2(lx1,lx0))*LTr.fP[2]++" //12
c5595838 2949
c5595838 2950
c5595838 2951
c5595838 2952
1fd56785 2953 TString *strq0 = toolkit.FitPlane(treeT,"gphi1-pphi0",fstring->Data(), "fSide==1"+cutA, chi2,npoints,fitParam,covMatrix);
c03e3250 2954
1fd56785 2955 treeT->SetAlias("fit",strq0->Data());
2956
c03e3250 2957
1fd56785 2958 TString *strqP = toolkit.FitPlane(treeT,"1000*(gphiP1-pphiP0)",fstring->Data(), "fSide==1"+cutA, chi2,npoints,fitParam,covMatrix);
c5595838 2959
1fd56785 2960 treeT->SetAlias("fitP",strqP->Data());
c5595838 2961
2962
ae69f16f 2963 TString *strqDrift = toolkit.FitPlane(treeT,"gz1","LTr.fP[1]++(1-2*(fSide==1))++lx1", cutA, chi2,npoints,fitParam,covMatrix);
2964 treeT->SetAlias("fitD",strqDrift->Data());
c5595838 2965
c03e3250 2966
ae69f16f 2967treeT->Draw("fit:LTr.fP[1]","abs(bz+0.4)<0.05"+cutA,"");
2968{
2969for (Int_t i=0; i<6;i++){
2970treeT->SetLineColor(i+2);
2971treeT->SetMarkerSize(1);
2972treeT->SetMarkerStyle(22+i);
2973treeT->SetMarkerColor(i+2);
c03e3250 2974
ae69f16f 2975treeT->Draw("fit:LTr.fP[1]",Form("abs(bz+0.4)<0.05&fRod==%d",i)+cutA,"same");
2976}
2977}
c03e3250 2978 */
68ff0583 2979
2980
2981
2982/*
2983 TTree * tree = (TTree*)f.Get("FitModels");
2984
2985 TEventList listLFit0("listLFit0","listLFit0");
2986 TEventList listLFit1("listLFit1","listLFit1");
68ff0583 2987 tree->Draw(">>listLFit0","seed.fdEdx<200&&seed.fdEdx>40");
2988 tree->SetEventList(&listLFit0);
2989
2990
95a0e09b 2991
2992
2993 gSystem->Load("libSTAT.so")
2994 TStatToolkit toolkit;
2995 Double_t chi2;
2996 TVectorD fitParam;
2997 TMatrixD covMatrix;
2998 Int_t npoints;
2999
3000 chain->SetAlias("dp","((Cl.fPad-int(Cl.fPad))*pi)");
3001 chain->SetAlias("dt","((Cl.fTimeBin-int(Cl.fTimeBin))*pi)");
3002
3003
3004 TString fstring="";
3005 fstring+="cos(dp)++";
3006 fstring+="sin(dp)++";
3007 fstring+="cos(dt)++";
3008 fstring+="sin(dt)++";
3009
3010 TString *str = toolkit.FitPlane(chain,"Cl.fZ-TrZInOut.fElements",fstring->Data(), "Cl.fDetector>35", chi2,npoints,fitParam,covMatrix,-1,0,200);
3011
3012
e5c59218 3013
3014*/
3015
3016
3017
3018/*
3019 Edge effects
3020 //
3021 //
3022 //
3023 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
3024 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
3025 AliXRDPROOFtoolkit tool;
3026 TChain * chainTrack = tool.MakeChain("laser.txt","Track",0,10200);
3027 chainTrack->Lookup();
3028 chainTrack->SetProof(kTRUE);
3029
3030 TChain * chain = tool.MakeChain("laser.txt","Residuals",0,10200);
3031 chain->Lookup();
3032 TChain * chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
3033 chainFit->Lookup();
3034 chainFit->SetProof(kTRUE);
3035 chain->SetProof(kTRUE);
3036 //
3037 // Fit cuts
3038 //
3039 TCut cutChi2YOut("sqrt(chi2y2Out*dEdx)<10");
3040 TCut cutChi2ZOut("sqrt(chi2z2Out*dEdx)<10");
3041 TCut cutChi2YIn("sqrt(chi2y2In*dEdx)<10");
3042 TCut cutChi2ZIn("sqrt(chi2z2In*dEdx)<10");
3043 //
3044 TCut cutdEdx("sqrt(dEdx)<30&&sqrt(dEdx)>3");
3045 TCut cutDY("abs(yPol2In.fElements[2]*nclO*nclO/4.)<3")
3046 TCut cutN("nclO>20&&nclI>20");
3047 TCut cutA = cutChi2YOut+cutChi2ZOut+cutChi2YIn+cutChi2ZIn+cutN+cutdEdx;
3048 //
3049 // Cluster cuts
3050 //
3051 TCut cutClY("abs(Cl.fY-TrYpol2.fElements)<0.2");
3052 TCut cutClZ("abs(Cl.fZ-TrZpol2.fElements)<0.4");
3053 TCut cutClX("abs(Cl.fX)>10");
3054 TCut cutE("abs(Cl.fY/Cl.fX)<0.14");
3055 TCut cutCl=cutClY+cutClZ+cutClX;
3056
3057
3058 // check edge effects
3059 chain->Draw("Cl.fY-TrYpol1.fElements:Cl.fY/Cl.fX",""+cutA+cutCl,"prof",10000)
3060 //
3061 chain->Draw("Cl.fY-TrYpol2.fElements:Cl.fPad-int(Cl.fPad)","Cl.fZ>0"+cutA+cutCl+cutE,"prof",100000)
3062
3063 chain->Draw("Cl.fY-TrYpol2.fElements:Cl.fPad-int(Cl.fPad)","Cl.fX>80&&Cl.fZ>0&&Cl.fDetector>35"+cutA+cutCl+cutE,"prof",100000)
3064
3065
3066
3067 chainFit->Draw("yInOut.fElements[4]:LTr.fP[2]","LTr.fP[1]<0"+cutA,"prof",1000);
3068 chainFit->Draw("yPol2In.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&&LTr.fP[1]<0"+cutA+cutD,"prof")
3069
68ff0583 3070*/
e5c59218 3071