1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 // 1. The laser track is associated with the mirror
21 // see function FindMirror
23 // 2. The laser track is accepted for the analysis under certain condition
24 // (see function Accpet laser)
26 // 3. The drift velocity and jitter is calculated event by event
27 // (see function drift velocity)
29 // 4. The tracks are refitted at different sectors
33 // 4.c) parabola with common P2 for inner and outer
35 // To make laser scan the user interaction neccessary
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");
43 laser->DumpMeanInfo(-0,0)
44 TFile fmean("laserMean.root")
46 // laser track clasification;
48 TCut cutT("cutT","abs(Tr.fP[3])<0.06");
49 TCut cutPt("cutPt","abs(Tr.fP[4])<0.1");
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;
53 TChain * chainTrL = tool.MakeChain("laser.txt","Track",0,10200);
60 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
61 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
62 AliXRDPROOFtoolkit tool;
63 TChain * chain = tool.MakeChain("laserScan.txt","Mean",0,10200);
65 AliTPCcalibLaser::DumpScanInfo(chain)
66 TFile fscan("laserScan.root")
67 TTree * treeT = (TTree*)fscan.Get("Mean")
71 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
72 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
73 AliXRDPROOFtoolkit tool;
74 TChain * chainDrift = tool.MakeChain("laser.txt","driftv",0,10200);
77 TChain * chain = tool.MakeChain("laser.txt","Residuals",0,10200);
79 TChain * chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
86 #include "TLinearFitter.h"
87 #include "AliTPCcalibLaser.h"
88 #include "AliExternalTrackParam.h"
89 #include "AliESDEvent.h"
90 #include "AliESDfriend.h"
91 #include "AliESDtrack.h"
92 #include "AliTPCTracklet.h"
97 #include "TTreeStream.h"
100 #include "TGraphErrors.h"
101 #include "AliTPCclusterMI.h"
102 #include "AliTPCseed.h"
103 #include "AliTracker.h"
105 #include "TClonesArray.h"
111 #include "TStatToolkit.h"
115 #include "TTreeStream.h"
118 #include "AliTPCLaserTrack.h"
119 #include "AliTPCcalibDB.h"
120 #include "AliTPCParam.h"
121 #include "TTimeStamp.h"
122 #include "AliDCSSensorArray.h"
123 #include "AliDCSSensor.h"
127 ClassImp(AliTPCcalibLaser)
129 AliTPCcalibLaser::AliTPCcalibLaser():
136 fTracksEsdParam(336),
146 fHisNclIn(0), //->Number of clusters inner
147 fHisNclOut(0), //->Number of clusters outer
148 fHisNclIO(0), //->Number of cluster inner outer
149 fHisLclIn(0), //->Level arm inner
150 fHisLclOut(0), //->Level arm outer
151 fHisLclIO(0), //->Number of cluster inner outer
152 fHisdEdx(0), //->dEdx histo
153 fHisdZfit(0), //->distance to the mirror after linear fit
156 fHisChi2YIn1(0), //->chi2 y inner - line
157 fHisChi2YOut1(0), //->chi2 y inner - line
158 fHisChi2YIn2(0), //->chi2 y inner - parabola
159 fHisChi2YOut2(0), //->chi2 y inner - parabola
160 fHisChi2YIO1(0), //->chi2 y IO - common
161 fHisChi2ZIn1(0), //->chi2 z inner - line
162 fHisChi2ZOut1(0), //->chi2 z inner - line
163 fHisChi2ZIn2(0), //->chi2 z inner - parabola
164 fHisChi2ZOut2(0), //->chi2 z inner - parabola
165 fHisChi2ZIO1(0), //->chi2 z IO - common
168 fHisPy1vP0(0), //-> delta y P0outer-P0inner - line
169 fHisPy2vP0(0), //-> delta y P0outer-P0inner - parabola
170 fHisPy3vP0(0), //-> delta y P0outer-P0inner - common parabola
171 fHisPy1vP1(0), //-> delta ky P1outer-P1inner - line
172 fHisPy2vP1(0), //-> delta ky P1outer-P1inner - parabola
173 fHisPy3vP1(0), //-> delta ky P1outer-P1inner - common parabola
174 fHisPy2vP2In(0), //-> Curv P2inner - parabola
175 fHisPy2vP2Out(0), //-> Curv P2outer - parabola
176 fHisPy3vP2IO(0), //-> Curv P2outerinner - common parabola
179 fHisPz1vP0(0), //-> delta z P0outer-P0inner - line
180 fHisPz2vP0(0), //-> delta z P0outer-P0inner - parabola
181 fHisPz3vP0(0), //-> delta z P0outer-P0inner - common parabola
182 fHisPz1vP1(0), //-> delta kz P1outer-P1inner - line
183 fHisPz2vP1(0), //-> delta kz P1outer-P1inner - parabola
184 fHisPz3vP1(0), //-> delta kz P1outer-P1inner - common parabola
185 fHisPz2vP2In(0), //-> Curv P2inner - parabola
186 fHisPz2vP2Out(0), //-> Curv P2outer - parabola
187 fHisPz3vP2IO(0), //-> Curv P2outerinner - common parabola
189 fDeltaYres(336), //->2D histo of residuals
190 fDeltaZres(336), //->2D histo fo residuals
191 fDeltaYres2(336), //->2D histo of residuals
192 fDeltaZres2(336), //->2D histo fo residuals
193 fDeltaYresAbs(336), //->2D histo of residuals
194 fDeltaZresAbs(336), //->2D histo of residuals
195 //fDeltaYres3(336), //->2D histo of residuals
196 //fDeltaZres3(336), //->2D histo fo residuals
197 fFitAside(new TVectorD(5)),
198 fFitCside(new TVectorD(5)),
199 fFitACside(new TVectorD(6)),
204 fBeamSectorOuter(336),
205 fBeamSectorInner(336),
206 fBeamOffsetYOuter(336),
207 fBeamSlopeYOuter(336),
208 fBeamOffsetYInner(336),
209 fBeamSlopeYInner(336),
210 fBeamOffsetZOuter(336),
211 fBeamSlopeZOuter(336),
212 fBeamOffsetZInner(336),
213 fBeamSlopeZInner(336),
214 fInverseSlopeZ(kTRUE)
219 fTracksEsdParam.SetOwner(kTRUE);
222 AliTPCcalibLaser::AliTPCcalibLaser(const Text_t *name, const Text_t *title, Bool_t full):
229 fTracksEsdParam(336),
233 fDeltaZ(336), // array of histograms of delta z for each track
234 fDeltaP3(336), // array of histograms of delta z for each track
235 fDeltaP4(336), // array of histograms of P3 for each track
236 fDeltaPhi(336), // array of histograms of P4 for each track
237 fDeltaPhiP(336), // array of histograms of delta z for each track
238 fSignals(336), // array of dedx signals
241 fHisNclIn(0), //->Number of clusters inner
242 fHisNclOut(0), //->Number of clusters outer
243 fHisNclIO(0), //->Number of cluster inner outer
244 fHisLclIn(0), //->Level arm inner
245 fHisLclOut(0), //->Level arm outer
246 fHisLclIO(0), //->Number of cluster inner outer
247 fHisdEdx(0), //->dEdx histo
248 fHisdZfit(0), //->distance to the mirror after linear fit
251 fHisChi2YIn1(0), //->chi2 y inner - line
252 fHisChi2YOut1(0), //->chi2 y inner - line
253 fHisChi2YIn2(0), //->chi2 y inner - parabola
254 fHisChi2YOut2(0), //->chi2 y inner - parabola
255 fHisChi2YIO1(0), //->chi2 y IO - common
256 fHisChi2ZIn1(0), //->chi2 z inner - line
257 fHisChi2ZOut1(0), //->chi2 z inner - line
258 fHisChi2ZIn2(0), //->chi2 z inner - parabola
259 fHisChi2ZOut2(0), //->chi2 z inner - parabola
260 fHisChi2ZIO1(0), //->chi2 z IO - common
263 fHisPy1vP0(0), //-> delta y P0outer-P0inner - line
264 fHisPy2vP0(0), //-> delta y P0outer-P0inner - parabola
265 fHisPy3vP0(0), //-> delta y P0outer-P0inner - common parabola
266 fHisPy1vP1(0), //-> delta ky P1outer-P1inner - line
267 fHisPy2vP1(0), //-> delta ky P1outer-P1inner - parabola
268 fHisPy3vP1(0), //-> delta ky P1outer-P1inner - common parabola
269 fHisPy2vP2In(0), //-> Curv P2inner - parabola
270 fHisPy2vP2Out(0), //-> Curv P2outer - parabola
271 fHisPy3vP2IO(0), //-> Curv P2outerinner - common parabola
274 fHisPz1vP0(0), //-> delta z P0outer-P0inner - line
275 fHisPz2vP0(0), //-> delta z P0outer-P0inner - parabola
276 fHisPz3vP0(0), //-> delta z P0outer-P0inner - common parabola
277 fHisPz1vP1(0), //-> delta kz P1outer-P1inner - line
278 fHisPz2vP1(0), //-> delta kz P1outer-P1inner - parabola
279 fHisPz3vP1(0), //-> delta kz P1outer-P1inner - common parabola
280 fHisPz2vP2In(0), //-> Curv P2inner - parabola
281 fHisPz2vP2Out(0), //-> Curv P2outer - parabola
282 fHisPz3vP2IO(0), //-> Curv P2outerinner - common parabola
294 fFitAside(new TVectorD(5)), // drift fit - A side
295 fFitCside(new TVectorD(5)), // drift fit - C- side
296 fFitACside(new TVectorD(6)), // drift fit - AC- side
297 fEdgeXcuts(3), // cuts in local x direction; used in the refit of the laser tracks
298 fEdgeYcuts(3), // cuts in local y direction; used in the refit of the laser tracks
299 fNClCuts(5), // cuts on the number of clusters per tracklet; used in the refit of the laser tracks
300 fNcuts(0), // number of cuts
301 fBeamSectorOuter(336),
302 fBeamSectorInner(336),
303 fBeamOffsetYOuter(336),
304 fBeamSlopeYOuter(336),
305 fBeamOffsetYInner(336),
306 fBeamSlopeYInner(336),
307 fBeamOffsetZOuter(336),
308 fBeamSlopeZOuter(336),
309 fBeamOffsetZInner(336),
310 fBeamSlopeZInner(336),
311 fInverseSlopeZ(kTRUE)
318 fTracksEsdParam.SetOwner(kTRUE);
321 AliTPCcalibLaser::AliTPCcalibLaser(const AliTPCcalibLaser& calibLaser):
322 AliTPCcalibBase(calibLaser),
328 fTracksEsdParam(336),
330 fFullCalib(calibLaser.fFullCalib),
332 fDeltaZ(calibLaser.fDeltaZ), // array of histograms of delta z for each track
333 fDeltaP3(((calibLaser.fDeltaP3))), // array of histograms of delta z for each track
334 fDeltaP4(((calibLaser.fDeltaP4))), // array of histograms of P3 for each track
335 fDeltaPhi(((calibLaser.fDeltaPhi))), // array of histograms of P4 for each track
336 fDeltaPhiP(((calibLaser.fDeltaPhiP))), // array of histograms of delta z for each track
337 fSignals(((calibLaser.fSignals))), // array of dedx signals
340 fHisNclIn(new TH2F(*(calibLaser.fHisNclIn))), //->Number of clusters inner
341 fHisNclOut(new TH2F(*(calibLaser.fHisNclOut))), //->Number of clusters outer
342 fHisNclIO(new TH2F(*(calibLaser.fHisNclIO))), //->Number of cluster inner outer
343 fHisLclIn(new TH2F(*(calibLaser.fHisLclIn))), //->Level arm inner
344 fHisLclOut(new TH2F(*(calibLaser.fHisLclOut))), //->Level arm outer
345 fHisLclIO(new TH2F(*(calibLaser.fHisLclIO))), //->Number of cluster inner outer
346 fHisdEdx(new TH2F(*(calibLaser.fHisdEdx))), //
347 fHisdZfit(new TH2F(*(calibLaser.fHisdZfit))), //->distance to the mirror after linear fit
350 fHisChi2YIn1(new TH2F(*(calibLaser.fHisChi2YIn1))), //->chi2 y inner - line
351 fHisChi2YOut1(new TH2F(*(calibLaser.fHisChi2YOut1))), //->chi2 y inner - line
352 fHisChi2YIn2(new TH2F(*(calibLaser.fHisChi2YIn2))), //->chi2 y inner - parabola
353 fHisChi2YOut2(new TH2F(*(calibLaser.fHisChi2YOut2))), //->chi2 y inner - parabola
354 fHisChi2YIO1(new TH2F(*(calibLaser.fHisChi2YIO1))), //->chi2 y IO - common
355 fHisChi2ZIn1(new TH2F(*(calibLaser.fHisChi2ZIn1))), //->chi2 z inner - line
356 fHisChi2ZOut1(new TH2F(*(calibLaser.fHisChi2ZOut1))), //->chi2 z inner - line
357 fHisChi2ZIn2(new TH2F(*(calibLaser.fHisChi2ZIn2))), //->chi2 z inner - parabola
358 fHisChi2ZOut2(new TH2F(*(calibLaser.fHisChi2ZOut2))), //->chi2 z inner - parabola
359 fHisChi2ZIO1(new TH2F(*(calibLaser.fHisChi2ZIO1))), //->chi2 z IO - common
362 fHisPy1vP0(new TH2F(*(calibLaser.fHisPy1vP0))), //-> delta y P0outer-P0inner - line
363 fHisPy2vP0(new TH2F(*(calibLaser.fHisPy2vP0))), //-> delta y P0outer-P0inner - parabola
364 fHisPy3vP0(new TH2F(*(calibLaser.fHisPy3vP0))), //-> delta y P0outer-P0inner - common parabola
365 fHisPy1vP1(new TH2F(*(calibLaser.fHisPy1vP1))), //-> delta ky P1outer-P1inner - line
366 fHisPy2vP1(new TH2F(*(calibLaser.fHisPy2vP1))), //-> delta ky P1outer-P1inner - parabola
367 fHisPy3vP1(new TH2F(*(calibLaser.fHisPy3vP1))), //-> delta ky P1outer-P1inner - common parabola
368 fHisPy2vP2In(new TH2F(*(calibLaser.fHisPy2vP2In))), //-> Curv P2inner - parabola
369 fHisPy2vP2Out(new TH2F(*(calibLaser.fHisPy2vP2Out))), //-> Curv P2outer - parabola
370 fHisPy3vP2IO(new TH2F(*(calibLaser.fHisPy3vP2IO))), //-> Curv P2outerinner - common parabola
373 fHisPz1vP0(new TH2F(*(calibLaser.fHisPz1vP0))), //-> delta z P0outer-P0inner - line
374 fHisPz2vP0(new TH2F(*(calibLaser.fHisPz2vP0))), //-> delta z P0outer-P0inner - parabola
375 fHisPz3vP0(new TH2F(*(calibLaser.fHisPz3vP0))), //-> delta z P0outer-P0inner - common parabola
376 fHisPz1vP1(new TH2F(*(calibLaser. fHisPz1vP1))), //-> delta kz P1outer-P1inner - line
377 fHisPz2vP1(new TH2F(*(calibLaser.fHisPz2vP1))), //-> delta kz P1outer-P1inner - parabola
378 fHisPz3vP1(new TH2F(*(calibLaser.fHisPz3vP1))), //-> delta kz P1outer-P1inner - common parabola
379 fHisPz2vP2In(new TH2F(*(calibLaser.fHisPz2vP2In))), //-> Curv P2inner - parabola
380 fHisPz2vP2Out(new TH2F(*(calibLaser. fHisPz2vP2Out))), //-> Curv P2outer - parabola
381 fHisPz3vP2IO(new TH2F(*(calibLaser.fHisPz3vP2IO))), //-> Curv P2outerinner - common parabola
384 fDeltaYres(((calibLaser.fDeltaYres))),
385 fDeltaZres(((calibLaser.fDeltaZres))),
386 fDeltaYres2(((calibLaser.fDeltaYres))),
387 fDeltaZres2(((calibLaser.fDeltaZres))),
388 fDeltaYresAbs(((calibLaser.fDeltaYresAbs))),
389 fDeltaZresAbs(((calibLaser.fDeltaZresAbs))),
390 // fDeltaYres3(((calibLaser.fDeltaYres))),
391 //fDeltaZres3(((calibLaser.fDeltaZres))),
392 fFitAside(new TVectorD(5)), // drift fit - A side
393 fFitCside(new TVectorD(5)), // drift fit - C- side
394 fFitACside(new TVectorD(6)), // drift fit - C- side
395 fEdgeXcuts(3), // cuts in local x direction; used in the refit of the laser tracks
396 fEdgeYcuts(3), // cuts in local y direction; used in the refit of the laser tracks
397 fNClCuts(5), // cuts on the number of clusters per tracklet; used in the refit of the laser tracks
398 fNcuts(0), // number of cuts
399 fBeamSectorOuter(336),
400 fBeamSectorInner(336),
401 fBeamOffsetYOuter(336),
402 fBeamSlopeYOuter(336),
403 fBeamOffsetYInner(336),
404 fBeamSlopeYInner(336),
405 fBeamOffsetZOuter(336),
406 fBeamSlopeZOuter(336),
407 fBeamOffsetZInner(336),
408 fBeamSlopeZInner(336),
409 fInverseSlopeZ(calibLaser.fInverseSlopeZ)
419 AliTPCcalibLaser & AliTPCcalibLaser::operator=(const AliTPCcalibLaser& calibLaser){
421 // assgnment operator
423 if (this != &calibLaser) {
424 new (this) AliTPCcalibLaser(calibLaser);
433 AliTPCcalibLaser::~AliTPCcalibLaser() {
438 delete fHisNclIn; //->Number of clusters inner
439 delete fHisNclOut; //->Number of clusters outer
440 delete fHisNclIO; //->Number of cluster inner outer
441 delete fHisLclIn; //->Level arm inner
442 delete fHisLclOut; //->Level arm outer
443 delete fHisLclIO; //->Number of cluster inner outer
448 delete fHisChi2YIn1; //->chi2 y inner - line
449 delete fHisChi2YOut1; //->chi2 y inner - line
450 delete fHisChi2YIn2; //->chi2 y inner - parabola
451 delete fHisChi2YOut2; //->chi2 y inner - parabola
452 delete fHisChi2YIO1; //->chi2 y IO - common
453 delete fHisChi2ZIn1; //->chi2 z inner - line
454 delete fHisChi2ZOut1; //->chi2 z inner - line
455 delete fHisChi2ZIn2; //->chi2 z inner - parabola
456 delete fHisChi2ZOut2; //->chi2 z inner - parabola
457 delete fHisChi2ZIO1; //->chi2 z IO - common
460 delete fHisPy1vP0; //-> delta y P0outer-P0inner - line
461 delete fHisPy2vP0; //-> delta y P0outer-P0inner - parabola
462 delete fHisPy3vP0; //-> delta y P0outer-P0inner - common parabola
463 delete fHisPy1vP1; //-> delta ky P1outer-P1inner - line
464 delete fHisPy2vP1; //-> delta ky P1outer-P1inner - parabola
465 delete fHisPy3vP1; //-> delta ky P1outer-P1inner - common parabola
466 delete fHisPy2vP2In; //-> Curv P2inner - parabola
467 delete fHisPy2vP2Out; //-> Curv P2outer - parabola
468 delete fHisPy3vP2IO; //-> Curv P2outerinner - common parabola
471 delete fHisPz1vP0; //-> delta z P0outer-P0inner - line
472 delete fHisPz2vP0; //-> delta z P0outer-P0inner - parabola
473 delete fHisPz3vP0; //-> delta z P0outer-P0inner - common parabola
474 delete fHisPz1vP1; //-> delta kz P1outer-P1inner - line
475 delete fHisPz2vP1; //-> delta kz P1outer-P1inner - parabola
476 delete fHisPz3vP1; //-> delta kz P1outer-P1inner - common parabola
477 delete fHisPz2vP2In; //-> Curv P2inner - parabola
478 delete fHisPz2vP2Out; //-> Curv P2outer - parabola
479 delete fHisPz3vP2IO; //-> Curv P2outerinner - common parabola
484 fDeltaZ.SetOwner(); //-> array of histograms of delta z for each track
485 fDeltaP3.SetOwner(); //-> array of histograms of P3 for each track
486 fDeltaP4.SetOwner(); //-> array of histograms of P4 for each track
487 fDeltaPhi.SetOwner(); //-> array of histograms of delta z for each track
488 fDeltaPhiP.SetOwner(); //-> array of histograms of delta z for each track
489 fSignals.SetOwner(); //->Array of dedx signals
491 fDeltaZ.Delete(); //-> array of histograms of delta z for each track
492 fDeltaP3.Delete(); //-> array of histograms of P3 for each track
493 fDeltaP4.Delete(); //-> array of histograms of P4 for each track
494 fDeltaPhi.Delete(); //-> array of histograms of delta z for each track
495 fDeltaPhiP.Delete(); //-> array of histograms of delta z for each track
496 fSignals.Delete(); //->Array of dedx signals
498 fDeltaYres.SetOwner();
500 fDeltaZres.SetOwner();
502 fDeltaYres2.SetOwner();
503 fDeltaYres2.Delete();
504 fDeltaZres2.SetOwner();
505 fDeltaZres2.Delete();
507 fDeltaYresAbs.SetOwner();
508 fDeltaYresAbs.Delete();
509 fDeltaZresAbs.SetOwner();
510 fDeltaZresAbs.Delete();
515 void AliTPCcalibLaser::Process(AliESDEvent * event) {
518 // Loop over tracks and call Process function
525 fESDfriend=static_cast<AliESDfriend*>(fESD->FindListObject("AliESDfriend"));
529 if (fESD->GetNumberOfTracks()<kMinTracks) return; //not enough tracks
530 AliDebug(4,Form("Event number in current file: %d",event->GetEventNumberInFile()));
533 fTracksEsdParam.Delete();
534 for (Int_t id=0; id<336;id++) {
536 fClusterCounter[id]=0;
540 Int_t n=fESD->GetNumberOfTracks();
542 for (Int_t i=0;i<n;++i) {
543 AliESDfriendTrack *friendTrack=fESDfriend->GetTrack(i);
544 if (!friendTrack) continue;
545 AliESDtrack *track=fESD->GetTrack(i);
546 TObject *calibObject=0;
548 for (Int_t j=0;(calibObject=friendTrack->GetCalibObject(j));++j)
549 if ((seed=dynamic_cast<AliTPCseed*>(calibObject)))
551 if (track&&seed &&TMath::Abs(track->Pt()) >1 ) {
553 Int_t id = FindMirror(track,seed);
559 if (counter<kMinTracks) return;
562 if (!fFullCalib) return;
563 static Bool_t init=kFALSE;
565 init = kTRUE; // way around for PROOF - to be investigated
569 for (Int_t id=0; id<336; id++){
571 if (!fTracksEsdParam.At(id)) continue;
572 if (fClusterSatur[id]>0.3) continue; // tracks in saturation
574 if ( AcceptLaser(id) && fFitZ[id]<0.5){
582 void AliTPCcalibLaser::MakeDistHisto(Int_t id){
586 // for (Int_t id=0; id<336; id++){
589 if (!fTracksEsdParam.At(id)) return;
590 if (!AcceptLaser(id)) return;
593 TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
594 if (!hisdz) MakeFitHistos();
595 hisdz = (TH1F*)fDeltaZ.At(id);
596 TH1F * hisP3 = (TH1F*)fDeltaP3.At(id);
597 TH1F * hisP4 = (TH1F*)fDeltaP4.At(id);
598 TH1F * hisdphi = (TH1F*)fDeltaPhi.At(id);
599 TH1F * hisdphiP = (TH1F*)fDeltaPhiP.At(id);
600 TH1F * hisSignal = (TH1F*)fSignals.At(id);
603 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
604 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
605 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
614 param->GetPxPyPz(pxyz);
616 ltrp->GetPxPyPz(lpxyz);
618 Float_t dz = param->GetZ()-ltrp->GetZ();
619 Float_t dphi = (TMath::ATan2(xyz[1],xyz[0])- TMath::ATan2(lxyz[1],lxyz[0]))*254.;
620 Float_t dphiP = param->GetParameter()[2]-ltrp->GetParameter()[2];
621 if (hisdz) hisdz->Fill(dz);
622 if (hisP3) hisP3->Fill(param->GetParameter()[3]);
623 if (hisP4) hisP4->Fill(param->GetParameter()[4]);
624 if (hisdphi) hisdphi->Fill(dphi);
625 if (hisdphiP) hisdphiP->Fill(dphiP);
626 if (hisSignal) hisSignal->Fill(TMath::Sqrt(TMath::Abs(track->GetTPCsignal())));
630 void AliTPCcalibLaser::FitDriftV(){
632 // Fit corrections to the drift velocity - linear approximation in the z and global y
633 //The transfromatiom from the drift time to the z position done in AliTPCTracnsform class
638 z = s* (z0 - vd*(t-t0))
642 vd - nominal drift velocity
643 zs - miscalibrated position
645 zs = s*(z0 - vd*(1+vr)*(t-(t0+dt))
646 vr - relative change of the drift velocity
651 zs ~ z - s*vr*(z0-s*z)+s*dzt
652 --------------------------------
653 1. Correction function vr constant:
656 dz = zs-z = -s*vr *(z0-s*z)+s*dzt
657 dzs/dl = dz/dl +s*s*vr*dz/dl
661 const Float_t kZCut = 240; // remove the closest laser beam
662 const Float_t kSaturCut = 0.05; // remove saturated lasers - cut on fraction of saturated
663 const Float_t kDistCut = 3; // distance sigma cut
664 const Float_t kDistCutAbs = 0.25;
665 const Float_t kMinClusters = 60; // minimal amount of the clusters
666 const Float_t kMinSignal = 16; // minimal mean height of the signal
667 const Float_t kChi2Cut = 0.1; // chi2 cut to accept drift fit
668 static TLinearFitter fdriftA(3,"hyp2");
669 static TLinearFitter fdriftC(3,"hyp2");
670 static TLinearFitter fdriftAC(4,"hyp3");
671 TVectorD fitA(3),fitC(3),fitAC(4);
673 AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
674 AliTPCParam * tpcparam = calib->GetParameters();
677 for (Int_t id=0; id<336; id++) fFitZ[id]=0;
687 for (Int_t iter=0; iter<3; iter++){
688 fdriftA.ClearPoints();
689 fdriftC.ClearPoints();
690 fdriftAC.ClearPoints();
692 for (Int_t id=0; id<336; id++){
693 if (!fTracksEsdParam.At(id)) continue;
694 if (!AcceptLaser(id)) continue;
695 if ( fClusterSatur[id]>kSaturCut) continue;
696 if ( fClusterCounter[id]<kMinClusters) continue;
697 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
698 if (track->GetTPCsignal()<kMinSignal) continue;
699 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
700 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
707 param->GetPxPyPz(pxyz);
709 ltrp->GetPxPyPz(lpxyz);
710 if (TMath::Abs(lxyz[2])>kZCut) continue;
711 Float_t sz = (ltrp->GetSide()==0) ? TMath::Sqrt(chi2A): TMath::Sqrt(chi2C);
712 if (npointsAC>0) sz =TMath::Sqrt(chi2AC);
713 if (TMath::Abs(fFitZ[id])>sz*kDistCut) continue;
714 if (iter>0 && TMath::Abs(fFitZ[id])>kDistCutAbs) continue;
717 Double_t zlength = tpcparam->GetZLength(0);
718 Double_t ldrift = zlength-TMath::Abs(lxyz[2]);
719 Double_t mdrift = zlength-TMath::Abs(xyz[2]);
720 Double_t xxx[2] = {ldrift,lxyz[1]*ldrift/(zlength*250.)};
721 if (ltrp->GetSide()==0){
722 fdriftA.AddPoint(xxx,mdrift,1);
724 fdriftC.AddPoint(xxx,mdrift,1);
726 Double_t xxx2[3] = {ltrp->GetSide(), ldrift,lxyz[1]*ldrift/(zlength*250.)};
727 fdriftAC.AddPoint(xxx2,mdrift,1);
730 if (fdriftA.GetNpoints()>10){
733 if (iter==0) fdriftA.EvalRobust(0.7);
734 else fdriftA.EvalRobust(0.8);
735 fdriftA.GetParameters(fitA);
736 npointsA= fdriftA.GetNpoints();
737 chi2A = fdriftA.GetChisquare()/fdriftA.GetNpoints();
738 if (chi2A<kChi2Cut ||(*fFitAside)[0]==0 ) {
739 if (fFitAside->GetNoElements()<5) fFitAside->ResizeTo(5);
740 (*fFitAside)[0] = fitA[0];
741 (*fFitAside)[1] = fitA[1];
742 (*fFitAside)[2] = fitA[2];
743 (*fFitAside)[3] = fdriftA.GetNpoints();
744 (*fFitAside)[4] = chi2A;
747 if (fdriftC.GetNpoints()>10){
749 if (iter==0) fdriftC.EvalRobust(0.7);
750 else fdriftC.EvalRobust(0.8);
752 fdriftC.GetParameters(fitC);
753 npointsC= fdriftC.GetNpoints();
754 chi2C = fdriftC.GetChisquare()/fdriftC.GetNpoints();
755 if (chi2C<kChi2Cut||(*fFitCside)[0]==0) {
756 if (fFitCside->GetNoElements()<5) fFitCside->ResizeTo(5);
757 (*fFitCside)[0] = fitC[0];
758 (*fFitCside)[1] = fitC[1];
759 (*fFitCside)[2] = fitC[2];
760 (*fFitCside)[3] = fdriftC.GetNpoints();
761 (*fFitCside)[4] = chi2C;
765 if (fdriftAC.GetNpoints()>10&&fdriftC.GetNpoints()>10&&fdriftA.GetNpoints()>10){
767 if (iter==0) fdriftAC.EvalRobust(0.7);
768 else fdriftAC.EvalRobust(0.8);
770 fdriftAC.GetParameters(fitAC);
771 npointsAC= fdriftAC.GetNpoints();
772 chi2AC = fdriftAC.GetChisquare()/fdriftAC.GetNpoints();
773 if (chi2AC<kChi2Cut||(*fFitACside)[0]==0) (*fFitACside) = fitAC;
776 for (Int_t id=0; id<336; id++){
777 if (!fTracksEsdParam.At(id)) continue;
779 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
780 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
786 param->GetPxPyPz(pxyz);
788 ltrp->GetPxPyPz(lpxyz);
789 Double_t zlength = tpcparam->GetZLength(0);
790 Double_t ldrift = zlength-TMath::Abs(lxyz[2]);
791 Double_t mdrift = zlength-TMath::Abs(xyz[2]);
794 if (ltrp->GetSide()==0){
795 fz = (fitA)[0]+(fitA)[1]*ldrift+(fitA)[2]*lxyz[1]*ldrift/(zlength*250.);
797 fz = (fitC)[0]+(fitC)[1]*ldrift+(fitC)[2]*lxyz[1]*ldrift/(zlength*250.);
800 fz = (fitAC)[0]+(fitAC)[1]*ltrp->GetSide()+(fitAC)[2]*ldrift+(fitAC)[3]*lxyz[1]*ldrift/(zlength*250.);
805 TTreeSRedirector *cstream = GetDebugStreamer();
806 TTimeStamp tstamp(fTime);
807 Float_t valuePressure0 = AliTPCcalibDB::GetPressure(tstamp,fRun,0);
808 Float_t valuePressure1 = AliTPCcalibDB::GetPressure(tstamp,fRun,1);
809 Double_t ptrelative0 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,0);
810 Double_t ptrelative1 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,1);
811 Double_t temp0 = AliTPCcalibDB::GetTemperature(tstamp,fRun,0);
812 Double_t temp1 = AliTPCcalibDB::GetTemperature(tstamp,fRun,1);
813 TVectorD vecGoofie(20);
814 AliDCSSensorArray* goofieArray = AliTPCcalibDB::Instance()->GetGoofieSensors(fRun);
816 for (Int_t isensor=0; isensor<goofieArray->NumSensors();isensor++){
817 AliDCSSensor *gsensor = goofieArray->GetSensor(isensor);
818 if (gsensor) vecGoofie[isensor]=gsensor->GetValue(tstamp);
822 (*cstream)<<"driftv"<<
823 "run="<<fRun<< // run number
824 "event="<<fEvent<< // event number
825 "time="<<fTime<< // time stamp of event
826 "trigger="<<fTrigger<< // trigger
827 "mag="<<fMagF<< // magnetic field
828 // Environment values
829 "press0="<<valuePressure0<<
830 "press1="<<valuePressure1<<
831 "pt0="<<ptrelative0<<
832 "pt1="<<ptrelative1<<
835 "vecGoofie.="<<&vecGoofie<<
839 "driftA.="<<fFitAside<<
840 "driftC.="<<fFitCside<<
841 "driftAC.="<<fFitACside<<
854 Float_t AliTPCcalibLaser::GetDistance(AliExternalTrackParam *param, AliTPCLaserTrack *ltrp){
856 // get distance between mirror and laser track
867 dist+=TMath::Abs((TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*param->GetX());
870 // apply drift correction if already exist
873 if (ltrp->GetSide()==0){
874 if ((*fFitAside)[1]>0.) dz = ((*fFitAside)[0]+(*fFitAside)[1]*lxyz[2]+(*fFitAside)[2]*lxyz[1])-xyz[2];
876 if ((*fFitCside)[1]>0.) dz = ((*fFitCside)[0]+(*fFitCside)[1]*lxyz[2]+(*fFitCside)[2]*lxyz[1])-xyz[2];
878 if (TMath::Abs(dz)>3*(TMath::Abs(lxyz[2]-xyz[2])+1)) dz= TMath::Abs(lxyz[2]-xyz[2]);
879 dist+=TMath::Abs(dz);
881 // phi dist - divergence on 50 cm
883 dist = TMath::Abs((param->GetParameter()[2]-ltrp->GetParameter()[2])*50);
888 Bool_t AliTPCcalibLaser::AcceptLaser(Int_t id){
893 TCut cutP0("cutP0","abs((atan2(x1,x0)-atan2(lx1,lx0))*254)<1.5");
894 TCut cutP1("cutP1","abs(LTr.fP[1]-Tr.fP[1])<30");
895 TCut cutP2("cutP2","abs(LTr.fP[2]-Tr.fP[2])<0.03");
896 TCut cutP3("cutP3","abs(Tr.fP[3])<0.05");
897 TCut cutP4("cutPt","abs(Tr.fP[4])<0.1");
899 TCut cutA = cutP0+cutP1+cutP2+cutP3+cutP4;
901 AliExternalTrackParam *param =(AliExternalTrackParam*)fTracksEsdParam.At(id);
902 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
903 //AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
908 if (TMath::Abs((TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*254)>1.5) return kFALSE; //cut y- P0
909 if (TMath::Abs(param->GetParameter()[1]-ltrp->GetParameter()[1])>30) return kFALSE; // cutZ -P1
910 if (TMath::Abs(param->GetParameter()[2]-ltrp->GetParameter()[2])>0.03) return kFALSE; // cut -P2
911 if (TMath::Abs(param->GetParameter()[3])>0.05) return kFALSE; // cut Tl -P3
912 if (TMath::Abs(param->GetParameter()[4])>0.1) return kFALSE; // cut Pt -P4
919 Int_t AliTPCcalibLaser::FindMirror(AliESDtrack *track, AliTPCseed *seed){
921 // Find corresponding mirror
922 // add the corresponding tracks
925 Float_t kRadius0 = 252;
926 Float_t kRadius = 253.4;
928 if (!track->GetOuterParam()) return -1;
929 AliExternalTrackParam param(*(track->GetOuterParam()));
930 AliTracker::PropagateTrackTo(¶m,kRadius0,0.10566,3,kTRUE);
931 AliTracker::PropagateTrackTo(¶m,kRadius,0.10566,0.1,kTRUE);
932 AliTPCLaserTrack ltr;
933 AliTPCLaserTrack *ltrp=0x0;
934 // AliTPCLaserTrack *ltrpjw=0x0;
936 Int_t id = AliTPCLaserTrack::IdentifyTrack(¶m);
937 // Int_t idjw = AliTPCLaserTrack::IdentifyTrackJW(¶m);
938 //AliDebug(4,Form("Identified Track: %03d (%03d)",id,idjw));
940 if (id!=-1 && (AliTPCLaserTrack::GetTracks()->UncheckedAt(id)))
941 ltrp=(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
951 Float_t counterSatur=0;
952 for (Int_t irow=158;irow>-1;--irow) {
953 AliTPCclusterMI *c=seed->GetClusterPointer(irow);
955 Double_t pedgeY = c->GetX()*TMath::DegToRad()*(10)-TMath::Abs(c->GetY());
956 Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
957 if (pedgeY<3) continue;
958 if (pedgeX<3) continue;
960 if (c->GetMax()>900) counterSatur++;
962 counterSatur/=(countercl+1);
964 if (counterSatur>fClusterSatur[id]) fClusterSatur[id]=counterSatur;
967 Float_t radius=TMath::Abs(ltrp->GetX());
968 AliTracker::PropagateTrackTo(¶m,radius,0.10566,0.01,kTRUE);
969 param.Rotate(ltrp->GetAlpha());
971 if (!fTracksMirror.At(id)) fTracksMirror.AddAt(ltrp,id);
974 // choose closer track
976 AliExternalTrackParam * param0 = (AliExternalTrackParam *)fTracksEsdParam.At(id);
978 Float_t dist0=GetDistance(param0,ltrp);
979 Float_t dist1=GetDistance(¶m,ltrp);
980 if (dist0<dist1) accept=kFALSE;
984 fClusterCounter[id]=countercl;
985 fTracksEsdParam.AddAt(param.Clone(),id);
986 fTracksEsd.AddAt(track,id);
987 fTracksTPC.AddAt(seed,id);
994 void AliTPCcalibLaser::DumpLaser(Int_t id) {
996 // Dump Laser info to the tree
998 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
999 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
1000 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
1009 param->GetPxPyPz(pxyz);
1011 ltrp->GetPxPyPz(lpxyz);
1012 Float_t dist3D = GetDistance(param,ltrp);
1013 Float_t dist0 = (TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*param->GetX();
1014 Float_t distphi = (param->GetParameter()[2]-ltrp->GetParameter()[2])*50;
1017 if (fStreamLevel>0){
1018 TTreeSRedirector *cstream = GetDebugStreamer();
1019 Int_t time = fESD->GetTimeStamp();
1020 Bool_t accept = AcceptLaser(id);
1022 (*cstream)<<"Track"<<
1024 "run="<<fRun<< // run number
1025 "event="<<fEvent<< // event number
1026 "time="<<fTime<< // time stamp of event
1027 "trigger="<<fTrigger<< // trigger
1028 "mag="<<fMagF<< // magnetic field
1032 "driftA.="<<fFitAside<<
1033 "driftC.="<<fFitCside<<
1037 "distphi="<<distphi<<
1040 "counter="<<fCounter[id]<<
1041 "clcounter="<<fClusterCounter[id]<<
1042 "satur="<<fClusterSatur[id]<<
1066 void AliTPCcalibLaser::RefitLaserJW(Int_t id){
1068 // Refit the track with different tracklet models:
1069 // 1. Per ROC using the kalman filter, different edge cuts
1070 // 2. Per ROC linear in y and z
1071 // 3. Per ROC quadratic in y and z
1072 // 4. Per track offset for each sector, linear for each sector, common quadratic
1073 // store x, y, z information for all models and the cluster to calculate the residuals
1076 // The clusters which do not fulfill given criteria are skipped
1078 // Cluters removed from fit
1079 // 1. Extended shape > kShapeCut
1080 // 2. In saturation Max > kMax
1081 // 3. Distance to edge < cutEdge
1083 // Clusters not used for the calibration:
1085 // 1. Extended shape > kShapeCut
1086 // 2. In saturation Max > kMax
1089 AliTPCseed *track = (AliTPCseed*)fTracksTPC.At(id);
1090 AliExternalTrackParam *extparam=(AliExternalTrackParam*)fTracksEsdParam.At(id);
1091 AliTPCLaserTrack *ltrp = (AliTPCLaserTrack*)fTracksMirror.At(id);
1093 AliTPCclusterMI dummyCl;
1096 Int_t kMaxTracklets=2;
1097 Float_t kShapeCut = 1.3;
1098 Float_t kRatioCut = 2.;
1100 Float_t kMax = 900.;
1103 //=============================================//
1104 // Linear Fitters for the Different Approaches //
1105 //=============================================//
1106 //linear fit model in y and z; inner - outer sector, combined with offset
1107 static TLinearFitter fy1I(2,"hyp1");
1108 static TLinearFitter fy1O(2,"hyp1");
1109 static TLinearFitter fz1I(2,"hyp1");
1110 static TLinearFitter fz1O(2,"hyp1");
1111 static TLinearFitter fy1IO(3,"hyp2");
1112 static TLinearFitter fz1IO(3,"hyp2");
1113 //quadratic fit model in y and z; inner - sector
1114 static TLinearFitter fy2I(3,"hyp2");
1115 static TLinearFitter fy2O(3,"hyp2");
1116 static TLinearFitter fz2I(3,"hyp2");
1117 static TLinearFitter fz2O(3,"hyp2");
1118 //common quadratic fit for IROC and OROC in y and z
1119 static TLinearFitter fy4(5,"hyp4");
1120 static TLinearFitter fz4(5,"hyp4");
1130 //=============================//
1131 // Loop over all Tracklet Cuts //
1132 //=============================//
1133 for (Int_t icut=0; icut<fNcuts; icut++){
1134 Float_t xinMin = 2500, xinMax=-90;
1135 Float_t xoutMin=2500, xoutMax=-90;
1136 Float_t msigmaYIn=0;
1137 Float_t msigmaYOut=0;
1138 Float_t mqratioIn=0;
1139 Float_t mqratioOut=0;
1142 AliDebug(4,Form("Processing cut %d for track with ID %d",icut,id));
1144 Double_t edgeCutX = fEdgeXcuts[icut];
1145 Double_t edgeCutY = fEdgeYcuts[icut];
1146 Int_t nclCut = (Int_t)fNClCuts[icut];
1147 //=========================//
1148 // Parameters to calculate //
1149 //=========================//
1150 //fit parameter inner, outer tracklet and combined fit
1151 TVectorD vecy1resInner(2),vecz1resInner(2); //pol1 fit parameters inner
1152 TVectorD vecy2resInner(3),vecz2resInner(3); //pol2 fit parameters inner
1154 TVectorD vecy1resOuter(2),vecz1resOuter(2); //pol1 fit parameters outer
1155 TVectorD vecy2resOuter(3),vecz2resOuter(3); //pol2 fit parameters outer
1156 TVectorD vecy4res(5),vecz4res(5);
1157 TVectorD vecy1resIO(3),vecz1resIO(3);
1158 // cluster and track positions for each row - used for residuals
1159 TVectorD vecgX(159); // global X
1160 TVectorD vecgY(159); // global Y
1161 TVectorD vecgZ(159); // global Z
1163 TVectorD vecX(159); // x is the same for all (row center)
1164 TVectorD vecYkalman(159); // y from kalman fit
1165 TVectorD vecZkalman(159); // z from kalman fit
1166 TVectorD vecY1(159); // y from pol1 fit per ROC
1167 TVectorD vecZ1(159); // z from pol1 fit per ROC
1168 TVectorD vecY1IO(159); // y from pol1 fit per ROC
1169 TVectorD vecZ1IO(159); // z from pol1 fit per ROC
1170 TVectorD vecY2(159); // y from pol2 fit per ROC
1171 TVectorD vecZ2(159); // z from pol2 fit per ROC
1172 TVectorD vecY4(159); // y from sector fit
1173 TVectorD vecZ4(159); // z from sector fit
1174 TVectorD vecClY(159); // y cluster position
1175 TVectorD vecClZ(159); // z cluster position
1176 TVectorD vecSec(159); // sector for each row
1177 TVectorD isReject(159); // flag - cluster to be rejected
1179 Double_t chi2I1z=0; // chi2 of pol1 fit in z (inner)
1180 Double_t chi2I1y=0; // chi2 of pol1 fit in y (inner)
1181 Double_t chi2O1z=0; // chi2 of pol1 fit in z (outer)
1182 Double_t chi2O1y=0; // chi2 of pol1 fit in y (outer)
1183 Double_t chi2IO1z=0; // chi2 of pol1 fit in z (outer)
1184 Double_t chi2IO1y=0; // chi2 of pol1 fit in y (outer)
1185 Double_t chi2I2z=0; // chi2 of pol2 fit in z (inner)
1186 Double_t chi2I2y=0; // chi2 of pol2 fit in y (inner)
1187 Double_t chi2O2z=0; // chi2 of pol2 fit in z (outer)
1188 Double_t chi2O2y=0; // chi2 of pol2 fit in y (outer)
1189 Double_t chi2IOz=0; // chi2 of hyp4 fit in z (inner+outer)
1190 Double_t chi2IOy=0; // chi2 of hyp4 fit in y (inner+outer)
1192 Int_t innerSector = -1; // number of inner sector
1193 Int_t outerSector = -1; // number of outer sector
1194 Int_t nclI=0; // number of clusters (inner)
1195 Int_t nclO=0; // number of clusters (outer)
1196 //=================================================//
1197 // Perform the Kalman Fit using the Tracklet Class //
1198 //=================================================//
1199 AliTPCTracklet::SetEdgeCut(edgeCutX,edgeCutY);
1200 TObjArray tracklets=
1201 AliTPCTracklet::CreateTracklets(track,AliTPCTracklet::kKalman,
1202 kFALSE,nclCut,kMaxTracklets);
1203 // tracklet pointers
1204 AliTPCTracklet *trInner = (AliTPCTracklet*)tracklets.At(0);
1205 AliTPCTracklet *trOuter = (AliTPCTracklet*)tracklets.At(1);
1206 AliTPCTracklet *tr=0x0;
1207 AliTPCTracklet dummy;
1208 //continue if we didn't find a tracklet
1209 if ( !trInner && !trOuter ) continue;
1210 //================================================================================//
1211 // Swap Inner and Outer if necessary (inner sector is definde by smaller local x) //
1212 //================================================================================//
1213 if ( trInner && trOuter ){
1214 if ( !trInner->GetInner() || !trOuter->GetInner() ) continue;
1215 if ( trInner->GetInner()->GetX() > trOuter->GetInner()->GetX() ){
1219 AliDebug(5,Form("Swapped Sectors: %02d (%f) <-> %02d (%f)", trOuter->GetSector(), trOuter->GetInner()->GetX(), trInner->GetSector(), trInner->GetInner()->GetX()));
1223 if ( !trInner->GetInner() ) continue;
1225 if ( trInner->GetSector()>35 ){
1230 if ( !trOuter->GetInner() ) continue;
1232 if ( trOuter->GetSector()<36 ){
1238 innerSector = trInner->GetSector();
1239 if ( innerSector>=0 ) AliDebug(5,Form("Found inner Sector %02d at X %.2f", innerSector, trInner->GetInner()->GetX()));
1240 outerSector = trOuter->GetSector();
1241 if ( outerSector>=0 ) AliDebug(5,Form("Found outer Sector %02d at X %.2f", outerSector, trOuter->GetInner()->GetX()));
1243 // array of clusters
1244 TClonesArray arrCl("AliTPCclusterMI",159);
1245 arrCl.ExpandCreateFast(159);
1246 //=======================================//
1247 // fill fitters with cluster information //
1248 //=======================================//
1249 AliDebug(3,"Filing Cluster Information");
1254 for (Int_t irow=158;irow>-1;--irow) {
1255 AliTPCclusterMI *c=track->GetClusterPointer(irow);
1256 AliTPCclusterMI &cl = (AliTPCclusterMI&) (*arrCl[irow]);
1261 Float_t meanY=0, sumY=0;
1262 for (Int_t drow=-1;drow<=1;drow++) {
1263 if (irow+drow<0) continue;
1264 if (irow+drow>158) continue;
1265 AliTPCclusterMI *ccurrent=track->GetClusterPointer(irow);
1266 if (!ccurrent) continue;
1267 Int_t roc = static_cast<Int_t>(ccurrent->GetDetector());
1268 if ( roc!=innerSector && roc!=outerSector ) continue;
1269 if (ccurrent->GetX()<10) continue;
1270 if (ccurrent->GetY()==0) continue;
1271 meanY+=ccurrent->GetY();
1274 if (sumY>0) meanY/=sumY;
1279 Double_t pedgeY = c->GetX()*TMath::Tan(TMath::DegToRad()*(10))-TMath::Abs(meanY);
1280 Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
1283 Int_t roc = static_cast<Int_t>(c->GetDetector());
1284 if ( roc!=innerSector && roc!=outerSector ) continue;
1286 //store clusters in clones array
1289 if (c->GetMax()<4) continue; // noise cluster?
1290 if (TMath::Abs(c->GetY())<0.0001) continue; // noise cluster?
1292 vecX[irow] = c->GetX();
1293 vecClY[irow] = c->GetY();
1294 vecClZ[irow] = c->GetZ();
1297 // c->GetGlobalXYZ(gxyz);
1298 // vecgX[irow] = gxyz[0];
1299 // vecgY[irow] = gxyz[1];
1300 // vecgZ[irow] = gxyz[2];
1302 Double_t x = vecX[irow]-133.4; //reference is between IROC and OROC
1303 Double_t y = vecClY[irow];
1304 Double_t z = vecClZ[irow];
1306 Double_t x2[2]={x,x*x}; //linear and parabolic parameters
1307 Double_t x4[4]={0,0,0,0}; //hyp4 parameters
1308 Double_t xIO[2]={0,x}; //common linear + offset IROC-OROC
1309 if ( roc == innerSector ) {
1310 x4[0]=1; //offset inner - outer sector
1311 x4[1]=x; //slope parameter inner sector
1314 x4[2]=x; //slope parameter outer sector
1316 x4[3]=x*x; //common parabolic shape
1317 if (pedgeX < fEdgeXcuts[icut]) continue;
1318 if (pedgeY < fEdgeYcuts[icut]) continue;
1319 if (c->GetMax()>900) continue; // cluster in saturation
1321 if ( roc==innerSector ){
1322 fy1I.AddPoint(x2,y);
1323 fz1I.AddPoint(x2,z);
1324 fy2I.AddPoint(x2,y);
1325 fz2I.AddPoint(x2,z);
1327 if (c->GetX()<xinMin) xinMin=c->GetX();
1328 if (c->GetX()>xinMax) xinMax=c->GetX();
1330 msigmaYIn +=TMath::Sqrt(c->GetSigmaY2());
1331 mqratioIn +=c->GetMax()/c->GetQ();
1334 if ( roc==outerSector ){
1335 fy1O.AddPoint(x2,y);
1336 fz1O.AddPoint(x2,z);
1337 fy2O.AddPoint(x2,y);
1338 fz2O.AddPoint(x2,z);
1340 if (c->GetX()<xoutMin) xoutMin=c->GetX();
1341 if (c->GetX()>xoutMax) xoutMax=c->GetX();
1342 msigmaYOut +=TMath::Sqrt(c->GetSigmaY2());
1343 mqratioOut +=c->GetMax()/c->GetQ();
1348 fy1IO.AddPoint(xIO,y);
1349 fz1IO.AddPoint(xIO,z);
1359 //======================================//
1360 // Evaluate and retrieve fit parameters //
1361 //======================================//
1362 AliDebug(5,Form("Evaluating fits with inner (outer) Sec: %02d (%02d)",innerSector,outerSector));
1364 if ( (innerSector>-1) && (fy1I.GetNpoints()>0) ){
1369 fy1I.GetParameters(vecy1resInner);
1370 fz1I.GetParameters(vecz1resInner);
1371 fy2I.GetParameters(vecy2resInner);
1372 fz2I.GetParameters(vecz2resInner);
1373 chi2I1y=fy1I.GetChisquare()/(fy1I.GetNpoints()-2);
1374 chi2I1z=fz1I.GetChisquare()/(fz1I.GetNpoints()-2);
1375 chi2I2y=fy2I.GetChisquare()/(fy2I.GetNpoints()-3);
1376 chi2I2z=fz2I.GetChisquare()/(fz2I.GetNpoints()-3);
1379 if ( (outerSector>-1) && (fy1O.GetNpoints()>0) ){
1384 fy1O.GetParameters(vecy1resOuter);
1385 fz1O.GetParameters(vecz1resOuter);
1386 fy2O.GetParameters(vecy2resOuter);
1387 fz2O.GetParameters(vecz2resOuter);
1388 chi2O1y=fy1O.GetChisquare()/(fy1O.GetNpoints()-2);
1389 chi2O1z=fz1O.GetChisquare()/(fz1O.GetNpoints()-2);
1390 chi2O2y=fy2O.GetChisquare()/(fy2O.GetNpoints()-3);
1391 chi2O2z=fz2O.GetChisquare()/(fz2O.GetNpoints()-3);
1394 if ( innerSector>0 && outerSector>0 ){
1395 if (fy4.GetNpoints()>0) {
1397 fy4.GetParameters(vecy4res);
1398 chi2IOy=fy4.GetChisquare()/(fy4.GetNpoints()-5);
1400 if (fz4.GetNpoints()>0) {
1402 fz4.GetParameters(vecz4res);
1403 chi2IOz=fz4.GetChisquare()/(fz4.GetNpoints()-5);
1405 if (fy1IO.GetNpoints()>0) {
1407 fy1IO.GetParameters(vecy1resIO);
1408 chi2IO1y=fy1IO.GetChisquare()/(fy1IO.GetNpoints()-3);
1410 if (fz1IO.GetNpoints()>0) {
1412 fz1IO.GetParameters(vecz1resIO);
1413 chi2IO1z=fz1IO.GetChisquare()/(fz1IO.GetNpoints()-3);
1417 fy4.ClearPoints(); fz4.ClearPoints();
1418 fy1I.ClearPoints(); fy1O.ClearPoints();
1419 fz1I.ClearPoints(); fz1O.ClearPoints();
1420 fy2I.ClearPoints(); fy2O.ClearPoints();
1421 fz2I.ClearPoints(); fz2O.ClearPoints();
1422 fy1IO.ClearPoints(); fz1IO.ClearPoints();
1423 //==============================//
1424 // calculate tracklet positions //
1425 //==============================//
1426 AliDebug(4,"Calculate tracklet positions");
1427 for (Int_t irow=158;irow>-1;--irow) {
1429 AliTPCclusterMI *c=track->GetClusterPointer(irow);
1430 if ( vecSec[irow]!=innerSector && vecSec[irow]!=outerSector ) { // no cluster in given sectors
1434 if (!c) { //no cluster
1437 if (c->GetMax()>kMax){ //saturation
1440 if ( vecSec[irow] == outerSector ) { //extended shape
1441 if (c->GetMax()/c->GetQ()> mqratioOut*kRatioCut) isReject[irow]+=8;
1442 if (TMath::Sqrt(c->GetSigmaY2())>msigmaYOut*kShapeCut) isReject[irow]+=16;
1444 if (c->GetMax()/c->GetQ()> mqratioIn*kRatioCut) isReject[irow]+=8;
1445 if (TMath::Sqrt(c->GetSigmaY2())>msigmaYIn*kShapeCut) isReject[irow]+=16;
1451 if ( vecSec[irow]==-1 ) continue; //no cluster info
1452 if ( vecSec[irow]!=innerSector && vecSec[irow]!=outerSector ) continue;
1454 Double_t x=vecX[irow];
1455 Double_t xref=x-133.4;
1457 Double_t yoffInner=0;
1458 Double_t zoffInner=0;
1459 Double_t yoffInner1=0;
1460 Double_t zoffInner1=0;
1461 Double_t yslopeInner=0;
1462 Double_t yslopeOuter=0;
1463 Double_t zslopeInner=0;
1464 Double_t zslopeOuter=0;
1465 //positions of hyperplane fits
1466 if ( vecSec[irow] == outerSector ) {
1468 vecY1[irow]=vecy1resOuter[0]+vecy1resOuter[1]*xref;
1469 vecZ1[irow]=vecz1resOuter[0]+vecz1resOuter[1]*xref;
1470 vecY2[irow]=vecy2resOuter[0]+vecy2resOuter[1]*xref+vecy2resOuter[2]*xref*xref;
1471 vecZ2[irow]=vecz2resOuter[0]+vecz2resOuter[1]*xref+vecz2resOuter[2]*xref*xref;
1472 yslopeOuter=vecy4res[3];
1473 zslopeOuter=vecz4res[3];
1476 vecY1[irow]=vecy1resInner[0]+vecy1resInner[1]*xref;
1477 vecZ1[irow]=vecz1resInner[0]+vecz1resInner[1]*xref;
1478 vecY2[irow]=vecy2resInner[0]+vecy2resInner[1]*xref+vecy2resInner[2]*xref*xref;
1479 vecZ2[irow]=vecz2resInner[0]+vecz2resInner[1]*xref+vecz2resInner[2]*xref*xref;
1480 yoffInner=vecy4res[1];
1481 zoffInner=vecz4res[1];
1482 yoffInner1=vecy1resIO[1];
1483 zoffInner1=vecz1resIO[1];
1484 yslopeInner=vecy4res[2];
1485 zslopeInner=vecz4res[2];
1487 vecY1IO[irow]=vecy1resIO[0]+yoffInner1+vecy1resIO[2]*xref;
1488 vecZ1IO[irow]=vecz1resIO[0]+zoffInner1+vecz1resIO[2]*xref;
1489 vecY4[irow]=vecy4res[0]+yoffInner+yslopeInner*xref+yslopeOuter*xref+vecy4res[4]*xref*xref;
1490 vecZ4[irow]=vecz4res[0]+zoffInner+zslopeInner*xref+zslopeOuter*xref+vecz4res[4]*xref*xref;
1491 //positions of kalman fits
1492 Double_t gxyz[3],xyz[3];
1493 AliExternalTrackParam *param = 0x0;
1495 param=tr->GetInner();
1497 param->GetXYZ(gxyz);
1498 Float_t bz = AliTracker::GetBz(gxyz);
1499 param->GetYAt(x, bz, xyz[1]);
1500 param->GetZAt(x, bz, xyz[2]);
1501 vecYkalman[irow]=xyz[1];
1502 vecZkalman[irow]=xyz[2];
1509 //=====================================================================//
1510 // write results from the different tracklet fits with debug streamers //
1511 //=====================================================================//
1512 if (fStreamLevel>4){
1513 TTreeSRedirector *cstream = GetDebugStreamer();
1515 Float_t dedx = track->GetdEdx();
1516 (*cstream)<<"FitModels"<<
1517 "run="<<fRun<< // run number
1518 "event="<<fEvent<< // event number
1519 "time="<<fTime<< // time stamp of event
1520 "trigger="<<fTrigger<< // trigger
1521 "mag="<<fMagF<< // magnetic field
1524 "edgeCutX=" << edgeCutX <<
1525 "edgeCutY=" << edgeCutY <<
1526 "nclCut=" << nclCut <<
1527 "innerSector="<< innerSector <<
1528 "outerSector="<< outerSector <<
1531 "Tr.=" << extparam <<
1532 "yPol1In.=" << &vecy1resInner <<
1533 "zPol1In.=" << &vecz1resInner <<
1534 "yPol1InOut.="<< &vecy1resIO <<
1535 "zPol1InOut.="<< &vecz1resIO <<
1536 "yPol2In.=" << &vecy2resInner <<
1537 "zPol2In.=" << &vecz2resInner <<
1538 "yPol1Out.=" << &vecy1resOuter <<
1539 "zPol1Out.=" << &vecz1resOuter <<
1540 "yPol2Out.=" << &vecy2resOuter <<
1541 "zPol2Out.=" << &vecz2resOuter <<
1542 "yInOut.=" << &vecy4res <<
1543 "zInOut.=" << &vecz4res <<
1544 "chi2y1In=" << chi2I1y <<
1545 "chi2z1In=" << chi2I1z <<
1546 "chi2y1InOut="<< chi2IO1y <<
1547 "chi2z1InOut="<< chi2IO1z <<
1548 "chi2y1Out=" << chi2O1y <<
1549 "chi2z1Out=" << chi2O1z <<
1550 "chi2y2In=" << chi2I2y <<
1551 "chi2z2In=" << chi2I2z <<
1552 "chi2y2Out=" << chi2O2y <<
1553 "chi2z2Out=" << chi2O2z <<
1554 "chi2yInOut=" << chi2IOy <<
1555 "chi2zInOut=" << chi2IOz <<
1556 "trletIn.=" << trInner <<
1557 "trletOut.=" << trOuter <<
1560 "xinMin=" << xinMin<<
1561 "xinMax=" << xinMax<<
1562 "xoutMin=" << xoutMin<<
1563 "xoutMax=" << xoutMax<<
1564 "msigmaYIn=" <<msigmaYIn<<
1565 "msigmaYOut=" <<msigmaYOut<<
1566 "mqratioIn=" <<mqratioIn<<
1567 "mqratioOut=" << mqratioOut <<
1572 // wirte residuals information
1573 if (fStreamLevel>5){
1574 TTreeSRedirector *cstream = GetDebugStreamer();
1576 Float_t dedx = track->GetdEdx();
1577 (*cstream)<<"Residuals"<<
1578 "run="<<fRun<< // run number
1579 "event="<<fEvent<< // event number
1580 "time="<<fTime<< // time stamp of event
1581 "trigger="<<fTrigger<< // trigger
1582 "mag="<<fMagF<< // magnetic field
1585 "edgeCutX=" << edgeCutX <<
1586 "edgeCutY=" << edgeCutY <<
1587 "nclCut=" << nclCut <<
1589 "Tr.=" << extparam<<
1592 "vX.=" << &vecgX<< // global x
1593 "vY.=" << &vecgY<< // global y
1594 "vZ.=" << &vecgZ<< // global z
1596 "TrYpol1.=" << &vecY1 <<
1597 "TrZpol1.=" << &vecZ1 <<
1598 "TrYpol2.=" << &vecY2 <<
1599 "TrZpol2.=" << &vecZ2 <<
1600 "TrYpol1InOut.="<< &vecY1IO <<
1601 "TrZpol1InOut.="<< &vecZ1IO <<
1602 "TrYInOut.=" << &vecY4 <<
1603 "TrZInOut.=" << &vecZ4 <<
1604 "ClY.=" << &vecClY <<
1605 "ClZ.=" << &vecClZ <<
1606 "isReject.=" << &isReject<<
1607 "sec.=" << &vecSec <<
1610 "xinMin=" << xinMin<<
1611 "xinMax=" << xinMax<<
1612 "xoutMin=" << xoutMin<<
1613 "xoutMax=" << xoutMax<<
1614 "msigmaYIn=" <<msigmaYIn<<
1615 "msigmaYOut=" <<msigmaYOut<<
1616 "mqratioIn=" <<mqratioIn<<
1617 "mqratioOut=" << mqratioOut <<
1618 "yInOut.=" << &vecy4res <<
1619 "zInOut.=" << &vecz4res <<
1621 "chi2y1In=" << chi2I1y << //
1622 "chi2z1In=" << chi2I1z <<
1623 "chi2y1Out=" << chi2O1y <<
1624 "chi2z1Out=" << chi2O1z <<
1625 "chi2y1InOut="<< chi2IO1y <<
1626 "chi2z1InOut="<< chi2IO1z <<
1627 "chi2y2In=" << chi2I2y <<
1628 "chi2z2In=" << chi2I2z <<
1629 "chi2y2Out=" << chi2O2y <<
1630 "chi2z2Out=" << chi2O2z <<
1631 "chi2yInOut=" << chi2IOy <<
1632 "chi2zInOut=" << chi2IOz <<
1634 "yPol1In.=" << &vecy1resInner <<
1635 "zPol1In.=" << &vecz1resInner <<
1636 "yPol2In.=" << &vecy2resInner <<
1637 "zPol2In.=" << &vecz2resInner <<
1638 "yPol1Out.=" << &vecy1resOuter <<
1639 "zPol1Out.=" << &vecz1resOuter <<
1640 "yPol1InOut.="<< &vecy1resIO <<
1641 "zPol1InOut.="<< &vecz1resIO <<
1642 "yPol2Out.=" << &vecy2resOuter <<
1643 "zPol2Out.=" << &vecz2resOuter <<
1649 //==========================//
1650 // Fill Residual Histograms //
1651 //==========================//
1652 if (!fHisNclIn) MakeFitHistos();
1654 TH2F *profy = (TH2F*)fDeltaYres.UncheckedAt(id);
1655 TH2F *profz = (TH2F*)fDeltaZres.UncheckedAt(id);
1656 TH2F *profy2 = (TH2F*)fDeltaYres2.UncheckedAt(id);
1657 TH2F *profz2 = (TH2F*)fDeltaZres2.UncheckedAt(id);
1658 TH2F *profyabs = (TH2F*)fDeltaYresAbs.UncheckedAt(id);
1659 TH2F *profzabs = (TH2F*)fDeltaZresAbs.UncheckedAt(id);
1660 // TH2F *profy3 = (TH2F*)fDeltaYres3.UncheckedAt(id);
1661 //TH2F *profz3 = (TH2F*)fDeltaZres3.UncheckedAt(id);
1663 for (Int_t irow=158;irow>-1;--irow) {
1664 if (vecSec[irow]==-1)continue; // no cluster info
1665 if (isReject[irow]>0.5) continue; //
1666 Double_t ycl = vecClY[irow];
1667 Double_t yfit = vecY1[irow];
1668 Double_t yfit2 = vecY2[irow];
1669 Double_t x = vecX[irow];
1670 Double_t yabsbeam = -1000;
1671 if(vecSec[irow]==outerSector && (outerSector%36)==fBeamSectorOuter[id])
1672 yabsbeam = fBeamSlopeYOuter[id]*x + fBeamOffsetYOuter[id];
1673 else if((innerSector%36)==fBeamSectorInner[id])
1674 yabsbeam = fBeamSlopeYInner[id]*x + fBeamOffsetYInner[id];
1676 // Double_t yfit3 = vecY2[irow];
1677 Double_t zcl = vecClZ[irow];
1678 Double_t zfit = vecZ1[irow];
1679 Double_t zfit2 = vecZ2[irow];
1680 //Double_t zfit3 = vecZ2[irow];
1683 // The expressions for zcorrected has been obtained by
1684 // inverting the fits in the FitDriftV() method (ignoring the
1685 // global y dependence for now):
1687 // 250 - zmeasured = [0] + [1]*(250 - zreal) + .... (yglobal)
1689 // zreal = (zmeasured + [0] - (1-[1])*250.0)/[1]
1692 // 250 + zmeasured = [0] + [1]*(250+zreal) + .... (yglobal)
1694 // zreal = (zmeasured - [0] + (1 - [1])*250.0)/[1]
1696 Double_t dzabs = -1000;
1697 if (ltrp->GetSide()==0){
1698 if ((*fFitAside)[1]>0.) {
1699 // ignore global y dependence for now
1700 Double_t zcorrected = (zcl + (*fFitAside)[0] -
1701 (1.0-(*fFitAside)[1])*250.0)/(*fFitAside)[1];
1702 // zcorrected = zcl;
1703 if(vecSec[irow]==outerSector && (outerSector%36)==fBeamSectorOuter[id])
1704 dzabs = zcorrected -fBeamSlopeZOuter[id]*x -fBeamOffsetZOuter[id];
1705 else if((innerSector%36)==fBeamSectorInner[id])
1706 dzabs = zcorrected -fBeamSlopeZInner[id]*x -fBeamOffsetZInner[id];
1709 if ((*fFitCside)[1]>0.) {
1710 Double_t zcorrected = (zcl - (*fFitCside)[0] +
1711 (1.0-(*fFitCside)[1])*250.0)/(*fFitCside)[1];
1712 // zcorrected = zcl;
1713 if(vecSec[irow]==outerSector && (outerSector%36)==fBeamSectorOuter[id])
1714 dzabs = zcorrected -fBeamSlopeZOuter[id]*x -fBeamOffsetZOuter[id];
1715 else if((innerSector%36)==fBeamSectorInner[id])
1716 dzabs = zcorrected -fBeamSlopeZInner[id]*x -fBeamOffsetZInner[id];
1720 if (TMath::Abs(yfit-ycl)<2&&TMath::Abs(zfit-zcl)<2){
1722 profy->Fill(irow,ycl-yfit);
1723 profy2->Fill(irow,ycl-yfit2);
1725 profyabs->Fill(irow,-0.99);
1727 profyabs->Fill(irow,ycl-yabsbeam);
1729 // profy3->Fill(irow,ycl-yfit3);
1732 profz->Fill(irow,zcl-zfit);
1733 profz2->Fill(irow,zcl-zfit2);
1734 //profz3->Fill(irow,zcl-zfit3);
1736 profzabs->Fill(irow,-0.99);
1738 profzabs->Fill(irow,dzabs);
1744 // Fill laser fit histograms
1746 Float_t dedx = track->GetdEdx();
1747 if (nclI>20&&nclO>20){
1748 fHisNclIn->Fill(id,nclI); //->Number of clusters inner
1749 fHisNclOut->Fill(id,nclO); //->Number of clusters outer
1750 fHisNclIO->Fill(id,nclI+nclO); //->Number of cluster inner outer
1752 fHisLclIn->Fill(id,xinMax-xinMin); //->Level arm inner
1753 fHisLclOut->Fill(id,xoutMax-xoutMin); //->Level arm outer
1754 fHisLclIO->Fill(id,xoutMax-xinMin); //->Number of cluster inner outer
1756 fHisdEdx->Fill(id,TMath::Sqrt(TMath::Abs(dedx)));
1757 fHisdZfit->Fill(id,fFitZ[id]);
1760 fHisChi2YIn1->Fill(id,TMath::Sqrt(chi2I1y)); //->chi2 y inner - line
1761 fHisChi2YOut1->Fill(id,TMath::Sqrt(chi2O1y)); //->chi2 y inner - line
1762 fHisChi2YIn2->Fill(id,TMath::Sqrt(chi2I2y)); //->chi2 y inner - parabola
1763 fHisChi2YOut2->Fill(id,TMath::Sqrt(chi2O2y)); //->chi2 y inner - parabola
1764 fHisChi2YIO1->Fill(id,TMath::Sqrt(chi2IOy)); //->chi2 y IO - common
1767 fHisChi2ZIn1->Fill(id,TMath::Sqrt(chi2I1z)); //->chi2 z inner - line
1768 fHisChi2ZOut1->Fill(id,TMath::Sqrt(chi2O1z)); //->chi2 z inner - line
1769 fHisChi2ZIn2->Fill(id,TMath::Sqrt(chi2O2y)); //->chi2 z inner - parabola
1770 fHisChi2ZOut2->Fill(id,TMath::Sqrt(chi2O2z)); //->chi2 z inner - parabola
1771 fHisChi2ZIO1->Fill(id,TMath::Sqrt(chi2IOz)); //->chi2 z IO - common
1774 fHisPy1vP0->Fill(id,vecy1resOuter[0]-vecy1resInner[0]); //-> delta y P0outer-P0inner - line
1775 fHisPy2vP0->Fill(id,vecy2resOuter[0]-vecy2resInner[0]); //-> delta y P0outer-P0inner - parabola
1776 fHisPy3vP0->Fill(id,vecy4res[1]); //-> delta y P0outer-P0inner - common parabola
1778 fHisPy1vP1->Fill(id,vecy1resOuter[1]-vecy1resInner[1]); //-> delta ky P1outer-P1inner - line
1779 fHisPy2vP1->Fill(id,vecy2resOuter[1]-vecy2resInner[1]); //-> delta ky P1outer-P1inner - parabola
1780 fHisPy3vP1->Fill(id,vecy4res[3]-vecy4res[2]); //-> delta ky P1outer-P1inner - common parabola
1782 fHisPy3vP2IO->Fill(id,vecy4res[4]); //-> Curv P2outerinner - common parabola
1783 fHisPz1vP0->Fill(id,vecz1resOuter[0]-vecz1resInner[0]); //-> delta z P0outer-P0inner - line
1784 fHisPz2vP0->Fill(id,vecz2resOuter[0]-vecz2resInner[0]); //-> delta z P0outer-P0inner - parabola
1785 fHisPz3vP0->Fill(id,vecz4res[1]); //-> delta z P0outer-P0inner - common parabola
1787 fHisPz1vP1->Fill(id,vecz1resOuter[1]-vecz1resInner[1]); //-> delta kz P1outer-P1inner - line
1788 fHisPz2vP1->Fill(id,vecz2resOuter[1]-vecz2resInner[1]); //-> delta kz P1outer-P1inner - parabola
1789 fHisPz3vP1->Fill(id,vecz4res[3]-vecz4res[2]); //-> delta kz P1outer-P1inner - common parabola
1790 fHisPz3vP2IO->Fill(id,vecz4res[4]); //-> Curv P2outerinner - common parabola
1793 fHisPy2vP2In->Fill(id,vecy2resInner[2]); //-> Curv P2inner - parabola
1794 fHisPz2vP2In->Fill(id,vecz2resInner[2]); //-> Curv P2inner - parabola
1798 fHisPz2vP2Out->Fill(id,vecz2resOuter[2]); //-> Curv P2outer - parabola
1799 fHisPy2vP2Out->Fill(id,vecy2resOuter[2]); //-> Curv P2outer - parabola
1807 void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run){
1809 // Dump information about laser beams
1810 // isOK variable indicates usability of the beam
1811 // Beam is not usable if:
1812 // a. No entries in range (krmsCut0)
1813 // b. Big sperad (krmscut1)
1814 // c. RMSto fit sigma bigger then (kmultiCut)
1815 // d. Too big angular spread
1818 const Float_t krmsCut0=0.001;
1819 const Float_t krmsCut1=0.16;
1820 const Float_t kmultiCut=2;
1821 const Float_t kcutP0=0.002;
1823 AliTPCcalibLaser *laser = this;
1824 TTreeSRedirector *pcstream = new TTreeSRedirector("laserMean.root");
1825 TF1 fg("fg","gaus");
1828 for (Int_t id=0; id<336; id++){
1830 TH1F * hisphi = (TH1F*)laser->fDeltaPhi.At(id);
1831 TH1F * hisphiP = (TH1F*)laser->fDeltaPhiP.At(id);
1832 TH1F * hisZ = (TH1F*)laser->fDeltaZ.At(id);
1833 TH1F * hisP3 = (TH1F*)laser->fDeltaP3.At(id);
1834 TH1F * hisP4 = (TH1F*)laser->fDeltaP4.At(id);
1835 TH1F * hisS = (TH1F*)laser->fSignals.At(id);
1836 //if (!hisphi) continue;
1837 Double_t entries = (hisphi==0)? 0: hisphi->GetEntries();
1838 //if (entries<minEntries) continue;
1840 AliTPCLaserTrack *ltrp = (AliTPCLaserTrack*)fTracksMirror.At(id);
1842 AliTPCLaserTrack::LoadTracks();
1843 ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
1845 pcstream->GetFile()->cd();
1846 if (hisphi) hisphi->Write();
1847 if (hisphiP) hisphiP->Write();
1848 if (hisZ) hisZ->Write();
1849 if (hisP3) hisP3->Write();
1850 if (hisP4) hisP4->Write();
1852 Float_t meanphi = hisphi->GetMean();
1853 Float_t rmsphi = hisphi->GetRMS();
1855 Float_t meanphiP = hisphiP->GetMean();
1856 Float_t rmsphiP = hisphiP->GetRMS();
1857 Float_t meanZ = hisZ->GetMean();
1858 Float_t rmsZ = hisZ->GetRMS();
1859 if (hisphi->GetRMS()>0)
1860 hisphi->Fit(&fg,"","",hisphi->GetMean()-4*hisphi->GetRMS(),hisphi->GetMean()+4*hisphi->GetRMS());
1861 Double_t gphi1 = fg.GetParameter(1);
1862 Double_t gphi2 = fg.GetParameter(2);
1863 if (hisphiP->GetRMS()>0)
1864 hisphiP->Fit(&fg,"","",hisphiP->GetMean()-4*hisphiP->GetRMS(),hisphiP->GetMean()+4*hisphiP->GetRMS());
1865 Double_t gphiP1 = fg.GetParameter(1);
1866 Double_t gphiP2 = fg.GetParameter(2);
1868 if (hisZ->GetRMS()>0)
1869 hisZ->Fit(&fg,"","",hisZ->GetMean()-4*hisZ->GetRMS()-0.1,hisZ->GetMean()+4*hisZ->GetRMS()+0.1);
1870 Double_t gz1 = fg.GetParameter(1);
1871 Double_t gz2 = fg.GetParameter(2);
1873 if (hisP3->GetRMS()>0)
1874 hisP3->Fit(&fg,"","",hisP3->GetMean()-4*hisP3->GetRMS(),hisP3->GetMean()+4*hisP3->GetRMS());
1875 Double_t gp31 = fg.GetParameter(1);
1876 Double_t gp32 = fg.GetParameter(2);
1878 if (hisP4->GetRMS()>0)
1879 hisP4->Fit(&fg,"","",hisP4->GetMean()-4*hisP4->GetRMS(),hisP4->GetMean()+4*hisP4->GetRMS());
1880 Double_t gp41 = fg.GetParameter(1);
1881 Double_t gp42 = fg.GetParameter(2);
1883 Float_t meanS=hisS->GetMean();
1888 ltrp->GetPxPyPz(lpxyz);
1890 if (rmsphi<krmsCut0) isOK=kFALSE; // empty in range - not entries inside
1891 if (rmsphi>krmsCut1) isOK=kFALSE; // empty in range - not entries inside
1892 if (rmsphi>krmsCut0) if (gphi2/rmsphi>kmultiCut) isOK=kFALSE; // multi peak structure
1893 if (gphiP2>kcutP0) isOK=kFALSE;
1899 his = fHisNclIn->ProjectionY("aaa",id+1,id+1);
1900 Float_t mnclIn = his->GetMean();
1902 his = fHisNclOut->ProjectionY("aaa",id+1,id+1);
1903 Float_t mnclOut = his->GetMean();
1905 his = fHisNclIO->ProjectionY("aaa",id+1,id+1);
1906 Float_t mnclIO = his->GetMean();
1908 his = fHisLclIn->ProjectionY("aaa",id+1,id+1);
1909 Float_t mLclIn = his->GetMean();
1911 his = fHisLclOut->ProjectionY("aaa",id+1,id+1);
1912 Float_t mLclOut = his->GetMean();
1914 his = fHisLclIO->ProjectionY("aaa",id+1,id+1);
1915 Float_t mLclIO = his->GetMean();
1918 his = fHisdEdx->ProjectionY("aaa",id+1,id+1);
1919 Float_t mdEdx = his->GetMean();
1925 his = fHisChi2YIn1->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - line
1926 Float_t mChi2YIn1= his->GetMean();
1928 his = fHisChi2YOut1->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - line
1929 Float_t mChi2YOut1 = his->GetMean();
1931 his = fHisChi2YIn2->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - parabola
1932 Float_t mChi2YIn2 = his->GetMean();
1934 his = fHisChi2YOut2->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - parabola
1935 Float_t mChi2YOut2 = his->GetMean();
1937 his = fHisChi2YIO1->ProjectionY("aaa",id+1,id+1); //->chi2 y IO - common
1938 Float_t mChi2YIO1 = his->GetMean();
1940 his = fHisChi2ZIn1->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - line
1941 Float_t mChi2ZIn1 = his->GetMean();
1943 his = fHisChi2ZOut1->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - line
1944 Float_t mChi2ZOut1 = his->GetMean();
1946 his = fHisChi2ZIn2->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - parabola
1947 Float_t mChi2ZIn2 = his->GetMean();
1949 his = fHisChi2ZOut2->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - parabola
1950 Float_t mChi2ZOut2 = his->GetMean();
1952 his = fHisChi2ZIO1->ProjectionY("aaa",id+1,id+1); //->chi2 z IO - common
1953 Float_t mChi2ZIO1 = his->GetMean();
1958 his = fHisdZfit->ProjectionY("aaa",id+1,id+1);
1959 Float_t edZfit = his->GetEntries();
1960 Float_t mdZfit = his->GetMean();
1961 Float_t rdZfit = his->GetRMS();
1964 his = fHisPy1vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - line
1965 Float_t ePy1vP0 = his->GetEntries();
1966 Float_t mPy1vP0 = his->GetMean();
1967 Float_t rPy1vP0 = his->GetRMS();
1970 his = fHisPy2vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - parabola
1971 Float_t ePy2vP0 = his->GetEntries();
1972 Float_t mPy2vP0 = his->GetMean();
1973 Float_t rPy2vP0 = his->GetRMS();
1976 his = fHisPy3vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - common parabola
1977 Float_t ePy3vP0 = his->GetEntries();
1978 Float_t mPy3vP0 = his->GetMean();
1979 Float_t rPy3vP0 = his->GetRMS();
1982 his = fHisPy1vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - line
1983 Float_t ePy1vP1 = his->GetEntries();
1984 Float_t mPy1vP1 = his->GetMean();
1985 Float_t rPy1vP1 = his->GetRMS();
1988 his = fHisPy2vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - parabola
1989 Float_t ePy2vP1 = his->GetEntries();
1990 Float_t mPy2vP1 = his->GetMean();
1991 Float_t rPy2vP1 = his->GetRMS();
1994 his = fHisPy3vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - common parabola
1995 Float_t ePy3vP1 = his->GetEntries();
1996 Float_t mPy3vP1 = his->GetMean();
1997 Float_t rPy3vP1 = his->GetRMS();
2000 his = fHisPy2vP2In->ProjectionY("aaa",id+1,id+1); //-> Curv P2inner - parabola
2001 Float_t ePy2vP2In = his->GetEntries();
2002 Float_t mPy2vP2In = his->GetMean();
2003 Float_t rPy2vP2In = his->GetRMS();
2006 his = fHisPy2vP2Out->ProjectionY("aaa",id+1,id+1); //-> Curv P2outer - parabola
2007 Float_t ePy2vP2Out = his->GetEntries();
2008 Float_t mPy2vP2Out = his->GetMean();
2009 Float_t rPy2vP2Out = his->GetRMS();
2012 his = fHisPy3vP2IO->ProjectionY("aaa",id+1,id+1); //-> Curv P2outerinner - common parabola
2013 Float_t ePy3vP2IO = his->GetEntries();
2014 Float_t mPy3vP2IO = his->GetMean();
2015 Float_t rPy3vP2IO = his->GetRMS();
2020 his = fHisPz1vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - line
2021 Float_t ePz1vP0 = his->GetEntries();
2022 Float_t mPz1vP0 = his->GetMean();
2023 Float_t rPz1vP0 = his->GetRMS();
2026 his = fHisPz2vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - parabola
2027 Float_t ePz2vP0 = his->GetEntries();
2028 Float_t mPz2vP0 = his->GetMean();
2029 Float_t rPz2vP0 = his->GetRMS();
2032 his = fHisPz3vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - common parabola
2033 Float_t ePz3vP0 = his->GetEntries();
2034 Float_t mPz3vP0 = his->GetMean();
2035 Float_t rPz3vP0 = his->GetRMS();
2038 his = fHisPz1vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - line
2039 Float_t ePz1vP1 = his->GetEntries();
2040 Float_t mPz1vP1 = his->GetMean();
2041 Float_t rPz1vP1 = his->GetRMS();
2044 his = fHisPz2vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - parabola
2045 Float_t ePz2vP1 = his->GetEntries();
2046 Float_t mPz2vP1 = his->GetMean();
2047 Float_t rPz2vP1 = his->GetRMS();
2050 his = fHisPz3vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - common parabola
2051 Float_t ePz3vP1 = his->GetEntries();
2052 Float_t mPz3vP1 = his->GetMean();
2053 Float_t rPz3vP1 = his->GetRMS();
2056 his = fHisPz2vP2In->ProjectionY("aaa",id+1,id+1); //-> Curv P2inner - parabola
2057 Float_t ePz2vP2In = his->GetEntries();
2058 Float_t mPz2vP2In = his->GetMean();
2059 Float_t rPz2vP2In = his->GetRMS();
2062 his = fHisPz2vP2Out->ProjectionY("aaa",id+1,id+1); //-> Curv P2outer - parabola
2063 Float_t ePz2vP2Out = his->GetEntries();
2064 Float_t mPz2vP2Out = his->GetMean();
2065 Float_t rPz2vP2Out = his->GetRMS();
2068 his = fHisPz3vP2IO->ProjectionY("aaa",id+1,id+1); //-> Curv P2outerinner - common parabola
2069 Float_t ePz3vP2IO = his->GetEntries();
2070 Float_t mPz3vP2IO = his->GetMean();
2071 Float_t rPz3vP2IO = his->GetRMS();
2075 (*pcstream)<<"Mean"<<
2078 "id="<<id<< // track id
2079 "entries="<<entries<< // number of entries
2080 "bz="<<bfield<< // bfield
2081 "LTr.="<<ltrp<< // refernece track
2083 "mnclIn="<<mnclIn<< // mean number of clusters in inner
2084 "mnclOut="<<mnclOut<< // mean number of clusters in outer
2085 "mnclIO="<<mnclIO<< // mean number of clusters in inner+outer
2086 "mLclIn="<<mLclIn<< // mean number of clusters in inner
2087 "mLclOut="<<mLclOut<< // mean number of clusters in outer
2088 "mLclIO="<<mLclIO<< // mean number of clusters in inner+outer
2089 "mdEdx="<<mdEdx<< // mean dEdx
2090 "edZfit="<<edZfit<< // entries z fit
2091 "mdZfit="<<mdZfit<< // mean z fit
2092 "rdZfit="<<rdZfit<< // RMS z fit
2095 "mChi2YIn1="<<mChi2YIn1<< //->chi2 y inner - line
2096 "mChi2YOut1="<<mChi2YOut1<< //->chi2 y inner - line
2097 "mChi2YIn2="<<mChi2YIn2<< //->chi2 y inner - parabola
2098 "mChi2YOut2="<<mChi2YOut2<< //->chi2 y inner - parabola
2099 "mChi2YIO1="<<mChi2YIO1<< //->chi2 y IO - common
2100 "mChi2ZIn1="<<mChi2ZIn1<< //->chi2 z inner - line
2101 "mChi2ZOut1="<<mChi2ZOut1<< //->chi2 z inner - line
2102 "mChi2ZIn2="<<mChi2ZIn2<< //->chi2 z inner - parabola
2103 "mChi2ZOut2="<<mChi2ZOut2<< //->chi2 z inner - parabola
2104 "mChi2ZIO1="<<mChi2ZIO1<< //->chi2 z IO - common
2107 "ePy1vP0="<<ePy1vP0<<
2108 "mPy1vP0="<<mPy1vP0<<
2109 "rPy1vP0="<<rPy1vP0<<
2110 "ePy2vP0="<<ePy2vP0<<
2111 "mPy2vP0="<<mPy2vP0<<
2112 "rPy2vP0="<<rPy2vP0<<
2113 "ePy3vP0="<<ePy3vP0<<
2114 "mPy3vP0="<<mPy3vP0<<
2115 "rPy3vP0="<<rPy3vP0<<
2116 "ePy1vP1="<<ePy1vP1<<
2117 "mPy1vP1="<<mPy1vP1<<
2118 "rPy1vP1="<<rPy1vP1<<
2119 "ePy2vP1="<<ePy2vP1<<
2120 "mPy2vP1="<<mPy2vP1<<
2121 "rPy2vP1="<<rPy2vP1<<
2122 "ePy3vP1="<<ePy3vP1<<
2123 "mPy3vP1="<<mPy3vP1<<
2124 "rPy3vP1="<<rPy3vP1<<
2125 "ePy2vP2In="<<ePy2vP2In<<
2126 "mPy2vP2In="<<mPy2vP2In<<
2127 "rPy2vP2In="<<rPy2vP2In<<
2128 "ePy2vP2Out="<<ePy2vP2Out<<
2129 "mPy2vP2Out="<<mPy2vP2Out<<
2130 "rPy2vP2Out="<<rPy2vP2Out<<
2131 "ePy3vP2IO="<<ePy3vP2IO<<
2132 "mPy3vP2IO="<<mPy3vP2IO<<
2133 "rPy3vP2IO="<<rPy3vP2IO<<
2136 "ePz1vP0="<<ePz1vP0<<
2137 "mPz1vP0="<<mPz1vP0<<
2138 "rPz1vP0="<<rPz1vP0<<
2139 "ePz2vP0="<<ePz2vP0<<
2140 "mPz2vP0="<<mPz2vP0<<
2141 "rPz2vP0="<<rPz2vP0<<
2142 "ePz3vP0="<<ePz3vP0<<
2143 "mPz3vP0="<<mPz3vP0<<
2144 "rPz3vP0="<<rPz3vP0<<
2145 "ePz1vP1="<<ePz1vP1<<
2146 "mPz1vP1="<<mPz1vP1<<
2147 "rPz1vP1="<<rPz1vP1<<
2148 "ePz2vP1="<<ePz2vP1<<
2149 "mPz2vP1="<<mPz2vP1<<
2150 "rPz2vP1="<<rPz2vP1<<
2151 "ePz3vP1="<<ePz3vP1<<
2152 "mPz3vP1="<<mPz3vP1<<
2153 "rPz3vP1="<<rPz3vP1<<
2154 "ePz2vP2In="<<ePz2vP2In<<
2155 "mPz2vP2In="<<mPz2vP2In<<
2156 "rPz2vP2In="<<rPz2vP2In<<
2157 "ePz2vP2Out="<<ePz2vP2Out<<
2158 "mPz2vP2Out="<<mPz2vP2Out<<
2159 "rPz2vP2Out="<<rPz2vP2Out<<
2160 "ePz3vP2IO="<<ePz3vP2IO<<
2161 "mPz3vP2IO="<<mPz3vP2IO<<
2162 "rPz3vP2IO="<<rPz3vP2IO<<
2166 "lx0="<<lxyz[0]<< // reference x
2167 "lx1="<<lxyz[1]<< // reference y
2168 "lx2="<<lxyz[2]<< // refernece z
2169 "lpx0="<<lpxyz[0]<< // reference x
2170 "lpx1="<<lpxyz[1]<< // reference y
2171 "lpx2="<<lpxyz[2]<< // refernece z
2175 "mphi="<<meanphi<< //
2176 "rmsphi="<<rmsphi<< //
2180 "mphiP="<<meanphiP<< //
2181 "rmsphiP="<<rmsphiP<< //
2190 "gp31="<<gp31<< //gaus mean - tgl
2191 "gp32="<<gp32<< //gaus rms -tgl
2192 "gp41="<<gp41<< //gaus mean - P4
2193 "gp42="<<gp42<< //gaus rms - P4
2200 TFile fmean("laserMean.root");
2210 void AliTPCcalibLaser::DumpScanInfo(TTree * chain, const char * cutUser){
2214 TTreeSRedirector *pcstream = new TTreeSRedirector("laserScan.root");
2215 TFile * f = pcstream->GetFile();
2217 f->mkdir("dirphiP");
2219 TF1 fp("p1","pol1");
2224 char grnamefull[1000];
2227 Double_t mphiP[100];
2228 Double_t smphi[100];
2229 Double_t smphiP[100];
2240 for (Int_t id=0; id<336; id++){
2242 sprintf(cut,"fId==%d&&%s",id,cutUser);
2243 Int_t entries = chain->Draw("bz",cut,"goff");
2244 if (entries<3) continue;
2245 AliTPCLaserTrack *ltrp = 0;
2246 if (!AliTPCLaserTrack::GetTracks()) AliTPCLaserTrack::LoadTracks();
2247 ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
2251 ltrp->GetPxPyPz(lpxyz);
2253 chain->Draw("bz",cut,"goff");
2254 memcpy(bz, chain->GetV1(), entries*sizeof(Double_t));
2255 chain->Draw("0.01*abs(bz)+0.02",cut,"goff");
2256 memcpy(sbz, chain->GetV1(), entries*sizeof(Double_t));
2258 chain->Draw("gphi1",cut,"goff");
2259 memcpy(mphi, chain->GetV1(), entries*sizeof(Double_t));
2260 chain->Draw("0.05*abs(mphi)+abs(gphi2)*0.5+0.05",cut,"goff");
2261 memcpy(smphi, chain->GetV1(), entries*sizeof(Double_t));
2263 chain->Draw("gphiP1",cut,"goff");
2264 memcpy(mphiP, chain->GetV1(), entries*sizeof(Double_t));
2265 chain->Draw("0.05*abs(mphiP)+abs(gphiP2)*0.5+0.001",cut,"goff");
2266 memcpy(smphiP, chain->GetV1(), entries*sizeof(Double_t));
2268 chain->Draw("gz1",cut,"goff");
2269 memcpy(mZ, chain->GetV1(), entries*sizeof(Double_t));
2270 chain->Draw("0.01*abs(meanZ)+abs(gz2)*0.5+0.1",cut,"goff");
2271 memcpy(smZ, chain->GetV1(), entries*sizeof(Double_t));
2274 sprintf(grnamefull,"Side_%d_Bundle_%d_Rod_%d_Beam_%d",
2275 ltrp->GetSide(), ltrp->GetBundle(), ltrp->GetRod(), ltrp->GetBeam());
2282 for (Int_t ientry=0; ientry<entries; ientry++){
2283 if (TMath::Abs(bz[ientry])<0.05){
2284 phiB0 = mphi[ientry];
2285 phiPB0 = mphiP[ientry];
2289 TGraphErrors *grphi = new TGraphErrors(entries,bz,mphi,sbz,smphi);
2292 pphi[0] = fp.GetParameter(0); // offset
2293 pphi[1] = fp.GetParameter(1); // slope
2294 pphi[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
2295 sprintf(grname,"phi_id%d",id);
2296 grphi->SetName(grname); grphi->SetTitle(grnamefull);
2297 grphi->GetXaxis()->SetTitle("b_{z} (T)");
2298 grphi->GetYaxis()->SetTitle("#Delta r#phi (cm)");
2299 grphi->SetMaximum(1.2);
2300 grphi->SetMinimum(-1.2);
2304 gPad->SaveAs(Form("pic/phi/phi_%s.gif",grnamefull));
2307 TGraphErrors *grphiP = new TGraphErrors(entries,bz,mphiP,sbz,smphiP);
2310 pphiP[0] = fp.GetParameter(0); // offset
2311 pphiP[1] = fp.GetParameter(1); // slope
2312 pphiP[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
2313 sprintf(grname,"phiP_id%d",id);
2314 grphiP->SetName(grname); grphiP->SetTitle(grnamefull);
2315 grphiP->GetXaxis()->SetTitle("b_{z} (T)");
2316 grphiP->GetYaxis()->SetTitle("#Delta #phi (rad)");
2317 grphiP->SetMaximum(pphiP[0]+0.005);
2318 grphiP->SetMinimum(pphiP[0]-0.005);
2320 gPad->SaveAs(Form("pic/phiP/phiP_%s.gif",grnamefull));
2325 TGraphErrors *grmZ = new TGraphErrors(entries,bz,mZ,sbz,smZ);
2328 pmZ[0] = fp.GetParameter(0); // offset
2329 pmZ[1] = fp.GetParameter(1); // slope
2330 pmZ[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
2331 sprintf(grname,"mZ_id%d",id);
2332 grmZ->SetName(grname); grmZ->SetTitle(grnamefull);
2333 grmZ->GetXaxis()->SetTitle("b_{z} (T)");
2334 grmZ->GetYaxis()->SetTitle("#Delta z (cm)");
2336 gPad->SaveAs(Form("pic/z/z_%s.gif",grnamefull));
2342 for (Int_t ientry=0; ientry<entries; ientry++){
2343 (*pcstream)<<"Mean"<<
2346 "entries="<<entries<<
2348 "lx0="<<lxyz[0]<< // reference x
2349 "lx1="<<lxyz[1]<< // reference y
2350 "lx2="<<lxyz[2]<< // refernece z
2351 "lpx0="<<lpxyz[0]<< // reference x
2352 "lpx1="<<lpxyz[1]<< // reference y
2353 "lpx2="<<lpxyz[2]<< // refernece z
2355 "phiB0="<<phiB0<< // position shift at 0 field
2356 "phiPB0="<<phiPB0<< // angular shift at 0 field
2357 "zB0="<<zB0<< // z shift for 0 field
2359 "gphi1="<<mphi[ientry]<< // mean - from gaus fit
2360 "pphi0="<<pphi[0]<< // offset
2361 "pphi1="<<pphi[1]<< // slope
2362 "pphi2="<<pphi[2]<< // norm chi2
2364 "gphiP1="<<mphiP[ientry]<< // mean - from gaus fit
2365 "pphiP0="<<pphiP[0]<< // offset
2366 "pphiP1="<<pphiP[1]<< // slope
2367 "pphiP2="<<pphiP[2]<< // norm chi2
2369 "gz1="<<mZ[ientry]<<
2370 "pmZ0="<<pmZ[0]<< // offset
2371 "pmZ1="<<pmZ[1]<< // slope
2372 "pmZ2="<<pmZ[2]<< // norm chi2
2382 void AliTPCcalibLaser::Analyze(){
2389 Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
2391 TIterator* iter = li->MakeIterator();
2392 AliTPCcalibLaser* cal = 0;
2393 static Int_t counter0=0;
2394 while ((cal = (AliTPCcalibLaser*)iter->Next())) {
2395 if (!cal->InheritsFrom(AliTPCcalibLaser::Class())) {
2396 // Error("Merge","Attempt to add object of class %s to a %s", cal->ClassName(), this->ClassName());
2399 printf("Marging number %d\n", counter0);
2402 MergeFitHistos(cal);
2407 // TProfile *hp=0x0;
2408 //TProfile *hpm=0x0;
2410 for (Int_t id=0; id<336; id++){
2411 // merge fDeltaZ histograms
2412 hm = (TH1F*)cal->fDeltaZ.At(id);
2413 h = (TH1F*)fDeltaZ.At(id);
2415 h=new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
2417 fDeltaZ.AddAt(h,id);
2420 // merge fP3 histograms
2421 hm = (TH1F*)cal->fDeltaP3.At(id);
2422 h = (TH1F*)fDeltaP3.At(id);
2424 h=new TH1F(Form("hisPar3v%d",id),Form("hisPar3v%d",id),400,-0.06,0.06);
2426 fDeltaP3.AddAt(h,id);
2429 // merge fP4 histograms
2430 hm = (TH1F*)cal->fDeltaP4.At(id);
2431 h = (TH1F*)fDeltaP4.At(id);
2433 h=new TH1F(Form("hisPar4v%d",id),Form("hisPar4v%d",id),200,-0.06,0.06);
2435 fDeltaP4.AddAt(h,id);
2440 // merge fDeltaPhi histograms
2441 hm = (TH1F*)cal->fDeltaPhi.At(id);
2442 h = (TH1F*)fDeltaPhi.At(id);
2444 h= new TH1F(Form("hisdphi%d",id),Form("hisdphi%d",id),1000,-1,1);
2446 fDeltaPhi.AddAt(h,id);
2449 // merge fDeltaPhiP histograms
2450 hm = (TH1F*)cal->fDeltaPhiP.At(id);
2451 h = (TH1F*)fDeltaPhiP.At(id);
2453 h=new TH1F(Form("hisdphiP%d",id),Form("hisdphiP%d",id),1000,-0.01,0.01);
2455 fDeltaPhiP.AddAt(h,id);
2458 // merge fSignals histograms
2459 hm = (TH1F*)cal->fSignals.At(id);
2460 h = (TH1F*)fSignals.At(id);
2462 h=new TH1F(Form("hisSignal%d",id),Form("hisSignal%d",id),100,0,300);
2464 fSignals.AddAt(h,id);
2469 // merge ProfileY histograms -0
2470 h2m = (TH2F*)cal->fDeltaYres.At(id);
2471 h2 = (TH2F*)fDeltaYres.At(id);
2472 if (h2m&&h2) h2->Add(h2m);
2474 h2m = (TH2F*)cal->fDeltaZres.At(id);
2475 h2 = (TH2F*)fDeltaZres.At(id);
2476 if (h2m&&h2) h2->Add(h2m);
2477 // merge ProfileY histograms - 2
2478 h2m = (TH2F*)cal->fDeltaYres2.At(id);
2479 h2 = (TH2F*)fDeltaYres2.At(id);
2480 if (h2m&&h2) h2->Add(h2m);
2482 h2m = (TH2F*)cal->fDeltaZres2.At(id);
2483 h2 = (TH2F*)fDeltaZres2.At(id);
2484 if (h2m&&h2) h2->Add(h2m);
2486 // merge ProfileY histograms - abs
2487 h2m = (TH2F*)cal->fDeltaYresAbs.At(id);
2488 h2 = (TH2F*)fDeltaYresAbs.At(id);
2489 if (h2m&&h2) h2->Add(h2m);
2491 h2m = (TH2F*)cal->fDeltaZresAbs.At(id);
2492 h2 = (TH2F*)fDeltaZresAbs.At(id);
2493 if (h2m&&h2) h2->Add(h2m);
2494 // merge ProfileY histograms - 3
2495 //h2m = (TH2F*)cal->fDeltaYres3.At(id);
2496 //h2 = (TH2F*)fDeltaYres3.At(id);
2497 //if (h2m) h2->Add(h2m);
2499 //h2m = (TH2F*)cal->fDeltaZres3.At(id);
2500 //h2 = (TH2F*)fDeltaZres3.At(id);
2501 //if (h2m) h->Add(h2m);
2509 void AliTPCcalibLaser::MakeFitHistos(){
2511 // Make a fit histograms
2513 // Number of clusters
2515 //TH2F *fHisNclIn; //->Number of clusters inner
2516 //TH2F *fHisNclOut; //->Number of clusters outer
2517 //TH2F *fHisNclIO; //->Number of cluster inner outer
2518 // TH2F *fHisdEdx; //->dEdx histo
2519 fHisNclIn = new TH2F("HisNclIn","HisNclIn",336,0,336,64,10,64);
2520 fHisNclOut = new TH2F("HisNclOut","HisNclOut",336,0,336,100,10,100);
2521 fHisNclIO = new TH2F("HisNclIO","HisNclIO",336,0,336,160,10,160);
2523 fHisLclIn = new TH2F("HisLclIn","HisLclIn",336,0,336,64,10,64);
2524 fHisLclOut = new TH2F("HisLclOut","HisLclOut",336,0,336,100,10,150);
2525 fHisLclIO = new TH2F("HisLclIO","HisLclIO",336,0,336,160,10,160);
2527 fHisdEdx = new TH2F("HisdEdx","HisdEdx",336,0,336,160,1,50);
2528 fHisdZfit = new TH2F("HisdZfit","HisdZfit",336,0,336,300,-0.3,0.3);
2533 // TH2F *fHisChi2YIn1; //->chi2 y inner - line
2534 // TH2F *fHisChi2YOut1; //->chi2 y inner - line
2535 // TH2F *fHisChi2YIn2; //->chi2 y inner - parabola
2536 // TH2F *fHisChi2YOut2; //->chi2 y inner - parabola
2537 // TH2F *fHisChi2YIO1; //->chi2 y IO - common
2538 fHisChi2YIn1 = new TH2F("Chi2YIn1","Chi2YIn1",336,0,336,500,0.001,0.5);
2539 fHisChi2YOut1 = new TH2F("Chi2YOut1","Chi2YOut1",336,0,336,500,0.001,0.5);
2540 fHisChi2YIn2 = new TH2F("Chi2YIn2","Chi2YIn2",336,0,336,500,0.001,0.5);
2541 fHisChi2YOut2 = new TH2F("Chi2YOut2","Chi2YOut2",336,0,336,500,0.001,0.5);
2542 fHisChi2YIO1 = new TH2F("Chi2YIO1","Chi2YIO1",336,0,336,500,0.001,0.5);
2543 // TH2F *fHisChi2ZIn1; //->chi2 z inner - line
2544 // TH2F *fHisChi2ZOut1; //->chi2 z inner - line
2545 // TH2F *fHisChi2ZIn2; //->chi2 z inner - parabola
2546 // TH2F *fHisChi2ZOut2; //->chi2 z inner - parabola
2547 // TH2F *fHisChi2ZIO1; //->chi2 z IO - common
2548 fHisChi2ZIn1 = new TH2F("Chi2ZIn1","Chi2ZIn1",336,0,336,500,0.001,0.5);
2549 fHisChi2ZOut1 = new TH2F("Chi2ZOut1","Chi2ZOut1",336,0,336,500,0.001,0.5);
2550 fHisChi2ZIn2 = new TH2F("Chi2ZIn2","Chi2ZIn2",336,0,336,500,0.001,0.5);
2551 fHisChi2ZOut2 = new TH2F("Chi2ZOut2","Chi2ZOut2",336,0,336,500,0.001,0.5);
2552 fHisChi2ZIO1 = new TH2F("Chi2ZIO1","Chi2ZIO1",336,0,336,500,0.001,0.5);
2557 // TH2F *fHisPy1vP0; //-> delta y P0outer-P0inner - line
2558 // TH2F *fHisPy2vP0; //-> delta y P0outer-P0inner - parabola
2559 // TH2F *fHisPy3vP0; //-> delta y P0outer-P0inner - common parabola
2560 // TH2F *fHisPy1vP1; //-> delta ky P1outer-P1inner - line
2561 // TH2F *fHisPy2vP1; //-> delta ky P1outer-P1inner - parabola
2562 // TH2F *fHisPy3vP1; //-> delta ky P1outer-P1inner - common parabola
2563 // TH2F *fHisPy2vP2In; //-> Curv P2inner - parabola
2564 // TH2F *fHisPy2vP2Out; //-> Curv P2outer - parabola
2565 // TH2F *fHisPy3vP2IO; //-> Curv P2outerinner - common parabola
2566 fHisPy1vP0 = new TH2F("HisPy1vP0", "HisPy1vP0",336,0,336,500,-0.3,0.3);
2567 fHisPy2vP0 = new TH2F("HisPy2vP0", "HisPy2vP0",336,0,336,500,-0.3,0.3);
2568 fHisPy3vP0 = new TH2F("HisPy3vP0", "HisPy3vP0",336,0,336,500,-0.3,0.3);
2569 fHisPy1vP1 = new TH2F("HisPy1vP1", "HisPy1vP1",336,0,336,500,-0.01,0.01);
2570 fHisPy2vP1 = new TH2F("HisPy2vP1", "HisPy2vP1",336,0,336,500,-0.01,0.01);
2571 fHisPy3vP1 = new TH2F("HisPy3vP1", "HisPy3vP1",336,0,336,500,-0.01,0.01);
2572 fHisPy2vP2In = new TH2F("HisPy2vP2In", "HisPy2vP2In",336,0,336,500,-0.0003,0.0003);
2573 fHisPy2vP2Out= new TH2F("HisPy2vP2Out","HisPy2vP2Out",336,0,336,500,-0.0003,0.0003);
2574 fHisPy3vP2IO = new TH2F("HisPy3vP2IO", "HisPy3vP2IO",336,0,336,500,-0.0003,0.0003);
2577 // TH2F *fHisPz1vP0; //-> delta z P0outer-P0inner - line
2578 // TH2F *fHisPz2vP0; //-> delta z P0outer-P0inner - parabola
2579 // TH2F *fHisPz3vP0; //-> delta z P0outer-P0inner - common parabola
2580 // TH2F *fHisPz1vP1; //-> delta kz P1outer-P1inner - line
2581 // TH2F *fHisPz2vP1; //-> delta kz P1outer-P1inner - parabola
2582 // TH2F *fHisPz3vP1; //-> delta kz P1outer-P1inner - common parabola
2583 // TH2F *fHisPz2vP2In; //-> Curv P2inner - parabola
2584 // TH2F *fHisPz2vP2Out; //-> Curv P2outer - parabola
2585 // TH2F *fHisPz3vP2IO; //-> Curv P2outerinner - common parabola
2586 fHisPz1vP0 = new TH2F("HisPz1vP0", "HisPz1vP0",336,0,336,500,-0.3,0.3);
2587 fHisPz2vP0 = new TH2F("HisPz2vP0", "HisPz2vP0",336,0,336,500,-0.3,0.3);
2588 fHisPz3vP0 = new TH2F("HisPz3vP0", "HisPz3vP0",336,0,336,500,-0.3,0.3);
2589 fHisPz1vP1 = new TH2F("HisPz1vP1", "HisPz1vP1",336,0,336,500,-0.01,0.01);
2590 fHisPz2vP1 = new TH2F("HisPz2vP1", "HisPz2vP1",336,0,336,500,-0.01,0.01);
2591 fHisPz3vP1 = new TH2F("HisPz3vP1", "HisPz3vP1",336,0,336,500,-0.01,0.01);
2592 fHisPz2vP2In = new TH2F("HisPz2vP2In", "HisPz2vP2In",336,0,336,500,-0.0003,0.0003);
2593 fHisPz2vP2Out= new TH2F("HisPz2vP2Out","HisPz2vP2Out",336,0,336,500,-0.0002,0.0002);
2594 fHisPz3vP2IO = new TH2F("HisPz3vP2IO", "HisPz3vP2IO",336,0,336,500,-0.0002,0.0002);
2596 fHisNclIn->SetDirectory(0); //->Number of clusters inner
2597 fHisNclOut->SetDirectory(0); //->Number of clusters outer
2598 fHisNclIO->SetDirectory(0); //->Number of cluster inner outer
2599 fHisLclIn->SetDirectory(0); //->Level arm inner
2600 fHisLclOut->SetDirectory(0); //->Level arm outer
2601 fHisLclIO->SetDirectory(0); //->Number of cluster inner outer
2602 fHisdEdx->SetDirectory(0); //->Number of cluster inner outer
2603 fHisdZfit->SetDirectory(0); //->Number of cluster inner outer
2606 fHisChi2YIn1->SetDirectory(0); //->chi2 y inner - line
2607 fHisChi2YOut1->SetDirectory(0); //->chi2 y inner - line
2608 fHisChi2YIn2->SetDirectory(0); //->chi2 y inner - parabola
2609 fHisChi2YOut2->SetDirectory(0); //->chi2 y inner - parabola
2610 fHisChi2YIO1->SetDirectory(0); //->chi2 y IO - common
2611 fHisChi2ZIn1->SetDirectory(0); //->chi2 z inner - line
2612 fHisChi2ZOut1->SetDirectory(0); //->chi2 z inner - line
2613 fHisChi2ZIn2->SetDirectory(0); //->chi2 z inner - parabola
2614 fHisChi2ZOut2->SetDirectory(0); //->chi2 z inner - parabola
2615 fHisChi2ZIO1->SetDirectory(0); //->chi2 z IO - common
2618 fHisPy1vP0->SetDirectory(0); //-> delta y P0outer-P0inner - line
2619 fHisPy2vP0->SetDirectory(0); //-> delta y P0outer-P0inner - parabola
2620 fHisPy3vP0->SetDirectory(0); //-> delta y P0outer-P0inner - common parabola
2621 fHisPy1vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - line
2622 fHisPy2vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - parabola
2623 fHisPy3vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - common parabola
2624 fHisPy2vP2In->SetDirectory(0); //-> Curv P2inner - parabola
2625 fHisPy2vP2Out->SetDirectory(0); //-> Curv P2outer - parabola
2626 fHisPy3vP2IO->SetDirectory(0); //-> Curv P2outerinner - common parabola
2629 fHisPz1vP0->SetDirectory(0); //-> delta z P0outer-P0inner - line
2630 fHisPz2vP0->SetDirectory(0); //-> delta z P0outer-P0inner - parabola
2631 fHisPz3vP0->SetDirectory(0); //-> delta z P0outer-P0inner - common parabola
2632 fHisPz1vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - line
2633 fHisPz2vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - parabola
2634 fHisPz3vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - common parabola
2635 fHisPz2vP2In->SetDirectory(0); //-> Curv P2inner - parabola
2636 fHisPz2vP2Out->SetDirectory(0); //-> Curv P2outer - parabola
2637 fHisPz3vP2IO->SetDirectory(0); //-> Curv P2outerinner - common parabola
2643 for (Int_t id=0; id<336;id++){
2644 TH2F *profy = (TH2F*)fDeltaYres.UncheckedAt(id);
2645 TH2F *profz = (TH2F*)fDeltaZres.UncheckedAt(id);
2646 TH2F *profy2 = (TH2F*)fDeltaYres2.UncheckedAt(id);
2647 TH2F *profz2 = (TH2F*)fDeltaZres2.UncheckedAt(id);
2648 TH2F *profyabs = (TH2F*)fDeltaYresAbs.UncheckedAt(id);
2649 TH2F *profzabs = (TH2F*)fDeltaYresAbs.UncheckedAt(id);
2650 // TH2F *profy3 = (TH2F*)fDeltaYres3.UncheckedAt(id);
2651 //TH2F *profz3 = (TH2F*)fDeltaZres3.UncheckedAt(id);
2653 profy=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d -Linear",id),160,0,160,50,-0.5,0.5);
2654 profy->SetDirectory(0);
2655 fDeltaYres.AddAt(profy,id);
2656 profy2=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d -Parabolic",id),160,0,160,50,-0.5,0.5);
2657 profy2->SetDirectory(0);
2658 fDeltaYres2.AddAt(profy2,id);
2659 profyabs=new TH2F(Form("pryabs%03d",id),Form("Y Residuals for Laser Beam %03d -Absolute",id),160,0,160,100,-1.0,1.0); // has to be bigger based on earlier studies
2660 profyabs->SetDirectory(0);
2661 fDeltaYresAbs.AddAt(profyabs,id);
2662 //profy3=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d- Parabolic2",id),160,0,160,100,-0.5,0.5);
2663 //profy3->SetDirectory(0);
2664 //fDeltaYres3.AddAt(profy3,id);
2667 profz=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d Linear",id),160,0,160,50,-0.5,0.5);
2668 profz->SetDirectory(0);
2669 fDeltaZres.AddAt(profz,id);
2670 profz2=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d - Parabolic",id),160,0,160,50,-0.5,0.5);
2671 profz2->SetDirectory(0);
2672 fDeltaZres2.AddAt(profz2,id);
2673 profzabs=new TH2F(Form("przabs%03d",id),Form("Z Residuals for Laser Beam %03d -Absolute",id),160,0,160,100,-1.0,1.0); // has to be bigger based on earlier studies
2674 profzabs->SetDirectory(0);
2675 fDeltaZresAbs.AddAt(profzabs,id);
2676 //profz3=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d- Parabolic2",id),160,0,160,100,-0.5,0.5);
2677 //profz3->SetDirectory(0);
2678 //fDeltaZres3.AddAt(profz3,id);
2683 for (Int_t id=0; id<336;id++){
2684 TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
2685 TH1F * hisP3 = (TH1F*)fDeltaP3.At(id);
2686 TH1F * hisP4 = (TH1F*)fDeltaP4.At(id);
2688 TH1F * hisdphi = (TH1F*)fDeltaPhi.At(id);
2689 TH1F * hisdphiP = (TH1F*)fDeltaPhiP.At(id);
2690 TH1F * hisSignal = (TH1F*)fSignals.At(id);
2693 hisdz = new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
2694 hisdz->SetDirectory(0);
2695 fDeltaZ.AddAt(hisdz,id);
2697 hisP3 = new TH1F(Form("hisPar3v%d",id),Form("hisPar3v%d",id),400,-0.06,0.06);
2698 hisP3->SetDirectory(0);
2699 fDeltaP3.AddAt(hisP3,id);
2701 hisP4 = new TH1F(Form("hisPar4v%d",id),Form("hisPar4v%d",id),200,-0.06,0.06);
2702 hisP4->SetDirectory(0);
2703 fDeltaP4.AddAt(hisP4,id);
2706 hisdphi = new TH1F(Form("hisdphi%d",id),Form("hisdphi%d",id),1000,-1,1);
2707 hisdphi->SetDirectory(0);
2708 fDeltaPhi.AddAt(hisdphi,id);
2710 hisdphiP = new TH1F(Form("hisdphiP%d",id),Form("hisdphiP%d",id),1000,-0.01,0.01);
2711 hisdphiP->SetDirectory(0);
2712 fDeltaPhiP.AddAt(hisdphiP,id);
2713 hisSignal = new TH1F(Form("hisSignal%d",id),Form("hisSignal%d",id),100,0,300);
2714 hisSignal->SetDirectory(0);
2715 fSignals.AddAt(hisSignal,id);
2719 SetBeamParameters(fBeamOffsetZOuter, fBeamSlopeZOuter, fBeamSectorOuter,2);
2720 SetBeamParameters(fBeamOffsetZInner, fBeamSlopeZInner, fBeamSectorInner,3);
2721 SetBeamParameters(fBeamOffsetYOuter, fBeamSlopeYOuter, fBeamSectorOuter,0);
2722 SetBeamParameters(fBeamOffsetYInner, fBeamSlopeYInner, fBeamSectorInner,1);
2725 void AliTPCcalibLaser::MergeFitHistos(AliTPCcalibLaser * laser){
2727 // Merge content of histograms
2729 // Only first histogram is checked - all other should be the same
2730 if (!laser->fHisNclIn) return; // empty histograms
2731 if (!fHisNclIn) MakeFitHistos();
2734 fHisNclIn->Add(laser->fHisNclIn ); //->Number of clusters inner
2735 fHisNclOut->Add(laser->fHisNclOut ); //->Number of clusters outer
2736 fHisNclIO->Add(laser->fHisNclIO ); //->Number of cluster inner outer
2737 fHisLclIn->Add(laser->fHisLclIn ); //->Level arm inner
2738 fHisLclOut->Add(laser->fHisLclOut ); //->Level arm outer
2739 fHisLclIO->Add(laser->fHisLclIO ); //->Number of cluster inner outer
2740 fHisdEdx->Add(laser->fHisdEdx ); //->dedx
2741 fHisdZfit->Add(laser->fHisdZfit ); //->dedx
2744 fHisChi2YIn1->Add(laser->fHisChi2YIn1 ); //->chi2 y inner - line
2745 fHisChi2YOut1->Add(laser->fHisChi2YOut1 ); //->chi2 y inner - line
2746 fHisChi2YIn2->Add(laser->fHisChi2YIn2 ); //->chi2 y inner - parabola
2747 fHisChi2YOut2->Add(laser->fHisChi2YOut2 ); //->chi2 y inner - parabola
2748 fHisChi2YIO1->Add(laser->fHisChi2YIO1 ); //->chi2 y IO - common
2749 fHisChi2ZIn1->Add(laser->fHisChi2ZIn1 ); //->chi2 z inner - line
2750 fHisChi2ZOut1->Add(laser->fHisChi2ZOut1 ); //->chi2 z inner - line
2751 fHisChi2ZIn2->Add(laser->fHisChi2ZIn2 ); //->chi2 z inner - parabola
2752 fHisChi2ZOut2->Add(laser->fHisChi2ZOut2 ); //->chi2 z inner - parabola
2753 fHisChi2ZIO1->Add(laser->fHisChi2ZIO1 ); //->chi2 z IO - common
2756 fHisPy1vP0->Add(laser->fHisPy1vP0 ); //-> delta y P0outer-P0inner - line
2757 fHisPy2vP0->Add(laser->fHisPy2vP0 ); //-> delta y P0outer-P0inner - parabola
2758 fHisPy3vP0->Add(laser->fHisPy3vP0 ); //-> delta y P0outer-P0inner - common parabola
2759 fHisPy1vP1->Add(laser->fHisPy1vP1 ); //-> delta ky P1outer-P1inner - line
2760 fHisPy2vP1->Add(laser->fHisPy2vP1 ); //-> delta ky P1outer-P1inner - parabola
2761 fHisPy3vP1->Add(laser->fHisPy3vP1 ); //-> delta ky P1outer-P1inner - common parabola
2762 fHisPy2vP2In->Add(laser-> fHisPy2vP2In ); //-> Curv P2inner - parabola
2763 fHisPy2vP2Out->Add(laser->fHisPy2vP2Out ); //-> Curv P2outer - parabola
2764 fHisPy3vP2IO->Add(laser->fHisPy3vP2IO ); //-> Curv P2outerinner - common parabola
2767 fHisPz1vP0->Add(laser->fHisPz1vP0 ); //-> delta z P0outer-P0inner - line
2768 fHisPz2vP0->Add(laser->fHisPz2vP0 ); //-> delta z P0outer-P0inner - parabola
2769 fHisPz3vP0->Add(laser->fHisPz3vP0 ); //-> delta z P0outer-P0inner - common parabola
2770 fHisPz1vP1->Add(laser->fHisPz1vP1 ); //-> delta kz P1outer-P1inner - line
2771 fHisPz2vP1->Add(laser->fHisPz2vP1 ); //-> delta kz P1outer-P1inner - parabola
2772 fHisPz3vP1->Add(laser->fHisPz3vP1 ); //-> delta kz P1outer-P1inner - common parabola
2773 fHisPz2vP2In->Add(laser->fHisPz2vP2In ); //-> Curv P2inner - parabola
2774 fHisPz2vP2Out->Add(laser->fHisPz2vP2Out ); //-> Curv P2outer - parabola
2775 fHisPz3vP2IO->Add(laser->fHisPz3vP2IO ); //-> Curv P2outerinner - common parabola
2788 void AliTPCcalibLaser::DumpFitInfo(TTree * chainFit,Int_t id){
2790 // Dump fit information - collect information from the streamers
2793 TChain * chainFit=0;
2794 TChain * chainTrack=0;
2797 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
2798 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+");
2799 AliXRDPROOFtoolkit tool;
2800 chainTrack = tool.MakeChain("laser.txt","Track",0,10200);
2801 chainTrack->Lookup();
2802 chainTrack->SetProof(kTRUE);
2803 chainDrift = tool.MakeChain("laser.txt","driftv",0,10200);
2804 chainDrift->Lookup();
2805 chainDrift->SetProof(kTRUE);
2807 chain = tool.MakeChain("laser.txt","Residuals",0,10200);
2809 chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
2811 chainFit->SetProof(kTRUE);
2812 chain->SetProof(kTRUE);
2813 AliTPCLaserTrack::LoadTracks();
2814 //AliTPCcalibLaser::DumpFitInfo(chainFit,0);
2820 TCut cutP3("abs(Tr.fP[3])<0.1");
2821 TCut cutP4("abs(Tr.fP[4])<0.5");
2822 TCut cutPx = cutP3+cutP4;
2823 TCut cutChi2YOut("sqrt(chi2y2Out*dEdx)<5&&chi2y2Out>0");
2824 TCut cutChi2ZOut("sqrt(chi2z2Out*dEdx)<5&&chi2z2Out>0");
2825 TCut cutChi2YIn("sqrt(chi2y2In*dEdx)<5&&chi2y2In>0");
2826 TCut cutChi2ZIn("sqrt(chi2z2In*dEdx)<5&&chi2z2In>0");
2828 TCut cutdEdx("sqrt(dEdx)>3");
2829 TCut cutDY("abs(yPol2In.fElements[2]*nclI*nclI/4.)<3");
2830 TCut cutN("nclO>20&&nclI>20");
2831 TCut cutA = cutChi2YOut+cutChi2ZOut+cutChi2YIn+cutChi2ZIn+cutN+cutdEdx+cutPx+"accept";
2835 TCut cutClY("abs(Cl[].fY-TrYpol2.fElements)<0.15");
2836 TCut cutClZ("abs(Cl[].fZ-TrZpol2.fElements)<0.15");
2837 TCut cutClX("abs(Cl[].fX)>10");
2838 TCut cutE("abs(Cl[].fY/Cl[].fX)<0.14");
2839 TCut cutSY("sqrt(Cl[].fSigmaY2)>0.05");
2840 TCut cutSZ("sqrt(Cl[].fSigmaZ2)>0.05");
2841 TCut cutQ("sqrt(Cl[].fMax)>4");
2842 TCut cutCl=cutClY+cutClZ+cutClX+cutE+cutSY+cutSZ+cutQ;
2846 TH1F * phisAccept = 0;
2848 TProfile * pdEdx = 0;
2856 TProfile * pNclI = 0;
2857 TProfile * pNclO = 0;
2859 TProfile * pchi2YIn =0;
2860 TProfile * pchi2ZIn =0;
2861 TProfile * pchi2YOut =0;
2862 TProfile * pchi2ZOut =0;
2863 TProfile * pchi2YInOut =0;
2864 TProfile * pchi2ZInOut =0;;
2866 chainFit->Draw("LTr.fId>>hisAl(350,0,350)","LTr.fId<350");
2867 phisAl = (TH1F*)gROOT->FindObject("hisAl");
2868 chainFit->Draw("LTr.fId>>hisAccept(350,0,350)","LTr.fId<350"+cutA);
2869 phisAccept = (TH1F*)gROOT->FindObject("hisAccept");
2870 chainFit->Draw("LTr.fId>>hisOut(350,0,350)","LTr.fId<350"+!cutA);
2871 phisOut = (TH1F*)gROOT->FindObject("hisOut");
2873 chainFit->Draw("sqrt(dEdx):LTr.fId>>hdEdx(350,0,350)","","prof");
2874 pdEdx = (TProfile*)gROOT->FindObject("hdEdx");
2877 chainFit->Draw("Tr.fP[0]:LTr.fId>>hP0(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2878 pP0 = (TProfile*)gROOT->FindObject("hP0");
2879 chainFit->Draw("Tr.fP[1]:LTr.fId>>hP1(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2880 pP1 = (TProfile*)gROOT->FindObject("hP1");
2881 chainFit->Draw("Tr.fP[2]:LTr.fId>>hP2(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2882 pP2 = (TProfile*)gROOT->FindObject("hP2");
2883 chainFit->Draw("Tr.fP[3]:LTr.fId>>hP3(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2884 pP3 = (TProfile*)gROOT->FindObject("hP3");
2885 chainFit->Draw("Tr.fP[4]:LTr.fId>>hP4(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2886 pP4 = (TProfile*)gROOT->FindObject("hP4");
2888 chainFit->Draw("nclI:LTr.fId>>hNclI(350,0,350)","","prof");
2889 pNclI = (TProfile*)gROOT->FindObject("hNclI");
2890 chainFit->Draw("nclO:LTr.fId>>hNclO(350,0,350)","","prof");
2891 pNclO = (TProfile*)gROOT->FindObject("hNclO");
2894 chainFit->Draw("sqrt(chi2y2In):LTr.fId>>hChi2YIn(350,0,350)",cutA+"","prof");
2895 pchi2YIn = (TProfile*)gROOT->FindObject("hChi2YIn");
2896 chainFit->Draw("sqrt(chi2y2Out):LTr.fId>>hChi2YOut(350,0,350)",cutA+"","prof");
2897 pchi2YOut = (TProfile*)gROOT->FindObject("hChi2YOut");
2898 chainFit->Draw("sqrt(chi2yInOut):LTr.fId>>hChi2YInOut(350,0,350)",cutA+"","prof");
2899 pchi2YInOut = (TProfile*)gROOT->FindObject("hChi2YInOut");
2900 chainFit->Draw("sqrt(chi2z2In):LTr.fId>>hChi2ZIn(350,0,350)",cutA+"","prof");
2901 pchi2ZIn = (TProfile*)gROOT->FindObject("hChi2ZIn");
2902 chainFit->Draw("sqrt(chi2z2Out):LTr.fId>>hChi2ZOut(350,0,350)",cutA+"","prof");
2903 pchi2ZOut = (TProfile*)gROOT->FindObject("hChi2ZOut");
2904 chainFit->Draw("sqrt(chi2zInOut):LTr.fId>>hChi2ZInOut(350,0,350)",cutA+"","prof");
2905 pchi2ZInOut = (TProfile*)gROOT->FindObject("hChi2ZInOut");
2907 // second derivatives
2909 TH2F * phisPy2In = new TH2F("Py2Inner","Py2Inner",350,0,350,100,-0.001,0.001);
2910 chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>Py2Inner",cutA,"");
2911 TH2F * phisPy2Out = new TH2F("Py2Outer","Py2Outer",350,0,350,200,-0.0005,0.0005);
2912 chainFit->Draw("yPol2Out.fElements[2]:LTr.fId>>Py2Outer",cutA,"");
2913 TH2F * phisPy2InOut = new TH2F("Py2InOut","Py2InOut",350,0,350,200,-0.0005,0.0005);
2914 chainFit->Draw("yInOut.fElements[4]:LTr.fId>>Py2InOut",cutA,"");
2916 phisPy2In->FitSlicesY();
2917 TH1D * phisPy2InEntries = (TH1D*)gROOT->FindObject("Py2Inner_0");
2918 TH1D * phisPy2InMean = (TH1D*)gROOT->FindObject("Py2Inner_1");
2919 TH1D * phisPy2InSigma = (TH1D*)gROOT->FindObject("Py2Inner_2");
2921 phisPy2Out->FitSlicesY();
2922 TH1D * phisPy2OutEntries = (TH1D*)gROOT->FindObject("Py2Outer_0");
2923 TH1D * phisPy2OutMean = (TH1D*)gROOT->FindObject("Py2Outer_1");
2924 TH1D * phisPy2OutSigma = (TH1D*)gROOT->FindObject("Py2Outer_2");
2926 phisPy2InOut->FitSlicesY();
2927 TH1D * phisPy2InOutEntries = (TH1D*)gROOT->FindObject("Py2InOut_0");
2928 TH1D * phisPy2InOutMean = (TH1D*)gROOT->FindObject("Py2InOut_1");
2929 TH1D * phisPy2InOutSigma = (TH1D*)gROOT->FindObject("Py2InOut_2");
2931 TH2F * phisPz2In = new TH2F("Pz2Inner","Pz2Inner",350,0,350,100,-0.001,0.001);
2932 chainFit->Draw("zPol2In.fElements[2]:LTr.fId>>Pz2Inner",cutA,"");
2933 TH2F * phisPz2Out = new TH2F("Pz2Outer","Pz2Outer",350,0,350,200,-0.0005,0.0005);
2934 chainFit->Draw("zPol2Out.fElements[2]:LTr.fId>>Pz2Outer",cutA,"");
2935 TH2F * phisPz2InOut = new TH2F("Pz2InOut","Pz2InOut",350,0,350,200,-0.0005,0.0005);
2936 chainFit->Draw("zInOut.fElements[4]:LTr.fId>>Pz2InOut",cutA,"");
2938 phisPz2In->FitSlicesY();
2939 TH1D * phisPz2InEntries = (TH1D*)gROOT->FindObject("Pz2Inner_0");
2940 TH1D * phisPz2InMean = (TH1D*)gROOT->FindObject("Pz2Inner_1");
2941 TH1D * phisPz2InSigma = (TH1D*)gROOT->FindObject("Pz2Inner_2");
2943 phisPz2Out->FitSlicesY();
2944 TH1D * phisPz2OutEntries = (TH1D*)gROOT->FindObject("Pz2Outer_0");
2945 TH1D * phisPz2OutMean = (TH1D*)gROOT->FindObject("Pz2Outer_1");
2946 TH1D * phisPz2OutSigma = (TH1D*)gROOT->FindObject("Pz2Outer_2");
2948 phisPz2InOut->FitSlicesY();
2949 TH1D * phisPz2InOutEntries = (TH1D*)gROOT->FindObject("Pz2InOut_0");
2950 TH1D * phisPz2InOutMean = (TH1D*)gROOT->FindObject("Pz2InOut_1");
2951 TH1D * phisPz2InOutSigma = (TH1D*)gROOT->FindObject("Pz2InOut_2");
2958 TTreeSRedirector *pcstream = new TTreeSRedirector("vscan.root");
2959 for (Int_t ilaser=0; ilaser<336; ilaser++){
2960 Float_t all=phisAl->GetBinContent(ilaser+1);
2961 Float_t accept=phisAccept->GetBinContent(ilaser+1);
2962 Float_t out=phisOut->GetBinContent(ilaser+1);
2963 Float_t sdedx = pdEdx->GetBinContent(ilaser+1);
2964 Float_t mP0 = pP0->GetBinContent(ilaser+1);
2965 Float_t mP1 = pP1->GetBinContent(ilaser+1);
2966 Float_t mP2 = pP2->GetBinContent(ilaser+1);
2967 Float_t mP3 = pP3->GetBinContent(ilaser+1);
2968 Float_t mP4 = pP4->GetBinContent(ilaser+1);
2971 Float_t nclI = pNclI->GetBinContent(ilaser+1);
2972 Float_t nclO = pNclO->GetBinContent(ilaser+1);
2974 Float_t chi2YIn=pchi2YIn->GetBinContent(ilaser+1);
2975 Float_t chi2YOut=pchi2YOut->GetBinContent(ilaser+1);
2976 Float_t chi2YInOut=pchi2YInOut->GetBinContent(ilaser+1);
2977 Float_t chi2ZIn=pchi2ZIn->GetBinContent(ilaser+1);
2978 Float_t chi2ZOut=pchi2ZOut->GetBinContent(ilaser+1);
2979 Float_t chi2ZInOut=pchi2ZInOut->GetBinContent(ilaser+1);
2981 Float_t entriesPy2In = phisPy2InEntries->GetBinContent(ilaser+1);
2982 Float_t meanPy2In = phisPy2InMean->GetBinContent(ilaser+1);
2983 Float_t sigmaPy2In = phisPy2InSigma->GetBinContent(ilaser+1);
2985 Float_t entriesPy2Out = phisPy2OutEntries->GetBinContent(ilaser+1);
2986 Float_t meanPy2Out = phisPy2OutMean->GetBinContent(ilaser+1);
2987 Float_t sigmaPy2Out = phisPy2OutSigma->GetBinContent(ilaser+1);
2989 Float_t entriesPy2InOut = phisPy2InOutEntries->GetBinContent(ilaser+1);
2990 Float_t meanPy2InOut = phisPy2InOutMean->GetBinContent(ilaser+1);
2991 Float_t sigmaPy2InOut = phisPy2InOutSigma->GetBinContent(ilaser+1);
2993 Float_t entriesPz2In = phisPz2InEntries->GetBinContent(ilaser+1);
2994 Float_t meanPz2In = phisPz2InMean->GetBinContent(ilaser+1);
2995 Float_t sigmaPz2In = phisPz2InSigma->GetBinContent(ilaser+1);
2997 Float_t entriesPz2Out = phisPz2OutEntries->GetBinContent(ilaser+1);
2998 Float_t meanPz2Out = phisPz2OutMean->GetBinContent(ilaser+1);
2999 Float_t sigmaPz2Out = phisPz2OutSigma->GetBinContent(ilaser+1);
3001 Float_t entriesPz2InOut = phisPz2InOutEntries->GetBinContent(ilaser+1);
3002 Float_t meanPz2InOut = phisPz2InOutMean->GetBinContent(ilaser+1);
3003 Float_t sigmaPz2InOut = phisPz2InOutSigma->GetBinContent(ilaser+1);
3005 AliTPCLaserTrack* ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(ilaser);
3006 (*pcstream)<<"Scan"<<
3020 "chi2YIn="<<chi2YIn<<
3021 "chi2YOut="<<chi2YOut<<
3022 "chi2YInOut="<<chi2YInOut<<
3023 "chi2ZIn="<<chi2ZIn<<
3024 "chi2ZOut="<<chi2ZOut<<
3025 "chi2ZInOut="<<chi2ZInOut<<
3027 "nPy2In="<<entriesPy2In<<
3028 "mPy2In="<<meanPy2In<<
3029 "sPy2In="<<sigmaPy2In<<
3031 "nPy2Out="<<entriesPy2Out<<
3032 "mPy2Out="<<meanPy2Out<<
3033 "sPy2Out="<<sigmaPy2Out<<
3035 "nPy2InOut="<<entriesPy2InOut<<
3036 "mPy2InOut="<<meanPy2InOut<<
3037 "sPy2InOut="<<sigmaPy2InOut<<
3039 "nPz2In="<<entriesPz2In<<
3040 "mPz2In="<<meanPz2In<<
3041 "sPz2In="<<sigmaPz2In<<
3043 "nPz2Out="<<entriesPz2Out<<
3044 "mPz2Out="<<meanPz2Out<<
3045 "sPz2Out="<<sigmaPz2Out<<
3047 "nPz2InOut="<<entriesPz2InOut<<
3048 "mPz2InOut="<<meanPz2InOut<<
3049 "sPz2InOut="<<sigmaPz2InOut<<
3057 void AliTPCcalibLaser::SetBeamParameters(TVectorD& meanOffset,
3058 TVectorD& meanSlope,
3059 TVectorD& sectorArray,
3062 // This method should ideally go in AliTPCLaser
3063 // option == 0 (pads outer - closest to beam)
3064 // option == 1 (pads inner)
3065 // option == 2 (time outer)
3066 // option == 3 (time inner)
3067 Int_t nFailures = 0;
3069 for(Int_t id = 0; id < 336; id++) {
3071 if (!AliTPCLaserTrack::GetTracks())
3072 AliTPCLaserTrack::LoadTracks();
3073 AliTPCLaserTrack *ltrp =
3074 (AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
3076 AliExternalTrackParam trackParam(*ltrp);
3078 Double_t deltaangle = 10.0; // sector is 1/2 a sector away from mirror
3079 if((option==1 || option==3)&& (ltrp->GetBeam()<=1 || ltrp->GetBeam()>=5))
3080 deltaangle = 30.0; // inner sector is 1 sector further away from mirror
3082 Double_t angle = trackParam.GetAlpha();
3084 angle += 2*TMath::Pi();
3085 if(trackParam.GetSnp()>0) // track points to sector "before"
3086 angle -= deltaangle*TMath::DegToRad();
3087 else // track points to sector "after"
3088 angle += deltaangle*TMath::DegToRad();
3090 Bool_t success = trackParam.Rotate(angle);
3093 // cout << "WARNING: Rotate failed for ID: " << id << endl;
3097 angle *= TMath::RadToDeg();
3099 Int_t sector = TMath::Nint((angle-10.0)/20.0);
3104 if(ltrp->GetSide()==1) // C side
3106 sectorArray[id] = sector;
3108 const Double_t x0 = 0;
3110 Double_t slopey = TMath::Tan(TMath::ASin(trackParam.GetSnp()));
3111 Double_t slopez = trackParam.GetTgl();
3112 // One needs a factor sqrt(1+slopey**2) to take into account the
3113 // longer path length
3114 slopez *= TMath::Sqrt(1.0 + slopey*slopey);
3115 if(fInverseSlopeZ) // wrong sign in database, should be fixed there
3117 // Double_t offsetz = trackParam.GetZ();
3118 Double_t offsety = trackParam.GetY() + slopey*(x0-trackParam.GetX());
3119 Double_t offsetz = trackParam.GetZ() + slopez*(x0-trackParam.GetX());
3120 if(option==2 || option==3) {
3121 meanOffset[id] = offsetz; meanSlope[id] = slopez;
3123 meanOffset[id] = offsety; meanSlope[id] = slopey;
3128 AliWarning(Form("Rotate method failed %d times", nFailures));
3133 TFile f("vscan.root");
3138 chain->Draw("Cl[].fPad-int(Cl[].fPad)",cutA+cutCl+"Cl[].fZ>0&&Cl[].fPad>1","",10000);
3140 chain->Draw("Cl[].fY-TrYpol1.fElements:Cl[].fPad-int(Cl[].fPad)",cutA+cutCl+"Cl[].fZ>0&&Cl[].fPad>1","prof",10000);
3143 chain->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);
3146 chain->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)
3155 // check edge effects
3156 chain->Draw("Cl.fY-TrYpol1.fElements:Cl.fY/Cl.fX",""+cutA+cutCl,"prof",10000)
3158 chain->Draw("Cl.fY-TrYpol2.fElements:Cl.fPad-int(Cl.fPad)","Cl.fZ>0"+cutA+cutCl+cutE,"prof",100000)
3160 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)
3164 chainFit->Draw("yInOut.fElements[4]:LTr.fP[2]","LTr.fP[1]<0"+cutA,"prof",1000);
3165 chainFit->Draw("yPol2In.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&<r.fP[1]<0"+cutA+cutD,"prof")
3176 dedge = sign(Cl.fY)*(Cl.fX*tan(pi/18)-abs(Cl.fY))
3179 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)
3181 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)
3187 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)
3189 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)
3193 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)
3195 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)
3204 chainFit->Draw("yPol2Out.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&<r.fP[1]<0"+cutA+cutDY,"prof")
3206 chainFit->Draw("yPol2In.fElements[2]*64*64/4.:LTr.fP[2]","nclI>20&<r.fP[1]<0"+cutA+cutDY,"prof")
3210 chainFit->Draw("LTr.fId","nclI>10",100000)
3212 chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>his(350,0,350,100,-0.002,0.002)","nclI>20","")
3214 chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>hisPy2In0(350,0,350,100,-0.002,0.002)","nclI>20","");
3216 TH2 * phisPy2In = (TH2*) gROOT->FindObject("hisPy2In0")
3226 gSystem->Load("libSTAT.so")
3227 TStatToolkit toolkit;
3233 TCut cutA("entries>2&&pphi2<3&&abs(gphiP1-pphiP0)<0.003&&abs(gz1)<6");
3238 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz++"; //1
3239 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*LTr.fP[2]++"; //2
3240 fstring+="(abs(LTr.fP[1]/250)^1-1)*bz++"; //3
3241 fstring+="(abs(LTr.fP[1]/250)-1)*bz*LTr.fP[2]++"; //4
3243 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*sin(atan2(lx1,lx0))++" //5
3244 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*sin(atan2(lx1,lx0))*LTr.fP[2]++" //6
3245 fstring+="(abs(LTr.fP[1]/250)-1)*bz*sin(atan2(lx1,lx0))++" //7
3246 fstring+="(abs(LTr.fP[1]/250)-1)*bz*sin(atan2(lx1,lx0))*LTr.fP[2]++" //8
3248 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*cos(atan2(lx1,lx0))++" //9
3249 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*cos(atan2(lx1,lx0))*LTr.fP[2]++" //10
3250 fstring+="(abs(LTr.fP[1]/250)-1)*bz*cos(atan2(lx1,lx0))++" //11
3251 fstring+="(abs(LTr.fP[1]/250)-1)*bz*cos(atan2(lx1,lx0))*LTr.fP[2]++" //12
3256 TString *strq0 = toolkit.FitPlane(treeT,"gphi1-pphi0",fstring->Data(), "fSide==1"+cutA, chi2,npoints,fitParam,covMatrix);
3258 treeT->SetAlias("fit",strq0->Data());
3261 TString *strqP = toolkit.FitPlane(treeT,"1000*(gphiP1-pphiP0)",fstring->Data(), "fSide==1"+cutA, chi2,npoints,fitParam,covMatrix);
3263 treeT->SetAlias("fitP",strqP->Data());
3266 TString *strqDrift = toolkit.FitPlane(treeT,"gz1","LTr.fP[1]++(1-2*(fSide==1))++lx1", cutA, chi2,npoints,fitParam,covMatrix);
3267 treeT->SetAlias("fitD",strqDrift->Data());
3270 treeT->Draw("fit:LTr.fP[1]","abs(bz+0.4)<0.05"+cutA,"");
3272 for (Int_t i=0; i<6;i++){
3273 treeT->SetLineColor(i+2);
3274 treeT->SetMarkerSize(1);
3275 treeT->SetMarkerStyle(22+i);
3276 treeT->SetMarkerColor(i+2);
3278 treeT->Draw("fit:LTr.fP[1]",Form("abs(bz+0.4)<0.05&fRod==%d",i)+cutA,"same");
3286 TTree * tree = (TTree*)f.Get("FitModels");
3288 TEventList listLFit0("listLFit0","listLFit0");
3289 TEventList listLFit1("listLFit1","listLFit1");
3290 tree->Draw(">>listLFit0","seed.fdEdx<200&&seed.fdEdx>40");
3291 tree->SetEventList(&listLFit0);
3296 gSystem->Load("libSTAT.so")
3297 TStatToolkit toolkit;
3303 chain->SetAlias("dp","((Cl.fPad-int(Cl.fPad))*pi)");
3304 chain->SetAlias("dt","((Cl.fTimeBin-int(Cl.fTimeBin))*pi)");
3308 fstring+="cos(dp)++";
3309 fstring+="sin(dp)++";
3310 fstring+="cos(dt)++";
3311 fstring+="sin(dt)++";
3313 TString *str = toolkit.FitPlane(chain,"Cl.fZ-TrZInOut.fElements",fstring->Data(), "Cl.fDetector>35", chi2,npoints,fitParam,covMatrix,-1,0,200);
3326 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
3327 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
3328 AliXRDPROOFtoolkit tool;
3329 TChain * chainTrack = tool.MakeChain("laser.txt","Track",0,10200);
3330 chainTrack->Lookup();
3331 chainTrack->SetProof(kTRUE);
3333 TChain * chain = tool.MakeChain("laser.txt","Residuals",0,10200);
3335 TChain * chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
3337 chainFit->SetProof(kTRUE);
3338 chain->SetProof(kTRUE);
3342 TCut cutChi2YOut("sqrt(chi2y2Out*dEdx)<10");
3343 TCut cutChi2ZOut("sqrt(chi2z2Out*dEdx)<10");
3344 TCut cutChi2YIn("sqrt(chi2y2In*dEdx)<10");
3345 TCut cutChi2ZIn("sqrt(chi2z2In*dEdx)<10");
3347 TCut cutdEdx("sqrt(dEdx)<30&&sqrt(dEdx)>3");
3348 TCut cutDY("abs(yPol2In.fElements[2]*nclO*nclO/4.)<3")
3349 TCut cutN("nclO>20&&nclI>20");
3350 TCut cutA = cutChi2YOut+cutChi2ZOut+cutChi2YIn+cutChi2ZIn+cutN+cutdEdx;
3354 TCut cutClY("abs(Cl.fY-TrYpol2.fElements)<0.2");
3355 TCut cutClZ("abs(Cl.fZ-TrZpol2.fElements)<0.4");
3356 TCut cutClX("abs(Cl.fX)>10");
3357 TCut cutE("abs(Cl.fY/Cl.fX)<0.14");
3358 TCut cutCl=cutClY+cutClZ+cutClX;
3361 // check edge effects
3362 chain->Draw("Cl.fY-TrYpol1.fElements:Cl.fY/Cl.fX",""+cutA+cutCl,"prof",10000)
3364 chain->Draw("Cl.fY-TrYpol2.fElements:Cl.fPad-int(Cl.fPad)","Cl.fZ>0"+cutA+cutCl+cutE,"prof",100000)
3366 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)
3370 chainFit->Draw("yInOut.fElements[4]:LTr.fP[2]","LTr.fP[1]<0"+cutA,"prof",1000);
3371 chainFit->Draw("yPol2In.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&<r.fP[1]<0"+cutA+cutD,"prof")