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,10)
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 * chain = tool.MakeChain("laser.txt","Residuals",0,10200);
76 TChain * chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
83 #include "TLinearFitter.h"
84 #include "AliTPCcalibLaser.h"
85 #include "AliExternalTrackParam.h"
86 #include "AliESDEvent.h"
87 #include "AliESDfriend.h"
88 #include "AliESDtrack.h"
89 #include "AliTPCTracklet.h"
94 #include "TTreeStream.h"
97 #include "TGraphErrors.h"
98 #include "AliTPCclusterMI.h"
99 #include "AliTPCseed.h"
100 #include "AliTracker.h"
102 #include "TClonesArray.h"
108 #include "TStatToolkit.h"
112 #include "TTreeStream.h"
115 #include "AliTPCLaserTrack.h"
119 ClassImp(AliTPCcalibLaser)
121 AliTPCcalibLaser::AliTPCcalibLaser():
127 fTracksEsdParam(336),
136 fHisNclIn(0), //->Number of clusters inner
137 fHisNclOut(0), //->Number of clusters outer
138 fHisNclIO(0), //->Number of cluster inner outer
139 fHisLclIn(0), //->Level arm inner
140 fHisLclOut(0), //->Level arm outer
141 fHisLclIO(0), //->Number of cluster inner outer
142 fHisdEdx(0), //->dEdx histo
143 fHisdZfit(0), //->distance to the mirror after linear fit
146 fHisChi2YIn1(0), //->chi2 y inner - line
147 fHisChi2YOut1(0), //->chi2 y inner - line
148 fHisChi2YIn2(0), //->chi2 y inner - parabola
149 fHisChi2YOut2(0), //->chi2 y inner - parabola
150 fHisChi2YIO1(0), //->chi2 y IO - common
151 fHisChi2ZIn1(0), //->chi2 z inner - line
152 fHisChi2ZOut1(0), //->chi2 z inner - line
153 fHisChi2ZIn2(0), //->chi2 z inner - parabola
154 fHisChi2ZOut2(0), //->chi2 z inner - parabola
155 fHisChi2ZIO1(0), //->chi2 z IO - common
158 fHisPy1vP0(0), //-> delta y P0outer-P0inner - line
159 fHisPy2vP0(0), //-> delta y P0outer-P0inner - parabola
160 fHisPy3vP0(0), //-> delta y P0outer-P0inner - common parabola
161 fHisPy1vP1(0), //-> delta ky P1outer-P1inner - line
162 fHisPy2vP1(0), //-> delta ky P1outer-P1inner - parabola
163 fHisPy3vP1(0), //-> delta ky P1outer-P1inner - common parabola
164 fHisPy2vP2In(0), //-> Curv P2inner - parabola
165 fHisPy2vP2Out(0), //-> Curv P2outer - parabola
166 fHisPy3vP2IO(0), //-> Curv P2outerinner - common parabola
169 fHisPz1vP0(0), //-> delta z P0outer-P0inner - line
170 fHisPz2vP0(0), //-> delta z P0outer-P0inner - parabola
171 fHisPz3vP0(0), //-> delta z P0outer-P0inner - common parabola
172 fHisPz1vP1(0), //-> delta kz P1outer-P1inner - line
173 fHisPz2vP1(0), //-> delta kz P1outer-P1inner - parabola
174 fHisPz3vP1(0), //-> delta kz P1outer-P1inner - common parabola
175 fHisPz2vP2In(0), //-> Curv P2inner - parabola
176 fHisPz2vP2Out(0), //-> Curv P2outer - parabola
177 fHisPz3vP2IO(0), //-> Curv P2outerinner - common parabola
181 fFitAside(new TVectorD(3)),
182 fFitCside(new TVectorD(3)),
193 fTracksEsdParam.SetOwner(kTRUE);
196 AliTPCcalibLaser::AliTPCcalibLaser(const Text_t *name, const Text_t *title):
202 fTracksEsdParam(336),
205 fDeltaZ(336), // array of histograms of delta z for each track
206 fDeltaP3(336), // array of histograms of delta z for each track
207 fDeltaP4(336), // array of histograms of P3 for each track
208 fDeltaPhi(336), // array of histograms of P4 for each track
209 fDeltaPhiP(336), // array of histograms of delta z for each track
210 fSignals(336), // array of dedx signals
213 fHisNclIn(0), //->Number of clusters inner
214 fHisNclOut(0), //->Number of clusters outer
215 fHisNclIO(0), //->Number of cluster inner outer
216 fHisLclIn(0), //->Level arm inner
217 fHisLclOut(0), //->Level arm outer
218 fHisLclIO(0), //->Number of cluster inner outer
219 fHisdEdx(0), //->dEdx histo
220 fHisdZfit(0), //->distance to the mirror after linear fit
223 fHisChi2YIn1(0), //->chi2 y inner - line
224 fHisChi2YOut1(0), //->chi2 y inner - line
225 fHisChi2YIn2(0), //->chi2 y inner - parabola
226 fHisChi2YOut2(0), //->chi2 y inner - parabola
227 fHisChi2YIO1(0), //->chi2 y IO - common
228 fHisChi2ZIn1(0), //->chi2 z inner - line
229 fHisChi2ZOut1(0), //->chi2 z inner - line
230 fHisChi2ZIn2(0), //->chi2 z inner - parabola
231 fHisChi2ZOut2(0), //->chi2 z inner - parabola
232 fHisChi2ZIO1(0), //->chi2 z IO - common
235 fHisPy1vP0(0), //-> delta y P0outer-P0inner - line
236 fHisPy2vP0(0), //-> delta y P0outer-P0inner - parabola
237 fHisPy3vP0(0), //-> delta y P0outer-P0inner - common parabola
238 fHisPy1vP1(0), //-> delta ky P1outer-P1inner - line
239 fHisPy2vP1(0), //-> delta ky P1outer-P1inner - parabola
240 fHisPy3vP1(0), //-> delta ky P1outer-P1inner - common parabola
241 fHisPy2vP2In(0), //-> Curv P2inner - parabola
242 fHisPy2vP2Out(0), //-> Curv P2outer - parabola
243 fHisPy3vP2IO(0), //-> Curv P2outerinner - common parabola
246 fHisPz1vP0(0), //-> delta z P0outer-P0inner - line
247 fHisPz2vP0(0), //-> delta z P0outer-P0inner - parabola
248 fHisPz3vP0(0), //-> delta z P0outer-P0inner - common parabola
249 fHisPz1vP1(0), //-> delta kz P1outer-P1inner - line
250 fHisPz2vP1(0), //-> delta kz P1outer-P1inner - parabola
251 fHisPz3vP1(0), //-> delta kz P1outer-P1inner - common parabola
252 fHisPz2vP2In(0), //-> Curv P2inner - parabola
253 fHisPz2vP2Out(0), //-> Curv P2outer - parabola
254 fHisPz3vP2IO(0), //-> Curv P2outerinner - common parabola
260 fFitAside(new TVectorD(3)), // drift fit - A side
261 fFitCside(new TVectorD(3)), // drift fit - C- side
262 fEdgeXcuts(3), // cuts in local x direction; used in the refit of the laser tracks
263 fEdgeYcuts(3), // cuts in local y direction; used in the refit of the laser tracks
264 fNClCuts(5), // cuts on the number of clusters per tracklet; used in the refit of the laser tracks
265 fNcuts(0), // number of cuts
274 fTracksEsdParam.SetOwner(kTRUE);
277 AliTPCcalibLaser::AliTPCcalibLaser(const AliTPCcalibLaser& calibLaser):
278 AliTPCcalibBase(calibLaser),
283 fTracksEsdParam(336),
286 fDeltaZ(calibLaser.fDeltaZ), // array of histograms of delta z for each track
287 fDeltaP3(((calibLaser.fDeltaP3))), // array of histograms of delta z for each track
288 fDeltaP4(((calibLaser.fDeltaP4))), // array of histograms of P3 for each track
289 fDeltaPhi(((calibLaser.fDeltaPhi))), // array of histograms of P4 for each track
290 fDeltaPhiP(((calibLaser.fDeltaPhiP))), // array of histograms of delta z for each track
291 fSignals(((calibLaser.fSignals))), // array of dedx signals
294 fHisNclIn(new TH2F(*(calibLaser.fHisNclIn))), //->Number of clusters inner
295 fHisNclOut(new TH2F(*(calibLaser.fHisNclOut))), //->Number of clusters outer
296 fHisNclIO(new TH2F(*(calibLaser.fHisNclIO))), //->Number of cluster inner outer
297 fHisLclIn(new TH2F(*(calibLaser.fHisLclIn))), //->Level arm inner
298 fHisLclOut(new TH2F(*(calibLaser.fHisLclOut))), //->Level arm outer
299 fHisLclIO(new TH2F(*(calibLaser.fHisLclIO))), //->Number of cluster inner outer
300 fHisdEdx(new TH2F(*(calibLaser.fHisdEdx))), //
301 fHisdZfit(new TH2F(*(calibLaser.fHisdZfit))), //->distance to the mirror after linear fit
304 fHisChi2YIn1(new TH2F(*(calibLaser.fHisChi2YIn1))), //->chi2 y inner - line
305 fHisChi2YOut1(new TH2F(*(calibLaser.fHisChi2YOut1))), //->chi2 y inner - line
306 fHisChi2YIn2(new TH2F(*(calibLaser.fHisChi2YIn2))), //->chi2 y inner - parabola
307 fHisChi2YOut2(new TH2F(*(calibLaser.fHisChi2YOut2))), //->chi2 y inner - parabola
308 fHisChi2YIO1(new TH2F(*(calibLaser.fHisChi2YIO1))), //->chi2 y IO - common
309 fHisChi2ZIn1(new TH2F(*(calibLaser.fHisChi2ZIn1))), //->chi2 z inner - line
310 fHisChi2ZOut1(new TH2F(*(calibLaser.fHisChi2ZOut1))), //->chi2 z inner - line
311 fHisChi2ZIn2(new TH2F(*(calibLaser.fHisChi2ZIn2))), //->chi2 z inner - parabola
312 fHisChi2ZOut2(new TH2F(*(calibLaser.fHisChi2ZOut2))), //->chi2 z inner - parabola
313 fHisChi2ZIO1(new TH2F(*(calibLaser.fHisChi2ZIO1))), //->chi2 z IO - common
316 fHisPy1vP0(new TH2F(*(calibLaser.fHisPy1vP0))), //-> delta y P0outer-P0inner - line
317 fHisPy2vP0(new TH2F(*(calibLaser.fHisPy2vP0))), //-> delta y P0outer-P0inner - parabola
318 fHisPy3vP0(new TH2F(*(calibLaser.fHisPy3vP0))), //-> delta y P0outer-P0inner - common parabola
319 fHisPy1vP1(new TH2F(*(calibLaser.fHisPy1vP1))), //-> delta ky P1outer-P1inner - line
320 fHisPy2vP1(new TH2F(*(calibLaser.fHisPy2vP1))), //-> delta ky P1outer-P1inner - parabola
321 fHisPy3vP1(new TH2F(*(calibLaser.fHisPy3vP1))), //-> delta ky P1outer-P1inner - common parabola
322 fHisPy2vP2In(new TH2F(*(calibLaser.fHisPy2vP2In))), //-> Curv P2inner - parabola
323 fHisPy2vP2Out(new TH2F(*(calibLaser.fHisPy2vP2Out))), //-> Curv P2outer - parabola
324 fHisPy3vP2IO(new TH2F(*(calibLaser.fHisPy3vP2IO))), //-> Curv P2outerinner - common parabola
327 fHisPz1vP0(new TH2F(*(calibLaser.fHisPz1vP0))), //-> delta z P0outer-P0inner - line
328 fHisPz2vP0(new TH2F(*(calibLaser.fHisPz2vP0))), //-> delta z P0outer-P0inner - parabola
329 fHisPz3vP0(new TH2F(*(calibLaser.fHisPz3vP0))), //-> delta z P0outer-P0inner - common parabola
330 fHisPz1vP1(new TH2F(*(calibLaser. fHisPz1vP1))), //-> delta kz P1outer-P1inner - line
331 fHisPz2vP1(new TH2F(*(calibLaser.fHisPz2vP1))), //-> delta kz P1outer-P1inner - parabola
332 fHisPz3vP1(new TH2F(*(calibLaser.fHisPz3vP1))), //-> delta kz P1outer-P1inner - common parabola
333 fHisPz2vP2In(new TH2F(*(calibLaser.fHisPz2vP2In))), //-> Curv P2inner - parabola
334 fHisPz2vP2Out(new TH2F(*(calibLaser. fHisPz2vP2Out))), //-> Curv P2outer - parabola
335 fHisPz3vP2IO(new TH2F(*(calibLaser.fHisPz3vP2IO))), //-> Curv P2outerinner - common parabola
338 fDeltaYres(((calibLaser.fDeltaYres))),
339 fDeltaZres(((calibLaser.fDeltaZres))),
340 fFitAside(new TVectorD(3)), // drift fit - A side
341 fFitCside(new TVectorD(3)), // drift fit - C- side
342 fEdgeXcuts(3), // cuts in local x direction; used in the refit of the laser tracks
343 fEdgeYcuts(3), // cuts in local y direction; used in the refit of the laser tracks
344 fNClCuts(5), // cuts on the number of clusters per tracklet; used in the refit of the laser tracks
345 fNcuts(0), // number of cuts
346 fRun(0), // run number
347 fEvent(0) // current eventnumber
356 AliTPCcalibLaser & AliTPCcalibLaser::operator=(const AliTPCcalibLaser& calibLaser){
358 // assgnment operator
360 if (this != &calibLaser) {
361 new (this) AliTPCcalibLaser(calibLaser);
370 AliTPCcalibLaser::~AliTPCcalibLaser() {
375 delete fHisNclIn; //->Number of clusters inner
376 delete fHisNclOut; //->Number of clusters outer
377 delete fHisNclIO; //->Number of cluster inner outer
378 delete fHisLclIn; //->Level arm inner
379 delete fHisLclOut; //->Level arm outer
380 delete fHisLclIO; //->Number of cluster inner outer
385 delete fHisChi2YIn1; //->chi2 y inner - line
386 delete fHisChi2YOut1; //->chi2 y inner - line
387 delete fHisChi2YIn2; //->chi2 y inner - parabola
388 delete fHisChi2YOut2; //->chi2 y inner - parabola
389 delete fHisChi2YIO1; //->chi2 y IO - common
390 delete fHisChi2ZIn1; //->chi2 z inner - line
391 delete fHisChi2ZOut1; //->chi2 z inner - line
392 delete fHisChi2ZIn2; //->chi2 z inner - parabola
393 delete fHisChi2ZOut2; //->chi2 z inner - parabola
394 delete fHisChi2ZIO1; //->chi2 z IO - common
397 delete fHisPy1vP0; //-> delta y P0outer-P0inner - line
398 delete fHisPy2vP0; //-> delta y P0outer-P0inner - parabola
399 delete fHisPy3vP0; //-> delta y P0outer-P0inner - common parabola
400 delete fHisPy1vP1; //-> delta ky P1outer-P1inner - line
401 delete fHisPy2vP1; //-> delta ky P1outer-P1inner - parabola
402 delete fHisPy3vP1; //-> delta ky P1outer-P1inner - common parabola
403 delete fHisPy2vP2In; //-> Curv P2inner - parabola
404 delete fHisPy2vP2Out; //-> Curv P2outer - parabola
405 delete fHisPy3vP2IO; //-> Curv P2outerinner - common parabola
408 delete fHisPz1vP0; //-> delta z P0outer-P0inner - line
409 delete fHisPz2vP0; //-> delta z P0outer-P0inner - parabola
410 delete fHisPz3vP0; //-> delta z P0outer-P0inner - common parabola
411 delete fHisPz1vP1; //-> delta kz P1outer-P1inner - line
412 delete fHisPz2vP1; //-> delta kz P1outer-P1inner - parabola
413 delete fHisPz3vP1; //-> delta kz P1outer-P1inner - common parabola
414 delete fHisPz2vP2In; //-> Curv P2inner - parabola
415 delete fHisPz2vP2Out; //-> Curv P2outer - parabola
416 delete fHisPz3vP2IO; //-> Curv P2outerinner - common parabola
422 void AliTPCcalibLaser::Process(AliESDEvent * event) {
425 // Loop over tracks and call Process function
431 fESDfriend=static_cast<AliESDfriend*>(fESD->FindListObject("AliESDfriend"));
435 AliDebug(4,Form("Event number in current file: %d",event->GetEventNumberInFile()));
438 fTracksEsdParam.Delete();
439 for (Int_t id=0; id<336;id++) {
441 fClusterCounter[id]=0;
444 static Bool_t init=kFALSE;
446 init = kTRUE; // way around for PROOF - to be investigated
450 Int_t n=fESD->GetNumberOfTracks();
451 Int_t run = fESD->GetRunNumber();
453 for (Int_t i=0;i<n;++i) {
454 AliESDfriendTrack *friendTrack=fESDfriend->GetTrack(i);
455 AliESDtrack *track=fESD->GetTrack(i);
456 TObject *calibObject=0;
458 for (Int_t j=0;(calibObject=friendTrack->GetCalibObject(j));++j)
459 if ((seed=dynamic_cast<AliTPCseed*>(calibObject)))
462 FindMirror(track,seed);
468 for (Int_t id=0; id<336; id++){
470 if (!fTracksEsdParam.At(id)) continue;
471 if (fClusterSatur[id]>0.3) continue; // tracks in saturation
473 if ( AcceptLaser(id) && fFitZ[id]<0.5){
482 void AliTPCcalibLaser::MakeDistHisto(Int_t id){
486 // for (Int_t id=0; id<336; id++){
489 if (!fTracksEsdParam.At(id)) return;
490 if (!AcceptLaser(id)) return;
493 TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
494 TH1F * hisP3 = (TH1F*)fDeltaP3.At(id);
495 TH1F * hisP4 = (TH1F*)fDeltaP4.At(id);
497 TH1F * hisdphi = (TH1F*)fDeltaPhi.At(id);
498 TH1F * hisdphiP = (TH1F*)fDeltaPhiP.At(id);
499 TH1F * hisSignal = (TH1F*)fSignals.At(id);
502 hisdz = new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
503 hisdz->SetDirectory(0);
504 fDeltaZ.AddAt(hisdz,id);
506 hisP3 = new TH1F(Form("hisPar3v%d",id),Form("hisPar3v%d",id),400,-0.06,0.06);
507 hisP3->SetDirectory(0);
508 fDeltaP3.AddAt(hisP3,id);
510 hisP4 = new TH1F(Form("hisPar4v%d",id),Form("hisPar4v%d",id),200,-0.06,0.06);
511 hisP4->SetDirectory(0);
512 fDeltaP4.AddAt(hisP4,id);
515 hisdphi = new TH1F(Form("hisdphi%d",id),Form("hisdphi%d",id),1000,-1,1);
516 hisdphi->SetDirectory(0);
517 fDeltaPhi.AddAt(hisdphi,id);
519 hisdphiP = new TH1F(Form("hisdphiP%d",id),Form("hisdphiP%d",id),1000,-0.01,0.01);
520 hisdphiP->SetDirectory(0);
521 fDeltaPhiP.AddAt(hisdphiP,id);
522 hisSignal = new TH1F(Form("hisSignal%d",id),Form("hisSignal%d",id),100,0,300);
523 hisSignal->SetDirectory(0);
524 fSignals.AddAt(hisSignal,id);
527 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
528 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
529 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
538 param->GetPxPyPz(pxyz);
540 ltrp->GetPxPyPz(lpxyz);
542 Float_t dz = param->GetZ()-ltrp->GetZ();
543 Float_t dphi = (TMath::ATan2(xyz[1],xyz[0])- TMath::ATan2(lxyz[1],lxyz[0]))*254.;
544 Float_t dphiP = param->GetParameter()[2]-ltrp->GetParameter()[2];
545 if (hisdz) hisdz->Fill(dz);
546 if (hisP3) hisP3->Fill(param->GetParameter()[3]);
547 if (hisP4) hisP4->Fill(param->GetParameter()[4]);
548 if (hisdphi) hisdphi->Fill(dphi);
549 if (hisdphiP) hisdphiP->Fill(dphiP);
550 if (hisSignal) hisSignal->Fill(TMath::Sqrt(TMath::Abs(track->GetTPCsignal())));
554 void AliTPCcalibLaser::FitDriftV(){
556 // Fit drift velocity - linear approximation in the z and global y
558 Float_t kDistCut = 4; // cut on distance to the fitted value
559 const Float_t kZCut = 200; // remove the closest laser beam
560 const Float_t kSaturCut = 0.05; // remove saturated lasers - cut on fraction of saturated
561 const Float_t kMinClusters = 60; // minimal amount of the clusters
562 const Float_t kMinSignal = 16; // minimal mean height of the signal
563 const Float_t kChi2Cut = 0.1; // chi2 cut to accept drift fit
564 static TLinearFitter fdriftA(3,"hyp2");
565 static TLinearFitter fdriftC(3,"hyp2");
566 static TLinearFitter fdriftA1(2,"hyp1");
567 static TLinearFitter fdriftC1(2,"hyp1");
568 TVectorD fitA(3),fitC(3);
570 for (Int_t id=0; id<336; id++) fFitZ[id]=0;
573 for (Int_t iter=0; iter<2; iter++){
574 fdriftA.ClearPoints();
575 fdriftC.ClearPoints();
576 fdriftA1.ClearPoints();
577 fdriftC1.ClearPoints();
579 for (Int_t id=0; id<336; id++){
580 if (!fTracksEsdParam.At(id)) continue;
581 if (!AcceptLaser(id)) continue;
582 if (TMath::Abs(fFitZ[id])>kDistCut-iter) continue;
583 if ( fClusterSatur[id]>kSaturCut) continue;
584 if ( fClusterCounter[id]<kMinClusters) continue;
586 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
587 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
593 param->GetPxPyPz(pxyz);
595 ltrp->GetPxPyPz(lpxyz);
596 if (TMath::Abs(lxyz[2])>kZCut) continue;
597 Double_t xxx[2] = {lxyz[2],lxyz[1]};
598 if (ltrp->GetSide()==0){
599 fdriftA1.AddPoint(xxx,xyz[2],1);
600 fdriftA.AddPoint(xxx,xyz[2],1);
602 fdriftC1.AddPoint(xxx,xyz[2],1);
603 fdriftC.AddPoint(xxx,xyz[2],1);
611 if (fdriftA.GetNpoints()>10){
613 fdriftA.GetParameters(fitA);
614 npointsA= fdriftA.GetNpoints();
615 chi2A = fdriftA.GetChisquare()/fdriftA.GetNpoints();
616 if (chi2A<kChi2Cut ||(*fFitAside)[0]==0 ) (*fFitAside) = fitA;
618 if (fdriftC.GetNpoints()>10){
620 fdriftC.GetParameters(fitC);
621 npointsC= fdriftC.GetNpoints();
622 chi2C = fdriftC.GetChisquare()/fdriftC.GetNpoints();
623 if (chi2C<kChi2Cut||(*fFitCside)[0]==0) (*fFitCside) = fitC;
626 for (Int_t id=0; id<336; id++){
627 if (!fTracksEsdParam.At(id)) continue;
629 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
630 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
636 param->GetPxPyPz(pxyz);
638 ltrp->GetPxPyPz(lpxyz);
640 if (ltrp->GetSide()==0){
641 fz = (fitA)[0]+(fitA)[1]*lxyz[2]+(fitA)[2]*lxyz[1];
643 fz = (fitC)[0]+(fitC)[1]*lxyz[2]+(fitC)[2]*lxyz[1];
648 TTreeSRedirector *cstream = GetDebugStreamer();
649 Int_t time = fESD->GetTimeStamp();
651 (*cstream)<<"driftv"<<
653 "driftA.="<<fFitAside<<
654 "driftC.="<<fFitCside<<
666 Float_t AliTPCcalibLaser::GetDistance(AliExternalTrackParam *param, AliTPCLaserTrack *ltrp){
668 // get distance between mirror and laser track
679 dist+=TMath::Abs((TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*param->GetX());
682 // apply drift correction if already exist
685 if (ltrp->GetSide()==0){
686 if ((*fFitAside)[1]>0.) dz = ((*fFitAside)[0]+(*fFitAside)[1]*lxyz[2]+(*fFitAside)[2]*lxyz[1])-xyz[2];
688 if ((*fFitCside)[1]>0.) dz = ((*fFitCside)[0]+(*fFitCside)[1]*lxyz[2]+(*fFitCside)[2]*lxyz[1])-xyz[2];
690 if (TMath::Abs(dz)>3*(TMath::Abs(lxyz[2]-xyz[2])+1)) dz= TMath::Abs(lxyz[2]-xyz[2]);
691 dist+=TMath::Abs(dz);
693 // phi dist - divergence on 50 cm
695 dist = TMath::Abs((param->GetParameter()[2]-ltrp->GetParameter()[2])*50);
700 Bool_t AliTPCcalibLaser::AcceptLaser(Int_t id){
705 TCut cutP0("cutP0","abs((atan2(x1,x0)-atan2(lx1,lx0))*254)<1.5");
706 TCut cutP1("cutP1","abs(LTr.fP[1]-Tr.fP[1])<30");
707 TCut cutP2("cutP2","abs(LTr.fP[2]-Tr.fP[2])<0.03");
708 TCut cutP3("cutP3","abs(Tr.fP[3])<0.05");
709 TCut cutP4("cutPt","abs(Tr.fP[4])<0.1");
711 TCut cutA = cutP0+cutP1+cutP2+cutP3+cutP4;
713 AliExternalTrackParam *param =(AliExternalTrackParam*)fTracksEsdParam.At(id);
714 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
715 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
720 if (TMath::Abs((TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*254)>1.5) return kFALSE; //cut y- P0
721 if (TMath::Abs(param->GetParameter()[1]-ltrp->GetParameter()[1])>30) return kFALSE; // cutZ -P1
722 if (TMath::Abs(param->GetParameter()[2]-ltrp->GetParameter()[2])>0.03) return kFALSE; // cut -P2
723 if (TMath::Abs(param->GetParameter()[3])>0.05) return kFALSE; // cut Tl -P3
724 if (TMath::Abs(param->GetParameter()[4])>0.1) return kFALSE; // cut Pt -P4
731 Int_t AliTPCcalibLaser::FindMirror(AliESDtrack *track, AliTPCseed *seed){
733 // Find corresponding mirror
734 // add the corresponding tracks
736 Float_t kRadius0 = 252;
737 Float_t kRadius = 253.4;
738 if (!track->GetOuterParam()) return -1;
739 AliExternalTrackParam param(*(track->GetOuterParam()));
740 AliTracker::PropagateTrackTo(¶m,kRadius0,0.10566,3,kTRUE);
741 AliTracker::PropagateTrackTo(¶m,kRadius,0.10566,0.1,kTRUE);
742 AliTPCLaserTrack ltr;
743 AliTPCLaserTrack *ltrp=0x0;
744 // AliTPCLaserTrack *ltrpjw=0x0;
746 Int_t id = AliTPCLaserTrack::IdentifyTrack(¶m);
747 // Int_t idjw = AliTPCLaserTrack::IdentifyTrackJW(¶m);
748 //AliDebug(4,Form("Identified Track: %03d (%03d)",id,idjw));
750 if (id!=-1 && (AliTPCLaserTrack::GetTracks()->UncheckedAt(id)))
751 ltrp=(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
761 Float_t counterSatur=0;
762 for (Int_t irow=158;irow>-1;--irow) {
763 AliTPCclusterMI *c=seed->GetClusterPointer(irow);
765 Double_t pedgeY = c->GetX()*TMath::DegToRad()*(10)-TMath::Abs(c->GetY());
766 Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
767 if (pedgeY<3) continue;
768 if (pedgeX<3) continue;
770 if (c->GetMax()>900) counterSatur++;
772 counterSatur/=(countercl+1);
774 if (counterSatur>fClusterSatur[id]) fClusterSatur[id]=counterSatur;
777 Float_t radius=TMath::Abs(ltrp->GetX());
778 AliTracker::PropagateTrackTo(¶m,radius,0.10566,0.01,kTRUE);
780 if (!fTracksMirror.At(id)) fTracksMirror.AddAt(ltrp,id);
783 // choose closer track
785 AliExternalTrackParam * param0 = (AliExternalTrackParam *)fTracksEsdParam.At(id);
787 Float_t dist0=GetDistance(param0,ltrp);
788 Float_t dist1=GetDistance(¶m,ltrp);
789 if (dist0<dist1) accept=kFALSE;
793 fClusterCounter[id]=countercl;
794 fTracksEsdParam.AddAt(param.Clone(),id);
795 fTracksEsd.AddAt(track,id);
796 fTracksTPC.AddAt(seed,id);
803 void AliTPCcalibLaser::DumpLaser(Int_t id) {
805 // Dump Laser info to the tree
807 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
808 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
809 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
818 param->GetPxPyPz(pxyz);
820 ltrp->GetPxPyPz(lpxyz);
821 Float_t dist3D = GetDistance(param,ltrp);
822 Float_t dist0 = (TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*param->GetX();
823 Float_t distphi = (param->GetParameter()[2]-ltrp->GetParameter()[2])*50;
827 TTreeSRedirector *cstream = GetDebugStreamer();
828 Int_t time = fESD->GetTimeStamp();
829 Bool_t accept = AcceptLaser(id);
831 (*cstream)<<"Track"<<
835 "driftA.="<<fFitAside<<
836 "driftC.="<<fFitCside<<
840 "distphi="<<distphi<<
843 "counter="<<fCounter[id]<<
844 "clcounter="<<fClusterCounter[id]<<
845 "satur="<<fClusterSatur[id]<<
869 void AliTPCcalibLaser::RefitLaserJW(Int_t id){
871 // Refit the track with different tracklet models:
872 // 1. Per ROC using the kalman filter, different edge cuts
873 // 2. Per ROC linear in y and z
874 // 3. Per ROC quadratic in y and z
875 // 4. Per track offset for each sector, linear for each sector, common quadratic
876 // store x, y, z information for all models and the cluster to calculate the residuals
879 AliTPCseed *track = (AliTPCseed*)fTracksTPC.At(id);
880 AliExternalTrackParam *extparam=(AliExternalTrackParam*)fTracksEsdParam.At(id);
881 AliTPCLaserTrack *ltrp = (AliTPCLaserTrack*)fTracksMirror.At(id);
883 AliTPCclusterMI dummyCl;
886 Int_t kMaxTracklets=2;
887 //=============================================//
888 // Linear Fitters for the Different Approaches //
889 //=============================================//
890 //linear fit model in y and z; inner - outer sector
891 static TLinearFitter fy1I(2,"hyp1");
892 static TLinearFitter fy1O(2,"hyp1");
893 static TLinearFitter fz1I(2,"hyp1");
894 static TLinearFitter fz1O(2,"hyp1");
895 //quadratic fit model in y and z; inner - sector
896 static TLinearFitter fy2I(3,"hyp2");
897 static TLinearFitter fy2O(3,"hyp2");
898 static TLinearFitter fz2I(3,"hyp2");
899 static TLinearFitter fz2O(3,"hyp2");
900 //common quadratic fit for IROC and OROC in y and z
901 static TLinearFitter fy4(5,"hyp4");
902 static TLinearFitter fz4(5,"hyp4");
912 //=============================//
913 // Loop over all Tracklet Cuts //
914 //=============================//
915 for (Int_t icut=0; icut<fNcuts; icut++){
916 Float_t xinMin = 250, xinMax=90;
917 Float_t xoutMin=250, xoutMax=90;
920 AliDebug(4,Form("Processing cut %d for track with ID %d",icut,id));
922 Double_t edgeCutX = fEdgeXcuts[icut];
923 Double_t edgeCutY = fEdgeYcuts[icut];
924 Int_t nclCut = (Int_t)fNClCuts[icut];
925 //=========================//
926 // Parameters to calculate //
927 //=========================//
928 //fit parameter inner, outer tracklet and combined fit
929 TVectorD vecy1resInner(2),vecz1resInner(2); //pol1 fit parameters inner
930 TVectorD vecy2resInner(3),vecz2resInner(3); //pol2 fit parameters inner
932 TVectorD vecy1resOuter(2),vecz1resOuter(2); //pol1 fit parameters outer
933 TVectorD vecy2resOuter(3),vecz2resOuter(3); //pol2 fit parameters outer
934 TVectorD vecy4res(5),vecz4res(5);
935 // cluster and track positions for each row - used for residuals
936 TVectorD vecX(159); // x is the same for all (row center)
937 TVectorD vecYkalman(159); // y from kalman fit
938 TVectorD vecZkalman(159); // z from kalman fit
939 TVectorD vecY1(159); // y from pol1 fit per ROC
940 TVectorD vecZ1(159); // z from pol1 fit per ROC
941 TVectorD vecY2(159); // y from pol2 fit per ROC
942 TVectorD vecZ2(159); // z from pol2 fit per ROC
943 TVectorD vecY4(159); // y from sector fit
944 TVectorD vecZ4(159); // z from sector fit
945 TVectorD vecClY(159); // y cluster position
946 TVectorD vecClZ(159); // z cluster position
947 TVectorD vecSec(159); // sector for each row
949 Double_t chi2I1z=0; // chi2 of pol1 fit in z (inner)
950 Double_t chi2I1y=0; // chi2 of pol1 fit in y (inner)
951 Double_t chi2O1z=0; // chi2 of pol1 fit in z (outer)
952 Double_t chi2O1y=0; // chi2 of pol1 fit in y (outer)
953 Double_t chi2I2z=0; // chi2 of pol2 fit in z (inner)
954 Double_t chi2I2y=0; // chi2 of pol2 fit in y (inner)
955 Double_t chi2O2z=0; // chi2 of pol2 fit in z (outer)
956 Double_t chi2O2y=0; // chi2 of pol2 fit in y (outer)
957 Double_t chi2IOz=0; // chi2 of hyp4 fit in z (inner+outer)
958 Double_t chi2IOy=0; // chi2 of hyp4 fit in y (inner+outer)
960 Int_t innerSector = -1; // number of inner sector
961 Int_t outerSector = -1; // number of outer sector
962 Int_t nclI=0; // number of clusters (inner)
963 Int_t nclO=0; // number of clusters (outer)
964 //=================================================//
965 // Perform the Kalman Fit using the Tracklet Class //
966 //=================================================//
967 AliTPCTracklet::SetEdgeCut(edgeCutX,edgeCutY);
969 AliTPCTracklet::CreateTracklets(track,AliTPCTracklet::kKalman,
970 kFALSE,nclCut,kMaxTracklets);
972 AliTPCTracklet *trInner = (AliTPCTracklet*)tracklets.At(0);
973 AliTPCTracklet *trOuter = (AliTPCTracklet*)tracklets.At(1);
974 AliTPCTracklet *tr=0x0;
975 AliTPCTracklet dummy;
976 //continue if we didn't find a tracklet
977 if ( !trInner && !trOuter ) continue;
978 //================================================================================//
979 // Swap Inner and Outer if necessary (inner sector is definde by smaller local x) //
980 //================================================================================//
981 if ( trInner && trOuter ){
982 if ( !trInner->GetInner() || !trOuter->GetInner() ) continue;
983 if ( trInner->GetInner()->GetX() > trOuter->GetInner()->GetX() ){
987 AliDebug(5,Form("Swapped Sectors: %02d (%f) <-> %02d (%f)", trOuter->GetSector(), trOuter->GetInner()->GetX(), trInner->GetSector(), trInner->GetInner()->GetX()));
991 if ( !trInner->GetInner() ) continue;
993 if ( trInner->GetSector()>35 ){
998 if ( !trOuter->GetInner() ) continue;
1000 if ( trOuter->GetSector()<36 ){
1006 innerSector = trInner->GetSector();
1007 if ( innerSector>=0 ) AliDebug(5,Form("Found inner Sector %02d at X %.2f", innerSector, trInner->GetInner()->GetX()));
1008 outerSector = trOuter->GetSector();
1009 if ( outerSector>=0 ) AliDebug(5,Form("Found outer Sector %02d at X %.2f", outerSector, trOuter->GetInner()->GetX()));
1011 // array of clusters
1012 TClonesArray arrCl("AliTPCclusterMI",159);
1013 arrCl.ExpandCreateFast(159);
1014 //=======================================//
1015 // fill fitters with cluster information //
1016 //=======================================//
1017 AliDebug(3,"Filing Cluster Information");
1018 for (Int_t irow=158;irow>-1;--irow) {
1019 AliTPCclusterMI *c=track->GetClusterPointer(irow);
1020 AliTPCclusterMI &cl = (AliTPCclusterMI&) (*arrCl[irow]);
1025 Float_t meanY=0, sumY=0;
1026 for (Int_t drow=-1;drow<=1;drow++) {
1027 if (irow+drow<0) continue;
1028 if (irow+drow>158) continue;
1029 AliTPCclusterMI *c=track->GetClusterPointer(irow);
1031 Int_t roc = static_cast<Int_t>(c->GetDetector());
1032 if ( roc!=innerSector && roc!=outerSector ) continue;
1033 if (c->GetX()<10) continue;
1034 if (c->GetY()==0) continue;
1038 if (sumY>0) meanY/=sumY;
1043 Double_t pedgeY = c->GetX()*TMath::DegToRad()*(10)-TMath::Abs(meanY);
1044 Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
1047 Int_t roc = static_cast<Int_t>(c->GetDetector());
1048 if ( roc!=innerSector && roc!=outerSector ) continue;
1050 //store clusters in clones array
1053 if (c->GetMax()<4) continue; // noise cluster?
1054 if (TMath::Abs(c->GetY())<0.0001) continue; // noise cluster?
1056 vecX[irow] = c->GetX();
1057 vecClY[irow] = c->GetY();
1058 vecClZ[irow] = c->GetZ();
1060 Double_t x = vecX[irow]-133.4; //reference is between IROC and OROC
1061 Double_t y = vecClY[irow];
1062 Double_t z = vecClZ[irow];
1064 Double_t x2[2]={x,x*x}; //linear and parabolic parameters
1065 Double_t x4[4]={0,0,0,0}; //hyp4 parameters
1066 if ( roc == innerSector ) {
1067 x4[0]=1; //offset inner - outer sector
1068 x4[1]=x; //slope parameter inner sector
1070 x4[2]=x; //slope parameter outer sector
1072 x4[3]=x*x; //common parabolic shape
1073 if (pedgeX < fEdgeXcuts[icut]) continue;
1074 if (pedgeY < fEdgeYcuts[icut]) continue;
1075 if (c->GetMax()>900) continue; // cluster in saturation
1077 if ( roc==innerSector ){
1078 fy1I.AddPoint(x2,y);
1079 fz1I.AddPoint(x2,z);
1080 fy2I.AddPoint(x2,y);
1081 fz2I.AddPoint(x2,z);
1083 if (x<xinMin) xinMin=x;
1084 if (x>xinMax) xinMax=x;
1086 if ( roc==outerSector ){
1087 fy1O.AddPoint(x2,y);
1088 fz1O.AddPoint(x2,z);
1089 fy2O.AddPoint(x2,y);
1090 fz2O.AddPoint(x2,z);
1092 if (x<xoutMin) xoutMin=x;
1093 if (x>xoutMax) xoutMax=x;
1098 //======================================//
1099 // Evaluate and retrieve fit parameters //
1100 //======================================//
1101 AliDebug(5,Form("Evaluating fits with inner (outer) Sec: %02d (%02d)",innerSector,outerSector));
1103 if ( (innerSector>-1) && (fy1I.GetNpoints()>0) ){
1108 fy1I.GetParameters(vecy1resInner);
1109 fz1I.GetParameters(vecz1resInner);
1110 fy2I.GetParameters(vecy2resInner);
1111 fz2I.GetParameters(vecz2resInner);
1112 chi2I1y=fy1I.GetChisquare()/(fy1I.GetNpoints()-2);
1113 chi2I1z=fz1I.GetChisquare()/(fz1I.GetNpoints()-2);
1114 chi2I2y=fy2I.GetChisquare()/(fy2I.GetNpoints()-3);
1115 chi2I2z=fz2I.GetChisquare()/(fz2I.GetNpoints()-3);
1118 if ( (outerSector>-1) && (fy1O.GetNpoints()>0) ){
1123 fy1O.GetParameters(vecy1resOuter);
1124 fz1O.GetParameters(vecz1resOuter);
1125 fy2O.GetParameters(vecy2resOuter);
1126 fz2O.GetParameters(vecz2resOuter);
1127 chi2O1y=fy1O.GetChisquare()/(fy1O.GetNpoints()-2);
1128 chi2O1z=fz1O.GetChisquare()/(fz1O.GetNpoints()-2);
1129 chi2O2y=fy2O.GetChisquare()/(fy2O.GetNpoints()-3);
1130 chi2O2z=fz2O.GetChisquare()/(fz2O.GetNpoints()-3);
1133 if ( innerSector>0 && outerSector>0 ){
1134 if (fy4.GetNpoints()>0) {
1136 fy4.GetParameters(vecy4res);
1137 chi2IOy=fy4.GetChisquare()/(fy4.GetNpoints()-5);
1139 if (fz4.GetNpoints()>0) {
1141 fz4.GetParameters(vecz4res);
1142 chi2IOz=fz4.GetChisquare()/(fz4.GetNpoints()-5);
1146 fy4.ClearPoints(); fz4.ClearPoints();
1147 fy1I.ClearPoints(); fy1O.ClearPoints();
1148 fz1I.ClearPoints(); fz1O.ClearPoints();
1149 fy2I.ClearPoints(); fy2O.ClearPoints();
1150 fz2I.ClearPoints(); fz2O.ClearPoints();
1151 //==============================//
1152 // calculate tracklet positions //
1153 //==============================//
1154 AliDebug(4,"Calculate tracklet positions");
1155 for (Int_t irow=158;irow>-1;--irow) {
1156 if ( vecSec[irow]==-1 ) continue; //no cluster info
1157 if ( vecSec[irow]!=innerSector && vecSec[irow]!=outerSector ) continue;
1159 Double_t x=vecX[irow];
1160 Double_t xref=x-133.4;
1162 Double_t yoffInner=0;
1163 Double_t zoffInner=0;
1164 Double_t yslopeInner=0;
1165 Double_t yslopeOuter=0;
1166 Double_t zslopeInner=0;
1167 Double_t zslopeOuter=0;
1168 //positions of hyperplane fits
1169 if ( vecSec[irow] == outerSector ) {
1171 vecY1[irow]=vecy1resOuter[0]+vecy1resOuter[1]*xref;
1172 vecZ1[irow]=vecz1resOuter[0]+vecz1resOuter[1]*xref;
1173 vecY2[irow]=vecy2resOuter[0]+vecy2resOuter[1]*xref+vecy2resOuter[2]*xref*xref;
1174 vecZ2[irow]=vecz2resOuter[0]+vecz2resOuter[1]*xref+vecz2resOuter[2]*xref*xref;
1175 yslopeOuter=vecy4res[3];
1176 zslopeOuter=vecz4res[3];
1179 vecY1[irow]=vecy1resInner[0]+vecy1resInner[1]*xref;
1180 vecZ1[irow]=vecz1resInner[0]+vecz1resInner[1]*xref;
1181 vecY2[irow]=vecy2resInner[0]+vecy2resInner[1]*xref+vecy2resInner[2]*xref*xref;
1182 vecZ2[irow]=vecz2resInner[0]+vecz2resInner[1]*xref+vecz2resInner[2]*xref*xref;
1183 yoffInner=vecy4res[1];
1184 zoffInner=vecz4res[1];
1185 yslopeInner=vecy4res[2];
1186 zslopeInner=vecz4res[2];
1188 vecY4[irow]=vecy4res[0]+yoffInner+yslopeInner*xref+yslopeOuter*xref+vecy4res[4]*xref*xref;
1189 vecZ4[irow]=vecz4res[0]+zoffInner+zslopeInner*xref+zslopeOuter*xref+vecz4res[4]*xref*xref;
1190 //positions of kalman fits
1191 Double_t gxyz[3],xyz[3];
1192 AliExternalTrackParam *param = 0x0;
1194 param=tr->GetInner();
1196 param->GetXYZ(gxyz);
1197 Float_t bz = AliTracker::GetBz(gxyz);
1198 param->GetYAt(x, bz, xyz[1]);
1199 param->GetZAt(x, bz, xyz[2]);
1200 vecYkalman[irow]=xyz[1];
1201 vecZkalman[irow]=xyz[2];
1204 //=====================================================================//
1205 // write results from the different tracklet fits with debug streamers //
1206 //=====================================================================//
1207 if (fStreamLevel>4){
1208 TTreeSRedirector *cstream = GetDebugStreamer();
1210 Float_t dedx = track->GetdEdx();
1211 (*cstream)<<"FitModels"<<
1213 "edgeCutX=" << edgeCutX <<
1214 "edgeCutY=" << edgeCutY <<
1215 "nclCut=" << nclCut <<
1216 "innerSector="<< innerSector <<
1217 "outerSector="<< outerSector <<
1220 "Tr.=" << extparam <<
1221 "yPol1In.=" << &vecy1resInner <<
1222 "zPol1In.=" << &vecz1resInner <<
1223 "yPol2In.=" << &vecy2resInner <<
1224 "zPol2In.=" << &vecz2resInner <<
1225 "yPol1Out.=" << &vecy1resOuter <<
1226 "zPol1Out.=" << &vecz1resOuter <<
1227 "yPol2Out.=" << &vecy2resOuter <<
1228 "zPol2Out.=" << &vecz2resOuter <<
1229 "yInOut.=" << &vecy4res <<
1230 "zInOut.=" << &vecz4res <<
1231 "chi2y1In=" << chi2I1y <<
1232 "chi2z1In=" << chi2I1z <<
1233 "chi2y1Out=" << chi2O1y <<
1234 "chi2z1Out=" << chi2O1z <<
1235 "chi2y2In=" << chi2I2y <<
1236 "chi2z2In=" << chi2I2z <<
1237 "chi2y2Out=" << chi2O2y <<
1238 "chi2z2Out=" << chi2O2z <<
1239 "chi2yInOut=" << chi2IOy <<
1240 "chi2zInOut=" << chi2IOz <<
1241 "trletIn.=" << trInner <<
1242 "trletOut.=" << trOuter <<
1245 "xinMin=" << xinMin<<
1246 "xinMax=" << xinMax<<
1247 "xoutMin=" << xoutMin<<
1248 "xoutMax=" << xoutMax<<
1253 // wirte residuals information
1254 if (fStreamLevel>5){
1255 TTreeSRedirector *cstream = GetDebugStreamer();
1257 Float_t dedx = track->GetdEdx();
1258 (*cstream)<<"Residuals"<<
1260 "edgeCutX=" << edgeCutX <<
1261 "edgeCutY=" << edgeCutY <<
1262 "nclCut=" << nclCut <<
1264 "Tr.=" << extparam<<
1268 "TrYpol1.=" << &vecY1 <<
1269 "TrZpol1.=" << &vecZ1 <<
1270 "TrYpol2.=" << &vecY2 <<
1271 "TrZpol2.=" << &vecZ2 <<
1272 "TrYInOut.=" << &vecY4 <<
1273 "TrZInOut.=" << &vecZ4 <<
1274 "ClY.=" << &vecClY <<
1275 "ClZ.=" << &vecClZ <<
1276 "sec.=" << &vecSec <<
1279 "xinMin=" << xinMin<<
1280 "xinMax=" << xinMax<<
1281 "xoutMin=" << xoutMin<<
1282 "xoutMax=" << xoutMax<<
1283 "yInOut.=" << &vecy4res <<
1284 "zInOut.=" << &vecz4res <<
1285 "chi2y1In=" << chi2I1y << //
1286 "chi2z1In=" << chi2I1z <<
1287 "chi2y1Out=" << chi2O1y <<
1288 "chi2z1Out=" << chi2O1z <<
1289 "chi2y2In=" << chi2I2y <<
1290 "chi2z2In=" << chi2I2z <<
1291 "chi2y2Out=" << chi2O2y <<
1292 "chi2z2Out=" << chi2O2z <<
1293 "chi2yInOut=" << chi2IOy <<
1294 "chi2zInOut=" << chi2IOz <<
1299 //==========================//
1300 // Fill Residual Histograms //
1301 //==========================//
1302 TProfile *profy = (TProfile*)fDeltaYres.UncheckedAt(id);
1303 TProfile *profz = (TProfile*)fDeltaZres.UncheckedAt(id);
1305 profy=new TProfile(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d",id),160,0,160);
1306 profy->SetDirectory(0);
1307 fDeltaYres.AddAt(profy,id);
1310 profz=new TProfile(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d",id),160,0,160);
1311 profz->SetDirectory(0);
1312 fDeltaZres.AddAt(profz,id);
1314 for (Int_t irow=158;irow>-1;--irow) {
1315 if (vecSec[irow]==-1)continue; //no cluster info
1316 Double_t x = vecX[irow];
1317 Double_t ycl = vecClY[irow];
1318 Double_t yfit = vecY1[irow];
1319 Double_t zcl = vecClZ[irow];
1320 Double_t zfit = vecZ1[irow];
1321 if (TMath::Abs(yfit-ycl)<2&&TMath::Abs(zfit-zcl)<2){
1323 if (profy->GetEntries()<1000000)
1324 profy->Fill(irow,yfit-ycl);
1326 if (profz->GetEntries()<1000000)
1327 profz->Fill(irow,zfit-zcl);
1332 // Fill laser fit histograms
1334 if (!fHisNclIn) MakeFitHistos();
1335 Float_t dedx = track->GetdEdx();
1336 if (nclI>20&&nclO>20){
1337 fHisNclIn->Fill(id,nclI); //->Number of clusters inner
1338 fHisNclOut->Fill(id,nclO); //->Number of clusters outer
1339 fHisNclIO->Fill(id,nclI+nclO); //->Number of cluster inner outer
1341 fHisLclIn->Fill(id,xinMax-xinMin); //->Level arm inner
1342 fHisLclOut->Fill(id,xoutMax-xoutMin); //->Level arm outer
1343 fHisLclIO->Fill(id,xoutMax-xinMin); //->Number of cluster inner outer
1345 fHisdEdx->Fill(id,TMath::Sqrt(TMath::Abs(dedx)));
1346 fHisdZfit->Fill(id,fFitZ[id]);
1349 fHisChi2YIn1->Fill(id,TMath::Sqrt(chi2I1y)); //->chi2 y inner - line
1350 fHisChi2YOut1->Fill(id,TMath::Sqrt(chi2O1y)); //->chi2 y inner - line
1351 fHisChi2YIn2->Fill(id,TMath::Sqrt(chi2I2y)); //->chi2 y inner - parabola
1352 fHisChi2YOut2->Fill(id,TMath::Sqrt(chi2O2y)); //->chi2 y inner - parabola
1353 fHisChi2YIO1->Fill(id,TMath::Sqrt(chi2IOy)); //->chi2 y IO - common
1356 fHisChi2ZIn1->Fill(id,TMath::Sqrt(chi2I1z)); //->chi2 z inner - line
1357 fHisChi2ZOut1->Fill(id,TMath::Sqrt(chi2O1z)); //->chi2 z inner - line
1358 fHisChi2ZIn2->Fill(id,TMath::Sqrt(chi2O2y)); //->chi2 z inner - parabola
1359 fHisChi2ZOut2->Fill(id,TMath::Sqrt(chi2O2z)); //->chi2 z inner - parabola
1360 fHisChi2ZIO1->Fill(id,TMath::Sqrt(chi2IOz)); //->chi2 z IO - common
1363 fHisPy1vP0->Fill(id,vecy1resOuter[0]-vecy1resInner[0]); //-> delta y P0outer-P0inner - line
1364 fHisPy2vP0->Fill(id,vecy2resOuter[0]-vecy2resInner[0]); //-> delta y P0outer-P0inner - parabola
1365 fHisPy3vP0->Fill(id,vecy4res[1]); //-> delta y P0outer-P0inner - common parabola
1367 fHisPy1vP1->Fill(id,vecy1resOuter[1]-vecy1resInner[1]); //-> delta ky P1outer-P1inner - line
1368 fHisPy2vP1->Fill(id,vecy2resOuter[1]-vecy2resInner[1]); //-> delta ky P1outer-P1inner - parabola
1369 fHisPy3vP1->Fill(id,vecy4res[3]-vecy4res[2]); //-> delta ky P1outer-P1inner - common parabola
1371 fHisPy3vP2IO->Fill(id,vecy4res[4]); //-> Curv P2outerinner - common parabola
1372 fHisPz1vP0->Fill(id,vecz1resOuter[0]-vecz1resInner[0]); //-> delta z P0outer-P0inner - line
1373 fHisPz2vP0->Fill(id,vecz2resOuter[0]-vecz2resInner[0]); //-> delta z P0outer-P0inner - parabola
1374 fHisPz3vP0->Fill(id,vecz4res[1]); //-> delta z P0outer-P0inner - common parabola
1376 fHisPz1vP1->Fill(id,vecz1resOuter[1]-vecz1resInner[1]); //-> delta kz P1outer-P1inner - line
1377 fHisPz2vP1->Fill(id,vecz2resOuter[1]-vecz2resInner[1]); //-> delta kz P1outer-P1inner - parabola
1378 fHisPz3vP1->Fill(id,vecz4res[3]-vecz4res[2]); //-> delta kz P1outer-P1inner - common parabola
1379 fHisPz3vP2IO->Fill(id,vecz4res[4]); //-> Curv P2outerinner - common parabola
1382 fHisPy2vP2In->Fill(id,vecy2resInner[2]); //-> Curv P2inner - parabola
1383 fHisPz2vP2In->Fill(id,vecz2resInner[2]); //-> Curv P2inner - parabola
1387 fHisPz2vP2Out->Fill(id,vecz2resOuter[2]); //-> Curv P2outer - parabola
1388 fHisPy2vP2Out->Fill(id,vecy2resOuter[2]); //-> Curv P2outer - parabola
1396 void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run, Int_t minEntries){
1398 // Dump information about laser beams
1399 // isOK variable indicates usability of the beam
1400 // Beam is not usable if:
1401 // a. No entries in range (krmsCut0)
1402 // b. Big sperad (krmscut1)
1403 // c. RMSto fit sigma bigger then (kmultiCut)
1404 // d. Too big angular spread
1407 const Float_t krmsCut0=0.001;
1408 const Float_t krmsCut1=0.16;
1409 const Float_t kmultiCut=2;
1410 const Float_t kcutP0=0.002;
1412 AliTPCcalibLaser *laser = this;
1413 TTreeSRedirector *pcstream = new TTreeSRedirector("laserMean.root");
1414 TF1 fg("fg","gaus");
1417 for (Int_t id=0; id<336; id++){
1419 TH1F * hisphi = (TH1F*)laser->fDeltaPhi.At(id);
1420 TH1F * hisphiP = (TH1F*)laser->fDeltaPhiP.At(id);
1421 TH1F * hisZ = (TH1F*)laser->fDeltaZ.At(id);
1422 TH1F * hisP3 = (TH1F*)laser->fDeltaP3.At(id);
1423 TH1F * hisP4 = (TH1F*)laser->fDeltaP4.At(id);
1424 TH1F * hisS = (TH1F*)laser->fSignals.At(id);
1425 //if (!hisphi) continue;
1426 Double_t entries = hisphi->GetEntries();
1427 //if (entries<minEntries) continue;
1429 AliTPCLaserTrack *ltrp = (AliTPCLaserTrack*)fTracksMirror.At(id);
1431 AliTPCLaserTrack::LoadTracks();
1432 ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
1434 pcstream->GetFile()->cd();
1435 if (hisphi) hisphi->Write();
1436 if (hisphiP) hisphiP->Write();
1437 if (hisZ) hisZ->Write();
1438 if (hisP3) hisP3->Write();
1439 if (hisP4) hisP4->Write();
1441 Float_t meanphi = hisphi->GetMean();
1442 Float_t rmsphi = hisphi->GetRMS();
1444 Float_t meanphiP = hisphiP->GetMean();
1445 Float_t rmsphiP = hisphiP->GetRMS();
1446 Float_t meanZ = hisZ->GetMean();
1447 Float_t rmsZ = hisZ->GetRMS();
1448 hisphi->Fit(&fg,"","",hisphi->GetMean()-4*hisphi->GetRMS(),hisphi->GetMean()+4*hisphi->GetRMS());
1449 Double_t gphi1 = fg.GetParameter(1);
1450 Double_t gphi2 = fg.GetParameter(2);
1451 hisphiP->Fit(&fg,"","",hisphiP->GetMean()-4*hisphiP->GetRMS(),hisphiP->GetMean()+4*hisphiP->GetRMS());
1452 Double_t gphiP1 = fg.GetParameter(1);
1453 Double_t gphiP2 = fg.GetParameter(2);
1455 hisZ->Fit(&fg,"","",hisZ->GetMean()-4*hisZ->GetRMS(),hisZ->GetMean()+4*hisZ->GetRMS());
1456 Double_t gz1 = fg.GetParameter(1);
1457 Double_t gz2 = fg.GetParameter(2);
1459 hisP3->Fit(&fg,"","",hisP3->GetMean()-4*hisP3->GetRMS(),hisP3->GetMean()+4*hisP3->GetRMS());
1460 Double_t gp31 = fg.GetParameter(1);
1461 Double_t gp32 = fg.GetParameter(2);
1463 hisP4->Fit(&fg,"","",hisP4->GetMean()-4*hisP4->GetRMS(),hisP4->GetMean()+4*hisP4->GetRMS());
1464 Double_t gp41 = fg.GetParameter(1);
1465 Double_t gp42 = fg.GetParameter(2);
1467 Float_t meanS=hisS->GetMean();
1472 ltrp->GetPxPyPz(lpxyz);
1474 if (rmsphi<krmsCut0) isOK=kFALSE; // empty in range - not entries inside
1475 if (rmsphi>krmsCut1) isOK=kFALSE; // empty in range - not entries inside
1476 if (rmsphi>krmsCut0) if (gphi2/rmsphi>kmultiCut) isOK=kFALSE; // multi peak structure
1477 if (gphiP2>kcutP0) isOK=kFALSE;
1483 his = fHisNclIn->ProjectionY("aaa",id+1,id+1);
1484 Float_t mnclIn = his->GetMean();
1486 his = fHisNclOut->ProjectionY("aaa",id+1,id+1);
1487 Float_t mnclOut = his->GetMean();
1489 his = fHisNclIO->ProjectionY("aaa",id+1,id+1);
1490 Float_t mnclIO = his->GetMean();
1492 his = fHisLclIn->ProjectionY("aaa",id+1,id+1);
1493 Float_t mLclIn = his->GetMean();
1495 his = fHisLclOut->ProjectionY("aaa",id+1,id+1);
1496 Float_t mLclOut = his->GetMean();
1498 his = fHisLclIO->ProjectionY("aaa",id+1,id+1);
1499 Float_t mLclIO = his->GetMean();
1502 his = fHisdEdx->ProjectionY("aaa",id+1,id+1);
1503 Float_t mdEdx = his->GetMean();
1506 his = fHisdZfit->ProjectionY("aaa",id+1,id+1);
1507 Float_t mdZfit = his->GetMean();
1512 his = fHisChi2YIn1->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - line
1513 Float_t mChi2YIn1= his->GetMean();
1515 his = fHisChi2YOut1->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - line
1516 Float_t mChi2YOut1 = his->GetMean();
1518 his = fHisChi2YIn2->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - parabola
1519 Float_t mChi2YIn2 = his->GetMean();
1521 his = fHisChi2YOut2->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - parabola
1522 Float_t mChi2YOut2 = his->GetMean();
1524 his = fHisChi2YIO1->ProjectionY("aaa",id+1,id+1); //->chi2 y IO - common
1525 Float_t mChi2YIO1 = his->GetMean();
1527 his = fHisChi2ZIn1->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - line
1528 Float_t mChi2ZIn1 = his->GetMean();
1530 his = fHisChi2ZOut1->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - line
1531 Float_t mChi2ZOut1 = his->GetMean();
1533 his = fHisChi2ZIn2->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - parabola
1534 Float_t mChi2ZIn2 = his->GetMean();
1536 his = fHisChi2ZOut2->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - parabola
1537 Float_t mChi2ZOut2 = his->GetMean();
1539 his = fHisChi2ZIO1->ProjectionY("aaa",id+1,id+1); //->chi2 z IO - common
1540 Float_t mChi2ZIO1 = his->GetMean();
1545 his = fHisPy1vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - line
1546 Float_t ePy1vP0 = his->GetEntries();
1547 Float_t mPy1vP0 = his->GetMean();
1548 Float_t rPy1vP0 = his->GetRMS();
1551 his = fHisPy2vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - parabola
1552 Float_t ePy2vP0 = his->GetEntries();
1553 Float_t mPy2vP0 = his->GetMean();
1554 Float_t rPy2vP0 = his->GetRMS();
1557 his = fHisPy3vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - common parabola
1558 Float_t ePy3vP0 = his->GetEntries();
1559 Float_t mPy3vP0 = his->GetMean();
1560 Float_t rPy3vP0 = his->GetRMS();
1563 his = fHisPy1vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - line
1564 Float_t ePy1vP1 = his->GetEntries();
1565 Float_t mPy1vP1 = his->GetMean();
1566 Float_t rPy1vP1 = his->GetRMS();
1569 his = fHisPy2vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - parabola
1570 Float_t ePy2vP1 = his->GetEntries();
1571 Float_t mPy2vP1 = his->GetMean();
1572 Float_t rPy2vP1 = his->GetRMS();
1575 his = fHisPy3vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - common parabola
1576 Float_t ePy3vP1 = his->GetEntries();
1577 Float_t mPy3vP1 = his->GetMean();
1578 Float_t rPy3vP1 = his->GetRMS();
1581 his = fHisPy2vP2In->ProjectionY("aaa",id+1,id+1); //-> Curv P2inner - parabola
1582 Float_t ePy2vP2In = his->GetEntries();
1583 Float_t mPy2vP2In = his->GetMean();
1584 Float_t rPy2vP2In = his->GetRMS();
1587 his = fHisPy2vP2Out->ProjectionY("aaa",id+1,id+1); //-> Curv P2outer - parabola
1588 Float_t ePy2vP2Out = his->GetEntries();
1589 Float_t mPy2vP2Out = his->GetMean();
1590 Float_t rPy2vP2Out = his->GetRMS();
1593 his = fHisPy3vP2IO->ProjectionY("aaa",id+1,id+1); //-> Curv P2outerinner - common parabola
1594 Float_t ePy3vP2IO = his->GetEntries();
1595 Float_t mPy3vP2IO = his->GetMean();
1596 Float_t rPy3vP2IO = his->GetRMS();
1601 his = fHisPz1vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - line
1602 Float_t ePz1vP0 = his->GetEntries();
1603 Float_t mPz1vP0 = his->GetMean();
1604 Float_t rPz1vP0 = his->GetRMS();
1607 his = fHisPz2vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - parabola
1608 Float_t ePz2vP0 = his->GetEntries();
1609 Float_t mPz2vP0 = his->GetMean();
1610 Float_t rPz2vP0 = his->GetRMS();
1613 his = fHisPz3vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - common parabola
1614 Float_t ePz3vP0 = his->GetEntries();
1615 Float_t mPz3vP0 = his->GetMean();
1616 Float_t rPz3vP0 = his->GetRMS();
1619 his = fHisPz1vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - line
1620 Float_t ePz1vP1 = his->GetEntries();
1621 Float_t mPz1vP1 = his->GetMean();
1622 Float_t rPz1vP1 = his->GetRMS();
1625 his = fHisPz2vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - parabola
1626 Float_t ePz2vP1 = his->GetEntries();
1627 Float_t mPz2vP1 = his->GetMean();
1628 Float_t rPz2vP1 = his->GetRMS();
1631 his = fHisPz3vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - common parabola
1632 Float_t ePz3vP1 = his->GetEntries();
1633 Float_t mPz3vP1 = his->GetMean();
1634 Float_t rPz3vP1 = his->GetRMS();
1637 his = fHisPz2vP2In->ProjectionY("aaa",id+1,id+1); //-> Curv P2inner - parabola
1638 Float_t ePz2vP2In = his->GetEntries();
1639 Float_t mPz2vP2In = his->GetMean();
1640 Float_t rPz2vP2In = his->GetRMS();
1643 his = fHisPz2vP2Out->ProjectionY("aaa",id+1,id+1); //-> Curv P2outer - parabola
1644 Float_t ePz2vP2Out = his->GetEntries();
1645 Float_t mPz2vP2Out = his->GetMean();
1646 Float_t rPz2vP2Out = his->GetRMS();
1649 his = fHisPz3vP2IO->ProjectionY("aaa",id+1,id+1); //-> Curv P2outerinner - common parabola
1650 Float_t ePz3vP2IO = his->GetEntries();
1651 Float_t mPz3vP2IO = his->GetMean();
1652 Float_t rPz3vP2IO = his->GetRMS();
1656 if (run<=0) run=fRun;
1657 (*pcstream)<<"Mean"<<
1660 "id="<<id<< // track id
1661 "entries="<<entries<< // number of entries
1662 "bz="<<bfield<< // bfield
1663 "LTr.="<<ltrp<< // refernece track
1665 "mnclIn="<<mnclIn<< // mean number of clusters in inner
1666 "mnclOut="<<mnclOut<< // mean number of clusters in outer
1667 "mnclIO="<<mnclIO<< // mean number of clusters in inner+outer
1668 "mLclIn="<<mLclIn<< // mean number of clusters in inner
1669 "mLclOut="<<mLclOut<< // mean number of clusters in outer
1670 "mLclIO="<<mLclIO<< // mean number of clusters in inner+outer
1671 "mdEdx="<<mdEdx<< // mean dEdx
1672 "mdZfit="<<mdZfit<< // mean z fit
1675 "mChi2YIn1="<<mChi2YIn1<< //->chi2 y inner - line
1676 "mChi2YOut1="<<mChi2YOut1<< //->chi2 y inner - line
1677 "mChi2YIn2="<<mChi2YIn2<< //->chi2 y inner - parabola
1678 "mChi2YOut2="<<mChi2YOut2<< //->chi2 y inner - parabola
1679 "mChi2YIO1="<<mChi2YIO1<< //->chi2 y IO - common
1680 "mChi2ZIn1="<<mChi2ZIn1<< //->chi2 z inner - line
1681 "mChi2ZOut1="<<mChi2ZOut1<< //->chi2 z inner - line
1682 "mChi2ZIn2="<<mChi2ZIn2<< //->chi2 z inner - parabola
1683 "mChi2ZOut2="<<mChi2ZOut2<< //->chi2 z inner - parabola
1684 "mChi2ZIO1="<<mChi2ZIO1<< //->chi2 z IO - common
1687 "ePy1vP0="<<ePy1vP0<<
1688 "mPy1vP0="<<mPy1vP0<<
1689 "rPy1vP0="<<rPy1vP0<<
1690 "ePy2vP0="<<ePy2vP0<<
1691 "mPy2vP0="<<mPy2vP0<<
1692 "rPy2vP0="<<rPy2vP0<<
1693 "ePy3vP0="<<ePy3vP0<<
1694 "mPy3vP0="<<mPy3vP0<<
1695 "rPy3vP0="<<rPy3vP0<<
1696 "ePy1vP1="<<ePy1vP1<<
1697 "mPy1vP1="<<mPy1vP1<<
1698 "rPy1vP1="<<rPy1vP1<<
1699 "ePy2vP1="<<ePy2vP1<<
1700 "mPy2vP1="<<mPy2vP1<<
1701 "rPy2vP1="<<rPy2vP1<<
1702 "ePy3vP1="<<ePy3vP1<<
1703 "mPy3vP1="<<mPy3vP1<<
1704 "rPy3vP1="<<rPy3vP1<<
1705 "ePy2vP2In="<<ePy2vP2In<<
1706 "mPy2vP2In="<<mPy2vP2In<<
1707 "rPy2vP2In="<<rPy2vP2In<<
1708 "ePy2vP2Out="<<ePy2vP2Out<<
1709 "mPy2vP2Out="<<mPy2vP2Out<<
1710 "rPy2vP2Out="<<rPy2vP2Out<<
1711 "ePy3vP2IO="<<ePy3vP2IO<<
1712 "mPy3vP2IO="<<mPy3vP2IO<<
1713 "rPy3vP2IO="<<rPy3vP2IO<<
1716 "ePz1vP0="<<ePz1vP0<<
1717 "mPz1vP0="<<mPz1vP0<<
1718 "rPz1vP0="<<rPz1vP0<<
1719 "ePz2vP0="<<ePz2vP0<<
1720 "mPz2vP0="<<mPz2vP0<<
1721 "rPz2vP0="<<rPz2vP0<<
1722 "ePz3vP0="<<ePz3vP0<<
1723 "mPz3vP0="<<mPz3vP0<<
1724 "rPz3vP0="<<rPz3vP0<<
1725 "ePz1vP1="<<ePz1vP1<<
1726 "mPz1vP1="<<mPz1vP1<<
1727 "rPz1vP1="<<rPz1vP1<<
1728 "ePz2vP1="<<ePz2vP1<<
1729 "mPz2vP1="<<mPz2vP1<<
1730 "rPz2vP1="<<rPz2vP1<<
1731 "ePz3vP1="<<ePz3vP1<<
1732 "mPz3vP1="<<mPz3vP1<<
1733 "rPz3vP1="<<rPz3vP1<<
1734 "ePz2vP2In="<<ePz2vP2In<<
1735 "mPz2vP2In="<<mPz2vP2In<<
1736 "rPz2vP2In="<<rPz2vP2In<<
1737 "ePz2vP2Out="<<ePz2vP2Out<<
1738 "mPz2vP2Out="<<mPz2vP2Out<<
1739 "rPz2vP2Out="<<rPz2vP2Out<<
1740 "ePz3vP2IO="<<ePz3vP2IO<<
1741 "mPz3vP2IO="<<mPz3vP2IO<<
1742 "rPz3vP2IO="<<rPz3vP2IO<<
1746 "lx0="<<lxyz[0]<< // reference x
1747 "lx1="<<lxyz[1]<< // reference y
1748 "lx2="<<lxyz[2]<< // refernece z
1749 "lpx0="<<lpxyz[0]<< // reference x
1750 "lpx1="<<lpxyz[1]<< // reference y
1751 "lpx2="<<lpxyz[2]<< // refernece z
1755 "mphi="<<meanphi<< //
1756 "rmsphi="<<rmsphi<< //
1760 "mphiP="<<meanphiP<< //
1761 "rmsphiP="<<rmsphiP<< //
1770 "gp31="<<gp31<< //gaus mean - tgl
1771 "gp32="<<gp32<< //gaus rms -tgl
1772 "gp41="<<gp41<< //gaus mean - P4
1773 "gp42="<<gp42<< //gaus rms - P4
1780 TFile fmean("laserMean.root");
1790 void AliTPCcalibLaser::DumpScanInfo(TTree * chain){
1794 TTreeSRedirector *pcstream = new TTreeSRedirector("laserScan.root");
1795 TFile * f = pcstream->GetFile();
1797 f->mkdir("dirphiP");
1799 TF1 fp("p1","pol1");
1804 char grnamefull[1000];
1807 Double_t mphiP[100];
1808 Double_t smphi[100];
1809 Double_t smphiP[100];
1819 for (Int_t id=0; id<336; id++){
1821 sprintf(cut,"isOK&&fId==%d",id);
1822 Int_t entries = chain->Draw("bz",cut,"goff");
1823 if (entries<3) continue;
1824 AliTPCLaserTrack *ltrp = 0;
1825 if (!AliTPCLaserTrack::GetTracks()) AliTPCLaserTrack::LoadTracks();
1826 ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
1830 ltrp->GetPxPyPz(lpxyz);
1832 chain->Draw("bz",cut,"goff");
1833 memcpy(bz, chain->GetV1(), entries*sizeof(Double_t));
1834 chain->Draw("0.01*abs(bz)+0.02",cut,"goff");
1835 memcpy(sbz, chain->GetV1(), entries*sizeof(Double_t));
1837 chain->Draw("gphi1",cut,"goff");
1838 memcpy(mphi, chain->GetV1(), entries*sizeof(Double_t));
1839 chain->Draw("0.05*abs(mphi)+gphi2",cut,"goff");
1840 memcpy(smphi, chain->GetV1(), entries*sizeof(Double_t));
1842 chain->Draw("gphiP1",cut,"goff");
1843 memcpy(mphiP, chain->GetV1(), entries*sizeof(Double_t));
1844 chain->Draw("0.05*abs(mphiP)+gphiP2",cut,"goff");
1845 memcpy(smphiP, chain->GetV1(), entries*sizeof(Double_t));
1847 chain->Draw("gz1",cut,"goff");
1848 memcpy(mZ, chain->GetV1(), entries*sizeof(Double_t));
1849 chain->Draw("0.01*abs(meanZ)+gz2",cut,"goff");
1850 memcpy(smZ, chain->GetV1(), entries*sizeof(Double_t));
1853 sprintf(grnamefull,"Side_%d_Bundle_%d_Rod_%d_Beam_%d",
1854 ltrp->GetSide(), ltrp->GetBundle(), ltrp->GetRod(), ltrp->GetBeam());
1858 TGraphErrors *grphi = new TGraphErrors(entries,bz,mphi,sbz,smphi);
1861 pphi[0] = fp.GetParameter(0); // offset
1862 pphi[1] = fp.GetParameter(1); // slope
1863 pphi[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
1864 sprintf(grname,"phi_id%d",id);
1865 grphi->SetName(grname); grphi->SetTitle(grnamefull);
1866 grphi->GetXaxis()->SetTitle("b_{z} (T)");
1867 grphi->GetYaxis()->SetTitle("#Delta r#phi (cm)");
1868 grphi->SetMaximum(1.2);
1869 grphi->SetMinimum(-1.2);
1873 gPad->SaveAs(Form("pic/phi/phi_%s.gif",grnamefull));
1876 TGraphErrors *grphiP = new TGraphErrors(entries,bz,mphiP,sbz,smphiP);
1879 pphiP[0] = fp.GetParameter(0); // offset
1880 pphiP[1] = fp.GetParameter(1); // slope
1881 pphiP[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
1882 sprintf(grname,"phiP_id%d",id);
1883 grphiP->SetName(grname); grphiP->SetTitle(grnamefull);
1884 grphiP->GetXaxis()->SetTitle("b_{z} (T)");
1885 grphiP->GetYaxis()->SetTitle("#Delta #phi (rad)");
1886 grphiP->SetMaximum(pphiP[0]+0.005);
1887 grphiP->SetMinimum(pphiP[0]-0.005);
1889 gPad->SaveAs(Form("pic/phiP/phiP_%s.gif",grnamefull));
1894 TGraphErrors *grmZ = new TGraphErrors(entries,bz,mZ,sbz,smZ);
1897 pmZ[0] = fp.GetParameter(0); // offset
1898 pmZ[1] = fp.GetParameter(1); // slope
1899 pmZ[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
1900 sprintf(grname,"mZ_id%d",id);
1901 grmZ->SetName(grname); grmZ->SetTitle(grnamefull);
1902 grmZ->GetXaxis()->SetTitle("b_{z} (T)");
1903 grmZ->GetYaxis()->SetTitle("#Delta z (cm)");
1905 gPad->SaveAs(Form("pic/z/z_%s.gif",grnamefull));
1909 for (Int_t ientry=0; ientry<entries; ientry++){
1910 (*pcstream)<<"Mean"<<
1913 "entries="<<entries<<
1915 "lx0="<<lxyz[0]<< // reference x
1916 "lx1="<<lxyz[1]<< // reference y
1917 "lx2="<<lxyz[2]<< // refernece z
1918 "lpx0="<<lpxyz[0]<< // reference x
1919 "lpx1="<<lpxyz[1]<< // reference y
1920 "lpx2="<<lpxyz[2]<< // refernece z
1922 "gphi1="<<mphi[ientry]<< // mean - from gaus fit
1923 "pphi0="<<pphi[0]<< // offset
1924 "pphi1="<<pphi[1]<< // mean
1925 "pphi2="<<pphi[2]<< // norm chi2
1927 "gphiP1="<<mphiP[ientry]<< // mean - from gaus fit
1928 "pphiP0="<<pphiP[0]<< // offset
1929 "pphiP1="<<pphiP[1]<< // mean
1930 "pphiP2="<<pphiP[2]<< // norm chi2
1932 "gz1="<<mZ[ientry]<<
1933 "pmZ0="<<pmZ[0]<< // offset
1934 "pmZ1="<<pmZ[1]<< // mean
1935 "pmZ2="<<pmZ[2]<< // norm chi2
1945 void AliTPCcalibLaser::Analyze(){
1952 Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
1954 TIterator* iter = li->MakeIterator();
1955 AliTPCcalibLaser* cal = 0;
1957 while ((cal = (AliTPCcalibLaser*)iter->Next())) {
1958 if (!cal->InheritsFrom(AliTPCcalibLaser::Class())) {
1959 Error("Merge","Attempt to add object of class %s to a %s", cal->ClassName(), this->ClassName());
1963 MergeFitHistos(cal);
1969 for (Int_t id=0; id<336; id++){
1970 // merge fDeltaZ histograms
1971 hm = (TH1F*)cal->fDeltaZ.At(id);
1972 h = (TH1F*)fDeltaZ.At(id);
1974 h=new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
1976 fDeltaZ.AddAt(h,id);
1979 // merge fP3 histograms
1980 hm = (TH1F*)cal->fDeltaP3.At(id);
1981 h = (TH1F*)fDeltaP3.At(id);
1983 h=new TH1F(Form("hisPar3v%d",id),Form("hisPar3v%d",id),400,-0.06,0.06);
1985 fDeltaP3.AddAt(h,id);
1988 // merge fP4 histograms
1989 hm = (TH1F*)cal->fDeltaP4.At(id);
1990 h = (TH1F*)fDeltaP4.At(id);
1992 h=new TH1F(Form("hisPar4v%d",id),Form("hisPar4v%d",id),200,-0.06,0.06);
1994 fDeltaP4.AddAt(h,id);
1999 // merge fDeltaPhi histograms
2000 hm = (TH1F*)cal->fDeltaPhi.At(id);
2001 h = (TH1F*)fDeltaPhi.At(id);
2003 h= new TH1F(Form("hisdphi%d",id),Form("hisdphi%d",id),1000,-1,1);
2005 fDeltaPhi.AddAt(h,id);
2008 // merge fDeltaPhiP histograms
2009 hm = (TH1F*)cal->fDeltaPhiP.At(id);
2010 h = (TH1F*)fDeltaPhiP.At(id);
2012 h=new TH1F(Form("hisdphiP%d",id),Form("hisdphiP%d",id),1000,-0.01,0.01);
2014 fDeltaPhiP.AddAt(h,id);
2017 // merge fSignals histograms
2018 hm = (TH1F*)cal->fSignals.At(id);
2019 h = (TH1F*)fSignals.At(id);
2021 h=new TH1F(Form("hisSignal%d",id),Form("hisSignal%d",id),100,0,300);
2023 fSignals.AddAt(h,id);
2028 // merge ProfileY histograms
2029 hpm = (TProfile*)cal->fDeltaYres.At(id);
2030 hp = (TProfile*)fDeltaYres.At(id);
2032 hp=new TProfile(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d",id),160,0,160);
2033 hp->SetDirectory(0);
2034 fDeltaYres.AddAt(hp,id);
2036 if (hpm) hp->Add(hpm);
2038 hpm = (TProfile*)cal->fDeltaZres.At(id);
2039 hp = (TProfile*)fDeltaZres.At(id);
2041 hp=new TProfile(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d",id),160,0,160);
2042 hp->SetDirectory(0);
2043 fDeltaZres.AddAt(hp,id);
2045 if (hpm) hp->Add(hpm);
2053 void AliTPCcalibLaser::MakeFitHistos(){
2055 // Make a fit histograms
2057 // Number of clusters
2059 //TH2F *fHisNclIn; //->Number of clusters inner
2060 //TH2F *fHisNclOut; //->Number of clusters outer
2061 //TH2F *fHisNclIO; //->Number of cluster inner outer
2062 // TH2F *fHisdEdx; //->dEdx histo
2063 fHisNclIn = new TH2F("HisNclIn","HisNclIn",336,0,336,64,10,64);
2064 fHisNclOut = new TH2F("HisNclOut","HisNclOut",336,0,336,100,10,100);
2065 fHisNclIO = new TH2F("HisNclIO","HisNclIO",336,0,336,160,10,160);
2067 fHisLclIn = new TH2F("HisLclIn","HisLclIn",336,0,336,64,10,64);
2068 fHisLclOut = new TH2F("HisLclOut","HisLclOut",336,0,336,100,10,150);
2069 fHisLclIO = new TH2F("HisLclIO","HisLclIO",336,0,336,160,10,160);
2071 fHisdEdx = new TH2F("HisdEdx","HisdEdx",336,0,336,160,1,50);
2072 fHisdZfit = new TH2F("HisdZfit","HisdZfit",336,0,336,300,-1.,1.);
2077 // TH2F *fHisChi2YIn1; //->chi2 y inner - line
2078 // TH2F *fHisChi2YOut1; //->chi2 y inner - line
2079 // TH2F *fHisChi2YIn2; //->chi2 y inner - parabola
2080 // TH2F *fHisChi2YOut2; //->chi2 y inner - parabola
2081 // TH2F *fHisChi2YIO1; //->chi2 y IO - common
2082 fHisChi2YIn1 = new TH2F("Chi2YIn1","Chi2YIn1",336,0,336,500,0.001,0.5);
2083 fHisChi2YOut1 = new TH2F("Chi2YOut1","Chi2YOut1",336,0,336,500,0.001,0.5);
2084 fHisChi2YIn2 = new TH2F("Chi2YIn2","Chi2YIn2",336,0,336,500,0.001,0.5);
2085 fHisChi2YOut2 = new TH2F("Chi2YOut2","Chi2YOut2",336,0,336,500,0.001,0.5);
2086 fHisChi2YIO1 = new TH2F("Chi2YIO1","Chi2YIO1",336,0,336,500,0.001,0.5);
2087 // TH2F *fHisChi2ZIn1; //->chi2 z inner - line
2088 // TH2F *fHisChi2ZOut1; //->chi2 z inner - line
2089 // TH2F *fHisChi2ZIn2; //->chi2 z inner - parabola
2090 // TH2F *fHisChi2ZOut2; //->chi2 z inner - parabola
2091 // TH2F *fHisChi2ZIO1; //->chi2 z IO - common
2092 fHisChi2ZIn1 = new TH2F("Chi2ZIn1","Chi2ZIn1",336,0,336,500,0.001,0.5);
2093 fHisChi2ZOut1 = new TH2F("Chi2ZOut1","Chi2ZOut1",336,0,336,500,0.001,0.5);
2094 fHisChi2ZIn2 = new TH2F("Chi2ZIn2","Chi2ZIn2",336,0,336,500,0.001,0.5);
2095 fHisChi2ZOut2 = new TH2F("Chi2ZOut2","Chi2ZOut2",336,0,336,500,0.001,0.5);
2096 fHisChi2ZIO1 = new TH2F("Chi2ZIO1","Chi2ZIO1",336,0,336,500,0.001,0.5);
2101 // TH2F *fHisPy1vP0; //-> delta y P0outer-P0inner - line
2102 // TH2F *fHisPy2vP0; //-> delta y P0outer-P0inner - parabola
2103 // TH2F *fHisPy3vP0; //-> delta y P0outer-P0inner - common parabola
2104 // TH2F *fHisPy1vP1; //-> delta ky P1outer-P1inner - line
2105 // TH2F *fHisPy2vP1; //-> delta ky P1outer-P1inner - parabola
2106 // TH2F *fHisPy3vP1; //-> delta ky P1outer-P1inner - common parabola
2107 // TH2F *fHisPy2vP2In; //-> Curv P2inner - parabola
2108 // TH2F *fHisPy2vP2Out; //-> Curv P2outer - parabola
2109 // TH2F *fHisPy3vP2IO; //-> Curv P2outerinner - common parabola
2110 fHisPy1vP0 = new TH2F("HisPy1vP0", "HisPy1vP0",336,0,336,500,-0.3,0.3);
2111 fHisPy2vP0 = new TH2F("HisPy2vP0", "HisPy2vP0",336,0,336,500,-0.3,0.3);
2112 fHisPy3vP0 = new TH2F("HisPy3vP0", "HisPy3vP0",336,0,336,500,-0.3,0.3);
2113 fHisPy1vP1 = new TH2F("HisPy1vP1", "HisPy1vP1",336,0,336,500,-0.01,0.01);
2114 fHisPy2vP1 = new TH2F("HisPy2vP1", "HisPy2vP1",336,0,336,500,-0.01,0.01);
2115 fHisPy3vP1 = new TH2F("HisPy3vP1", "HisPy3vP1",336,0,336,500,-0.01,0.01);
2116 fHisPy2vP2In = new TH2F("HisPy2vP2In", "HisPy2vP2In",336,0,336,500,-0.0003,0.0003);
2117 fHisPy2vP2Out= new TH2F("HisPy2vP2Out","HisPy2vP2Out",336,0,336,500,-0.0003,0.0003);
2118 fHisPy3vP2IO = new TH2F("HisPy3vP2IO", "HisPy3vP2IO",336,0,336,500,-0.0003,0.0003);
2121 // TH2F *fHisPz1vP0; //-> delta z P0outer-P0inner - line
2122 // TH2F *fHisPz2vP0; //-> delta z P0outer-P0inner - parabola
2123 // TH2F *fHisPz3vP0; //-> delta z P0outer-P0inner - common parabola
2124 // TH2F *fHisPz1vP1; //-> delta kz P1outer-P1inner - line
2125 // TH2F *fHisPz2vP1; //-> delta kz P1outer-P1inner - parabola
2126 // TH2F *fHisPz3vP1; //-> delta kz P1outer-P1inner - common parabola
2127 // TH2F *fHisPz2vP2In; //-> Curv P2inner - parabola
2128 // TH2F *fHisPz2vP2Out; //-> Curv P2outer - parabola
2129 // TH2F *fHisPz3vP2IO; //-> Curv P2outerinner - common parabola
2130 fHisPz1vP0 = new TH2F("HisPz1vP0", "HisPz1vP0",336,0,336,500,-0.3,0.3);
2131 fHisPz2vP0 = new TH2F("HisPz2vP0", "HisPz2vP0",336,0,336,500,-0.3,0.3);
2132 fHisPz3vP0 = new TH2F("HisPz3vP0", "HisPz3vP0",336,0,336,500,-0.3,0.3);
2133 fHisPz1vP1 = new TH2F("HisPz1vP1", "HisPz1vP1",336,0,336,500,-0.01,0.01);
2134 fHisPz2vP1 = new TH2F("HisPz2vP1", "HisPz2vP1",336,0,336,500,-0.01,0.01);
2135 fHisPz3vP1 = new TH2F("HisPz3vP1", "HisPz3vP1",336,0,336,500,-0.01,0.01);
2136 fHisPz2vP2In = new TH2F("HisPz2vP2In", "HisPz2vP2In",336,0,336,500,-0.0003,0.0003);
2137 fHisPz2vP2Out= new TH2F("HisPz2vP2Out","HisPz2vP2Out",336,0,336,500,-0.0002,0.0002);
2138 fHisPz3vP2IO = new TH2F("HisPz3vP2IO", "HisPz3vP2IO",336,0,336,500,-0.0002,0.0002);
2140 fHisNclIn->SetDirectory(0); //->Number of clusters inner
2141 fHisNclOut->SetDirectory(0); //->Number of clusters outer
2142 fHisNclIO->SetDirectory(0); //->Number of cluster inner outer
2143 fHisLclIn->SetDirectory(0); //->Level arm inner
2144 fHisLclOut->SetDirectory(0); //->Level arm outer
2145 fHisLclIO->SetDirectory(0); //->Number of cluster inner outer
2146 fHisdEdx->SetDirectory(0); //->Number of cluster inner outer
2147 fHisdZfit->SetDirectory(0); //->Number of cluster inner outer
2150 fHisChi2YIn1->SetDirectory(0); //->chi2 y inner - line
2151 fHisChi2YOut1->SetDirectory(0); //->chi2 y inner - line
2152 fHisChi2YIn2->SetDirectory(0); //->chi2 y inner - parabola
2153 fHisChi2YOut2->SetDirectory(0); //->chi2 y inner - parabola
2154 fHisChi2YIO1->SetDirectory(0); //->chi2 y IO - common
2155 fHisChi2ZIn1->SetDirectory(0); //->chi2 z inner - line
2156 fHisChi2ZOut1->SetDirectory(0); //->chi2 z inner - line
2157 fHisChi2ZIn2->SetDirectory(0); //->chi2 z inner - parabola
2158 fHisChi2ZOut2->SetDirectory(0); //->chi2 z inner - parabola
2159 fHisChi2ZIO1->SetDirectory(0); //->chi2 z IO - common
2162 fHisPy1vP0->SetDirectory(0); //-> delta y P0outer-P0inner - line
2163 fHisPy2vP0->SetDirectory(0); //-> delta y P0outer-P0inner - parabola
2164 fHisPy3vP0->SetDirectory(0); //-> delta y P0outer-P0inner - common parabola
2165 fHisPy1vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - line
2166 fHisPy2vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - parabola
2167 fHisPy3vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - common parabola
2168 fHisPy2vP2In->SetDirectory(0); //-> Curv P2inner - parabola
2169 fHisPy2vP2Out->SetDirectory(0); //-> Curv P2outer - parabola
2170 fHisPy3vP2IO->SetDirectory(0); //-> Curv P2outerinner - common parabola
2173 fHisPz1vP0->SetDirectory(0); //-> delta z P0outer-P0inner - line
2174 fHisPz2vP0->SetDirectory(0); //-> delta z P0outer-P0inner - parabola
2175 fHisPz3vP0->SetDirectory(0); //-> delta z P0outer-P0inner - common parabola
2176 fHisPz1vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - line
2177 fHisPz2vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - parabola
2178 fHisPz3vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - common parabola
2179 fHisPz2vP2In->SetDirectory(0); //-> Curv P2inner - parabola
2180 fHisPz2vP2Out->SetDirectory(0); //-> Curv P2outer - parabola
2181 fHisPz3vP2IO->SetDirectory(0); //-> Curv P2outerinner - common parabola
2187 void AliTPCcalibLaser::MergeFitHistos(AliTPCcalibLaser * laser){
2189 // Merge content of histograms
2191 // Only first histogram is checked - all other should be the same
2192 if (!laser->fHisNclIn) return; // empty histograms
2193 if (!fHisNclIn) MakeFitHistos();
2196 fHisNclIn->Add(laser->fHisNclIn ); //->Number of clusters inner
2197 fHisNclOut->Add(laser->fHisNclOut ); //->Number of clusters outer
2198 fHisNclIO->Add(laser->fHisNclIO ); //->Number of cluster inner outer
2199 fHisLclIn->Add(laser->fHisLclIn ); //->Level arm inner
2200 fHisLclOut->Add(laser->fHisLclOut ); //->Level arm outer
2201 fHisLclIO->Add(laser->fHisLclIO ); //->Number of cluster inner outer
2202 fHisdEdx->Add(laser->fHisdEdx ); //->dedx
2203 fHisdZfit->Add(laser->fHisdZfit ); //->dedx
2206 fHisChi2YIn1->Add(laser->fHisChi2YIn1 ); //->chi2 y inner - line
2207 fHisChi2YOut1->Add(laser->fHisChi2YOut1 ); //->chi2 y inner - line
2208 fHisChi2YIn2->Add(laser->fHisChi2YIn2 ); //->chi2 y inner - parabola
2209 fHisChi2YOut2->Add(laser->fHisChi2YOut2 ); //->chi2 y inner - parabola
2210 fHisChi2YIO1->Add(laser->fHisChi2YIO1 ); //->chi2 y IO - common
2211 fHisChi2ZIn1->Add(laser->fHisChi2ZIn1 ); //->chi2 z inner - line
2212 fHisChi2ZOut1->Add(laser->fHisChi2ZOut1 ); //->chi2 z inner - line
2213 fHisChi2ZIn2->Add(laser->fHisChi2ZIn2 ); //->chi2 z inner - parabola
2214 fHisChi2ZOut2->Add(laser->fHisChi2ZOut2 ); //->chi2 z inner - parabola
2215 fHisChi2ZIO1->Add(laser->fHisChi2ZIO1 ); //->chi2 z IO - common
2218 fHisPy1vP0->Add(laser->fHisPy1vP0 ); //-> delta y P0outer-P0inner - line
2219 fHisPy2vP0->Add(laser->fHisPy2vP0 ); //-> delta y P0outer-P0inner - parabola
2220 fHisPy3vP0->Add(laser->fHisPy3vP0 ); //-> delta y P0outer-P0inner - common parabola
2221 fHisPy1vP1->Add(laser->fHisPy1vP1 ); //-> delta ky P1outer-P1inner - line
2222 fHisPy2vP1->Add(laser->fHisPy2vP1 ); //-> delta ky P1outer-P1inner - parabola
2223 fHisPy3vP1->Add(laser->fHisPy3vP1 ); //-> delta ky P1outer-P1inner - common parabola
2224 fHisPy2vP2In->Add(laser-> fHisPy2vP2In ); //-> Curv P2inner - parabola
2225 fHisPy2vP2Out->Add(laser->fHisPy2vP2Out ); //-> Curv P2outer - parabola
2226 fHisPy3vP2IO->Add(laser->fHisPy3vP2IO ); //-> Curv P2outerinner - common parabola
2229 fHisPz1vP0->Add(laser->fHisPz1vP0 ); //-> delta z P0outer-P0inner - line
2230 fHisPz2vP0->Add(laser->fHisPz2vP0 ); //-> delta z P0outer-P0inner - parabola
2231 fHisPz3vP0->Add(laser->fHisPz3vP0 ); //-> delta z P0outer-P0inner - common parabola
2232 fHisPz1vP1->Add(laser->fHisPz1vP1 ); //-> delta kz P1outer-P1inner - line
2233 fHisPz2vP1->Add(laser->fHisPz2vP1 ); //-> delta kz P1outer-P1inner - parabola
2234 fHisPz3vP1->Add(laser->fHisPz3vP1 ); //-> delta kz P1outer-P1inner - common parabola
2235 fHisPz2vP2In->Add(laser->fHisPz2vP2In ); //-> Curv P2inner - parabola
2236 fHisPz2vP2Out->Add(laser->fHisPz2vP2Out ); //-> Curv P2outer - parabola
2237 fHisPz3vP2IO->Add(laser->fHisPz3vP2IO ); //-> Curv P2outerinner - common parabola
2250 void AliTPCcalibLaser::DumpFitInfo(TTree * chainFit,Int_t id){
2252 // Dump fit information - collect information from the streamers
2255 TChain * chainFit=0;
2256 TChain * chainTrack=0;
2259 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
2260 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+");
2261 AliXRDPROOFtoolkit tool;
2262 chainTrack = tool.MakeChain("laser.txt","Track",0,10200);
2263 chainTrack->Lookup();
2264 chainTrack->SetProof(kTRUE);
2265 chainDrift = tool.MakeChain("laser.txt","driftv",0,10200);
2266 chainDrift->Lookup();
2267 chainDrift->SetProof(kTRUE);
2269 chain = tool.MakeChain("laser.txt","Residuals",0,10200);
2271 chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
2273 chainFit->SetProof(kTRUE);
2274 chain->SetProof(kTRUE);
2275 AliTPCLaserTrack::LoadTracks();
2276 //AliTPCcalibLaser::DumpFitInfo(chainFit,0);
2282 TCut cutP3("abs(Tr.fP[3])<0.1");
2283 TCut cutP4("abs(Tr.fP[4])<0.5");
2284 TCut cutPx = cutP3+cutP4;
2285 TCut cutChi2YOut("sqrt(chi2y2Out*dEdx)<5&&chi2y2Out>0");
2286 TCut cutChi2ZOut("sqrt(chi2z2Out*dEdx)<5&&chi2z2Out>0");
2287 TCut cutChi2YIn("sqrt(chi2y2In*dEdx)<5&&chi2y2In>0");
2288 TCut cutChi2ZIn("sqrt(chi2z2In*dEdx)<5&&chi2z2In>0");
2290 TCut cutdEdx("sqrt(dEdx)>3");
2291 TCut cutDY("abs(yPol2In.fElements[2]*nclI*nclI/4.)<3");
2292 TCut cutN("nclO>20&&nclI>20");
2293 TCut cutA = cutChi2YOut+cutChi2ZOut+cutChi2YIn+cutChi2ZIn+cutN+cutdEdx+cutPx+"accept";
2297 TCut cutClY("abs(Cl[].fY-TrYpol2.fElements)<0.15");
2298 TCut cutClZ("abs(Cl[].fZ-TrZpol2.fElements)<0.15");
2299 TCut cutClX("abs(Cl[].fX)>10");
2300 TCut cutE("abs(Cl[].fY/Cl[].fX)<0.14");
2301 TCut cutSY("sqrt(Cl[].fSigmaY2)>0.05");
2302 TCut cutSZ("sqrt(Cl[].fSigmaZ2)>0.05");
2303 TCut cutQ("sqrt(Cl[].fMax)>4");
2304 TCut cutCl=cutClY+cutClZ+cutClX+cutE+cutSY+cutSZ+cutQ;
2308 TH1F * phisAccept = 0;
2310 TProfile * pdEdx = 0;
2318 TProfile * pNclI = 0;
2319 TProfile * pNclO = 0;
2321 TProfile * pchi2YIn =0;
2322 TProfile * pchi2ZIn =0;
2323 TProfile * pchi2YOut =0;
2324 TProfile * pchi2ZOut =0;
2325 TProfile * pchi2YInOut =0;
2326 TProfile * pchi2ZInOut =0;;
2328 chainFit->Draw("LTr.fId>>hisAl(350,0,350)","LTr.fId<350");
2329 phisAl = (TH1F*)gROOT->FindObject("hisAl");
2330 chainFit->Draw("LTr.fId>>hisAccept(350,0,350)","LTr.fId<350"+cutA);
2331 phisAccept = (TH1F*)gROOT->FindObject("hisAccept");
2332 chainFit->Draw("LTr.fId>>hisOut(350,0,350)","LTr.fId<350"+!cutA);
2333 phisOut = (TH1F*)gROOT->FindObject("hisOut");
2335 chainFit->Draw("sqrt(dEdx):LTr.fId>>hdEdx(350,0,350)","","prof");
2336 pdEdx = (TProfile*)gROOT->FindObject("hdEdx");
2339 chainFit->Draw("Tr.fP[0]:LTr.fId>>hP0(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2340 pP0 = (TProfile*)gROOT->FindObject("hP0");
2341 chainFit->Draw("Tr.fP[1]:LTr.fId>>hP1(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2342 pP1 = (TProfile*)gROOT->FindObject("hP1");
2343 chainFit->Draw("Tr.fP[2]:LTr.fId>>hP2(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2344 pP2 = (TProfile*)gROOT->FindObject("hP2");
2345 chainFit->Draw("Tr.fP[3]:LTr.fId>>hP3(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2346 pP3 = (TProfile*)gROOT->FindObject("hP3");
2347 chainFit->Draw("Tr.fP[4]:LTr.fId>>hP4(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2348 pP4 = (TProfile*)gROOT->FindObject("hP4");
2350 chainFit->Draw("nclI:LTr.fId>>hNclI(350,0,350)","","prof");
2351 pNclI = (TProfile*)gROOT->FindObject("hNclI");
2352 chainFit->Draw("nclO:LTr.fId>>hNclO(350,0,350)","","prof");
2353 pNclO = (TProfile*)gROOT->FindObject("hNclO");
2356 chainFit->Draw("sqrt(chi2y2In):LTr.fId>>hChi2YIn(350,0,350)",cutA+"","prof");
2357 pchi2YIn = (TProfile*)gROOT->FindObject("hChi2YIn");
2358 chainFit->Draw("sqrt(chi2y2Out):LTr.fId>>hChi2YOut(350,0,350)",cutA+"","prof");
2359 pchi2YOut = (TProfile*)gROOT->FindObject("hChi2YOut");
2360 chainFit->Draw("sqrt(chi2yInOut):LTr.fId>>hChi2YInOut(350,0,350)",cutA+"","prof");
2361 pchi2YInOut = (TProfile*)gROOT->FindObject("hChi2YInOut");
2362 chainFit->Draw("sqrt(chi2z2In):LTr.fId>>hChi2ZIn(350,0,350)",cutA+"","prof");
2363 pchi2ZIn = (TProfile*)gROOT->FindObject("hChi2ZIn");
2364 chainFit->Draw("sqrt(chi2z2Out):LTr.fId>>hChi2ZOut(350,0,350)",cutA+"","prof");
2365 pchi2ZOut = (TProfile*)gROOT->FindObject("hChi2ZOut");
2366 chainFit->Draw("sqrt(chi2zInOut):LTr.fId>>hChi2ZInOut(350,0,350)",cutA+"","prof");
2367 pchi2ZInOut = (TProfile*)gROOT->FindObject("hChi2ZInOut");
2369 // second derivatives
2371 TH2F * phisPy2In = new TH2F("Py2Inner","Py2Inner",350,0,350,100,-0.001,0.001);
2372 chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>Py2Inner",cutA,"");
2373 TH2F * phisPy2Out = new TH2F("Py2Outer","Py2Outer",350,0,350,200,-0.0005,0.0005);
2374 chainFit->Draw("yPol2Out.fElements[2]:LTr.fId>>Py2Outer",cutA,"");
2375 TH2F * phisPy2InOut = new TH2F("Py2InOut","Py2InOut",350,0,350,200,-0.0005,0.0005);
2376 chainFit->Draw("yInOut.fElements[4]:LTr.fId>>Py2InOut",cutA,"");
2378 phisPy2In->FitSlicesY();
2379 TH1D * phisPy2InEntries = (TH1D*)gROOT->FindObject("Py2Inner_0");
2380 TH1D * phisPy2InMean = (TH1D*)gROOT->FindObject("Py2Inner_1");
2381 TH1D * phisPy2InSigma = (TH1D*)gROOT->FindObject("Py2Inner_2");
2383 phisPy2Out->FitSlicesY();
2384 TH1D * phisPy2OutEntries = (TH1D*)gROOT->FindObject("Py2Outer_0");
2385 TH1D * phisPy2OutMean = (TH1D*)gROOT->FindObject("Py2Outer_1");
2386 TH1D * phisPy2OutSigma = (TH1D*)gROOT->FindObject("Py2Outer_2");
2388 phisPy2InOut->FitSlicesY();
2389 TH1D * phisPy2InOutEntries = (TH1D*)gROOT->FindObject("Py2InOut_0");
2390 TH1D * phisPy2InOutMean = (TH1D*)gROOT->FindObject("Py2InOut_1");
2391 TH1D * phisPy2InOutSigma = (TH1D*)gROOT->FindObject("Py2InOut_2");
2393 TH2F * phisPz2In = new TH2F("Pz2Inner","Pz2Inner",350,0,350,100,-0.001,0.001);
2394 chainFit->Draw("zPol2In.fElements[2]:LTr.fId>>Pz2Inner",cutA,"");
2395 TH2F * phisPz2Out = new TH2F("Pz2Outer","Pz2Outer",350,0,350,200,-0.0005,0.0005);
2396 chainFit->Draw("zPol2Out.fElements[2]:LTr.fId>>Pz2Outer",cutA,"");
2397 TH2F * phisPz2InOut = new TH2F("Pz2InOut","Pz2InOut",350,0,350,200,-0.0005,0.0005);
2398 chainFit->Draw("zInOut.fElements[4]:LTr.fId>>Pz2InOut",cutA,"");
2400 phisPz2In->FitSlicesY();
2401 TH1D * phisPz2InEntries = (TH1D*)gROOT->FindObject("Pz2Inner_0");
2402 TH1D * phisPz2InMean = (TH1D*)gROOT->FindObject("Pz2Inner_1");
2403 TH1D * phisPz2InSigma = (TH1D*)gROOT->FindObject("Pz2Inner_2");
2405 phisPz2Out->FitSlicesY();
2406 TH1D * phisPz2OutEntries = (TH1D*)gROOT->FindObject("Pz2Outer_0");
2407 TH1D * phisPz2OutMean = (TH1D*)gROOT->FindObject("Pz2Outer_1");
2408 TH1D * phisPz2OutSigma = (TH1D*)gROOT->FindObject("Pz2Outer_2");
2410 phisPz2InOut->FitSlicesY();
2411 TH1D * phisPz2InOutEntries = (TH1D*)gROOT->FindObject("Pz2InOut_0");
2412 TH1D * phisPz2InOutMean = (TH1D*)gROOT->FindObject("Pz2InOut_1");
2413 TH1D * phisPz2InOutSigma = (TH1D*)gROOT->FindObject("Pz2InOut_2");
2420 TTreeSRedirector *pcstream = new TTreeSRedirector("vscan.root");
2421 for (Int_t ilaser=0; ilaser<336; ilaser++){
2422 Float_t all=phisAl->GetBinContent(ilaser+1);
2423 Float_t accept=phisAccept->GetBinContent(ilaser+1);
2424 Float_t out=phisOut->GetBinContent(ilaser+1);
2425 Float_t sdedx = pdEdx->GetBinContent(ilaser+1);
2426 Float_t mP0 = pP0->GetBinContent(ilaser+1);
2427 Float_t mP1 = pP1->GetBinContent(ilaser+1);
2428 Float_t mP2 = pP2->GetBinContent(ilaser+1);
2429 Float_t mP3 = pP3->GetBinContent(ilaser+1);
2430 Float_t mP4 = pP4->GetBinContent(ilaser+1);
2433 Float_t nclI = pNclI->GetBinContent(ilaser+1);
2434 Float_t nclO = pNclO->GetBinContent(ilaser+1);
2436 Float_t chi2YIn=pchi2YIn->GetBinContent(ilaser+1);
2437 Float_t chi2YOut=pchi2YOut->GetBinContent(ilaser+1);
2438 Float_t chi2YInOut=pchi2YInOut->GetBinContent(ilaser+1);
2439 Float_t chi2ZIn=pchi2ZIn->GetBinContent(ilaser+1);
2440 Float_t chi2ZOut=pchi2ZOut->GetBinContent(ilaser+1);
2441 Float_t chi2ZInOut=pchi2ZInOut->GetBinContent(ilaser+1);
2443 Float_t entriesPy2In = phisPy2InEntries->GetBinContent(ilaser+1);
2444 Float_t meanPy2In = phisPy2InMean->GetBinContent(ilaser+1);
2445 Float_t sigmaPy2In = phisPy2InSigma->GetBinContent(ilaser+1);
2447 Float_t entriesPy2Out = phisPy2OutEntries->GetBinContent(ilaser+1);
2448 Float_t meanPy2Out = phisPy2OutMean->GetBinContent(ilaser+1);
2449 Float_t sigmaPy2Out = phisPy2OutSigma->GetBinContent(ilaser+1);
2451 Float_t entriesPy2InOut = phisPy2InOutEntries->GetBinContent(ilaser+1);
2452 Float_t meanPy2InOut = phisPy2InOutMean->GetBinContent(ilaser+1);
2453 Float_t sigmaPy2InOut = phisPy2InOutSigma->GetBinContent(ilaser+1);
2455 Float_t entriesPz2In = phisPz2InEntries->GetBinContent(ilaser+1);
2456 Float_t meanPz2In = phisPz2InMean->GetBinContent(ilaser+1);
2457 Float_t sigmaPz2In = phisPz2InSigma->GetBinContent(ilaser+1);
2459 Float_t entriesPz2Out = phisPz2OutEntries->GetBinContent(ilaser+1);
2460 Float_t meanPz2Out = phisPz2OutMean->GetBinContent(ilaser+1);
2461 Float_t sigmaPz2Out = phisPz2OutSigma->GetBinContent(ilaser+1);
2463 Float_t entriesPz2InOut = phisPz2InOutEntries->GetBinContent(ilaser+1);
2464 Float_t meanPz2InOut = phisPz2InOutMean->GetBinContent(ilaser+1);
2465 Float_t sigmaPz2InOut = phisPz2InOutSigma->GetBinContent(ilaser+1);
2467 AliTPCLaserTrack* ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(ilaser);
2468 (*pcstream)<<"Scan"<<
2482 "chi2YIn="<<chi2YIn<<
2483 "chi2YOut="<<chi2YOut<<
2484 "chi2YInOut="<<chi2YInOut<<
2485 "chi2ZIn="<<chi2ZIn<<
2486 "chi2ZOut="<<chi2ZOut<<
2487 "chi2ZInOut="<<chi2ZInOut<<
2489 "nPy2In="<<entriesPy2In<<
2490 "mPy2In="<<meanPy2In<<
2491 "sPy2In="<<sigmaPy2In<<
2493 "nPy2Out="<<entriesPy2Out<<
2494 "mPy2Out="<<meanPy2Out<<
2495 "sPy2Out="<<sigmaPy2Out<<
2497 "nPy2InOut="<<entriesPy2InOut<<
2498 "mPy2InOut="<<meanPy2InOut<<
2499 "sPy2InOut="<<sigmaPy2InOut<<
2501 "nPz2In="<<entriesPz2In<<
2502 "mPz2In="<<meanPz2In<<
2503 "sPz2In="<<sigmaPz2In<<
2505 "nPz2Out="<<entriesPz2Out<<
2506 "mPz2Out="<<meanPz2Out<<
2507 "sPz2Out="<<sigmaPz2Out<<
2509 "nPz2InOut="<<entriesPz2InOut<<
2510 "mPz2InOut="<<meanPz2InOut<<
2511 "sPz2InOut="<<sigmaPz2InOut<<
2518 TFile f("vscan.root");
2523 chain->Draw("Cl[].fPad-int(Cl[].fPad)",cutA+cutCl+"Cl[].fZ>0&&Cl[].fPad>1","",10000);
2525 chain->Draw("Cl[].fY-TrYpol1.fElements:Cl[].fPad-int(Cl[].fPad)",cutA+cutCl+"Cl[].fZ>0&&Cl[].fPad>1","prof",10000);
2528 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);
2531 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)
2540 // check edge effects
2541 chain->Draw("Cl.fY-TrYpol1.fElements:Cl.fY/Cl.fX",""+cutA+cutCl,"prof",10000)
2543 chain->Draw("Cl.fY-TrYpol2.fElements:Cl.fPad-int(Cl.fPad)","Cl.fZ>0"+cutA+cutCl+cutE,"prof",100000)
2545 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)
2549 chainFit->Draw("yInOut.fElements[4]:LTr.fP[2]","LTr.fP[1]<0"+cutA,"prof",1000);
2550 chainFit->Draw("yPol2In.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&<r.fP[1]<0"+cutA+cutD,"prof")
2561 dedge = sign(Cl.fY)*(Cl.fX*tan(pi/18)-abs(Cl.fY))
2564 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)
2566 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)
2572 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)
2574 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)
2578 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)
2580 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)
2589 chainFit->Draw("yPol2Out.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&<r.fP[1]<0"+cutA+cutDY,"prof")
2591 chainFit->Draw("yPol2In.fElements[2]*64*64/4.:LTr.fP[2]","nclI>20&<r.fP[1]<0"+cutA+cutDY,"prof")
2595 chainFit->Draw("LTr.fId","nclI>10",100000)
2597 chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>his(350,0,350,100,-0.002,0.002)","nclI>20","")
2599 chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>hisPy2In0(350,0,350,100,-0.002,0.002)","nclI>20","");
2601 TH2 * phisPy2In = (TH2*) gROOT->FindObject("hisPy2In0")
2613 gSystem->Load("libSTAT.so")
2614 TStatToolkit toolkit;
2620 TCut cutA("entries>2&&pphi2<3&&abs(gphiP1-pphiP0)<0.003&&abs(gz1)<6");
2625 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz++"; //1
2626 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*LTr.fP[2]++"; //2
2627 fstring+="(abs(LTr.fP[1]/250)^1-1)*bz++"; //3
2628 fstring+="(abs(LTr.fP[1]/250)-1)*bz*LTr.fP[2]++"; //4
2630 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*sin(atan2(lx1,lx0))++" //5
2631 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*sin(atan2(lx1,lx0))*LTr.fP[2]++" //6
2632 fstring+="(abs(LTr.fP[1]/250)-1)*bz*sin(atan2(lx1,lx0))++" //7
2633 fstring+="(abs(LTr.fP[1]/250)-1)*bz*sin(atan2(lx1,lx0))*LTr.fP[2]++" //8
2635 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*cos(atan2(lx1,lx0))++" //9
2636 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*cos(atan2(lx1,lx0))*LTr.fP[2]++" //10
2637 fstring+="(abs(LTr.fP[1]/250)-1)*bz*cos(atan2(lx1,lx0))++" //11
2638 fstring+="(abs(LTr.fP[1]/250)-1)*bz*cos(atan2(lx1,lx0))*LTr.fP[2]++" //12
2643 TString *strq0 = toolkit.FitPlane(treeT,"gphi1-pphi0",fstring->Data(), "fSide==1"+cutA, chi2,npoints,fitParam,covMatrix);
2645 treeT->SetAlias("fit",strq0->Data());
2648 TString *strqP = toolkit.FitPlane(treeT,"1000*(gphiP1-pphiP0)",fstring->Data(), "fSide==1"+cutA, chi2,npoints,fitParam,covMatrix);
2650 treeT->SetAlias("fitP",strqP->Data());
2653 TString *strqDrift = toolkit.FitPlane(treeT,"gz1","LTr.fP[1]++(1-2*(fSide==1))++lx1", cutA, chi2,npoints,fitParam,covMatrix);
2654 treeT->SetAlias("fitD",strqDrift->Data());
2657 treeT->Draw("fit:LTr.fP[1]","abs(bz+0.4)<0.05"+cutA,"");
2659 for (Int_t i=0; i<6;i++){
2660 treeT->SetLineColor(i+2);
2661 treeT->SetMarkerSize(1);
2662 treeT->SetMarkerStyle(22+i);
2663 treeT->SetMarkerColor(i+2);
2665 treeT->Draw("fit:LTr.fP[1]",Form("abs(bz+0.4)<0.05&fRod==%d",i)+cutA,"same");
2673 TTree * tree = (TTree*)f.Get("FitModels");
2675 TEventList listLFit0("listLFit0","listLFit0");
2676 TEventList listLFit1("listLFit1","listLFit1");
2677 tree->Draw(">>listLFit0","seed.fdEdx<200&&seed.fdEdx>40");
2678 tree->SetEventList(&listLFit0);
2683 gSystem->Load("libSTAT.so")
2684 TStatToolkit toolkit;
2690 chain->SetAlias("dp","((Cl.fPad-int(Cl.fPad))*pi)");
2691 chain->SetAlias("dt","((Cl.fTimeBin-int(Cl.fTimeBin))*pi)");
2695 fstring+="cos(dp)++";
2696 fstring+="sin(dp)++";
2697 fstring+="cos(dt)++";
2698 fstring+="sin(dt)++";
2700 TString *str = toolkit.FitPlane(chain,"Cl.fZ-TrZInOut.fElements",fstring->Data(), "Cl.fDetector>35", chi2,npoints,fitParam,covMatrix,-1,0,200);
2713 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
2714 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
2715 AliXRDPROOFtoolkit tool;
2716 TChain * chainTrack = tool.MakeChain("laser.txt","Track",0,10200);
2717 chainTrack->Lookup();
2718 chainTrack->SetProof(kTRUE);
2720 TChain * chain = tool.MakeChain("laser.txt","Residuals",0,10200);
2722 TChain * chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
2724 chainFit->SetProof(kTRUE);
2725 chain->SetProof(kTRUE);
2729 TCut cutChi2YOut("sqrt(chi2y2Out*dEdx)<10");
2730 TCut cutChi2ZOut("sqrt(chi2z2Out*dEdx)<10");
2731 TCut cutChi2YIn("sqrt(chi2y2In*dEdx)<10");
2732 TCut cutChi2ZIn("sqrt(chi2z2In*dEdx)<10");
2734 TCut cutdEdx("sqrt(dEdx)<30&&sqrt(dEdx)>3");
2735 TCut cutDY("abs(yPol2In.fElements[2]*nclO*nclO/4.)<3")
2736 TCut cutN("nclO>20&&nclI>20");
2737 TCut cutA = cutChi2YOut+cutChi2ZOut+cutChi2YIn+cutChi2ZIn+cutN+cutdEdx;
2741 TCut cutClY("abs(Cl.fY-TrYpol2.fElements)<0.2");
2742 TCut cutClZ("abs(Cl.fZ-TrZpol2.fElements)<0.4");
2743 TCut cutClX("abs(Cl.fX)>10");
2744 TCut cutE("abs(Cl.fY/Cl.fX)<0.14");
2745 TCut cutCl=cutClY+cutClZ+cutClX;
2748 // check edge effects
2749 chain->Draw("Cl.fY-TrYpol1.fElements:Cl.fY/Cl.fX",""+cutA+cutCl,"prof",10000)
2751 chain->Draw("Cl.fY-TrYpol2.fElements:Cl.fPad-int(Cl.fPad)","Cl.fZ>0"+cutA+cutCl+cutE,"prof",100000)
2753 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)
2757 chainFit->Draw("yInOut.fElements[4]:LTr.fP[2]","LTr.fP[1]<0"+cutA,"prof",1000);
2758 chainFit->Draw("yPol2In.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&<r.fP[1]<0"+cutA+cutD,"prof")