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 **************************************************************************/
16 //--------------------------------------------------------------------//
18 // AliTOFtrackerV1 Class //
19 // Task: Perform association of the ESD tracks to TOF Clusters //
20 // and Update ESD track with associated TOF Cluster parameters //
22 // -- Authors : S. Arcelli, C. Zampolli (Bologna University and INFN) //
23 // -- Contacts: Annalisa.De.Caro@cern.ch //
24 // -- : Chiara.Zampolli@bo.infn.it //
25 // -- : Silvia.Arcelli@bo.infn.it //
27 //--------------------------------------------------------------------//
32 #include <TClonesArray.h>
37 #include <TSeqCollection.h>
39 #include "AliESDtrack.h"
40 #include "AliESDEvent.h"
42 #include "AliTrackPointArray.h"
43 #include "AliGeomManager.h"
44 #include "AliCDBManager.h"
46 #include "AliTOFcalib.h"
47 #include "AliTOFRecoParam.h"
48 #include "AliTOFcluster.h"
49 #include "AliTOFGeometry.h"
50 #include "AliTOFtrackerV1.h"
51 #include "AliTOFtrack.h"
52 #include "AliTOFpidESD.h"
56 ClassImp(AliTOFtrackerV1)
58 //_____________________________________________________________________________
59 AliTOFtrackerV1::AliTOFtrackerV1():
69 fTracks(new TClonesArray("AliTOFtrack")),
70 fSeeds(new TClonesArray("AliESDtrack")),
83 //AliTOFtrackerV1 main Ctor
85 // Read the reconstruction parameters from the OCDB
86 AliTOFcalib *calib = new AliTOFcalib();
87 fRecoParam = (AliTOFRecoParam*)calib->ReadRecParFromCDB("TOF/Calib",-1);
88 if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
90 parPID[0]=fRecoParam->GetTimeResolution();
91 parPID[1]=fRecoParam->GetTimeNSigma();
92 fPid=new AliTOFpidESD(parPID);
97 //_____________________________________________________________________________
98 AliTOFtrackerV1::AliTOFtrackerV1(const AliTOFtrackerV1 &t):
109 fTracks(new TClonesArray("AliTOFtrack")),
110 fSeeds(new TClonesArray("AliESDtrack")),
120 fHRecSigYVsPWin(0x0),
123 //AliTOFtrackerV1 copy Ctor
127 fNseedsTOF=t.fNseedsTOF;
128 fngoodmatch=t.fngoodmatch;
129 fnbadmatch=t.fnbadmatch;
130 fnunmatch=t.fnunmatch;
132 fRecoParam=t.fRecoParam;
139 //_____________________________________________________________________________
140 AliTOFtrackerV1& AliTOFtrackerV1::operator=(const AliTOFtrackerV1 &t)
142 //AliTOFtrackerV1 assignment operator
144 this->fNseeds=t.fNseeds;
145 this->fNseedsTOF=t.fNseedsTOF;
146 this->fngoodmatch=t.fngoodmatch;
147 this->fnbadmatch=t.fnbadmatch;
148 this->fnunmatch=t.fnunmatch;
149 this->fnmatch=t.fnmatch;
150 this->fRecoParam = t.fRecoParam;
152 this->fSeeds=t.fSeeds;
153 this->fTracks=t.fTracks;
158 //_____________________________________________________________________________
159 AliTOFtrackerV1::~AliTOFtrackerV1() {
166 if(!(AliCDBManager::Instance()->GetCacheFlag())){
172 delete fHDigClusTime;
179 delete fHRecSigYVsPWin;
180 delete fHRecSigZVsPWin;
192 //_____________________________________________________________________________
193 Int_t AliTOFtrackerV1::PropagateBack(AliESDEvent* event) {
195 // Gets seeds from ESD event and Match with TOF Clusters
199 //Initialise some counters
208 Int_t ntrk=event->GetNumberOfTracks();
210 TClonesArray &aESDTrack = *fSeeds;
213 //Load ESD tracks into a local Array of ESD Seeds
215 for (Int_t i=0; i<fNseeds; i++) {
216 AliESDtrack *t=event->GetTrack(i);
217 new(aESDTrack[i]) AliESDtrack(*t);
220 //Prepare ESD tracks candidates for TOF Matching
226 AliInfo(Form("Number of matched tracks: %d",fnmatch));
227 AliInfo(Form("Number of good matched tracks: %d",fngoodmatch));
228 AliInfo(Form("Number of bad matched tracks: %d",fnbadmatch));
230 //Update the matched ESD tracks
232 for (Int_t i=0; i<ntrk; i++) {
233 AliESDtrack *t=event->GetTrack(i);
234 AliESDtrack *seed =(AliESDtrack*)fSeeds->UncheckedAt(i);
235 if(seed->GetTOFsignal()>0){
236 t->SetTOFsignal(seed->GetTOFsignal());
237 t->SetTOFcluster(seed->GetTOFcluster());
238 t->SetTOFsignalToT(seed->GetTOFsignalToT());
239 t->SetTOFsignalRaw(seed->GetTOFsignalRaw());
240 t->SetTOFsignalDz(seed->GetTOFsignalDz());
241 t->SetTOFCalChannel(seed->GetTOFCalChannel());
242 Int_t tlab[3]; seed->GetTOFLabel(tlab);
243 t->SetTOFLabel(tlab);
244 AliTOFtrack *track = new AliTOFtrack(*seed);
245 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
250 //Handle Time Zero information
252 Double_t timeZero=0.;
253 Double_t timeZeroMax=99999.;
254 Bool_t usetimeZero = fRecoParam->UseTimeZero();
255 Bool_t timeZeroFromT0 = fRecoParam->GetTimeZerofromT0();
256 Bool_t timeZeroFromTOF = fRecoParam->GetTimeZerofromTOF();
258 AliDebug(1,Form("Use Time Zero?: %d",usetimeZero));
259 AliDebug(1,Form("Time Zero from T0? : %d",timeZeroFromT0));
260 AliDebug(1,Form("Time Zero From TOF? : %d",timeZeroFromTOF));
264 timeZero=GetTimeZerofromT0(event);
266 if(timeZeroFromTOF && (timeZero>timeZeroMax || !timeZeroFromT0)){
267 timeZero=GetTimeZerofromTOF(event);
270 AliDebug(2,Form("time Zero used in PID: %f",timeZero));
272 fPid->MakePID(event,timeZero);
279 //_________________________________________________________________________
280 void AliTOFtrackerV1::CollectESD() {
281 //prepare the set of ESD tracks to be matched to clusters in TOF
286 TClonesArray &aTOFTrack = *fTracks;
287 for (Int_t i=0; i<fNseeds; i++) {
289 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(i);
290 if ((t->GetStatus()&AliESDtrack::kTPCout)==0)continue;
292 // TRD 'good' tracks, already propagated at 372 cm
294 AliTOFtrack *track = new AliTOFtrack(*t); // New
295 Double_t x = track->GetX(); //New
297 if (((t->GetStatus()&AliESDtrack::kTRDout)!=0 ) &&
298 ( x >= AliTOFGeometry::RinTOF()) ){
299 track->SetSeedIndex(i);
300 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
301 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
307 // Propagate the rest of TPCbp
310 if(track->PropagateToInnerTOF()){
311 track->SetSeedIndex(i);
312 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
313 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
321 AliInfo(Form("Number of TOF seeds %i",fNseedsTOF));
322 AliInfo(Form("Number of TOF seeds Type 1 %i",seedsTOF1));
323 AliInfo(Form("Number of TOF seeds Type 2 %i",seedsTOF2));
325 // Sort according uncertainties on track position
329 //_________________________________________________________________________
330 void AliTOFtrackerV1::MatchTracks( ){
332 //Match ESD tracks to clusters in TOF
336 // Parameters regulating the reconstruction
337 Float_t dY=AliTOFGeometry::XPad();
338 Float_t dZ=AliTOFGeometry::ZPad();
340 const Int_t kncmax = 100;
341 Float_t sensRadius = fRecoParam->GetSensRadius();
342 Float_t scaleFact = fRecoParam->GetWindowScaleFact();
343 Float_t dyMax=fRecoParam->GetWindowSizeMaxY();
344 Float_t dzMax=fRecoParam->GetWindowSizeMaxZ();
345 Double_t maxChi2=fRecoParam->GetMaxChi2();
346 Bool_t timeWalkCorr = fRecoParam->GetTimeWalkCorr();
347 AliDebug(1,"++++++++++++++TOF Reconstruction Parameters:++++++++++++ \n");
348 AliDebug(1,Form("TOF sens radius: %f",sensRadius));
349 AliDebug(1,Form("TOF Window scale factor: %f",scaleFact));
350 AliDebug(1,Form("TOF Window max dy: %f",dyMax));
351 AliDebug(1,Form("TOF Window max dz: %f",dzMax));
352 AliDebug(1,Form("TOF Max Chi2: %f",maxChi2));
353 AliDebug(1,Form("Time Walk Correction? : %d",timeWalkCorr));
358 for (Int_t iseed=0; iseed<fNseedsTOF; iseed++) {
360 AliTOFtrack *track =(AliTOFtrack*)fTracks->UncheckedAt(iseed);
361 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(track->GetSeedIndex());
362 if(t->GetTOFsignal()>0. ) continue;
363 AliTOFtrack *trackTOFin =new AliTOFtrack(*track);
365 // Determine a window around the track
366 Double_t x,par[5]; trackTOFin->GetExternalParameters(x,par);
367 Double_t cov[15]; trackTOFin->GetExternalCovariance(cov);
370 Double_t dz = scaleFact*3.*TMath::Sqrt(cov[2]+dZ*dZ/12);
371 Double_t dphi = scaleFact*3.*TMath::Sqrt(cov[0]+dY*dY/12.)/sensRadius;
373 Double_t phi=TMath::ATan2(par[0],x) + trackTOFin->GetAlpha();
374 if (phi<-TMath::Pi())phi+=2*TMath::Pi();
375 if (phi>=TMath::Pi())phi-=2*TMath::Pi();
377 //upper limit on window's size.
378 if(dz> dzMax) dz=dzMax;
379 if(dphi*sensRadius> dyMax) dphi=dyMax/sensRadius;
382 // find the clusters inside the selected window
384 AliTOFcluster *clusters[kncmax]; // pointers to the clusters in the window
385 Int_t index[kncmax];//to keep track of the cluster index
386 for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
387 AliTOFcluster *c=fClusters[k];
389 if(c->GetZ() > z+dz) break;
390 if(c->IsUsed()) continue;
391 if(!c->GetStatus()) {
392 AliDebug(1,"Cluster in channel declared bad!");
393 continue; // skip bad channels as declared in OCDB
395 Float_t xyz[3]; c->GetGlobalXYZ(xyz);
396 Double_t clPhi=TMath::ATan2(xyz[1],xyz[0]);
397 Double_t dph=TMath::Abs(clPhi-phi);
398 if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
399 if (TMath::Abs(dph)>dphi) continue;
405 //start propagation: go to the average TOF pad middle plane at ~379.5 cm
407 Float_t xTOF = sensRadius;
408 Double_t ymax = xTOF*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
409 Bool_t skip = kFALSE;
410 Double_t ysect = trackTOFin->GetYat(xTOF,skip);
413 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
416 } else if (ysect <-ymax) {
417 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
421 if(!trackTOFin->PropagateTo(xTOF)) {
426 AliTOFcluster *bestCluster=0;
427 Double_t bestChi2=maxChi2;
429 for (Int_t i=0; i<nc; i++){
430 AliTOFcluster *c=clusters[i]; // one of the preselected clusters
431 Double_t chi2=trackTOFin->GetPredictedChi2((AliCluster3D*)c);
432 if (chi2 >= bestChi2) continue;
438 if (!bestCluster) { // no matching , go to the next track
446 AliDebug(2, Form("%7i %7i %10i %10i %10i %10i",
449 TMath::Abs(trackTOFin->GetLabel()),
450 bestCluster->GetLabel(0),
451 bestCluster->GetLabel(1),
452 bestCluster->GetLabel(2))); // AdC
456 (bestCluster->GetLabel(0)==TMath::Abs(trackTOFin->GetLabel()))
458 (bestCluster->GetLabel(1)==TMath::Abs(trackTOFin->GetLabel()))
460 (bestCluster->GetLabel(2)==TMath::Abs(trackTOFin->GetLabel()))
463 AliDebug(2,Form(" track label good %5i",trackTOFin->GetLabel()));
468 AliDebug(2,Form(" track label bad %5i",trackTOFin->GetLabel()));
471 //Propagate the track to the best matched cluster
472 trackTOFin->PropagateTo(bestCluster);
475 //now take the local distance in Z from the pad center for time walk correction
476 Float_t tiltangle = AliTOFGeometry::GetAngles(bestCluster->GetDetInd(1),bestCluster->GetDetInd(2))*TMath::DegToRad();
477 Double_t dzTW=trackTOFin->GetZ()-bestCluster->GetZ(); // in cm
478 dzTW/=TMath::Cos(tiltangle);
480 //update the ESD track and delete the TOFtrack
481 t->UpdateTrackParams(trackTOFin,AliESDtrack::kTOFout);
484 // Store quantities to be used in the TOF Calibration
485 Float_t tToT=AliTOFGeometry::ToTBinWidth()*bestCluster->GetToT()*1E-3; // in ns
486 t->SetTOFsignalToT(tToT);
487 Float_t rawTime=AliTOFGeometry::TdcBinWidth()*bestCluster->GetTDCRAW()+32; // RAW time,in ps
488 t->SetTOFsignalRaw(rawTime);
489 t->SetTOFsignalDz(dzTW);
490 AliDebug(2,Form(" Setting TOF raw time: %f z distance: %f time: %f = ",rawTime,dzTW));
492 ind[0]=bestCluster->GetDetInd(0);
493 ind[1]=bestCluster->GetDetInd(1);
494 ind[2]=bestCluster->GetDetInd(2);
495 ind[3]=bestCluster->GetDetInd(3);
496 ind[4]=bestCluster->GetDetInd(4);
497 Int_t calindex = AliTOFGeometry::GetIndex(ind);
498 t->SetTOFCalChannel(calindex);
500 // keep track of the track labels in the matched cluster
502 tlab[0]=bestCluster->GetLabel(0);
503 tlab[1]=bestCluster->GetLabel(1);
504 tlab[2]=bestCluster->GetLabel(2);
505 AliDebug(2,Form(" tdc time of the matched track %i = ",bestCluster->GetTDC()));
506 Double_t tof=AliTOFGeometry::TdcBinWidth()*bestCluster->GetTDC()+32; // in ps
507 AliDebug(2,Form(" tof time of the matched track: %f = ",tof));
508 Double_t tofcorr=tof;
509 if(timeWalkCorr)tofcorr=CorrectTimeWalk(dzTW,tof);
510 AliDebug(2,Form(" tof time of the matched track, after TW corr: %f = ",tofcorr));
511 //Set TOF time signal and pointer to the matched cluster
512 t->SetTOFsignal(tofcorr);
513 t->SetTOFcluster(idclus); // pointing to the recPoints tree
514 t->SetTOFLabel(tlab);
516 Double_t mom=t->GetP();
517 // Fill Reco-QA histos for Reconstruction
518 fHRecNClus->Fill(nc);
519 fHRecChi2->Fill(bestChi2);
520 fHRecDistZ->Fill(dzTW);
521 fHRecSigYVsP->Fill(mom,TMath::Sqrt(cov[0]));
522 fHRecSigZVsP->Fill(mom,TMath::Sqrt(cov[2]));
523 fHRecSigYVsPWin->Fill(mom,dphi*sensRadius);
524 fHRecSigZVsPWin->Fill(mom,dz);
526 // Fill Tree for on-the-fly offline Calibration
527 // no longer there - all info is in the ESDs now
532 //_________________________________________________________________________
533 Int_t AliTOFtrackerV1::LoadClusters(TTree *cTree) {
534 //--------------------------------------------------------------------
535 //This function loads the TOF clusters
536 //--------------------------------------------------------------------
538 Int_t npadX = AliTOFGeometry::NpadX();
539 Int_t npadZ = AliTOFGeometry::NpadZ();
540 Int_t nStripA = AliTOFGeometry::NStripA();
541 Int_t nStripB = AliTOFGeometry::NStripB();
542 Int_t nStripC = AliTOFGeometry::NStripC();
544 TBranch *branch=cTree->GetBranch("TOF");
546 AliError("can't get the branch with the TOF clusters !");
550 static TClonesArray dummy("AliTOFcluster",10000);
552 TClonesArray *clusters=&dummy;
553 branch->SetAddress(&clusters);
556 Int_t nc=clusters->GetEntriesFast();
557 fHDigNClus->Fill(nc);
559 AliInfo(Form("Number of clusters: %d",nc));
561 for (Int_t i=0; i<nc; i++) {
562 AliTOFcluster *c=(AliTOFcluster*)clusters->UncheckedAt(i);
563 fClusters[i]=new AliTOFcluster(*c); fN++;
565 // Fill Digits QA histos
567 Int_t isector = c->GetDetInd(0);
568 Int_t iplate = c->GetDetInd(1);
569 Int_t istrip = c->GetDetInd(2);
570 Int_t ipadX = c->GetDetInd(4);
571 Int_t ipadZ = c->GetDetInd(3);
573 Float_t time =(AliTOFGeometry::TdcBinWidth()*c->GetTDC())*1E-3; // in ns
574 Float_t tot = (AliTOFGeometry::TdcBinWidth()*c->GetToT())*1E-3;//in ns
576 Int_t stripOffset = 0;
582 stripOffset = nStripC;
585 stripOffset = nStripC+nStripB;
588 stripOffset = nStripC+nStripB+nStripA;
591 stripOffset = nStripC+nStripB+nStripA+nStripB;
594 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
597 Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1);
598 Int_t phiindex=npadX*isector+ipadX+1;
599 fHDigClusMap->Fill(zindex,phiindex);
600 fHDigClusTime->Fill(time);
601 fHDigClusToT->Fill(tot);
607 //_________________________________________________________________________
608 void AliTOFtrackerV1::UnloadClusters() {
609 //--------------------------------------------------------------------
610 //This function unloads TOF clusters
611 //--------------------------------------------------------------------
612 for (Int_t i=0; i<fN; i++) {
619 //_________________________________________________________________________
620 Int_t AliTOFtrackerV1::FindClusterIndex(Double_t z) const {
621 //--------------------------------------------------------------------
622 // This function returns the index of the nearest cluster
623 //--------------------------------------------------------------------
625 //Here we need to get the Z in the tracking system
628 if (z <= fClusters[0]->GetZ()) return 0;
629 if (z > fClusters[fN-1]->GetZ()) return fN;
630 Int_t b=0, e=fN-1, m=(b+e)/2;
631 for (; b<e; m=(b+e)/2) {
632 if (z > fClusters[m]->GetZ()) b=m+1;
638 //_________________________________________________________________________
639 Bool_t AliTOFtrackerV1::GetTrackPoint(Int_t index, AliTrackPoint& p) const
641 // Get track space point with index i
642 // Coordinates are in the global system
643 AliTOFcluster *cl = fClusters[index];
645 cl->GetGlobalXYZ(xyz);
646 Float_t phi=TMath::ATan2(xyz[1],xyz[0]);
647 Float_t phiangle = (Int_t(phi*TMath::RadToDeg()/20.)+0.5)*20.*TMath::DegToRad();
648 Float_t sinphi = TMath::Sin(phiangle), cosphi = TMath::Cos(phiangle);
649 Float_t tiltangle = AliTOFGeometry::GetAngles(cl->GetDetInd(1),cl->GetDetInd(2))*TMath::DegToRad();
650 Float_t sinth = TMath::Sin(tiltangle), costh = TMath::Cos(tiltangle);
651 Float_t sigmay2 = AliTOFGeometry::XPad()*AliTOFGeometry::XPad()/12.;
652 Float_t sigmaz2 = AliTOFGeometry::ZPad()*AliTOFGeometry::ZPad()/12.;
654 cov[0] = sinphi*sinphi*sigmay2 + cosphi*cosphi*sinth*sinth*sigmaz2;
655 cov[1] = -sinphi*cosphi*sigmay2 + sinphi*cosphi*sinth*sinth*sigmaz2;
656 cov[2] = -cosphi*sinth*costh*sigmaz2;
657 cov[3] = cosphi*cosphi*sigmay2 + sinphi*sinphi*sinth*sinth*sigmaz2;
658 cov[4] = -sinphi*sinth*costh*sigmaz2;
659 cov[5] = costh*costh*sigmaz2;
660 p.SetXYZ(xyz[0],xyz[1],xyz[2],cov);
662 // Detector numbering scheme
663 Int_t nSector = AliTOFGeometry::NSectors();
664 Int_t nPlate = AliTOFGeometry::NPlates();
665 Int_t nStripA = AliTOFGeometry::NStripA();
666 Int_t nStripB = AliTOFGeometry::NStripB();
667 Int_t nStripC = AliTOFGeometry::NStripC();
669 Int_t isector = cl->GetDetInd(0);
670 if (isector >= nSector)
671 AliError(Form("Wrong sector number in TOF (%d) !",isector));
672 Int_t iplate = cl->GetDetInd(1);
673 if (iplate >= nPlate)
674 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
675 Int_t istrip = cl->GetDetInd(2);
677 Int_t stripOffset = 0;
683 stripOffset = nStripC;
686 stripOffset = nStripC+nStripB;
689 stripOffset = nStripC+nStripB+nStripA;
692 stripOffset = nStripC+nStripB+nStripA+nStripB;
695 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
699 Int_t idet = (2*(nStripC+nStripB)+nStripA)*isector +
702 UShort_t volid = AliGeomManager::LayerToVolUID(AliGeomManager::kTOF,idet);
703 p.SetVolumeID((UShort_t)volid);
706 //_________________________________________________________________________
707 void AliTOFtrackerV1::InitCheckHists() {
709 //Init histos for Digits/Reco QA and Calibration
712 fHDigClusMap = new TH2F("TOFDig_ClusMap", "",182,0.5,182.5,864, 0.5,864.5);
713 fHDigNClus = new TH1F("TOFDig_NClus", "",200,0.5,200.5);
714 fHDigClusTime = new TH1F("TOFDig_ClusTime", "",2000,0.,200.);
715 fHDigClusToT = new TH1F("TOFDig_ClusToT", "",500,0.,100);
718 fHRecNClus =new TH1F("TOFRec_NClusW", "",50,0.5,50.5);
719 fHRecDistZ=new TH1F("TOFRec_DistZ", "",50,0.5,10.5);
720 fHRecChi2=new TH1F("TOFRec_Chi2", "",100,0.,10.);
721 fHRecSigYVsP=new TH2F("TOFDig_SigYVsP", "",40,0.,4.,100, 0.,5.);
722 fHRecSigZVsP=new TH2F("TOFDig_SigZVsP", "",40,0.,4.,100, 0.,5.);
723 fHRecSigYVsPWin=new TH2F("TOFDig_SigYVsPWin", "",40,0.,4.,100, 0.,50.);
724 fHRecSigZVsPWin=new TH2F("TOFDig_SigZVsPWin", "",40,0.,4.,100, 0.,50.);
727 //_________________________________________________________________________
728 void AliTOFtrackerV1::SaveCheckHists() {
730 //write histos for Digits/Reco QA and Calibration
732 TDirectory *dir = gDirectory;
734 TFile *logFileTOF = 0;
736 TSeqCollection *list = gROOT->GetListOfFiles();
737 int n = list->GetEntries();
738 for(int i=0; i<n; i++) {
739 logFile = (TFile*)list->At(i);
740 if (strstr(logFile->GetName(), "AliESDs.root")) break;
743 Bool_t isThere=kFALSE;
744 for(int i=0; i<n; i++) {
745 logFileTOF = (TFile*)list->At(i);
746 if (strstr(logFileTOF->GetName(), "TOFQA.root")){
753 fHDigClusMap->Write(fHDigClusMap->GetName(), TObject::kOverwrite);
754 fHDigNClus->Write(fHDigNClus->GetName(), TObject::kOverwrite);
755 fHDigClusTime->Write(fHDigClusTime->GetName(), TObject::kOverwrite);
756 fHDigClusToT->Write(fHDigClusToT->GetName(), TObject::kOverwrite);
757 fHRecNClus->Write(fHRecNClus->GetName(), TObject::kOverwrite);
758 fHRecChi2->Write(fHRecChi2->GetName(), TObject::kOverwrite);
759 fHRecDistZ->Write(fHRecDistZ->GetName(), TObject::kOverwrite);
760 fHRecSigYVsP->Write(fHRecSigYVsP->GetName(), TObject::kOverwrite);
761 fHRecSigZVsP->Write(fHRecSigZVsP->GetName(), TObject::kOverwrite);
762 fHRecSigYVsPWin->Write(fHRecSigYVsPWin->GetName(), TObject::kOverwrite);
763 fHRecSigZVsPWin->Write(fHRecSigZVsPWin->GetName(), TObject::kOverwrite);
766 if(!isThere)logFileTOF = new TFile( "TOFQA.root","RECREATE");
768 fHDigClusMap->Write(fHDigClusMap->GetName(), TObject::kOverwrite);
769 fHDigNClus->Write(fHDigNClus->GetName(), TObject::kOverwrite);
770 fHDigClusTime->Write(fHDigClusTime->GetName(), TObject::kOverwrite);
771 fHDigClusToT->Write(fHDigClusToT->GetName(), TObject::kOverwrite);
772 fHRecNClus->Write(fHRecNClus->GetName(), TObject::kOverwrite);
773 fHRecChi2->Write(fHRecChi2->GetName(), TObject::kOverwrite);
774 fHRecDistZ->Write(fHRecDistZ->GetName(), TObject::kOverwrite);
775 fHRecSigYVsP->Write(fHRecSigYVsP->GetName(), TObject::kOverwrite);
776 fHRecSigZVsP->Write(fHRecSigZVsP->GetName(), TObject::kOverwrite);
777 fHRecSigYVsPWin->Write(fHRecSigYVsPWin->GetName(), TObject::kOverwrite);
778 fHRecSigZVsPWin->Write(fHRecSigZVsPWin->GetName(), TObject::kOverwrite);
783 //_________________________________________________________________________
784 Float_t AliTOFtrackerV1::CorrectTimeWalk( Float_t dist, Float_t tof) {
786 //dummy, for the moment
788 if(dist<AliTOFGeometry::ZPad()*0.5){
790 //place here the actual correction
796 //_________________________________________________________________________
797 Float_t AliTOFtrackerV1::GetTimeZerofromT0(AliESDEvent *event) const {
799 //Returns TimeZero as measured by T0 detector
801 return event->GetT0();
803 //_________________________________________________________________________
804 Float_t AliTOFtrackerV1::GetTimeZerofromTOF(AliESDEvent * /*event*/) const {
806 //dummy, for the moment. T0 algorithm using tracks on TOF
808 //place T0 algo here...
812 //_________________________________________________________________________
814 void AliTOFtrackerV1::FillClusterArray(TObjArray* arr) const
817 // Returns the TOF cluster array
823 for (Int_t i=0; i<fN; ++i) arr->Add(fClusters[i]);