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():
135 fTracksEsdParam(336),
145 fHisNclIn(0), //->Number of clusters inner
146 fHisNclOut(0), //->Number of clusters outer
147 fHisNclIO(0), //->Number of cluster inner outer
148 fHisLclIn(0), //->Level arm inner
149 fHisLclOut(0), //->Level arm outer
150 fHisLclIO(0), //->Number of cluster inner outer
151 fHisdEdx(0), //->dEdx histo
152 fHisdZfit(0), //->distance to the mirror after linear fit
155 fHisChi2YIn1(0), //->chi2 y inner - line
156 fHisChi2YOut1(0), //->chi2 y inner - line
157 fHisChi2YIn2(0), //->chi2 y inner - parabola
158 fHisChi2YOut2(0), //->chi2 y inner - parabola
159 fHisChi2YIO1(0), //->chi2 y IO - common
160 fHisChi2ZIn1(0), //->chi2 z inner - line
161 fHisChi2ZOut1(0), //->chi2 z inner - line
162 fHisChi2ZIn2(0), //->chi2 z inner - parabola
163 fHisChi2ZOut2(0), //->chi2 z inner - parabola
164 fHisChi2ZIO1(0), //->chi2 z IO - common
167 fHisPy1vP0(0), //-> delta y P0outer-P0inner - line
168 fHisPy2vP0(0), //-> delta y P0outer-P0inner - parabola
169 fHisPy3vP0(0), //-> delta y P0outer-P0inner - common parabola
170 fHisPy1vP1(0), //-> delta ky P1outer-P1inner - line
171 fHisPy2vP1(0), //-> delta ky P1outer-P1inner - parabola
172 fHisPy3vP1(0), //-> delta ky P1outer-P1inner - common parabola
173 fHisPy2vP2In(0), //-> Curv P2inner - parabola
174 fHisPy2vP2Out(0), //-> Curv P2outer - parabola
175 fHisPy3vP2IO(0), //-> Curv P2outerinner - common parabola
178 fHisPz1vP0(0), //-> delta z P0outer-P0inner - line
179 fHisPz2vP0(0), //-> delta z P0outer-P0inner - parabola
180 fHisPz3vP0(0), //-> delta z P0outer-P0inner - common parabola
181 fHisPz1vP1(0), //-> delta kz P1outer-P1inner - line
182 fHisPz2vP1(0), //-> delta kz P1outer-P1inner - parabola
183 fHisPz3vP1(0), //-> delta kz P1outer-P1inner - common parabola
184 fHisPz2vP2In(0), //-> Curv P2inner - parabola
185 fHisPz2vP2Out(0), //-> Curv P2outer - parabola
186 fHisPz3vP2IO(0), //-> Curv P2outerinner - common parabola
188 fDeltaYres(336), //->2D histo of residuals
189 fDeltaZres(336), //->2D histo fo residuals
190 fDeltaYres2(336), //->2D histo of residuals
191 fDeltaZres2(336), //->2D histo fo residuals
192 //fDeltaYres3(336), //->2D histo of residuals
193 //fDeltaZres3(336), //->2D histo fo residuals
194 fFitAside(new TVectorD(3)),
195 fFitCside(new TVectorD(3)),
196 fFitACside(new TVectorD(4)),
205 fTracksEsdParam.SetOwner(kTRUE);
208 AliTPCcalibLaser::AliTPCcalibLaser(const Text_t *name, const Text_t *title, Bool_t full):
214 fTracksEsdParam(336),
218 fDeltaZ(336), // array of histograms of delta z for each track
219 fDeltaP3(336), // array of histograms of delta z for each track
220 fDeltaP4(336), // array of histograms of P3 for each track
221 fDeltaPhi(336), // array of histograms of P4 for each track
222 fDeltaPhiP(336), // array of histograms of delta z for each track
223 fSignals(336), // array of dedx signals
226 fHisNclIn(0), //->Number of clusters inner
227 fHisNclOut(0), //->Number of clusters outer
228 fHisNclIO(0), //->Number of cluster inner outer
229 fHisLclIn(0), //->Level arm inner
230 fHisLclOut(0), //->Level arm outer
231 fHisLclIO(0), //->Number of cluster inner outer
232 fHisdEdx(0), //->dEdx histo
233 fHisdZfit(0), //->distance to the mirror after linear fit
236 fHisChi2YIn1(0), //->chi2 y inner - line
237 fHisChi2YOut1(0), //->chi2 y inner - line
238 fHisChi2YIn2(0), //->chi2 y inner - parabola
239 fHisChi2YOut2(0), //->chi2 y inner - parabola
240 fHisChi2YIO1(0), //->chi2 y IO - common
241 fHisChi2ZIn1(0), //->chi2 z inner - line
242 fHisChi2ZOut1(0), //->chi2 z inner - line
243 fHisChi2ZIn2(0), //->chi2 z inner - parabola
244 fHisChi2ZOut2(0), //->chi2 z inner - parabola
245 fHisChi2ZIO1(0), //->chi2 z IO - common
248 fHisPy1vP0(0), //-> delta y P0outer-P0inner - line
249 fHisPy2vP0(0), //-> delta y P0outer-P0inner - parabola
250 fHisPy3vP0(0), //-> delta y P0outer-P0inner - common parabola
251 fHisPy1vP1(0), //-> delta ky P1outer-P1inner - line
252 fHisPy2vP1(0), //-> delta ky P1outer-P1inner - parabola
253 fHisPy3vP1(0), //-> delta ky P1outer-P1inner - common parabola
254 fHisPy2vP2In(0), //-> Curv P2inner - parabola
255 fHisPy2vP2Out(0), //-> Curv P2outer - parabola
256 fHisPy3vP2IO(0), //-> Curv P2outerinner - common parabola
259 fHisPz1vP0(0), //-> delta z P0outer-P0inner - line
260 fHisPz2vP0(0), //-> delta z P0outer-P0inner - parabola
261 fHisPz3vP0(0), //-> delta z P0outer-P0inner - common parabola
262 fHisPz1vP1(0), //-> delta kz P1outer-P1inner - line
263 fHisPz2vP1(0), //-> delta kz P1outer-P1inner - parabola
264 fHisPz3vP1(0), //-> delta kz P1outer-P1inner - common parabola
265 fHisPz2vP2In(0), //-> Curv P2inner - parabola
266 fHisPz2vP2Out(0), //-> Curv P2outer - parabola
267 fHisPz3vP2IO(0), //-> Curv P2outerinner - common parabola
277 fFitAside(new TVectorD(3)), // drift fit - A side
278 fFitCside(new TVectorD(3)), // drift fit - C- side
279 fFitACside(new TVectorD(4)), // drift fit - AC- side
280 fEdgeXcuts(3), // cuts in local x direction; used in the refit of the laser tracks
281 fEdgeYcuts(3), // cuts in local y direction; used in the refit of the laser tracks
282 fNClCuts(5), // cuts on the number of clusters per tracklet; used in the refit of the laser tracks
283 fNcuts(0) // number of cuts
290 fTracksEsdParam.SetOwner(kTRUE);
293 AliTPCcalibLaser::AliTPCcalibLaser(const AliTPCcalibLaser& calibLaser):
294 AliTPCcalibBase(calibLaser),
299 fTracksEsdParam(336),
301 fFullCalib(calibLaser.fFullCalib),
303 fDeltaZ(calibLaser.fDeltaZ), // array of histograms of delta z for each track
304 fDeltaP3(((calibLaser.fDeltaP3))), // array of histograms of delta z for each track
305 fDeltaP4(((calibLaser.fDeltaP4))), // array of histograms of P3 for each track
306 fDeltaPhi(((calibLaser.fDeltaPhi))), // array of histograms of P4 for each track
307 fDeltaPhiP(((calibLaser.fDeltaPhiP))), // array of histograms of delta z for each track
308 fSignals(((calibLaser.fSignals))), // array of dedx signals
311 fHisNclIn(new TH2F(*(calibLaser.fHisNclIn))), //->Number of clusters inner
312 fHisNclOut(new TH2F(*(calibLaser.fHisNclOut))), //->Number of clusters outer
313 fHisNclIO(new TH2F(*(calibLaser.fHisNclIO))), //->Number of cluster inner outer
314 fHisLclIn(new TH2F(*(calibLaser.fHisLclIn))), //->Level arm inner
315 fHisLclOut(new TH2F(*(calibLaser.fHisLclOut))), //->Level arm outer
316 fHisLclIO(new TH2F(*(calibLaser.fHisLclIO))), //->Number of cluster inner outer
317 fHisdEdx(new TH2F(*(calibLaser.fHisdEdx))), //
318 fHisdZfit(new TH2F(*(calibLaser.fHisdZfit))), //->distance to the mirror after linear fit
321 fHisChi2YIn1(new TH2F(*(calibLaser.fHisChi2YIn1))), //->chi2 y inner - line
322 fHisChi2YOut1(new TH2F(*(calibLaser.fHisChi2YOut1))), //->chi2 y inner - line
323 fHisChi2YIn2(new TH2F(*(calibLaser.fHisChi2YIn2))), //->chi2 y inner - parabola
324 fHisChi2YOut2(new TH2F(*(calibLaser.fHisChi2YOut2))), //->chi2 y inner - parabola
325 fHisChi2YIO1(new TH2F(*(calibLaser.fHisChi2YIO1))), //->chi2 y IO - common
326 fHisChi2ZIn1(new TH2F(*(calibLaser.fHisChi2ZIn1))), //->chi2 z inner - line
327 fHisChi2ZOut1(new TH2F(*(calibLaser.fHisChi2ZOut1))), //->chi2 z inner - line
328 fHisChi2ZIn2(new TH2F(*(calibLaser.fHisChi2ZIn2))), //->chi2 z inner - parabola
329 fHisChi2ZOut2(new TH2F(*(calibLaser.fHisChi2ZOut2))), //->chi2 z inner - parabola
330 fHisChi2ZIO1(new TH2F(*(calibLaser.fHisChi2ZIO1))), //->chi2 z IO - common
333 fHisPy1vP0(new TH2F(*(calibLaser.fHisPy1vP0))), //-> delta y P0outer-P0inner - line
334 fHisPy2vP0(new TH2F(*(calibLaser.fHisPy2vP0))), //-> delta y P0outer-P0inner - parabola
335 fHisPy3vP0(new TH2F(*(calibLaser.fHisPy3vP0))), //-> delta y P0outer-P0inner - common parabola
336 fHisPy1vP1(new TH2F(*(calibLaser.fHisPy1vP1))), //-> delta ky P1outer-P1inner - line
337 fHisPy2vP1(new TH2F(*(calibLaser.fHisPy2vP1))), //-> delta ky P1outer-P1inner - parabola
338 fHisPy3vP1(new TH2F(*(calibLaser.fHisPy3vP1))), //-> delta ky P1outer-P1inner - common parabola
339 fHisPy2vP2In(new TH2F(*(calibLaser.fHisPy2vP2In))), //-> Curv P2inner - parabola
340 fHisPy2vP2Out(new TH2F(*(calibLaser.fHisPy2vP2Out))), //-> Curv P2outer - parabola
341 fHisPy3vP2IO(new TH2F(*(calibLaser.fHisPy3vP2IO))), //-> Curv P2outerinner - common parabola
344 fHisPz1vP0(new TH2F(*(calibLaser.fHisPz1vP0))), //-> delta z P0outer-P0inner - line
345 fHisPz2vP0(new TH2F(*(calibLaser.fHisPz2vP0))), //-> delta z P0outer-P0inner - parabola
346 fHisPz3vP0(new TH2F(*(calibLaser.fHisPz3vP0))), //-> delta z P0outer-P0inner - common parabola
347 fHisPz1vP1(new TH2F(*(calibLaser. fHisPz1vP1))), //-> delta kz P1outer-P1inner - line
348 fHisPz2vP1(new TH2F(*(calibLaser.fHisPz2vP1))), //-> delta kz P1outer-P1inner - parabola
349 fHisPz3vP1(new TH2F(*(calibLaser.fHisPz3vP1))), //-> delta kz P1outer-P1inner - common parabola
350 fHisPz2vP2In(new TH2F(*(calibLaser.fHisPz2vP2In))), //-> Curv P2inner - parabola
351 fHisPz2vP2Out(new TH2F(*(calibLaser. fHisPz2vP2Out))), //-> Curv P2outer - parabola
352 fHisPz3vP2IO(new TH2F(*(calibLaser.fHisPz3vP2IO))), //-> Curv P2outerinner - common parabola
355 fDeltaYres(((calibLaser.fDeltaYres))),
356 fDeltaZres(((calibLaser.fDeltaZres))),
357 fDeltaYres2(((calibLaser.fDeltaYres))),
358 fDeltaZres2(((calibLaser.fDeltaZres))),
359 // fDeltaYres3(((calibLaser.fDeltaYres))),
360 //fDeltaZres3(((calibLaser.fDeltaZres))),
361 fFitAside(new TVectorD(3)), // drift fit - A side
362 fFitCside(new TVectorD(3)), // drift fit - C- side
363 fFitACside(new TVectorD(4)), // drift fit - C- side
364 fEdgeXcuts(3), // cuts in local x direction; used in the refit of the laser tracks
365 fEdgeYcuts(3), // cuts in local y direction; used in the refit of the laser tracks
366 fNClCuts(5), // cuts on the number of clusters per tracklet; used in the refit of the laser tracks
367 fNcuts(0) // number of cuts
376 AliTPCcalibLaser & AliTPCcalibLaser::operator=(const AliTPCcalibLaser& calibLaser){
378 // assgnment operator
380 if (this != &calibLaser) {
381 new (this) AliTPCcalibLaser(calibLaser);
390 AliTPCcalibLaser::~AliTPCcalibLaser() {
395 delete fHisNclIn; //->Number of clusters inner
396 delete fHisNclOut; //->Number of clusters outer
397 delete fHisNclIO; //->Number of cluster inner outer
398 delete fHisLclIn; //->Level arm inner
399 delete fHisLclOut; //->Level arm outer
400 delete fHisLclIO; //->Number of cluster inner outer
405 delete fHisChi2YIn1; //->chi2 y inner - line
406 delete fHisChi2YOut1; //->chi2 y inner - line
407 delete fHisChi2YIn2; //->chi2 y inner - parabola
408 delete fHisChi2YOut2; //->chi2 y inner - parabola
409 delete fHisChi2YIO1; //->chi2 y IO - common
410 delete fHisChi2ZIn1; //->chi2 z inner - line
411 delete fHisChi2ZOut1; //->chi2 z inner - line
412 delete fHisChi2ZIn2; //->chi2 z inner - parabola
413 delete fHisChi2ZOut2; //->chi2 z inner - parabola
414 delete fHisChi2ZIO1; //->chi2 z IO - common
417 delete fHisPy1vP0; //-> delta y P0outer-P0inner - line
418 delete fHisPy2vP0; //-> delta y P0outer-P0inner - parabola
419 delete fHisPy3vP0; //-> delta y P0outer-P0inner - common parabola
420 delete fHisPy1vP1; //-> delta ky P1outer-P1inner - line
421 delete fHisPy2vP1; //-> delta ky P1outer-P1inner - parabola
422 delete fHisPy3vP1; //-> delta ky P1outer-P1inner - common parabola
423 delete fHisPy2vP2In; //-> Curv P2inner - parabola
424 delete fHisPy2vP2Out; //-> Curv P2outer - parabola
425 delete fHisPy3vP2IO; //-> Curv P2outerinner - common parabola
428 delete fHisPz1vP0; //-> delta z P0outer-P0inner - line
429 delete fHisPz2vP0; //-> delta z P0outer-P0inner - parabola
430 delete fHisPz3vP0; //-> delta z P0outer-P0inner - common parabola
431 delete fHisPz1vP1; //-> delta kz P1outer-P1inner - line
432 delete fHisPz2vP1; //-> delta kz P1outer-P1inner - parabola
433 delete fHisPz3vP1; //-> delta kz P1outer-P1inner - common parabola
434 delete fHisPz2vP2In; //-> Curv P2inner - parabola
435 delete fHisPz2vP2Out; //-> Curv P2outer - parabola
436 delete fHisPz3vP2IO; //-> Curv P2outerinner - common parabola
441 fDeltaZ.SetOwner(); //-> array of histograms of delta z for each track
442 fDeltaP3.SetOwner(); //-> array of histograms of P3 for each track
443 fDeltaP4.SetOwner(); //-> array of histograms of P4 for each track
444 fDeltaPhi.SetOwner(); //-> array of histograms of delta z for each track
445 fDeltaPhiP.SetOwner(); //-> array of histograms of delta z for each track
446 fSignals.SetOwner(); //->Array of dedx signals
448 fDeltaZ.Delete(); //-> array of histograms of delta z for each track
449 fDeltaP3.Delete(); //-> array of histograms of P3 for each track
450 fDeltaP4.Delete(); //-> array of histograms of P4 for each track
451 fDeltaPhi.Delete(); //-> array of histograms of delta z for each track
452 fDeltaPhiP.Delete(); //-> array of histograms of delta z for each track
453 fSignals.Delete(); //->Array of dedx signals
455 fDeltaYres.SetOwner();
457 fDeltaZres.SetOwner();
459 fDeltaYres2.SetOwner();
460 fDeltaYres2.Delete();
461 fDeltaZres2.SetOwner();
462 fDeltaZres2.Delete();
469 void AliTPCcalibLaser::Process(AliESDEvent * event) {
472 // Loop over tracks and call Process function
479 fESDfriend=static_cast<AliESDfriend*>(fESD->FindListObject("AliESDfriend"));
483 if (fESD->GetNumberOfTracks()<kMinTracks) return; //not enough tracks
484 AliDebug(4,Form("Event number in current file: %d",event->GetEventNumberInFile()));
487 fTracksEsdParam.Delete();
488 for (Int_t id=0; id<336;id++) {
490 fClusterCounter[id]=0;
493 static Bool_t init=kFALSE;
495 init = kTRUE; // way around for PROOF - to be investigated
499 Int_t n=fESD->GetNumberOfTracks();
501 for (Int_t i=0;i<n;++i) {
502 AliESDfriendTrack *friendTrack=fESDfriend->GetTrack(i);
503 AliESDtrack *track=fESD->GetTrack(i);
504 TObject *calibObject=0;
506 for (Int_t j=0;(calibObject=friendTrack->GetCalibObject(j));++j)
507 if ((seed=dynamic_cast<AliTPCseed*>(calibObject)))
509 if (track&&seed &&TMath::Abs(track->Pt()) >1 ) {
511 Int_t id = FindMirror(track,seed);
516 if (counter<kMinTracks) return;
519 if (!fFullCalib) return;
521 for (Int_t id=0; id<336; id++){
523 if (!fTracksEsdParam.At(id)) continue;
524 if (fClusterSatur[id]>0.3) continue; // tracks in saturation
526 if ( AcceptLaser(id) && fFitZ[id]<0.5){
534 void AliTPCcalibLaser::MakeDistHisto(Int_t id){
538 // for (Int_t id=0; id<336; id++){
541 if (!fTracksEsdParam.At(id)) return;
542 if (!AcceptLaser(id)) return;
545 TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
546 if (!hisdz) MakeFitHistos();
547 hisdz = (TH1F*)fDeltaZ.At(id);
548 TH1F * hisP3 = (TH1F*)fDeltaP3.At(id);
549 TH1F * hisP4 = (TH1F*)fDeltaP4.At(id);
550 TH1F * hisdphi = (TH1F*)fDeltaPhi.At(id);
551 TH1F * hisdphiP = (TH1F*)fDeltaPhiP.At(id);
552 TH1F * hisSignal = (TH1F*)fSignals.At(id);
555 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
556 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
557 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
566 param->GetPxPyPz(pxyz);
568 ltrp->GetPxPyPz(lpxyz);
570 Float_t dz = param->GetZ()-ltrp->GetZ();
571 Float_t dphi = (TMath::ATan2(xyz[1],xyz[0])- TMath::ATan2(lxyz[1],lxyz[0]))*254.;
572 Float_t dphiP = param->GetParameter()[2]-ltrp->GetParameter()[2];
573 if (hisdz) hisdz->Fill(dz);
574 if (hisP3) hisP3->Fill(param->GetParameter()[3]);
575 if (hisP4) hisP4->Fill(param->GetParameter()[4]);
576 if (hisdphi) hisdphi->Fill(dphi);
577 if (hisdphiP) hisdphiP->Fill(dphiP);
578 if (hisSignal) hisSignal->Fill(TMath::Sqrt(TMath::Abs(track->GetTPCsignal())));
582 void AliTPCcalibLaser::FitDriftV(){
584 // Fit corrections to the drift velocity - linear approximation in the z and global y
585 //The transfromatiom from the drift time to the z position done in AliTPCTracnsform class
590 z = s* (z0 - vd*(t-t0))
594 vd - nominal drift velocity
595 zs - miscalibrated position
597 zs = s*(z0 - vd*(1+vr)*(t-(t0+dt))
598 vr - relative change of the drift velocity
603 zs ~ z - s*vr*(z0-s*z)+s*dzt
604 --------------------------------
605 1. Correction function vr constant:
608 dz = zs-z = -s*vr *(z0-s*z)+s*dzt
609 dzs/dl = dz/dl +s*s*vr*dz/dl
613 const Float_t kZCut = 240; // remove the closest laser beam
614 const Float_t kSaturCut = 0.05; // remove saturated lasers - cut on fraction of saturated
615 const Float_t kDistCut = 3; // distance sigma cut
616 const Float_t kDistCutAbs = 0.25;
617 const Float_t kMinClusters = 60; // minimal amount of the clusters
618 const Float_t kMinSignal = 16; // minimal mean height of the signal
619 const Float_t kChi2Cut = 0.1; // chi2 cut to accept drift fit
620 static TLinearFitter fdriftA(3,"hyp2");
621 static TLinearFitter fdriftC(3,"hyp2");
622 static TLinearFitter fdriftAC(4,"hyp3");
623 TVectorD fitA(3),fitC(3),fitAC(4);
625 AliTPCcalibDB* calib=AliTPCcalibDB::Instance();
626 AliTPCParam * tpcparam = calib->GetParameters();
629 for (Int_t id=0; id<336; id++) fFitZ[id]=0;
639 for (Int_t iter=0; iter<3; iter++){
640 fdriftA.ClearPoints();
641 fdriftC.ClearPoints();
642 fdriftAC.ClearPoints();
644 for (Int_t id=0; id<336; id++){
645 if (!fTracksEsdParam.At(id)) continue;
646 if (!AcceptLaser(id)) continue;
647 if ( fClusterSatur[id]>kSaturCut) continue;
648 if ( fClusterCounter[id]<kMinClusters) continue;
649 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
650 if (track->GetTPCsignal()<kMinSignal) continue;
651 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
652 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
659 param->GetPxPyPz(pxyz);
661 ltrp->GetPxPyPz(lpxyz);
662 if (TMath::Abs(lxyz[2])>kZCut) continue;
663 Float_t sz = (ltrp->GetSide()==0) ? TMath::Sqrt(chi2A): TMath::Sqrt(chi2C);
664 if (npointsAC>0) sz =TMath::Sqrt(chi2AC);
665 if (TMath::Abs(fFitZ[id])>sz*kDistCut) continue;
666 if (iter>0 && TMath::Abs(fFitZ[id])>kDistCutAbs) continue;
669 Double_t zlength = tpcparam->GetZLength(0);
670 Double_t ldrift = zlength-TMath::Abs(lxyz[2]);
671 Double_t mdrift = zlength-TMath::Abs(xyz[2]);
672 Double_t xxx[2] = {ldrift,lxyz[1]*ldrift/(zlength*250.)};
673 if (ltrp->GetSide()==0){
674 fdriftA.AddPoint(xxx,mdrift,1);
676 fdriftC.AddPoint(xxx,mdrift,1);
678 Double_t xxx2[3] = {ltrp->GetSide(), ldrift,lxyz[1]*ldrift/(zlength*250.)};
679 fdriftAC.AddPoint(xxx2,mdrift,1);
682 if (fdriftA.GetNpoints()>10){
685 if (iter==0) fdriftA.EvalRobust(0.7);
686 else fdriftA.EvalRobust(0.8);
687 fdriftA.GetParameters(fitA);
688 npointsA= fdriftA.GetNpoints();
689 chi2A = fdriftA.GetChisquare()/fdriftA.GetNpoints();
690 if (chi2A<kChi2Cut ||(*fFitAside)[0]==0 ) (*fFitAside) = fitA;
692 if (fdriftC.GetNpoints()>10){
694 if (iter==0) fdriftC.EvalRobust(0.7);
695 else fdriftC.EvalRobust(0.8);
697 fdriftC.GetParameters(fitC);
698 npointsC= fdriftC.GetNpoints();
699 chi2C = fdriftC.GetChisquare()/fdriftC.GetNpoints();
700 if (chi2C<kChi2Cut||(*fFitCside)[0]==0) (*fFitCside) = fitC;
703 if (fdriftAC.GetNpoints()>10&&fdriftC.GetNpoints()>10&&fdriftA.GetNpoints()>10){
705 if (iter==0) fdriftAC.EvalRobust(0.7);
706 else fdriftAC.EvalRobust(0.8);
708 fdriftAC.GetParameters(fitAC);
709 npointsAC= fdriftAC.GetNpoints();
710 chi2AC = fdriftAC.GetChisquare()/fdriftAC.GetNpoints();
711 if (chi2AC<kChi2Cut||(*fFitACside)[0]==0) (*fFitACside) = fitAC;
714 for (Int_t id=0; id<336; id++){
715 if (!fTracksEsdParam.At(id)) continue;
717 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
718 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
724 param->GetPxPyPz(pxyz);
726 ltrp->GetPxPyPz(lpxyz);
727 Double_t zlength = tpcparam->GetZLength(0);
728 Double_t ldrift = zlength-TMath::Abs(lxyz[2]);
729 Double_t mdrift = zlength-TMath::Abs(xyz[2]);
732 if (ltrp->GetSide()==0){
733 fz = (fitA)[0]+(fitA)[1]*ldrift+(fitA)[2]*lxyz[1]*ldrift/(zlength*250.);
735 fz = (fitC)[0]+(fitC)[1]*ldrift+(fitC)[2]*lxyz[1]*ldrift/(zlength*250.);
738 fz = (fitAC)[0]+(fitAC)[1]*ltrp->GetSide()+(fitAC)[2]*ldrift+(fitAC)[3]*lxyz[1]*ldrift/(zlength*250.);
743 TTreeSRedirector *cstream = GetDebugStreamer();
744 TTimeStamp tstamp(fTime);
745 Float_t valuePressure0 = AliTPCcalibDB::GetPressure(tstamp,fRun,0);
746 Float_t valuePressure1 = AliTPCcalibDB::GetPressure(tstamp,fRun,1);
747 Double_t ptrelative0 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,0);
748 Double_t ptrelative1 = AliTPCcalibDB::GetPTRelative(tstamp,fRun,1);
749 Double_t temp0 = AliTPCcalibDB::GetTemperature(tstamp,fRun,0);
750 Double_t temp1 = AliTPCcalibDB::GetTemperature(tstamp,fRun,1);
751 TVectorD vecGoofie(20);
752 AliDCSSensorArray* goofieArray = AliTPCcalibDB::Instance()->GetGoofieSensors(fRun);
754 for (Int_t isensor=0; isensor<goofieArray->NumSensors();isensor++){
755 AliDCSSensor *gsensor = goofieArray->GetSensor(isensor);
756 if (gsensor) vecGoofie[isensor]=gsensor->GetValue(tstamp);
760 (*cstream)<<"driftv"<<
761 "run="<<fRun<< // run number
762 "event="<<fEvent<< // event number
763 "time="<<fTime<< // time stamp of event
764 "trigger="<<fTrigger<< // trigger
765 "mag="<<fMagF<< // magnetic field
766 // Environment values
767 "press0="<<valuePressure0<<
768 "press1="<<valuePressure1<<
769 "pt0="<<ptrelative0<<
770 "pt1="<<ptrelative1<<
773 "vecGoofie.="<<&vecGoofie<<
777 "driftA.="<<fFitAside<<
778 "driftC.="<<fFitCside<<
779 "driftAC.="<<fFitACside<<
792 Float_t AliTPCcalibLaser::GetDistance(AliExternalTrackParam *param, AliTPCLaserTrack *ltrp){
794 // get distance between mirror and laser track
805 dist+=TMath::Abs((TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*param->GetX());
808 // apply drift correction if already exist
811 if (ltrp->GetSide()==0){
812 if ((*fFitAside)[1]>0.) dz = ((*fFitAside)[0]+(*fFitAside)[1]*lxyz[2]+(*fFitAside)[2]*lxyz[1])-xyz[2];
814 if ((*fFitCside)[1]>0.) dz = ((*fFitCside)[0]+(*fFitCside)[1]*lxyz[2]+(*fFitCside)[2]*lxyz[1])-xyz[2];
816 if (TMath::Abs(dz)>3*(TMath::Abs(lxyz[2]-xyz[2])+1)) dz= TMath::Abs(lxyz[2]-xyz[2]);
817 dist+=TMath::Abs(dz);
819 // phi dist - divergence on 50 cm
821 dist = TMath::Abs((param->GetParameter()[2]-ltrp->GetParameter()[2])*50);
826 Bool_t AliTPCcalibLaser::AcceptLaser(Int_t id){
831 TCut cutP0("cutP0","abs((atan2(x1,x0)-atan2(lx1,lx0))*254)<1.5");
832 TCut cutP1("cutP1","abs(LTr.fP[1]-Tr.fP[1])<30");
833 TCut cutP2("cutP2","abs(LTr.fP[2]-Tr.fP[2])<0.03");
834 TCut cutP3("cutP3","abs(Tr.fP[3])<0.05");
835 TCut cutP4("cutPt","abs(Tr.fP[4])<0.1");
837 TCut cutA = cutP0+cutP1+cutP2+cutP3+cutP4;
839 AliExternalTrackParam *param =(AliExternalTrackParam*)fTracksEsdParam.At(id);
840 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
841 //AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
846 if (TMath::Abs((TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*254)>1.5) return kFALSE; //cut y- P0
847 if (TMath::Abs(param->GetParameter()[1]-ltrp->GetParameter()[1])>30) return kFALSE; // cutZ -P1
848 if (TMath::Abs(param->GetParameter()[2]-ltrp->GetParameter()[2])>0.03) return kFALSE; // cut -P2
849 if (TMath::Abs(param->GetParameter()[3])>0.05) return kFALSE; // cut Tl -P3
850 if (TMath::Abs(param->GetParameter()[4])>0.1) return kFALSE; // cut Pt -P4
857 Int_t AliTPCcalibLaser::FindMirror(AliESDtrack *track, AliTPCseed *seed){
859 // Find corresponding mirror
860 // add the corresponding tracks
863 Float_t kRadius0 = 252;
864 Float_t kRadius = 253.4;
866 if (!track->GetOuterParam()) return -1;
867 AliExternalTrackParam param(*(track->GetOuterParam()));
868 AliTracker::PropagateTrackTo(¶m,kRadius0,0.10566,3,kTRUE);
869 AliTracker::PropagateTrackTo(¶m,kRadius,0.10566,0.1,kTRUE);
870 AliTPCLaserTrack ltr;
871 AliTPCLaserTrack *ltrp=0x0;
872 // AliTPCLaserTrack *ltrpjw=0x0;
874 Int_t id = AliTPCLaserTrack::IdentifyTrack(¶m);
875 // Int_t idjw = AliTPCLaserTrack::IdentifyTrackJW(¶m);
876 //AliDebug(4,Form("Identified Track: %03d (%03d)",id,idjw));
878 if (id!=-1 && (AliTPCLaserTrack::GetTracks()->UncheckedAt(id)))
879 ltrp=(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
889 Float_t counterSatur=0;
890 for (Int_t irow=158;irow>-1;--irow) {
891 AliTPCclusterMI *c=seed->GetClusterPointer(irow);
893 Double_t pedgeY = c->GetX()*TMath::DegToRad()*(10)-TMath::Abs(c->GetY());
894 Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
895 if (pedgeY<3) continue;
896 if (pedgeX<3) continue;
898 if (c->GetMax()>900) counterSatur++;
900 counterSatur/=(countercl+1);
902 if (counterSatur>fClusterSatur[id]) fClusterSatur[id]=counterSatur;
905 Float_t radius=TMath::Abs(ltrp->GetX());
906 AliTracker::PropagateTrackTo(¶m,radius,0.10566,0.01,kTRUE);
908 if (!fTracksMirror.At(id)) fTracksMirror.AddAt(ltrp,id);
911 // choose closer track
913 AliExternalTrackParam * param0 = (AliExternalTrackParam *)fTracksEsdParam.At(id);
915 Float_t dist0=GetDistance(param0,ltrp);
916 Float_t dist1=GetDistance(¶m,ltrp);
917 if (dist0<dist1) accept=kFALSE;
921 fClusterCounter[id]=countercl;
922 fTracksEsdParam.AddAt(param.Clone(),id);
923 fTracksEsd.AddAt(track,id);
924 fTracksTPC.AddAt(seed,id);
931 void AliTPCcalibLaser::DumpLaser(Int_t id) {
933 // Dump Laser info to the tree
935 AliESDtrack *track = (AliESDtrack*)fTracksEsd.At(id);
936 AliExternalTrackParam *param=(AliExternalTrackParam*)fTracksEsdParam.At(id);
937 AliTPCLaserTrack *ltrp = ( AliTPCLaserTrack*)fTracksMirror.At(id);
946 param->GetPxPyPz(pxyz);
948 ltrp->GetPxPyPz(lpxyz);
949 Float_t dist3D = GetDistance(param,ltrp);
950 Float_t dist0 = (TMath::ATan2(xyz[1],xyz[0])-TMath::ATan2(lxyz[1],lxyz[0]))*param->GetX();
951 Float_t distphi = (param->GetParameter()[2]-ltrp->GetParameter()[2])*50;
955 TTreeSRedirector *cstream = GetDebugStreamer();
956 Int_t time = fESD->GetTimeStamp();
957 Bool_t accept = AcceptLaser(id);
959 (*cstream)<<"Track"<<
961 "run="<<fRun<< // run number
962 "event="<<fEvent<< // event number
963 "time="<<fTime<< // time stamp of event
964 "trigger="<<fTrigger<< // trigger
965 "mag="<<fMagF<< // magnetic field
969 "driftA.="<<fFitAside<<
970 "driftC.="<<fFitCside<<
974 "distphi="<<distphi<<
977 "counter="<<fCounter[id]<<
978 "clcounter="<<fClusterCounter[id]<<
979 "satur="<<fClusterSatur[id]<<
1003 void AliTPCcalibLaser::RefitLaserJW(Int_t id){
1005 // Refit the track with different tracklet models:
1006 // 1. Per ROC using the kalman filter, different edge cuts
1007 // 2. Per ROC linear in y and z
1008 // 3. Per ROC quadratic in y and z
1009 // 4. Per track offset for each sector, linear for each sector, common quadratic
1010 // store x, y, z information for all models and the cluster to calculate the residuals
1013 // The clusters which do not fulfill given criteria are skipped
1015 // Cluters removed from fit
1016 // 1. Extended shape > kShapeCut
1017 // 2. In saturation Max > kMax
1018 // 3. Distance to edge < cutEdge
1020 // Clusters not used for the calibration:
1022 // 1. Extended shape > kShapeCut
1023 // 2. In saturation Max > kMax
1026 AliTPCseed *track = (AliTPCseed*)fTracksTPC.At(id);
1027 AliExternalTrackParam *extparam=(AliExternalTrackParam*)fTracksEsdParam.At(id);
1028 AliTPCLaserTrack *ltrp = (AliTPCLaserTrack*)fTracksMirror.At(id);
1030 AliTPCclusterMI dummyCl;
1033 Int_t kMaxTracklets=2;
1034 Float_t kShapeCut = 1.3;
1035 Float_t kRatioCut = 2.;
1037 Float_t kMax = 900.;
1040 //=============================================//
1041 // Linear Fitters for the Different Approaches //
1042 //=============================================//
1043 //linear fit model in y and z; inner - outer sector
1044 static TLinearFitter fy1I(2,"hyp1");
1045 static TLinearFitter fy1O(2,"hyp1");
1046 static TLinearFitter fz1I(2,"hyp1");
1047 static TLinearFitter fz1O(2,"hyp1");
1048 //quadratic fit model in y and z; inner - sector
1049 static TLinearFitter fy2I(3,"hyp2");
1050 static TLinearFitter fy2O(3,"hyp2");
1051 static TLinearFitter fz2I(3,"hyp2");
1052 static TLinearFitter fz2O(3,"hyp2");
1053 //common quadratic fit for IROC and OROC in y and z
1054 static TLinearFitter fy4(5,"hyp4");
1055 static TLinearFitter fz4(5,"hyp4");
1065 //=============================//
1066 // Loop over all Tracklet Cuts //
1067 //=============================//
1068 for (Int_t icut=0; icut<fNcuts; icut++){
1069 Float_t xinMin = 2500, xinMax=-90;
1070 Float_t xoutMin=2500, xoutMax=-90;
1071 Float_t msigmaYIn=0;
1072 Float_t msigmaYOut=0;
1073 Float_t mqratioIn=0;
1074 Float_t mqratioOut=0;
1077 AliDebug(4,Form("Processing cut %d for track with ID %d",icut,id));
1079 Double_t edgeCutX = fEdgeXcuts[icut];
1080 Double_t edgeCutY = fEdgeYcuts[icut];
1081 Int_t nclCut = (Int_t)fNClCuts[icut];
1082 //=========================//
1083 // Parameters to calculate //
1084 //=========================//
1085 //fit parameter inner, outer tracklet and combined fit
1086 TVectorD vecy1resInner(2),vecz1resInner(2); //pol1 fit parameters inner
1087 TVectorD vecy2resInner(3),vecz2resInner(3); //pol2 fit parameters inner
1089 TVectorD vecy1resOuter(2),vecz1resOuter(2); //pol1 fit parameters outer
1090 TVectorD vecy2resOuter(3),vecz2resOuter(3); //pol2 fit parameters outer
1091 TVectorD vecy4res(5),vecz4res(5);
1092 // cluster and track positions for each row - used for residuals
1093 TVectorD vecgX(159); // global X
1094 TVectorD vecgY(159); // global Y
1095 TVectorD vecgZ(159); // global Z
1097 TVectorD vecX(159); // x is the same for all (row center)
1098 TVectorD vecYkalman(159); // y from kalman fit
1099 TVectorD vecZkalman(159); // z from kalman fit
1100 TVectorD vecY1(159); // y from pol1 fit per ROC
1101 TVectorD vecZ1(159); // z from pol1 fit per ROC
1102 TVectorD vecY2(159); // y from pol2 fit per ROC
1103 TVectorD vecZ2(159); // z from pol2 fit per ROC
1104 TVectorD vecY4(159); // y from sector fit
1105 TVectorD vecZ4(159); // z from sector fit
1106 TVectorD vecClY(159); // y cluster position
1107 TVectorD vecClZ(159); // z cluster position
1108 TVectorD vecSec(159); // sector for each row
1109 TVectorD isReject(159); // flag - cluster to be rejected
1111 Double_t chi2I1z=0; // chi2 of pol1 fit in z (inner)
1112 Double_t chi2I1y=0; // chi2 of pol1 fit in y (inner)
1113 Double_t chi2O1z=0; // chi2 of pol1 fit in z (outer)
1114 Double_t chi2O1y=0; // chi2 of pol1 fit in y (outer)
1115 Double_t chi2I2z=0; // chi2 of pol2 fit in z (inner)
1116 Double_t chi2I2y=0; // chi2 of pol2 fit in y (inner)
1117 Double_t chi2O2z=0; // chi2 of pol2 fit in z (outer)
1118 Double_t chi2O2y=0; // chi2 of pol2 fit in y (outer)
1119 Double_t chi2IOz=0; // chi2 of hyp4 fit in z (inner+outer)
1120 Double_t chi2IOy=0; // chi2 of hyp4 fit in y (inner+outer)
1122 Int_t innerSector = -1; // number of inner sector
1123 Int_t outerSector = -1; // number of outer sector
1124 Int_t nclI=0; // number of clusters (inner)
1125 Int_t nclO=0; // number of clusters (outer)
1126 //=================================================//
1127 // Perform the Kalman Fit using the Tracklet Class //
1128 //=================================================//
1129 AliTPCTracklet::SetEdgeCut(edgeCutX,edgeCutY);
1130 TObjArray tracklets=
1131 AliTPCTracklet::CreateTracklets(track,AliTPCTracklet::kKalman,
1132 kFALSE,nclCut,kMaxTracklets);
1133 // tracklet pointers
1134 AliTPCTracklet *trInner = (AliTPCTracklet*)tracklets.At(0);
1135 AliTPCTracklet *trOuter = (AliTPCTracklet*)tracklets.At(1);
1136 AliTPCTracklet *tr=0x0;
1137 AliTPCTracklet dummy;
1138 //continue if we didn't find a tracklet
1139 if ( !trInner && !trOuter ) continue;
1140 //================================================================================//
1141 // Swap Inner and Outer if necessary (inner sector is definde by smaller local x) //
1142 //================================================================================//
1143 if ( trInner && trOuter ){
1144 if ( !trInner->GetInner() || !trOuter->GetInner() ) continue;
1145 if ( trInner->GetInner()->GetX() > trOuter->GetInner()->GetX() ){
1149 AliDebug(5,Form("Swapped Sectors: %02d (%f) <-> %02d (%f)", trOuter->GetSector(), trOuter->GetInner()->GetX(), trInner->GetSector(), trInner->GetInner()->GetX()));
1153 if ( !trInner->GetInner() ) continue;
1155 if ( trInner->GetSector()>35 ){
1160 if ( !trOuter->GetInner() ) continue;
1162 if ( trOuter->GetSector()<36 ){
1168 innerSector = trInner->GetSector();
1169 if ( innerSector>=0 ) AliDebug(5,Form("Found inner Sector %02d at X %.2f", innerSector, trInner->GetInner()->GetX()));
1170 outerSector = trOuter->GetSector();
1171 if ( outerSector>=0 ) AliDebug(5,Form("Found outer Sector %02d at X %.2f", outerSector, trOuter->GetInner()->GetX()));
1173 // array of clusters
1174 TClonesArray arrCl("AliTPCclusterMI",159);
1175 arrCl.ExpandCreateFast(159);
1176 //=======================================//
1177 // fill fitters with cluster information //
1178 //=======================================//
1179 AliDebug(3,"Filing Cluster Information");
1184 for (Int_t irow=158;irow>-1;--irow) {
1185 AliTPCclusterMI *c=track->GetClusterPointer(irow);
1186 AliTPCclusterMI &cl = (AliTPCclusterMI&) (*arrCl[irow]);
1191 Float_t meanY=0, sumY=0;
1192 for (Int_t drow=-1;drow<=1;drow++) {
1193 if (irow+drow<0) continue;
1194 if (irow+drow>158) continue;
1195 AliTPCclusterMI *ccurrent=track->GetClusterPointer(irow);
1196 if (!ccurrent) continue;
1197 Int_t roc = static_cast<Int_t>(ccurrent->GetDetector());
1198 if ( roc!=innerSector && roc!=outerSector ) continue;
1199 if (ccurrent->GetX()<10) continue;
1200 if (ccurrent->GetY()==0) continue;
1201 meanY+=ccurrent->GetY();
1204 if (sumY>0) meanY/=sumY;
1209 Double_t pedgeY = c->GetX()*TMath::Tan(TMath::DegToRad()*(10))-TMath::Abs(meanY);
1210 Double_t pedgeX = TMath::Min((irow)*0.75, (159.-irow)*1.5);
1213 Int_t roc = static_cast<Int_t>(c->GetDetector());
1214 if ( roc!=innerSector && roc!=outerSector ) continue;
1216 //store clusters in clones array
1219 if (c->GetMax()<4) continue; // noise cluster?
1220 if (TMath::Abs(c->GetY())<0.0001) continue; // noise cluster?
1222 vecX[irow] = c->GetX();
1223 vecClY[irow] = c->GetY();
1224 vecClZ[irow] = c->GetZ();
1227 // c->GetGlobalXYZ(gxyz);
1228 // vecgX[irow] = gxyz[0];
1229 // vecgY[irow] = gxyz[1];
1230 // vecgZ[irow] = gxyz[2];
1232 Double_t x = vecX[irow]-133.4; //reference is between IROC and OROC
1233 Double_t y = vecClY[irow];
1234 Double_t z = vecClZ[irow];
1236 Double_t x2[2]={x,x*x}; //linear and parabolic parameters
1237 Double_t x4[4]={0,0,0,0}; //hyp4 parameters
1238 if ( roc == innerSector ) {
1239 x4[0]=1; //offset inner - outer sector
1240 x4[1]=x; //slope parameter inner sector
1242 x4[2]=x; //slope parameter outer sector
1244 x4[3]=x*x; //common parabolic shape
1245 if (pedgeX < fEdgeXcuts[icut]) continue;
1246 if (pedgeY < fEdgeYcuts[icut]) continue;
1247 if (c->GetMax()>900) continue; // cluster in saturation
1249 if ( roc==innerSector ){
1250 fy1I.AddPoint(x2,y);
1251 fz1I.AddPoint(x2,z);
1252 fy2I.AddPoint(x2,y);
1253 fz2I.AddPoint(x2,z);
1255 if (c->GetX()<xinMin) xinMin=c->GetX();
1256 if (c->GetX()>xinMax) xinMax=c->GetX();
1258 msigmaYIn +=TMath::Sqrt(c->GetSigmaY2());
1259 mqratioIn +=c->GetMax()/c->GetQ();
1262 if ( roc==outerSector ){
1263 fy1O.AddPoint(x2,y);
1264 fz1O.AddPoint(x2,z);
1265 fy2O.AddPoint(x2,y);
1266 fz2O.AddPoint(x2,z);
1268 if (c->GetX()<xoutMin) xoutMin=c->GetX();
1269 if (c->GetX()>xoutMax) xoutMax=c->GetX();
1270 msigmaYOut +=TMath::Sqrt(c->GetSigmaY2());
1271 mqratioOut +=c->GetMax()/c->GetQ();
1285 //======================================//
1286 // Evaluate and retrieve fit parameters //
1287 //======================================//
1288 AliDebug(5,Form("Evaluating fits with inner (outer) Sec: %02d (%02d)",innerSector,outerSector));
1290 if ( (innerSector>-1) && (fy1I.GetNpoints()>0) ){
1295 fy1I.GetParameters(vecy1resInner);
1296 fz1I.GetParameters(vecz1resInner);
1297 fy2I.GetParameters(vecy2resInner);
1298 fz2I.GetParameters(vecz2resInner);
1299 chi2I1y=fy1I.GetChisquare()/(fy1I.GetNpoints()-2);
1300 chi2I1z=fz1I.GetChisquare()/(fz1I.GetNpoints()-2);
1301 chi2I2y=fy2I.GetChisquare()/(fy2I.GetNpoints()-3);
1302 chi2I2z=fz2I.GetChisquare()/(fz2I.GetNpoints()-3);
1305 if ( (outerSector>-1) && (fy1O.GetNpoints()>0) ){
1310 fy1O.GetParameters(vecy1resOuter);
1311 fz1O.GetParameters(vecz1resOuter);
1312 fy2O.GetParameters(vecy2resOuter);
1313 fz2O.GetParameters(vecz2resOuter);
1314 chi2O1y=fy1O.GetChisquare()/(fy1O.GetNpoints()-2);
1315 chi2O1z=fz1O.GetChisquare()/(fz1O.GetNpoints()-2);
1316 chi2O2y=fy2O.GetChisquare()/(fy2O.GetNpoints()-3);
1317 chi2O2z=fz2O.GetChisquare()/(fz2O.GetNpoints()-3);
1320 if ( innerSector>0 && outerSector>0 ){
1321 if (fy4.GetNpoints()>0) {
1323 fy4.GetParameters(vecy4res);
1324 chi2IOy=fy4.GetChisquare()/(fy4.GetNpoints()-5);
1326 if (fz4.GetNpoints()>0) {
1328 fz4.GetParameters(vecz4res);
1329 chi2IOz=fz4.GetChisquare()/(fz4.GetNpoints()-5);
1333 fy4.ClearPoints(); fz4.ClearPoints();
1334 fy1I.ClearPoints(); fy1O.ClearPoints();
1335 fz1I.ClearPoints(); fz1O.ClearPoints();
1336 fy2I.ClearPoints(); fy2O.ClearPoints();
1337 fz2I.ClearPoints(); fz2O.ClearPoints();
1338 //==============================//
1339 // calculate tracklet positions //
1340 //==============================//
1341 AliDebug(4,"Calculate tracklet positions");
1342 for (Int_t irow=158;irow>-1;--irow) {
1344 AliTPCclusterMI *c=track->GetClusterPointer(irow);
1345 if ( vecSec[irow]!=innerSector && vecSec[irow]!=outerSector ) { // no cluster in given sectors
1349 if (!c) { //no cluster
1352 if (c->GetMax()>kMax){ //saturation
1355 if ( vecSec[irow] == outerSector ) { //extended shape
1356 if (c->GetMax()/c->GetQ()> mqratioOut*kRatioCut) isReject[irow]+=8;
1357 if (TMath::Sqrt(c->GetSigmaY2())>msigmaYOut*kShapeCut) isReject[irow]+=16;
1359 if (c->GetMax()/c->GetQ()> mqratioIn*kRatioCut) isReject[irow]+=8;
1360 if (TMath::Sqrt(c->GetSigmaY2())>msigmaYIn*kShapeCut) isReject[irow]+=16;
1366 if ( vecSec[irow]==-1 ) continue; //no cluster info
1367 if ( vecSec[irow]!=innerSector && vecSec[irow]!=outerSector ) continue;
1369 Double_t x=vecX[irow];
1370 Double_t xref=x-133.4;
1372 Double_t yoffInner=0;
1373 Double_t zoffInner=0;
1374 Double_t yslopeInner=0;
1375 Double_t yslopeOuter=0;
1376 Double_t zslopeInner=0;
1377 Double_t zslopeOuter=0;
1378 //positions of hyperplane fits
1379 if ( vecSec[irow] == outerSector ) {
1381 vecY1[irow]=vecy1resOuter[0]+vecy1resOuter[1]*xref;
1382 vecZ1[irow]=vecz1resOuter[0]+vecz1resOuter[1]*xref;
1383 vecY2[irow]=vecy2resOuter[0]+vecy2resOuter[1]*xref+vecy2resOuter[2]*xref*xref;
1384 vecZ2[irow]=vecz2resOuter[0]+vecz2resOuter[1]*xref+vecz2resOuter[2]*xref*xref;
1385 yslopeOuter=vecy4res[3];
1386 zslopeOuter=vecz4res[3];
1389 vecY1[irow]=vecy1resInner[0]+vecy1resInner[1]*xref;
1390 vecZ1[irow]=vecz1resInner[0]+vecz1resInner[1]*xref;
1391 vecY2[irow]=vecy2resInner[0]+vecy2resInner[1]*xref+vecy2resInner[2]*xref*xref;
1392 vecZ2[irow]=vecz2resInner[0]+vecz2resInner[1]*xref+vecz2resInner[2]*xref*xref;
1393 yoffInner=vecy4res[1];
1394 zoffInner=vecz4res[1];
1395 yslopeInner=vecy4res[2];
1396 zslopeInner=vecz4res[2];
1398 vecY4[irow]=vecy4res[0]+yoffInner+yslopeInner*xref+yslopeOuter*xref+vecy4res[4]*xref*xref;
1399 vecZ4[irow]=vecz4res[0]+zoffInner+zslopeInner*xref+zslopeOuter*xref+vecz4res[4]*xref*xref;
1400 //positions of kalman fits
1401 Double_t gxyz[3],xyz[3];
1402 AliExternalTrackParam *param = 0x0;
1404 param=tr->GetInner();
1406 param->GetXYZ(gxyz);
1407 Float_t bz = AliTracker::GetBz(gxyz);
1408 param->GetYAt(x, bz, xyz[1]);
1409 param->GetZAt(x, bz, xyz[2]);
1410 vecYkalman[irow]=xyz[1];
1411 vecZkalman[irow]=xyz[2];
1418 //=====================================================================//
1419 // write results from the different tracklet fits with debug streamers //
1420 //=====================================================================//
1421 if (fStreamLevel>4){
1422 TTreeSRedirector *cstream = GetDebugStreamer();
1424 Float_t dedx = track->GetdEdx();
1425 (*cstream)<<"FitModels"<<
1426 "run="<<fRun<< // run number
1427 "event="<<fEvent<< // event number
1428 "time="<<fTime<< // time stamp of event
1429 "trigger="<<fTrigger<< // trigger
1430 "mag="<<fMagF<< // magnetic field
1433 "edgeCutX=" << edgeCutX <<
1434 "edgeCutY=" << edgeCutY <<
1435 "nclCut=" << nclCut <<
1436 "innerSector="<< innerSector <<
1437 "outerSector="<< outerSector <<
1440 "Tr.=" << extparam <<
1441 "yPol1In.=" << &vecy1resInner <<
1442 "zPol1In.=" << &vecz1resInner <<
1443 "yPol2In.=" << &vecy2resInner <<
1444 "zPol2In.=" << &vecz2resInner <<
1445 "yPol1Out.=" << &vecy1resOuter <<
1446 "zPol1Out.=" << &vecz1resOuter <<
1447 "yPol2Out.=" << &vecy2resOuter <<
1448 "zPol2Out.=" << &vecz2resOuter <<
1449 "yInOut.=" << &vecy4res <<
1450 "zInOut.=" << &vecz4res <<
1451 "chi2y1In=" << chi2I1y <<
1452 "chi2z1In=" << chi2I1z <<
1453 "chi2y1Out=" << chi2O1y <<
1454 "chi2z1Out=" << chi2O1z <<
1455 "chi2y2In=" << chi2I2y <<
1456 "chi2z2In=" << chi2I2z <<
1457 "chi2y2Out=" << chi2O2y <<
1458 "chi2z2Out=" << chi2O2z <<
1459 "chi2yInOut=" << chi2IOy <<
1460 "chi2zInOut=" << chi2IOz <<
1461 "trletIn.=" << trInner <<
1462 "trletOut.=" << trOuter <<
1465 "xinMin=" << xinMin<<
1466 "xinMax=" << xinMax<<
1467 "xoutMin=" << xoutMin<<
1468 "xoutMax=" << xoutMax<<
1469 "msigmaYIn=" <<msigmaYIn<<
1470 "msigmaYOut=" <<msigmaYOut<<
1471 "mqratioIn=" <<mqratioIn<<
1472 "mqratioOut=" << mqratioOut <<
1477 // wirte residuals information
1478 if (fStreamLevel>5){
1479 TTreeSRedirector *cstream = GetDebugStreamer();
1481 Float_t dedx = track->GetdEdx();
1482 (*cstream)<<"Residuals"<<
1483 "run="<<fRun<< // run number
1484 "event="<<fEvent<< // event number
1485 "time="<<fTime<< // time stamp of event
1486 "trigger="<<fTrigger<< // trigger
1487 "mag="<<fMagF<< // magnetic field
1490 "edgeCutX=" << edgeCutX <<
1491 "edgeCutY=" << edgeCutY <<
1492 "nclCut=" << nclCut <<
1494 "Tr.=" << extparam<<
1497 "vX.=" << &vecgX<< // global x
1498 "vY.=" << &vecgY<< // global y
1499 "vZ.=" << &vecgZ<< // global z
1501 "TrYpol1.=" << &vecY1 <<
1502 "TrZpol1.=" << &vecZ1 <<
1503 "TrYpol2.=" << &vecY2 <<
1504 "TrZpol2.=" << &vecZ2 <<
1505 "TrYInOut.=" << &vecY4 <<
1506 "TrZInOut.=" << &vecZ4 <<
1507 "ClY.=" << &vecClY <<
1508 "ClZ.=" << &vecClZ <<
1509 "isReject.=" << &isReject<<
1510 "sec.=" << &vecSec <<
1513 "xinMin=" << xinMin<<
1514 "xinMax=" << xinMax<<
1515 "xoutMin=" << xoutMin<<
1516 "xoutMax=" << xoutMax<<
1517 "msigmaYIn=" <<msigmaYIn<<
1518 "msigmaYOut=" <<msigmaYOut<<
1519 "mqratioIn=" <<mqratioIn<<
1520 "mqratioOut=" << mqratioOut <<
1521 "yInOut.=" << &vecy4res <<
1522 "zInOut.=" << &vecz4res <<
1524 "chi2y1In=" << chi2I1y << //
1525 "chi2z1In=" << chi2I1z <<
1526 "chi2y1Out=" << chi2O1y <<
1527 "chi2z1Out=" << chi2O1z <<
1528 "chi2y2In=" << chi2I2y <<
1529 "chi2z2In=" << chi2I2z <<
1530 "chi2y2Out=" << chi2O2y <<
1531 "chi2z2Out=" << chi2O2z <<
1532 "chi2yInOut=" << chi2IOy <<
1533 "chi2zInOut=" << chi2IOz <<
1535 "yPol1In.=" << &vecy1resInner <<
1536 "zPol1In.=" << &vecz1resInner <<
1537 "yPol2In.=" << &vecy2resInner <<
1538 "zPol2In.=" << &vecz2resInner <<
1539 "yPol1Out.=" << &vecy1resOuter <<
1540 "zPol1Out.=" << &vecz1resOuter <<
1541 "yPol2Out.=" << &vecy2resOuter <<
1542 "zPol2Out.=" << &vecz2resOuter <<
1548 //==========================//
1549 // Fill Residual Histograms //
1550 //==========================//
1551 if (!fHisNclIn) MakeFitHistos();
1553 TH2F *profy = (TH2F*)fDeltaYres.UncheckedAt(id);
1554 TH2F *profz = (TH2F*)fDeltaZres.UncheckedAt(id);
1555 TH2F *profy2 = (TH2F*)fDeltaYres2.UncheckedAt(id);
1556 TH2F *profz2 = (TH2F*)fDeltaZres2.UncheckedAt(id);
1557 // TH2F *profy3 = (TH2F*)fDeltaYres3.UncheckedAt(id);
1558 //TH2F *profz3 = (TH2F*)fDeltaZres3.UncheckedAt(id);
1560 for (Int_t irow=158;irow>-1;--irow) {
1561 if (vecSec[irow]==-1)continue; // no cluster info
1562 if (isReject[irow]>0.5) continue; //
1563 //Double_t x = vecX[irow];
1564 Double_t ycl = vecClY[irow];
1565 Double_t yfit = vecY1[irow];
1566 Double_t yfit2 = vecY2[irow];
1567 // Double_t yfit3 = vecY2[irow];
1568 Double_t zcl = vecClZ[irow];
1569 Double_t zfit = vecZ1[irow];
1570 Double_t zfit2 = vecZ2[irow];
1571 //Double_t zfit3 = vecZ2[irow];
1573 if (TMath::Abs(yfit-ycl)<2&&TMath::Abs(zfit-zcl)<2){
1575 profy->Fill(irow,ycl-yfit);
1576 profy2->Fill(irow,ycl-yfit2);
1577 // profy3->Fill(irow,ycl-yfit3);
1580 profz->Fill(irow,zcl-zfit);
1581 profz2->Fill(irow,zcl-zfit2);
1582 //profz3->Fill(irow,zcl-zfit3);
1588 // Fill laser fit histograms
1590 Float_t dedx = track->GetdEdx();
1591 if (nclI>20&&nclO>20){
1592 fHisNclIn->Fill(id,nclI); //->Number of clusters inner
1593 fHisNclOut->Fill(id,nclO); //->Number of clusters outer
1594 fHisNclIO->Fill(id,nclI+nclO); //->Number of cluster inner outer
1596 fHisLclIn->Fill(id,xinMax-xinMin); //->Level arm inner
1597 fHisLclOut->Fill(id,xoutMax-xoutMin); //->Level arm outer
1598 fHisLclIO->Fill(id,xoutMax-xinMin); //->Number of cluster inner outer
1600 fHisdEdx->Fill(id,TMath::Sqrt(TMath::Abs(dedx)));
1601 fHisdZfit->Fill(id,fFitZ[id]);
1604 fHisChi2YIn1->Fill(id,TMath::Sqrt(chi2I1y)); //->chi2 y inner - line
1605 fHisChi2YOut1->Fill(id,TMath::Sqrt(chi2O1y)); //->chi2 y inner - line
1606 fHisChi2YIn2->Fill(id,TMath::Sqrt(chi2I2y)); //->chi2 y inner - parabola
1607 fHisChi2YOut2->Fill(id,TMath::Sqrt(chi2O2y)); //->chi2 y inner - parabola
1608 fHisChi2YIO1->Fill(id,TMath::Sqrt(chi2IOy)); //->chi2 y IO - common
1611 fHisChi2ZIn1->Fill(id,TMath::Sqrt(chi2I1z)); //->chi2 z inner - line
1612 fHisChi2ZOut1->Fill(id,TMath::Sqrt(chi2O1z)); //->chi2 z inner - line
1613 fHisChi2ZIn2->Fill(id,TMath::Sqrt(chi2O2y)); //->chi2 z inner - parabola
1614 fHisChi2ZOut2->Fill(id,TMath::Sqrt(chi2O2z)); //->chi2 z inner - parabola
1615 fHisChi2ZIO1->Fill(id,TMath::Sqrt(chi2IOz)); //->chi2 z IO - common
1618 fHisPy1vP0->Fill(id,vecy1resOuter[0]-vecy1resInner[0]); //-> delta y P0outer-P0inner - line
1619 fHisPy2vP0->Fill(id,vecy2resOuter[0]-vecy2resInner[0]); //-> delta y P0outer-P0inner - parabola
1620 fHisPy3vP0->Fill(id,vecy4res[1]); //-> delta y P0outer-P0inner - common parabola
1622 fHisPy1vP1->Fill(id,vecy1resOuter[1]-vecy1resInner[1]); //-> delta ky P1outer-P1inner - line
1623 fHisPy2vP1->Fill(id,vecy2resOuter[1]-vecy2resInner[1]); //-> delta ky P1outer-P1inner - parabola
1624 fHisPy3vP1->Fill(id,vecy4res[3]-vecy4res[2]); //-> delta ky P1outer-P1inner - common parabola
1626 fHisPy3vP2IO->Fill(id,vecy4res[4]); //-> Curv P2outerinner - common parabola
1627 fHisPz1vP0->Fill(id,vecz1resOuter[0]-vecz1resInner[0]); //-> delta z P0outer-P0inner - line
1628 fHisPz2vP0->Fill(id,vecz2resOuter[0]-vecz2resInner[0]); //-> delta z P0outer-P0inner - parabola
1629 fHisPz3vP0->Fill(id,vecz4res[1]); //-> delta z P0outer-P0inner - common parabola
1631 fHisPz1vP1->Fill(id,vecz1resOuter[1]-vecz1resInner[1]); //-> delta kz P1outer-P1inner - line
1632 fHisPz2vP1->Fill(id,vecz2resOuter[1]-vecz2resInner[1]); //-> delta kz P1outer-P1inner - parabola
1633 fHisPz3vP1->Fill(id,vecz4res[3]-vecz4res[2]); //-> delta kz P1outer-P1inner - common parabola
1634 fHisPz3vP2IO->Fill(id,vecz4res[4]); //-> Curv P2outerinner - common parabola
1637 fHisPy2vP2In->Fill(id,vecy2resInner[2]); //-> Curv P2inner - parabola
1638 fHisPz2vP2In->Fill(id,vecz2resInner[2]); //-> Curv P2inner - parabola
1642 fHisPz2vP2Out->Fill(id,vecz2resOuter[2]); //-> Curv P2outer - parabola
1643 fHisPy2vP2Out->Fill(id,vecy2resOuter[2]); //-> Curv P2outer - parabola
1651 void AliTPCcalibLaser::DumpMeanInfo(Float_t bfield, Int_t run){
1653 // Dump information about laser beams
1654 // isOK variable indicates usability of the beam
1655 // Beam is not usable if:
1656 // a. No entries in range (krmsCut0)
1657 // b. Big sperad (krmscut1)
1658 // c. RMSto fit sigma bigger then (kmultiCut)
1659 // d. Too big angular spread
1662 const Float_t krmsCut0=0.001;
1663 const Float_t krmsCut1=0.16;
1664 const Float_t kmultiCut=2;
1665 const Float_t kcutP0=0.002;
1667 AliTPCcalibLaser *laser = this;
1668 TTreeSRedirector *pcstream = new TTreeSRedirector("laserMean.root");
1669 TF1 fg("fg","gaus");
1672 for (Int_t id=0; id<336; id++){
1674 TH1F * hisphi = (TH1F*)laser->fDeltaPhi.At(id);
1675 TH1F * hisphiP = (TH1F*)laser->fDeltaPhiP.At(id);
1676 TH1F * hisZ = (TH1F*)laser->fDeltaZ.At(id);
1677 TH1F * hisP3 = (TH1F*)laser->fDeltaP3.At(id);
1678 TH1F * hisP4 = (TH1F*)laser->fDeltaP4.At(id);
1679 TH1F * hisS = (TH1F*)laser->fSignals.At(id);
1680 //if (!hisphi) continue;
1681 Double_t entries = (hisphi==0)? 0: hisphi->GetEntries();
1682 //if (entries<minEntries) continue;
1684 AliTPCLaserTrack *ltrp = (AliTPCLaserTrack*)fTracksMirror.At(id);
1686 AliTPCLaserTrack::LoadTracks();
1687 ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
1689 pcstream->GetFile()->cd();
1690 if (hisphi) hisphi->Write();
1691 if (hisphiP) hisphiP->Write();
1692 if (hisZ) hisZ->Write();
1693 if (hisP3) hisP3->Write();
1694 if (hisP4) hisP4->Write();
1696 Float_t meanphi = hisphi->GetMean();
1697 Float_t rmsphi = hisphi->GetRMS();
1699 Float_t meanphiP = hisphiP->GetMean();
1700 Float_t rmsphiP = hisphiP->GetRMS();
1701 Float_t meanZ = hisZ->GetMean();
1702 Float_t rmsZ = hisZ->GetRMS();
1703 hisphi->Fit(&fg,"","",hisphi->GetMean()-4*hisphi->GetRMS(),hisphi->GetMean()+4*hisphi->GetRMS());
1704 Double_t gphi1 = fg.GetParameter(1);
1705 Double_t gphi2 = fg.GetParameter(2);
1706 hisphiP->Fit(&fg,"","",hisphiP->GetMean()-4*hisphiP->GetRMS(),hisphiP->GetMean()+4*hisphiP->GetRMS());
1707 Double_t gphiP1 = fg.GetParameter(1);
1708 Double_t gphiP2 = fg.GetParameter(2);
1710 hisZ->Fit(&fg,"","",hisZ->GetMean()-4*hisZ->GetRMS(),hisZ->GetMean()+4*hisZ->GetRMS());
1711 Double_t gz1 = fg.GetParameter(1);
1712 Double_t gz2 = fg.GetParameter(2);
1714 hisP3->Fit(&fg,"","",hisP3->GetMean()-4*hisP3->GetRMS(),hisP3->GetMean()+4*hisP3->GetRMS());
1715 Double_t gp31 = fg.GetParameter(1);
1716 Double_t gp32 = fg.GetParameter(2);
1718 hisP4->Fit(&fg,"","",hisP4->GetMean()-4*hisP4->GetRMS(),hisP4->GetMean()+4*hisP4->GetRMS());
1719 Double_t gp41 = fg.GetParameter(1);
1720 Double_t gp42 = fg.GetParameter(2);
1722 Float_t meanS=hisS->GetMean();
1727 ltrp->GetPxPyPz(lpxyz);
1729 if (rmsphi<krmsCut0) isOK=kFALSE; // empty in range - not entries inside
1730 if (rmsphi>krmsCut1) isOK=kFALSE; // empty in range - not entries inside
1731 if (rmsphi>krmsCut0) if (gphi2/rmsphi>kmultiCut) isOK=kFALSE; // multi peak structure
1732 if (gphiP2>kcutP0) isOK=kFALSE;
1738 his = fHisNclIn->ProjectionY("aaa",id+1,id+1);
1739 Float_t mnclIn = his->GetMean();
1741 his = fHisNclOut->ProjectionY("aaa",id+1,id+1);
1742 Float_t mnclOut = his->GetMean();
1744 his = fHisNclIO->ProjectionY("aaa",id+1,id+1);
1745 Float_t mnclIO = his->GetMean();
1747 his = fHisLclIn->ProjectionY("aaa",id+1,id+1);
1748 Float_t mLclIn = his->GetMean();
1750 his = fHisLclOut->ProjectionY("aaa",id+1,id+1);
1751 Float_t mLclOut = his->GetMean();
1753 his = fHisLclIO->ProjectionY("aaa",id+1,id+1);
1754 Float_t mLclIO = his->GetMean();
1757 his = fHisdEdx->ProjectionY("aaa",id+1,id+1);
1758 Float_t mdEdx = his->GetMean();
1764 his = fHisChi2YIn1->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - line
1765 Float_t mChi2YIn1= his->GetMean();
1767 his = fHisChi2YOut1->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - line
1768 Float_t mChi2YOut1 = his->GetMean();
1770 his = fHisChi2YIn2->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - parabola
1771 Float_t mChi2YIn2 = his->GetMean();
1773 his = fHisChi2YOut2->ProjectionY("aaa",id+1,id+1); //->chi2 y inner - parabola
1774 Float_t mChi2YOut2 = his->GetMean();
1776 his = fHisChi2YIO1->ProjectionY("aaa",id+1,id+1); //->chi2 y IO - common
1777 Float_t mChi2YIO1 = his->GetMean();
1779 his = fHisChi2ZIn1->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - line
1780 Float_t mChi2ZIn1 = his->GetMean();
1782 his = fHisChi2ZOut1->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - line
1783 Float_t mChi2ZOut1 = his->GetMean();
1785 his = fHisChi2ZIn2->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - parabola
1786 Float_t mChi2ZIn2 = his->GetMean();
1788 his = fHisChi2ZOut2->ProjectionY("aaa",id+1,id+1); //->chi2 z inner - parabola
1789 Float_t mChi2ZOut2 = his->GetMean();
1791 his = fHisChi2ZIO1->ProjectionY("aaa",id+1,id+1); //->chi2 z IO - common
1792 Float_t mChi2ZIO1 = his->GetMean();
1797 his = fHisdZfit->ProjectionY("aaa",id+1,id+1);
1798 Float_t edZfit = his->GetEntries();
1799 Float_t mdZfit = his->GetMean();
1800 Float_t rdZfit = his->GetRMS();
1803 his = fHisPy1vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - line
1804 Float_t ePy1vP0 = his->GetEntries();
1805 Float_t mPy1vP0 = his->GetMean();
1806 Float_t rPy1vP0 = his->GetRMS();
1809 his = fHisPy2vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - parabola
1810 Float_t ePy2vP0 = his->GetEntries();
1811 Float_t mPy2vP0 = his->GetMean();
1812 Float_t rPy2vP0 = his->GetRMS();
1815 his = fHisPy3vP0->ProjectionY("aaa",id+1,id+1); //-> delta y P0outer-P0inner - common parabola
1816 Float_t ePy3vP0 = his->GetEntries();
1817 Float_t mPy3vP0 = his->GetMean();
1818 Float_t rPy3vP0 = his->GetRMS();
1821 his = fHisPy1vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - line
1822 Float_t ePy1vP1 = his->GetEntries();
1823 Float_t mPy1vP1 = his->GetMean();
1824 Float_t rPy1vP1 = his->GetRMS();
1827 his = fHisPy2vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - parabola
1828 Float_t ePy2vP1 = his->GetEntries();
1829 Float_t mPy2vP1 = his->GetMean();
1830 Float_t rPy2vP1 = his->GetRMS();
1833 his = fHisPy3vP1->ProjectionY("aaa",id+1,id+1); //-> delta ky P1outer-P1inner - common parabola
1834 Float_t ePy3vP1 = his->GetEntries();
1835 Float_t mPy3vP1 = his->GetMean();
1836 Float_t rPy3vP1 = his->GetRMS();
1839 his = fHisPy2vP2In->ProjectionY("aaa",id+1,id+1); //-> Curv P2inner - parabola
1840 Float_t ePy2vP2In = his->GetEntries();
1841 Float_t mPy2vP2In = his->GetMean();
1842 Float_t rPy2vP2In = his->GetRMS();
1845 his = fHisPy2vP2Out->ProjectionY("aaa",id+1,id+1); //-> Curv P2outer - parabola
1846 Float_t ePy2vP2Out = his->GetEntries();
1847 Float_t mPy2vP2Out = his->GetMean();
1848 Float_t rPy2vP2Out = his->GetRMS();
1851 his = fHisPy3vP2IO->ProjectionY("aaa",id+1,id+1); //-> Curv P2outerinner - common parabola
1852 Float_t ePy3vP2IO = his->GetEntries();
1853 Float_t mPy3vP2IO = his->GetMean();
1854 Float_t rPy3vP2IO = his->GetRMS();
1859 his = fHisPz1vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - line
1860 Float_t ePz1vP0 = his->GetEntries();
1861 Float_t mPz1vP0 = his->GetMean();
1862 Float_t rPz1vP0 = his->GetRMS();
1865 his = fHisPz2vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - parabola
1866 Float_t ePz2vP0 = his->GetEntries();
1867 Float_t mPz2vP0 = his->GetMean();
1868 Float_t rPz2vP0 = his->GetRMS();
1871 his = fHisPz3vP0->ProjectionY("aaa",id+1,id+1); //-> delta z P0outer-P0inner - common parabola
1872 Float_t ePz3vP0 = his->GetEntries();
1873 Float_t mPz3vP0 = his->GetMean();
1874 Float_t rPz3vP0 = his->GetRMS();
1877 his = fHisPz1vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - line
1878 Float_t ePz1vP1 = his->GetEntries();
1879 Float_t mPz1vP1 = his->GetMean();
1880 Float_t rPz1vP1 = his->GetRMS();
1883 his = fHisPz2vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - parabola
1884 Float_t ePz2vP1 = his->GetEntries();
1885 Float_t mPz2vP1 = his->GetMean();
1886 Float_t rPz2vP1 = his->GetRMS();
1889 his = fHisPz3vP1->ProjectionY("aaa",id+1,id+1); //-> delta kz P1outer-P1inner - common parabola
1890 Float_t ePz3vP1 = his->GetEntries();
1891 Float_t mPz3vP1 = his->GetMean();
1892 Float_t rPz3vP1 = his->GetRMS();
1895 his = fHisPz2vP2In->ProjectionY("aaa",id+1,id+1); //-> Curv P2inner - parabola
1896 Float_t ePz2vP2In = his->GetEntries();
1897 Float_t mPz2vP2In = his->GetMean();
1898 Float_t rPz2vP2In = his->GetRMS();
1901 his = fHisPz2vP2Out->ProjectionY("aaa",id+1,id+1); //-> Curv P2outer - parabola
1902 Float_t ePz2vP2Out = his->GetEntries();
1903 Float_t mPz2vP2Out = his->GetMean();
1904 Float_t rPz2vP2Out = his->GetRMS();
1907 his = fHisPz3vP2IO->ProjectionY("aaa",id+1,id+1); //-> Curv P2outerinner - common parabola
1908 Float_t ePz3vP2IO = his->GetEntries();
1909 Float_t mPz3vP2IO = his->GetMean();
1910 Float_t rPz3vP2IO = his->GetRMS();
1914 (*pcstream)<<"Mean"<<
1917 "id="<<id<< // track id
1918 "entries="<<entries<< // number of entries
1919 "bz="<<bfield<< // bfield
1920 "LTr.="<<ltrp<< // refernece track
1922 "mnclIn="<<mnclIn<< // mean number of clusters in inner
1923 "mnclOut="<<mnclOut<< // mean number of clusters in outer
1924 "mnclIO="<<mnclIO<< // mean number of clusters in inner+outer
1925 "mLclIn="<<mLclIn<< // mean number of clusters in inner
1926 "mLclOut="<<mLclOut<< // mean number of clusters in outer
1927 "mLclIO="<<mLclIO<< // mean number of clusters in inner+outer
1928 "mdEdx="<<mdEdx<< // mean dEdx
1929 "edZfit="<<edZfit<< // entries z fit
1930 "mdZfit="<<mdZfit<< // mean z fit
1931 "rdZfit="<<rdZfit<< // RMS z fit
1934 "mChi2YIn1="<<mChi2YIn1<< //->chi2 y inner - line
1935 "mChi2YOut1="<<mChi2YOut1<< //->chi2 y inner - line
1936 "mChi2YIn2="<<mChi2YIn2<< //->chi2 y inner - parabola
1937 "mChi2YOut2="<<mChi2YOut2<< //->chi2 y inner - parabola
1938 "mChi2YIO1="<<mChi2YIO1<< //->chi2 y IO - common
1939 "mChi2ZIn1="<<mChi2ZIn1<< //->chi2 z inner - line
1940 "mChi2ZOut1="<<mChi2ZOut1<< //->chi2 z inner - line
1941 "mChi2ZIn2="<<mChi2ZIn2<< //->chi2 z inner - parabola
1942 "mChi2ZOut2="<<mChi2ZOut2<< //->chi2 z inner - parabola
1943 "mChi2ZIO1="<<mChi2ZIO1<< //->chi2 z IO - common
1946 "ePy1vP0="<<ePy1vP0<<
1947 "mPy1vP0="<<mPy1vP0<<
1948 "rPy1vP0="<<rPy1vP0<<
1949 "ePy2vP0="<<ePy2vP0<<
1950 "mPy2vP0="<<mPy2vP0<<
1951 "rPy2vP0="<<rPy2vP0<<
1952 "ePy3vP0="<<ePy3vP0<<
1953 "mPy3vP0="<<mPy3vP0<<
1954 "rPy3vP0="<<rPy3vP0<<
1955 "ePy1vP1="<<ePy1vP1<<
1956 "mPy1vP1="<<mPy1vP1<<
1957 "rPy1vP1="<<rPy1vP1<<
1958 "ePy2vP1="<<ePy2vP1<<
1959 "mPy2vP1="<<mPy2vP1<<
1960 "rPy2vP1="<<rPy2vP1<<
1961 "ePy3vP1="<<ePy3vP1<<
1962 "mPy3vP1="<<mPy3vP1<<
1963 "rPy3vP1="<<rPy3vP1<<
1964 "ePy2vP2In="<<ePy2vP2In<<
1965 "mPy2vP2In="<<mPy2vP2In<<
1966 "rPy2vP2In="<<rPy2vP2In<<
1967 "ePy2vP2Out="<<ePy2vP2Out<<
1968 "mPy2vP2Out="<<mPy2vP2Out<<
1969 "rPy2vP2Out="<<rPy2vP2Out<<
1970 "ePy3vP2IO="<<ePy3vP2IO<<
1971 "mPy3vP2IO="<<mPy3vP2IO<<
1972 "rPy3vP2IO="<<rPy3vP2IO<<
1975 "ePz1vP0="<<ePz1vP0<<
1976 "mPz1vP0="<<mPz1vP0<<
1977 "rPz1vP0="<<rPz1vP0<<
1978 "ePz2vP0="<<ePz2vP0<<
1979 "mPz2vP0="<<mPz2vP0<<
1980 "rPz2vP0="<<rPz2vP0<<
1981 "ePz3vP0="<<ePz3vP0<<
1982 "mPz3vP0="<<mPz3vP0<<
1983 "rPz3vP0="<<rPz3vP0<<
1984 "ePz1vP1="<<ePz1vP1<<
1985 "mPz1vP1="<<mPz1vP1<<
1986 "rPz1vP1="<<rPz1vP1<<
1987 "ePz2vP1="<<ePz2vP1<<
1988 "mPz2vP1="<<mPz2vP1<<
1989 "rPz2vP1="<<rPz2vP1<<
1990 "ePz3vP1="<<ePz3vP1<<
1991 "mPz3vP1="<<mPz3vP1<<
1992 "rPz3vP1="<<rPz3vP1<<
1993 "ePz2vP2In="<<ePz2vP2In<<
1994 "mPz2vP2In="<<mPz2vP2In<<
1995 "rPz2vP2In="<<rPz2vP2In<<
1996 "ePz2vP2Out="<<ePz2vP2Out<<
1997 "mPz2vP2Out="<<mPz2vP2Out<<
1998 "rPz2vP2Out="<<rPz2vP2Out<<
1999 "ePz3vP2IO="<<ePz3vP2IO<<
2000 "mPz3vP2IO="<<mPz3vP2IO<<
2001 "rPz3vP2IO="<<rPz3vP2IO<<
2005 "lx0="<<lxyz[0]<< // reference x
2006 "lx1="<<lxyz[1]<< // reference y
2007 "lx2="<<lxyz[2]<< // refernece z
2008 "lpx0="<<lpxyz[0]<< // reference x
2009 "lpx1="<<lpxyz[1]<< // reference y
2010 "lpx2="<<lpxyz[2]<< // refernece z
2014 "mphi="<<meanphi<< //
2015 "rmsphi="<<rmsphi<< //
2019 "mphiP="<<meanphiP<< //
2020 "rmsphiP="<<rmsphiP<< //
2029 "gp31="<<gp31<< //gaus mean - tgl
2030 "gp32="<<gp32<< //gaus rms -tgl
2031 "gp41="<<gp41<< //gaus mean - P4
2032 "gp42="<<gp42<< //gaus rms - P4
2039 TFile fmean("laserMean.root");
2049 void AliTPCcalibLaser::DumpScanInfo(TTree * chain){
2053 TTreeSRedirector *pcstream = new TTreeSRedirector("laserScan.root");
2054 TFile * f = pcstream->GetFile();
2056 f->mkdir("dirphiP");
2058 TF1 fp("p1","pol1");
2063 char grnamefull[1000];
2066 Double_t mphiP[100];
2067 Double_t smphi[100];
2068 Double_t smphiP[100];
2078 for (Int_t id=0; id<336; id++){
2080 sprintf(cut,"isOK&&fId==%d",id);
2081 Int_t entries = chain->Draw("bz",cut,"goff");
2082 if (entries<3) continue;
2083 AliTPCLaserTrack *ltrp = 0;
2084 if (!AliTPCLaserTrack::GetTracks()) AliTPCLaserTrack::LoadTracks();
2085 ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(id);
2089 ltrp->GetPxPyPz(lpxyz);
2091 chain->Draw("bz",cut,"goff");
2092 memcpy(bz, chain->GetV1(), entries*sizeof(Double_t));
2093 chain->Draw("0.01*abs(bz)+0.02",cut,"goff");
2094 memcpy(sbz, chain->GetV1(), entries*sizeof(Double_t));
2096 chain->Draw("gphi1",cut,"goff");
2097 memcpy(mphi, chain->GetV1(), entries*sizeof(Double_t));
2098 chain->Draw("0.05*abs(mphi)+gphi2",cut,"goff");
2099 memcpy(smphi, chain->GetV1(), entries*sizeof(Double_t));
2101 chain->Draw("gphiP1",cut,"goff");
2102 memcpy(mphiP, chain->GetV1(), entries*sizeof(Double_t));
2103 chain->Draw("0.05*abs(mphiP)+gphiP2",cut,"goff");
2104 memcpy(smphiP, chain->GetV1(), entries*sizeof(Double_t));
2106 chain->Draw("gz1",cut,"goff");
2107 memcpy(mZ, chain->GetV1(), entries*sizeof(Double_t));
2108 chain->Draw("0.01*abs(meanZ)+gz2",cut,"goff");
2109 memcpy(smZ, chain->GetV1(), entries*sizeof(Double_t));
2112 sprintf(grnamefull,"Side_%d_Bundle_%d_Rod_%d_Beam_%d",
2113 ltrp->GetSide(), ltrp->GetBundle(), ltrp->GetRod(), ltrp->GetBeam());
2117 TGraphErrors *grphi = new TGraphErrors(entries,bz,mphi,sbz,smphi);
2120 pphi[0] = fp.GetParameter(0); // offset
2121 pphi[1] = fp.GetParameter(1); // slope
2122 pphi[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
2123 sprintf(grname,"phi_id%d",id);
2124 grphi->SetName(grname); grphi->SetTitle(grnamefull);
2125 grphi->GetXaxis()->SetTitle("b_{z} (T)");
2126 grphi->GetYaxis()->SetTitle("#Delta r#phi (cm)");
2127 grphi->SetMaximum(1.2);
2128 grphi->SetMinimum(-1.2);
2132 gPad->SaveAs(Form("pic/phi/phi_%s.gif",grnamefull));
2135 TGraphErrors *grphiP = new TGraphErrors(entries,bz,mphiP,sbz,smphiP);
2138 pphiP[0] = fp.GetParameter(0); // offset
2139 pphiP[1] = fp.GetParameter(1); // slope
2140 pphiP[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
2141 sprintf(grname,"phiP_id%d",id);
2142 grphiP->SetName(grname); grphiP->SetTitle(grnamefull);
2143 grphiP->GetXaxis()->SetTitle("b_{z} (T)");
2144 grphiP->GetYaxis()->SetTitle("#Delta #phi (rad)");
2145 grphiP->SetMaximum(pphiP[0]+0.005);
2146 grphiP->SetMinimum(pphiP[0]-0.005);
2148 gPad->SaveAs(Form("pic/phiP/phiP_%s.gif",grnamefull));
2153 TGraphErrors *grmZ = new TGraphErrors(entries,bz,mZ,sbz,smZ);
2156 pmZ[0] = fp.GetParameter(0); // offset
2157 pmZ[1] = fp.GetParameter(1); // slope
2158 pmZ[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.)); // normalized chi2
2159 sprintf(grname,"mZ_id%d",id);
2160 grmZ->SetName(grname); grmZ->SetTitle(grnamefull);
2161 grmZ->GetXaxis()->SetTitle("b_{z} (T)");
2162 grmZ->GetYaxis()->SetTitle("#Delta z (cm)");
2164 gPad->SaveAs(Form("pic/z/z_%s.gif",grnamefull));
2168 for (Int_t ientry=0; ientry<entries; ientry++){
2169 (*pcstream)<<"Mean"<<
2172 "entries="<<entries<<
2174 "lx0="<<lxyz[0]<< // reference x
2175 "lx1="<<lxyz[1]<< // reference y
2176 "lx2="<<lxyz[2]<< // refernece z
2177 "lpx0="<<lpxyz[0]<< // reference x
2178 "lpx1="<<lpxyz[1]<< // reference y
2179 "lpx2="<<lpxyz[2]<< // refernece z
2181 "gphi1="<<mphi[ientry]<< // mean - from gaus fit
2182 "pphi0="<<pphi[0]<< // offset
2183 "pphi1="<<pphi[1]<< // mean
2184 "pphi2="<<pphi[2]<< // norm chi2
2186 "gphiP1="<<mphiP[ientry]<< // mean - from gaus fit
2187 "pphiP0="<<pphiP[0]<< // offset
2188 "pphiP1="<<pphiP[1]<< // mean
2189 "pphiP2="<<pphiP[2]<< // norm chi2
2191 "gz1="<<mZ[ientry]<<
2192 "pmZ0="<<pmZ[0]<< // offset
2193 "pmZ1="<<pmZ[1]<< // mean
2194 "pmZ2="<<pmZ[2]<< // norm chi2
2204 void AliTPCcalibLaser::Analyze(){
2211 Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
2213 TIterator* iter = li->MakeIterator();
2214 AliTPCcalibLaser* cal = 0;
2215 static Int_t counter0=0;
2216 while ((cal = (AliTPCcalibLaser*)iter->Next())) {
2217 if (!cal->InheritsFrom(AliTPCcalibLaser::Class())) {
2218 // Error("Merge","Attempt to add object of class %s to a %s", cal->ClassName(), this->ClassName());
2221 printf("Marging number %d\n", counter0);
2224 MergeFitHistos(cal);
2229 // TProfile *hp=0x0;
2230 //TProfile *hpm=0x0;
2232 for (Int_t id=0; id<336; id++){
2233 // merge fDeltaZ histograms
2234 hm = (TH1F*)cal->fDeltaZ.At(id);
2235 h = (TH1F*)fDeltaZ.At(id);
2237 h=new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
2239 fDeltaZ.AddAt(h,id);
2242 // merge fP3 histograms
2243 hm = (TH1F*)cal->fDeltaP3.At(id);
2244 h = (TH1F*)fDeltaP3.At(id);
2246 h=new TH1F(Form("hisPar3v%d",id),Form("hisPar3v%d",id),400,-0.06,0.06);
2248 fDeltaP3.AddAt(h,id);
2251 // merge fP4 histograms
2252 hm = (TH1F*)cal->fDeltaP4.At(id);
2253 h = (TH1F*)fDeltaP4.At(id);
2255 h=new TH1F(Form("hisPar4v%d",id),Form("hisPar4v%d",id),200,-0.06,0.06);
2257 fDeltaP4.AddAt(h,id);
2262 // merge fDeltaPhi histograms
2263 hm = (TH1F*)cal->fDeltaPhi.At(id);
2264 h = (TH1F*)fDeltaPhi.At(id);
2266 h= new TH1F(Form("hisdphi%d",id),Form("hisdphi%d",id),1000,-1,1);
2268 fDeltaPhi.AddAt(h,id);
2271 // merge fDeltaPhiP histograms
2272 hm = (TH1F*)cal->fDeltaPhiP.At(id);
2273 h = (TH1F*)fDeltaPhiP.At(id);
2275 h=new TH1F(Form("hisdphiP%d",id),Form("hisdphiP%d",id),1000,-0.01,0.01);
2277 fDeltaPhiP.AddAt(h,id);
2280 // merge fSignals histograms
2281 hm = (TH1F*)cal->fSignals.At(id);
2282 h = (TH1F*)fSignals.At(id);
2284 h=new TH1F(Form("hisSignal%d",id),Form("hisSignal%d",id),100,0,300);
2286 fSignals.AddAt(h,id);
2291 // merge ProfileY histograms -0
2292 h2m = (TH2F*)cal->fDeltaYres.At(id);
2293 h2 = (TH2F*)fDeltaYres.At(id);
2294 if (h2m&&h2) h2->Add(h2m);
2296 h2m = (TH2F*)cal->fDeltaZres.At(id);
2297 h2 = (TH2F*)fDeltaZres.At(id);
2298 if (h2m&&h2) h2->Add(h2m);
2299 // merge ProfileY histograms - 2
2300 h2m = (TH2F*)cal->fDeltaYres2.At(id);
2301 h2 = (TH2F*)fDeltaYres2.At(id);
2302 if (h2m&&h2) h2->Add(h2m);
2304 h2m = (TH2F*)cal->fDeltaZres2.At(id);
2305 h2 = (TH2F*)fDeltaZres2.At(id);
2306 if (h2m&&h2) h2->Add(h2m);
2307 // merge ProfileY histograms - 3
2308 //h2m = (TH2F*)cal->fDeltaYres3.At(id);
2309 //h2 = (TH2F*)fDeltaYres3.At(id);
2310 //if (h2m) h2->Add(h2m);
2312 //h2m = (TH2F*)cal->fDeltaZres3.At(id);
2313 //h2 = (TH2F*)fDeltaZres3.At(id);
2314 //if (h2m) h->Add(h2m);
2322 void AliTPCcalibLaser::MakeFitHistos(){
2324 // Make a fit histograms
2326 // Number of clusters
2328 //TH2F *fHisNclIn; //->Number of clusters inner
2329 //TH2F *fHisNclOut; //->Number of clusters outer
2330 //TH2F *fHisNclIO; //->Number of cluster inner outer
2331 // TH2F *fHisdEdx; //->dEdx histo
2332 fHisNclIn = new TH2F("HisNclIn","HisNclIn",336,0,336,64,10,64);
2333 fHisNclOut = new TH2F("HisNclOut","HisNclOut",336,0,336,100,10,100);
2334 fHisNclIO = new TH2F("HisNclIO","HisNclIO",336,0,336,160,10,160);
2336 fHisLclIn = new TH2F("HisLclIn","HisLclIn",336,0,336,64,10,64);
2337 fHisLclOut = new TH2F("HisLclOut","HisLclOut",336,0,336,100,10,150);
2338 fHisLclIO = new TH2F("HisLclIO","HisLclIO",336,0,336,160,10,160);
2340 fHisdEdx = new TH2F("HisdEdx","HisdEdx",336,0,336,160,1,50);
2341 fHisdZfit = new TH2F("HisdZfit","HisdZfit",336,0,336,300,-0.3,0.3);
2346 // TH2F *fHisChi2YIn1; //->chi2 y inner - line
2347 // TH2F *fHisChi2YOut1; //->chi2 y inner - line
2348 // TH2F *fHisChi2YIn2; //->chi2 y inner - parabola
2349 // TH2F *fHisChi2YOut2; //->chi2 y inner - parabola
2350 // TH2F *fHisChi2YIO1; //->chi2 y IO - common
2351 fHisChi2YIn1 = new TH2F("Chi2YIn1","Chi2YIn1",336,0,336,500,0.001,0.5);
2352 fHisChi2YOut1 = new TH2F("Chi2YOut1","Chi2YOut1",336,0,336,500,0.001,0.5);
2353 fHisChi2YIn2 = new TH2F("Chi2YIn2","Chi2YIn2",336,0,336,500,0.001,0.5);
2354 fHisChi2YOut2 = new TH2F("Chi2YOut2","Chi2YOut2",336,0,336,500,0.001,0.5);
2355 fHisChi2YIO1 = new TH2F("Chi2YIO1","Chi2YIO1",336,0,336,500,0.001,0.5);
2356 // TH2F *fHisChi2ZIn1; //->chi2 z inner - line
2357 // TH2F *fHisChi2ZOut1; //->chi2 z inner - line
2358 // TH2F *fHisChi2ZIn2; //->chi2 z inner - parabola
2359 // TH2F *fHisChi2ZOut2; //->chi2 z inner - parabola
2360 // TH2F *fHisChi2ZIO1; //->chi2 z IO - common
2361 fHisChi2ZIn1 = new TH2F("Chi2ZIn1","Chi2ZIn1",336,0,336,500,0.001,0.5);
2362 fHisChi2ZOut1 = new TH2F("Chi2ZOut1","Chi2ZOut1",336,0,336,500,0.001,0.5);
2363 fHisChi2ZIn2 = new TH2F("Chi2ZIn2","Chi2ZIn2",336,0,336,500,0.001,0.5);
2364 fHisChi2ZOut2 = new TH2F("Chi2ZOut2","Chi2ZOut2",336,0,336,500,0.001,0.5);
2365 fHisChi2ZIO1 = new TH2F("Chi2ZIO1","Chi2ZIO1",336,0,336,500,0.001,0.5);
2370 // TH2F *fHisPy1vP0; //-> delta y P0outer-P0inner - line
2371 // TH2F *fHisPy2vP0; //-> delta y P0outer-P0inner - parabola
2372 // TH2F *fHisPy3vP0; //-> delta y P0outer-P0inner - common parabola
2373 // TH2F *fHisPy1vP1; //-> delta ky P1outer-P1inner - line
2374 // TH2F *fHisPy2vP1; //-> delta ky P1outer-P1inner - parabola
2375 // TH2F *fHisPy3vP1; //-> delta ky P1outer-P1inner - common parabola
2376 // TH2F *fHisPy2vP2In; //-> Curv P2inner - parabola
2377 // TH2F *fHisPy2vP2Out; //-> Curv P2outer - parabola
2378 // TH2F *fHisPy3vP2IO; //-> Curv P2outerinner - common parabola
2379 fHisPy1vP0 = new TH2F("HisPy1vP0", "HisPy1vP0",336,0,336,500,-0.3,0.3);
2380 fHisPy2vP0 = new TH2F("HisPy2vP0", "HisPy2vP0",336,0,336,500,-0.3,0.3);
2381 fHisPy3vP0 = new TH2F("HisPy3vP0", "HisPy3vP0",336,0,336,500,-0.3,0.3);
2382 fHisPy1vP1 = new TH2F("HisPy1vP1", "HisPy1vP1",336,0,336,500,-0.01,0.01);
2383 fHisPy2vP1 = new TH2F("HisPy2vP1", "HisPy2vP1",336,0,336,500,-0.01,0.01);
2384 fHisPy3vP1 = new TH2F("HisPy3vP1", "HisPy3vP1",336,0,336,500,-0.01,0.01);
2385 fHisPy2vP2In = new TH2F("HisPy2vP2In", "HisPy2vP2In",336,0,336,500,-0.0003,0.0003);
2386 fHisPy2vP2Out= new TH2F("HisPy2vP2Out","HisPy2vP2Out",336,0,336,500,-0.0003,0.0003);
2387 fHisPy3vP2IO = new TH2F("HisPy3vP2IO", "HisPy3vP2IO",336,0,336,500,-0.0003,0.0003);
2390 // TH2F *fHisPz1vP0; //-> delta z P0outer-P0inner - line
2391 // TH2F *fHisPz2vP0; //-> delta z P0outer-P0inner - parabola
2392 // TH2F *fHisPz3vP0; //-> delta z P0outer-P0inner - common parabola
2393 // TH2F *fHisPz1vP1; //-> delta kz P1outer-P1inner - line
2394 // TH2F *fHisPz2vP1; //-> delta kz P1outer-P1inner - parabola
2395 // TH2F *fHisPz3vP1; //-> delta kz P1outer-P1inner - common parabola
2396 // TH2F *fHisPz2vP2In; //-> Curv P2inner - parabola
2397 // TH2F *fHisPz2vP2Out; //-> Curv P2outer - parabola
2398 // TH2F *fHisPz3vP2IO; //-> Curv P2outerinner - common parabola
2399 fHisPz1vP0 = new TH2F("HisPz1vP0", "HisPz1vP0",336,0,336,500,-0.3,0.3);
2400 fHisPz2vP0 = new TH2F("HisPz2vP0", "HisPz2vP0",336,0,336,500,-0.3,0.3);
2401 fHisPz3vP0 = new TH2F("HisPz3vP0", "HisPz3vP0",336,0,336,500,-0.3,0.3);
2402 fHisPz1vP1 = new TH2F("HisPz1vP1", "HisPz1vP1",336,0,336,500,-0.01,0.01);
2403 fHisPz2vP1 = new TH2F("HisPz2vP1", "HisPz2vP1",336,0,336,500,-0.01,0.01);
2404 fHisPz3vP1 = new TH2F("HisPz3vP1", "HisPz3vP1",336,0,336,500,-0.01,0.01);
2405 fHisPz2vP2In = new TH2F("HisPz2vP2In", "HisPz2vP2In",336,0,336,500,-0.0003,0.0003);
2406 fHisPz2vP2Out= new TH2F("HisPz2vP2Out","HisPz2vP2Out",336,0,336,500,-0.0002,0.0002);
2407 fHisPz3vP2IO = new TH2F("HisPz3vP2IO", "HisPz3vP2IO",336,0,336,500,-0.0002,0.0002);
2409 fHisNclIn->SetDirectory(0); //->Number of clusters inner
2410 fHisNclOut->SetDirectory(0); //->Number of clusters outer
2411 fHisNclIO->SetDirectory(0); //->Number of cluster inner outer
2412 fHisLclIn->SetDirectory(0); //->Level arm inner
2413 fHisLclOut->SetDirectory(0); //->Level arm outer
2414 fHisLclIO->SetDirectory(0); //->Number of cluster inner outer
2415 fHisdEdx->SetDirectory(0); //->Number of cluster inner outer
2416 fHisdZfit->SetDirectory(0); //->Number of cluster inner outer
2419 fHisChi2YIn1->SetDirectory(0); //->chi2 y inner - line
2420 fHisChi2YOut1->SetDirectory(0); //->chi2 y inner - line
2421 fHisChi2YIn2->SetDirectory(0); //->chi2 y inner - parabola
2422 fHisChi2YOut2->SetDirectory(0); //->chi2 y inner - parabola
2423 fHisChi2YIO1->SetDirectory(0); //->chi2 y IO - common
2424 fHisChi2ZIn1->SetDirectory(0); //->chi2 z inner - line
2425 fHisChi2ZOut1->SetDirectory(0); //->chi2 z inner - line
2426 fHisChi2ZIn2->SetDirectory(0); //->chi2 z inner - parabola
2427 fHisChi2ZOut2->SetDirectory(0); //->chi2 z inner - parabola
2428 fHisChi2ZIO1->SetDirectory(0); //->chi2 z IO - common
2431 fHisPy1vP0->SetDirectory(0); //-> delta y P0outer-P0inner - line
2432 fHisPy2vP0->SetDirectory(0); //-> delta y P0outer-P0inner - parabola
2433 fHisPy3vP0->SetDirectory(0); //-> delta y P0outer-P0inner - common parabola
2434 fHisPy1vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - line
2435 fHisPy2vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - parabola
2436 fHisPy3vP1->SetDirectory(0); //-> delta ky P1outer-P1inner - common parabola
2437 fHisPy2vP2In->SetDirectory(0); //-> Curv P2inner - parabola
2438 fHisPy2vP2Out->SetDirectory(0); //-> Curv P2outer - parabola
2439 fHisPy3vP2IO->SetDirectory(0); //-> Curv P2outerinner - common parabola
2442 fHisPz1vP0->SetDirectory(0); //-> delta z P0outer-P0inner - line
2443 fHisPz2vP0->SetDirectory(0); //-> delta z P0outer-P0inner - parabola
2444 fHisPz3vP0->SetDirectory(0); //-> delta z P0outer-P0inner - common parabola
2445 fHisPz1vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - line
2446 fHisPz2vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - parabola
2447 fHisPz3vP1->SetDirectory(0); //-> delta kz P1outer-P1inner - common parabola
2448 fHisPz2vP2In->SetDirectory(0); //-> Curv P2inner - parabola
2449 fHisPz2vP2Out->SetDirectory(0); //-> Curv P2outer - parabola
2450 fHisPz3vP2IO->SetDirectory(0); //-> Curv P2outerinner - common parabola
2456 for (Int_t id=0; id<336;id++){
2457 TH2F *profy = (TH2F*)fDeltaYres.UncheckedAt(id);
2458 TH2F *profz = (TH2F*)fDeltaZres.UncheckedAt(id);
2459 TH2F *profy2 = (TH2F*)fDeltaYres2.UncheckedAt(id);
2460 TH2F *profz2 = (TH2F*)fDeltaZres2.UncheckedAt(id);
2461 // TH2F *profy3 = (TH2F*)fDeltaYres3.UncheckedAt(id);
2462 //TH2F *profz3 = (TH2F*)fDeltaZres3.UncheckedAt(id);
2464 profy=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d -Linear",id),160,0,160,50,-0.5,0.5);
2465 profy->SetDirectory(0);
2466 fDeltaYres.AddAt(profy,id);
2467 profy2=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d -Parabolic",id),160,0,160,50,-0.5,0.5);
2468 profy2->SetDirectory(0);
2469 fDeltaYres2.AddAt(profy2,id);
2470 //profy3=new TH2F(Form("pry%03d",id),Form("Y Residuals for Laser Beam %03d- Parabolic2",id),160,0,160,100,-0.5,0.5);
2471 //profy3->SetDirectory(0);
2472 //fDeltaYres3.AddAt(profy3,id);
2475 profz=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d Linear",id),160,0,160,50,-0.5,0.5);
2476 profz->SetDirectory(0);
2477 fDeltaZres.AddAt(profz,id);
2478 profz2=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d - Parabolic",id),160,0,160,50,-0.5,0.5);
2479 profz2->SetDirectory(0);
2480 fDeltaZres2.AddAt(profz2,id);
2481 //profz3=new TH2F(Form("prz%03d",id),Form("Z Residuals for Laser Beam %03d- Parabolic2",id),160,0,160,100,-0.5,0.5);
2482 //profz3->SetDirectory(0);
2483 //fDeltaZres3.AddAt(profz3,id);
2488 for (Int_t id=0; id<336;id++){
2489 TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
2490 TH1F * hisP3 = (TH1F*)fDeltaP3.At(id);
2491 TH1F * hisP4 = (TH1F*)fDeltaP4.At(id);
2493 TH1F * hisdphi = (TH1F*)fDeltaPhi.At(id);
2494 TH1F * hisdphiP = (TH1F*)fDeltaPhiP.At(id);
2495 TH1F * hisSignal = (TH1F*)fSignals.At(id);
2498 hisdz = new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
2499 hisdz->SetDirectory(0);
2500 fDeltaZ.AddAt(hisdz,id);
2502 hisP3 = new TH1F(Form("hisPar3v%d",id),Form("hisPar3v%d",id),400,-0.06,0.06);
2503 hisP3->SetDirectory(0);
2504 fDeltaP3.AddAt(hisP3,id);
2506 hisP4 = new TH1F(Form("hisPar4v%d",id),Form("hisPar4v%d",id),200,-0.06,0.06);
2507 hisP4->SetDirectory(0);
2508 fDeltaP4.AddAt(hisP4,id);
2511 hisdphi = new TH1F(Form("hisdphi%d",id),Form("hisdphi%d",id),1000,-1,1);
2512 hisdphi->SetDirectory(0);
2513 fDeltaPhi.AddAt(hisdphi,id);
2515 hisdphiP = new TH1F(Form("hisdphiP%d",id),Form("hisdphiP%d",id),1000,-0.01,0.01);
2516 hisdphiP->SetDirectory(0);
2517 fDeltaPhiP.AddAt(hisdphiP,id);
2518 hisSignal = new TH1F(Form("hisSignal%d",id),Form("hisSignal%d",id),100,0,300);
2519 hisSignal->SetDirectory(0);
2520 fSignals.AddAt(hisSignal,id);
2525 void AliTPCcalibLaser::MergeFitHistos(AliTPCcalibLaser * laser){
2527 // Merge content of histograms
2529 // Only first histogram is checked - all other should be the same
2530 if (!laser->fHisNclIn) return; // empty histograms
2531 if (!fHisNclIn) MakeFitHistos();
2534 fHisNclIn->Add(laser->fHisNclIn ); //->Number of clusters inner
2535 fHisNclOut->Add(laser->fHisNclOut ); //->Number of clusters outer
2536 fHisNclIO->Add(laser->fHisNclIO ); //->Number of cluster inner outer
2537 fHisLclIn->Add(laser->fHisLclIn ); //->Level arm inner
2538 fHisLclOut->Add(laser->fHisLclOut ); //->Level arm outer
2539 fHisLclIO->Add(laser->fHisLclIO ); //->Number of cluster inner outer
2540 fHisdEdx->Add(laser->fHisdEdx ); //->dedx
2541 fHisdZfit->Add(laser->fHisdZfit ); //->dedx
2544 fHisChi2YIn1->Add(laser->fHisChi2YIn1 ); //->chi2 y inner - line
2545 fHisChi2YOut1->Add(laser->fHisChi2YOut1 ); //->chi2 y inner - line
2546 fHisChi2YIn2->Add(laser->fHisChi2YIn2 ); //->chi2 y inner - parabola
2547 fHisChi2YOut2->Add(laser->fHisChi2YOut2 ); //->chi2 y inner - parabola
2548 fHisChi2YIO1->Add(laser->fHisChi2YIO1 ); //->chi2 y IO - common
2549 fHisChi2ZIn1->Add(laser->fHisChi2ZIn1 ); //->chi2 z inner - line
2550 fHisChi2ZOut1->Add(laser->fHisChi2ZOut1 ); //->chi2 z inner - line
2551 fHisChi2ZIn2->Add(laser->fHisChi2ZIn2 ); //->chi2 z inner - parabola
2552 fHisChi2ZOut2->Add(laser->fHisChi2ZOut2 ); //->chi2 z inner - parabola
2553 fHisChi2ZIO1->Add(laser->fHisChi2ZIO1 ); //->chi2 z IO - common
2556 fHisPy1vP0->Add(laser->fHisPy1vP0 ); //-> delta y P0outer-P0inner - line
2557 fHisPy2vP0->Add(laser->fHisPy2vP0 ); //-> delta y P0outer-P0inner - parabola
2558 fHisPy3vP0->Add(laser->fHisPy3vP0 ); //-> delta y P0outer-P0inner - common parabola
2559 fHisPy1vP1->Add(laser->fHisPy1vP1 ); //-> delta ky P1outer-P1inner - line
2560 fHisPy2vP1->Add(laser->fHisPy2vP1 ); //-> delta ky P1outer-P1inner - parabola
2561 fHisPy3vP1->Add(laser->fHisPy3vP1 ); //-> delta ky P1outer-P1inner - common parabola
2562 fHisPy2vP2In->Add(laser-> fHisPy2vP2In ); //-> Curv P2inner - parabola
2563 fHisPy2vP2Out->Add(laser->fHisPy2vP2Out ); //-> Curv P2outer - parabola
2564 fHisPy3vP2IO->Add(laser->fHisPy3vP2IO ); //-> Curv P2outerinner - common parabola
2567 fHisPz1vP0->Add(laser->fHisPz1vP0 ); //-> delta z P0outer-P0inner - line
2568 fHisPz2vP0->Add(laser->fHisPz2vP0 ); //-> delta z P0outer-P0inner - parabola
2569 fHisPz3vP0->Add(laser->fHisPz3vP0 ); //-> delta z P0outer-P0inner - common parabola
2570 fHisPz1vP1->Add(laser->fHisPz1vP1 ); //-> delta kz P1outer-P1inner - line
2571 fHisPz2vP1->Add(laser->fHisPz2vP1 ); //-> delta kz P1outer-P1inner - parabola
2572 fHisPz3vP1->Add(laser->fHisPz3vP1 ); //-> delta kz P1outer-P1inner - common parabola
2573 fHisPz2vP2In->Add(laser->fHisPz2vP2In ); //-> Curv P2inner - parabola
2574 fHisPz2vP2Out->Add(laser->fHisPz2vP2Out ); //-> Curv P2outer - parabola
2575 fHisPz3vP2IO->Add(laser->fHisPz3vP2IO ); //-> Curv P2outerinner - common parabola
2588 void AliTPCcalibLaser::DumpFitInfo(TTree * chainFit,Int_t id){
2590 // Dump fit information - collect information from the streamers
2593 TChain * chainFit=0;
2594 TChain * chainTrack=0;
2597 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
2598 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+");
2599 AliXRDPROOFtoolkit tool;
2600 chainTrack = tool.MakeChain("laser.txt","Track",0,10200);
2601 chainTrack->Lookup();
2602 chainTrack->SetProof(kTRUE);
2603 chainDrift = tool.MakeChain("laser.txt","driftv",0,10200);
2604 chainDrift->Lookup();
2605 chainDrift->SetProof(kTRUE);
2607 chain = tool.MakeChain("laser.txt","Residuals",0,10200);
2609 chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
2611 chainFit->SetProof(kTRUE);
2612 chain->SetProof(kTRUE);
2613 AliTPCLaserTrack::LoadTracks();
2614 //AliTPCcalibLaser::DumpFitInfo(chainFit,0);
2620 TCut cutP3("abs(Tr.fP[3])<0.1");
2621 TCut cutP4("abs(Tr.fP[4])<0.5");
2622 TCut cutPx = cutP3+cutP4;
2623 TCut cutChi2YOut("sqrt(chi2y2Out*dEdx)<5&&chi2y2Out>0");
2624 TCut cutChi2ZOut("sqrt(chi2z2Out*dEdx)<5&&chi2z2Out>0");
2625 TCut cutChi2YIn("sqrt(chi2y2In*dEdx)<5&&chi2y2In>0");
2626 TCut cutChi2ZIn("sqrt(chi2z2In*dEdx)<5&&chi2z2In>0");
2628 TCut cutdEdx("sqrt(dEdx)>3");
2629 TCut cutDY("abs(yPol2In.fElements[2]*nclI*nclI/4.)<3");
2630 TCut cutN("nclO>20&&nclI>20");
2631 TCut cutA = cutChi2YOut+cutChi2ZOut+cutChi2YIn+cutChi2ZIn+cutN+cutdEdx+cutPx+"accept";
2635 TCut cutClY("abs(Cl[].fY-TrYpol2.fElements)<0.15");
2636 TCut cutClZ("abs(Cl[].fZ-TrZpol2.fElements)<0.15");
2637 TCut cutClX("abs(Cl[].fX)>10");
2638 TCut cutE("abs(Cl[].fY/Cl[].fX)<0.14");
2639 TCut cutSY("sqrt(Cl[].fSigmaY2)>0.05");
2640 TCut cutSZ("sqrt(Cl[].fSigmaZ2)>0.05");
2641 TCut cutQ("sqrt(Cl[].fMax)>4");
2642 TCut cutCl=cutClY+cutClZ+cutClX+cutE+cutSY+cutSZ+cutQ;
2646 TH1F * phisAccept = 0;
2648 TProfile * pdEdx = 0;
2656 TProfile * pNclI = 0;
2657 TProfile * pNclO = 0;
2659 TProfile * pchi2YIn =0;
2660 TProfile * pchi2ZIn =0;
2661 TProfile * pchi2YOut =0;
2662 TProfile * pchi2ZOut =0;
2663 TProfile * pchi2YInOut =0;
2664 TProfile * pchi2ZInOut =0;;
2666 chainFit->Draw("LTr.fId>>hisAl(350,0,350)","LTr.fId<350");
2667 phisAl = (TH1F*)gROOT->FindObject("hisAl");
2668 chainFit->Draw("LTr.fId>>hisAccept(350,0,350)","LTr.fId<350"+cutA);
2669 phisAccept = (TH1F*)gROOT->FindObject("hisAccept");
2670 chainFit->Draw("LTr.fId>>hisOut(350,0,350)","LTr.fId<350"+!cutA);
2671 phisOut = (TH1F*)gROOT->FindObject("hisOut");
2673 chainFit->Draw("sqrt(dEdx):LTr.fId>>hdEdx(350,0,350)","","prof");
2674 pdEdx = (TProfile*)gROOT->FindObject("hdEdx");
2677 chainFit->Draw("Tr.fP[0]:LTr.fId>>hP0(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2678 pP0 = (TProfile*)gROOT->FindObject("hP0");
2679 chainFit->Draw("Tr.fP[1]:LTr.fId>>hP1(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2680 pP1 = (TProfile*)gROOT->FindObject("hP1");
2681 chainFit->Draw("Tr.fP[2]:LTr.fId>>hP2(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2682 pP2 = (TProfile*)gROOT->FindObject("hP2");
2683 chainFit->Draw("Tr.fP[3]:LTr.fId>>hP3(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2684 pP3 = (TProfile*)gROOT->FindObject("hP3");
2685 chainFit->Draw("Tr.fP[4]:LTr.fId>>hP4(350,0,350)","Tr.fP[4]/sqrt(Tr.fC[14])<20"+cutA,"prof");
2686 pP4 = (TProfile*)gROOT->FindObject("hP4");
2688 chainFit->Draw("nclI:LTr.fId>>hNclI(350,0,350)","","prof");
2689 pNclI = (TProfile*)gROOT->FindObject("hNclI");
2690 chainFit->Draw("nclO:LTr.fId>>hNclO(350,0,350)","","prof");
2691 pNclO = (TProfile*)gROOT->FindObject("hNclO");
2694 chainFit->Draw("sqrt(chi2y2In):LTr.fId>>hChi2YIn(350,0,350)",cutA+"","prof");
2695 pchi2YIn = (TProfile*)gROOT->FindObject("hChi2YIn");
2696 chainFit->Draw("sqrt(chi2y2Out):LTr.fId>>hChi2YOut(350,0,350)",cutA+"","prof");
2697 pchi2YOut = (TProfile*)gROOT->FindObject("hChi2YOut");
2698 chainFit->Draw("sqrt(chi2yInOut):LTr.fId>>hChi2YInOut(350,0,350)",cutA+"","prof");
2699 pchi2YInOut = (TProfile*)gROOT->FindObject("hChi2YInOut");
2700 chainFit->Draw("sqrt(chi2z2In):LTr.fId>>hChi2ZIn(350,0,350)",cutA+"","prof");
2701 pchi2ZIn = (TProfile*)gROOT->FindObject("hChi2ZIn");
2702 chainFit->Draw("sqrt(chi2z2Out):LTr.fId>>hChi2ZOut(350,0,350)",cutA+"","prof");
2703 pchi2ZOut = (TProfile*)gROOT->FindObject("hChi2ZOut");
2704 chainFit->Draw("sqrt(chi2zInOut):LTr.fId>>hChi2ZInOut(350,0,350)",cutA+"","prof");
2705 pchi2ZInOut = (TProfile*)gROOT->FindObject("hChi2ZInOut");
2707 // second derivatives
2709 TH2F * phisPy2In = new TH2F("Py2Inner","Py2Inner",350,0,350,100,-0.001,0.001);
2710 chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>Py2Inner",cutA,"");
2711 TH2F * phisPy2Out = new TH2F("Py2Outer","Py2Outer",350,0,350,200,-0.0005,0.0005);
2712 chainFit->Draw("yPol2Out.fElements[2]:LTr.fId>>Py2Outer",cutA,"");
2713 TH2F * phisPy2InOut = new TH2F("Py2InOut","Py2InOut",350,0,350,200,-0.0005,0.0005);
2714 chainFit->Draw("yInOut.fElements[4]:LTr.fId>>Py2InOut",cutA,"");
2716 phisPy2In->FitSlicesY();
2717 TH1D * phisPy2InEntries = (TH1D*)gROOT->FindObject("Py2Inner_0");
2718 TH1D * phisPy2InMean = (TH1D*)gROOT->FindObject("Py2Inner_1");
2719 TH1D * phisPy2InSigma = (TH1D*)gROOT->FindObject("Py2Inner_2");
2721 phisPy2Out->FitSlicesY();
2722 TH1D * phisPy2OutEntries = (TH1D*)gROOT->FindObject("Py2Outer_0");
2723 TH1D * phisPy2OutMean = (TH1D*)gROOT->FindObject("Py2Outer_1");
2724 TH1D * phisPy2OutSigma = (TH1D*)gROOT->FindObject("Py2Outer_2");
2726 phisPy2InOut->FitSlicesY();
2727 TH1D * phisPy2InOutEntries = (TH1D*)gROOT->FindObject("Py2InOut_0");
2728 TH1D * phisPy2InOutMean = (TH1D*)gROOT->FindObject("Py2InOut_1");
2729 TH1D * phisPy2InOutSigma = (TH1D*)gROOT->FindObject("Py2InOut_2");
2731 TH2F * phisPz2In = new TH2F("Pz2Inner","Pz2Inner",350,0,350,100,-0.001,0.001);
2732 chainFit->Draw("zPol2In.fElements[2]:LTr.fId>>Pz2Inner",cutA,"");
2733 TH2F * phisPz2Out = new TH2F("Pz2Outer","Pz2Outer",350,0,350,200,-0.0005,0.0005);
2734 chainFit->Draw("zPol2Out.fElements[2]:LTr.fId>>Pz2Outer",cutA,"");
2735 TH2F * phisPz2InOut = new TH2F("Pz2InOut","Pz2InOut",350,0,350,200,-0.0005,0.0005);
2736 chainFit->Draw("zInOut.fElements[4]:LTr.fId>>Pz2InOut",cutA,"");
2738 phisPz2In->FitSlicesY();
2739 TH1D * phisPz2InEntries = (TH1D*)gROOT->FindObject("Pz2Inner_0");
2740 TH1D * phisPz2InMean = (TH1D*)gROOT->FindObject("Pz2Inner_1");
2741 TH1D * phisPz2InSigma = (TH1D*)gROOT->FindObject("Pz2Inner_2");
2743 phisPz2Out->FitSlicesY();
2744 TH1D * phisPz2OutEntries = (TH1D*)gROOT->FindObject("Pz2Outer_0");
2745 TH1D * phisPz2OutMean = (TH1D*)gROOT->FindObject("Pz2Outer_1");
2746 TH1D * phisPz2OutSigma = (TH1D*)gROOT->FindObject("Pz2Outer_2");
2748 phisPz2InOut->FitSlicesY();
2749 TH1D * phisPz2InOutEntries = (TH1D*)gROOT->FindObject("Pz2InOut_0");
2750 TH1D * phisPz2InOutMean = (TH1D*)gROOT->FindObject("Pz2InOut_1");
2751 TH1D * phisPz2InOutSigma = (TH1D*)gROOT->FindObject("Pz2InOut_2");
2758 TTreeSRedirector *pcstream = new TTreeSRedirector("vscan.root");
2759 for (Int_t ilaser=0; ilaser<336; ilaser++){
2760 Float_t all=phisAl->GetBinContent(ilaser+1);
2761 Float_t accept=phisAccept->GetBinContent(ilaser+1);
2762 Float_t out=phisOut->GetBinContent(ilaser+1);
2763 Float_t sdedx = pdEdx->GetBinContent(ilaser+1);
2764 Float_t mP0 = pP0->GetBinContent(ilaser+1);
2765 Float_t mP1 = pP1->GetBinContent(ilaser+1);
2766 Float_t mP2 = pP2->GetBinContent(ilaser+1);
2767 Float_t mP3 = pP3->GetBinContent(ilaser+1);
2768 Float_t mP4 = pP4->GetBinContent(ilaser+1);
2771 Float_t nclI = pNclI->GetBinContent(ilaser+1);
2772 Float_t nclO = pNclO->GetBinContent(ilaser+1);
2774 Float_t chi2YIn=pchi2YIn->GetBinContent(ilaser+1);
2775 Float_t chi2YOut=pchi2YOut->GetBinContent(ilaser+1);
2776 Float_t chi2YInOut=pchi2YInOut->GetBinContent(ilaser+1);
2777 Float_t chi2ZIn=pchi2ZIn->GetBinContent(ilaser+1);
2778 Float_t chi2ZOut=pchi2ZOut->GetBinContent(ilaser+1);
2779 Float_t chi2ZInOut=pchi2ZInOut->GetBinContent(ilaser+1);
2781 Float_t entriesPy2In = phisPy2InEntries->GetBinContent(ilaser+1);
2782 Float_t meanPy2In = phisPy2InMean->GetBinContent(ilaser+1);
2783 Float_t sigmaPy2In = phisPy2InSigma->GetBinContent(ilaser+1);
2785 Float_t entriesPy2Out = phisPy2OutEntries->GetBinContent(ilaser+1);
2786 Float_t meanPy2Out = phisPy2OutMean->GetBinContent(ilaser+1);
2787 Float_t sigmaPy2Out = phisPy2OutSigma->GetBinContent(ilaser+1);
2789 Float_t entriesPy2InOut = phisPy2InOutEntries->GetBinContent(ilaser+1);
2790 Float_t meanPy2InOut = phisPy2InOutMean->GetBinContent(ilaser+1);
2791 Float_t sigmaPy2InOut = phisPy2InOutSigma->GetBinContent(ilaser+1);
2793 Float_t entriesPz2In = phisPz2InEntries->GetBinContent(ilaser+1);
2794 Float_t meanPz2In = phisPz2InMean->GetBinContent(ilaser+1);
2795 Float_t sigmaPz2In = phisPz2InSigma->GetBinContent(ilaser+1);
2797 Float_t entriesPz2Out = phisPz2OutEntries->GetBinContent(ilaser+1);
2798 Float_t meanPz2Out = phisPz2OutMean->GetBinContent(ilaser+1);
2799 Float_t sigmaPz2Out = phisPz2OutSigma->GetBinContent(ilaser+1);
2801 Float_t entriesPz2InOut = phisPz2InOutEntries->GetBinContent(ilaser+1);
2802 Float_t meanPz2InOut = phisPz2InOutMean->GetBinContent(ilaser+1);
2803 Float_t sigmaPz2InOut = phisPz2InOutSigma->GetBinContent(ilaser+1);
2805 AliTPCLaserTrack* ltrp =(AliTPCLaserTrack*)AliTPCLaserTrack::GetTracks()->UncheckedAt(ilaser);
2806 (*pcstream)<<"Scan"<<
2820 "chi2YIn="<<chi2YIn<<
2821 "chi2YOut="<<chi2YOut<<
2822 "chi2YInOut="<<chi2YInOut<<
2823 "chi2ZIn="<<chi2ZIn<<
2824 "chi2ZOut="<<chi2ZOut<<
2825 "chi2ZInOut="<<chi2ZInOut<<
2827 "nPy2In="<<entriesPy2In<<
2828 "mPy2In="<<meanPy2In<<
2829 "sPy2In="<<sigmaPy2In<<
2831 "nPy2Out="<<entriesPy2Out<<
2832 "mPy2Out="<<meanPy2Out<<
2833 "sPy2Out="<<sigmaPy2Out<<
2835 "nPy2InOut="<<entriesPy2InOut<<
2836 "mPy2InOut="<<meanPy2InOut<<
2837 "sPy2InOut="<<sigmaPy2InOut<<
2839 "nPz2In="<<entriesPz2In<<
2840 "mPz2In="<<meanPz2In<<
2841 "sPz2In="<<sigmaPz2In<<
2843 "nPz2Out="<<entriesPz2Out<<
2844 "mPz2Out="<<meanPz2Out<<
2845 "sPz2Out="<<sigmaPz2Out<<
2847 "nPz2InOut="<<entriesPz2InOut<<
2848 "mPz2InOut="<<meanPz2InOut<<
2849 "sPz2InOut="<<sigmaPz2InOut<<
2856 TFile f("vscan.root");
2861 chain->Draw("Cl[].fPad-int(Cl[].fPad)",cutA+cutCl+"Cl[].fZ>0&&Cl[].fPad>1","",10000);
2863 chain->Draw("Cl[].fY-TrYpol1.fElements:Cl[].fPad-int(Cl[].fPad)",cutA+cutCl+"Cl[].fZ>0&&Cl[].fPad>1","prof",10000);
2866 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);
2869 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)
2878 // check edge effects
2879 chain->Draw("Cl.fY-TrYpol1.fElements:Cl.fY/Cl.fX",""+cutA+cutCl,"prof",10000)
2881 chain->Draw("Cl.fY-TrYpol2.fElements:Cl.fPad-int(Cl.fPad)","Cl.fZ>0"+cutA+cutCl+cutE,"prof",100000)
2883 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)
2887 chainFit->Draw("yInOut.fElements[4]:LTr.fP[2]","LTr.fP[1]<0"+cutA,"prof",1000);
2888 chainFit->Draw("yPol2In.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&<r.fP[1]<0"+cutA+cutD,"prof")
2899 dedge = sign(Cl.fY)*(Cl.fX*tan(pi/18)-abs(Cl.fY))
2902 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)
2904 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)
2910 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)
2912 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)
2916 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)
2918 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)
2927 chainFit->Draw("yPol2Out.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&<r.fP[1]<0"+cutA+cutDY,"prof")
2929 chainFit->Draw("yPol2In.fElements[2]*64*64/4.:LTr.fP[2]","nclI>20&<r.fP[1]<0"+cutA+cutDY,"prof")
2933 chainFit->Draw("LTr.fId","nclI>10",100000)
2935 chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>his(350,0,350,100,-0.002,0.002)","nclI>20","")
2937 chainFit->Draw("yPol2In.fElements[2]:LTr.fId>>hisPy2In0(350,0,350,100,-0.002,0.002)","nclI>20","");
2939 TH2 * phisPy2In = (TH2*) gROOT->FindObject("hisPy2In0")
2951 gSystem->Load("libSTAT.so")
2952 TStatToolkit toolkit;
2958 TCut cutA("entries>2&&pphi2<3&&abs(gphiP1-pphiP0)<0.003&&abs(gz1)<6");
2963 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz++"; //1
2964 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*LTr.fP[2]++"; //2
2965 fstring+="(abs(LTr.fP[1]/250)^1-1)*bz++"; //3
2966 fstring+="(abs(LTr.fP[1]/250)-1)*bz*LTr.fP[2]++"; //4
2968 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*sin(atan2(lx1,lx0))++" //5
2969 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*sin(atan2(lx1,lx0))*LTr.fP[2]++" //6
2970 fstring+="(abs(LTr.fP[1]/250)-1)*bz*sin(atan2(lx1,lx0))++" //7
2971 fstring+="(abs(LTr.fP[1]/250)-1)*bz*sin(atan2(lx1,lx0))*LTr.fP[2]++" //8
2973 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*cos(atan2(lx1,lx0))++" //9
2974 fstring+="(abs(LTr.fP[1]/250)^3-1)*bz*cos(atan2(lx1,lx0))*LTr.fP[2]++" //10
2975 fstring+="(abs(LTr.fP[1]/250)-1)*bz*cos(atan2(lx1,lx0))++" //11
2976 fstring+="(abs(LTr.fP[1]/250)-1)*bz*cos(atan2(lx1,lx0))*LTr.fP[2]++" //12
2981 TString *strq0 = toolkit.FitPlane(treeT,"gphi1-pphi0",fstring->Data(), "fSide==1"+cutA, chi2,npoints,fitParam,covMatrix);
2983 treeT->SetAlias("fit",strq0->Data());
2986 TString *strqP = toolkit.FitPlane(treeT,"1000*(gphiP1-pphiP0)",fstring->Data(), "fSide==1"+cutA, chi2,npoints,fitParam,covMatrix);
2988 treeT->SetAlias("fitP",strqP->Data());
2991 TString *strqDrift = toolkit.FitPlane(treeT,"gz1","LTr.fP[1]++(1-2*(fSide==1))++lx1", cutA, chi2,npoints,fitParam,covMatrix);
2992 treeT->SetAlias("fitD",strqDrift->Data());
2995 treeT->Draw("fit:LTr.fP[1]","abs(bz+0.4)<0.05"+cutA,"");
2997 for (Int_t i=0; i<6;i++){
2998 treeT->SetLineColor(i+2);
2999 treeT->SetMarkerSize(1);
3000 treeT->SetMarkerStyle(22+i);
3001 treeT->SetMarkerColor(i+2);
3003 treeT->Draw("fit:LTr.fP[1]",Form("abs(bz+0.4)<0.05&fRod==%d",i)+cutA,"same");
3011 TTree * tree = (TTree*)f.Get("FitModels");
3013 TEventList listLFit0("listLFit0","listLFit0");
3014 TEventList listLFit1("listLFit1","listLFit1");
3015 tree->Draw(">>listLFit0","seed.fdEdx<200&&seed.fdEdx>40");
3016 tree->SetEventList(&listLFit0);
3021 gSystem->Load("libSTAT.so")
3022 TStatToolkit toolkit;
3028 chain->SetAlias("dp","((Cl.fPad-int(Cl.fPad))*pi)");
3029 chain->SetAlias("dt","((Cl.fTimeBin-int(Cl.fTimeBin))*pi)");
3033 fstring+="cos(dp)++";
3034 fstring+="sin(dp)++";
3035 fstring+="cos(dt)++";
3036 fstring+="sin(dt)++";
3038 TString *str = toolkit.FitPlane(chain,"Cl.fZ-TrZInOut.fElements",fstring->Data(), "Cl.fDetector>35", chi2,npoints,fitParam,covMatrix,-1,0,200);
3051 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
3052 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
3053 AliXRDPROOFtoolkit tool;
3054 TChain * chainTrack = tool.MakeChain("laser.txt","Track",0,10200);
3055 chainTrack->Lookup();
3056 chainTrack->SetProof(kTRUE);
3058 TChain * chain = tool.MakeChain("laser.txt","Residuals",0,10200);
3060 TChain * chainFit = tool.MakeChain("laser.txt","FitModels",0,10200);
3062 chainFit->SetProof(kTRUE);
3063 chain->SetProof(kTRUE);
3067 TCut cutChi2YOut("sqrt(chi2y2Out*dEdx)<10");
3068 TCut cutChi2ZOut("sqrt(chi2z2Out*dEdx)<10");
3069 TCut cutChi2YIn("sqrt(chi2y2In*dEdx)<10");
3070 TCut cutChi2ZIn("sqrt(chi2z2In*dEdx)<10");
3072 TCut cutdEdx("sqrt(dEdx)<30&&sqrt(dEdx)>3");
3073 TCut cutDY("abs(yPol2In.fElements[2]*nclO*nclO/4.)<3")
3074 TCut cutN("nclO>20&&nclI>20");
3075 TCut cutA = cutChi2YOut+cutChi2ZOut+cutChi2YIn+cutChi2ZIn+cutN+cutdEdx;
3079 TCut cutClY("abs(Cl.fY-TrYpol2.fElements)<0.2");
3080 TCut cutClZ("abs(Cl.fZ-TrZpol2.fElements)<0.4");
3081 TCut cutClX("abs(Cl.fX)>10");
3082 TCut cutE("abs(Cl.fY/Cl.fX)<0.14");
3083 TCut cutCl=cutClY+cutClZ+cutClX;
3086 // check edge effects
3087 chain->Draw("Cl.fY-TrYpol1.fElements:Cl.fY/Cl.fX",""+cutA+cutCl,"prof",10000)
3089 chain->Draw("Cl.fY-TrYpol2.fElements:Cl.fPad-int(Cl.fPad)","Cl.fZ>0"+cutA+cutCl+cutE,"prof",100000)
3091 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)
3095 chainFit->Draw("yInOut.fElements[4]:LTr.fP[2]","LTr.fP[1]<0"+cutA,"prof",1000);
3096 chainFit->Draw("yPol2In.fElements[2]*90*90/4.:LTr.fP[2]","nclO>40&<r.fP[1]<0"+cutA+cutD,"prof")