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 "AliTOFRecoParam.h"
47 #include "AliTOFReconstructor.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
88 //_____________________________________________________________________________
89 AliTOFtrackerV1::~AliTOFtrackerV1() {
96 if(!(AliCDBManager::Instance()->GetCacheFlag())){
102 delete fHDigClusTime;
109 delete fHRecSigYVsPWin;
110 delete fHRecSigZVsPWin;
122 //_____________________________________________________________________________
123 Int_t AliTOFtrackerV1::PropagateBack(AliESDEvent* event) {
125 // Gets seeds from ESD event and Match with TOF Clusters
128 // initialize RecoParam for current event
130 AliInfo("Initializing params for TOF... ");
132 fRecoParam = AliTOFReconstructor::GetRecoParam(); // instantiate reco param from STEER...
134 if (fRecoParam == 0x0) {
135 AliFatal("No Reco Param found for TOF!!!");
137 //fRecoParam->Dump();
138 //if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
139 //fRecoParam->PrintParameters();
142 parPID[0]=fRecoParam->GetTimeResolution();
143 parPID[1]=fRecoParam->GetTimeNSigma();
144 fPid=new AliTOFpidESD(parPID);
146 //Initialise some counters
155 Int_t ntrk=event->GetNumberOfTracks();
157 TClonesArray &aESDTrack = *fSeeds;
160 //Load ESD tracks into a local Array of ESD Seeds
162 for (Int_t i=0; i<fNseeds; i++) {
163 AliESDtrack *t=event->GetTrack(i);
164 new(aESDTrack[i]) AliESDtrack(*t);
167 //Prepare ESD tracks candidates for TOF Matching
173 AliInfo(Form("Number of matched tracks: %d",fnmatch));
174 AliInfo(Form("Number of good matched tracks: %d",fngoodmatch));
175 AliInfo(Form("Number of bad matched tracks: %d",fnbadmatch));
177 //Update the matched ESD tracks
179 for (Int_t i=0; i<ntrk; i++) {
180 AliESDtrack *t=event->GetTrack(i);
181 AliESDtrack *seed =(AliESDtrack*)fSeeds->UncheckedAt(i);
182 if(seed->GetTOFsignal()>0){
183 t->SetTOFsignal(seed->GetTOFsignal());
184 t->SetTOFcluster(seed->GetTOFcluster());
185 t->SetTOFsignalToT(seed->GetTOFsignalToT());
186 t->SetTOFsignalRaw(seed->GetTOFsignalRaw());
187 t->SetTOFsignalDz(seed->GetTOFsignalDz());
188 t->SetTOFCalChannel(seed->GetTOFCalChannel());
189 Int_t tlab[3]; seed->GetTOFLabel(tlab);
190 t->SetTOFLabel(tlab);
191 AliTOFtrack *track = new AliTOFtrack(*seed);
192 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
197 //Handle Time Zero information
199 Double_t timeZero=0.;
200 Double_t timeZeroMax=99999.;
201 Bool_t usetimeZero = fRecoParam->UseTimeZero();
202 Bool_t timeZeroFromT0 = fRecoParam->GetTimeZerofromT0();
203 Bool_t timeZeroFromTOF = fRecoParam->GetTimeZerofromTOF();
205 AliDebug(1,Form("Use Time Zero?: %d",usetimeZero));
206 AliDebug(1,Form("Time Zero from T0? : %d",timeZeroFromT0));
207 AliDebug(1,Form("Time Zero From TOF? : %d",timeZeroFromTOF));
211 timeZero=GetTimeZerofromT0(event);
213 if(timeZeroFromTOF && (timeZero>timeZeroMax || !timeZeroFromT0)){
214 timeZero=GetTimeZerofromTOF(event);
217 AliDebug(2,Form("time Zero used in PID: %f",timeZero));
219 fPid->MakePID(event,timeZero);
226 //_________________________________________________________________________
227 void AliTOFtrackerV1::CollectESD() {
228 //prepare the set of ESD tracks to be matched to clusters in TOF
233 TClonesArray &aTOFTrack = *fTracks;
234 for (Int_t i=0; i<fNseeds; i++) {
236 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(i);
237 if ((t->GetStatus()&AliESDtrack::kTPCout)==0)continue;
239 // TRD 'good' tracks, already propagated at 372 cm
241 AliTOFtrack *track = new AliTOFtrack(*t); // New
242 Double_t x = track->GetX(); //New
244 if (((t->GetStatus()&AliESDtrack::kTRDout)!=0 ) &&
245 ( x >= AliTOFGeometry::RinTOF()) ){
246 track->SetSeedIndex(i);
247 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
248 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
254 // Propagate the rest of TPCbp
257 if(track->PropagateToInnerTOF()){
258 track->SetSeedIndex(i);
259 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
260 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
268 AliInfo(Form("Number of TOF seeds %i",fNseedsTOF));
269 AliInfo(Form("Number of TOF seeds Type 1 %i",seedsTOF1));
270 AliInfo(Form("Number of TOF seeds Type 2 %i",seedsTOF2));
272 // Sort according uncertainties on track position
276 //_________________________________________________________________________
277 void AliTOFtrackerV1::MatchTracks( ){
279 //Match ESD tracks to clusters in TOF
283 // Parameters regulating the reconstruction
284 Float_t dY=AliTOFGeometry::XPad();
285 Float_t dZ=AliTOFGeometry::ZPad();
287 const Int_t kncmax = 100;
288 Float_t sensRadius = fRecoParam->GetSensRadius();
289 Float_t scaleFact = fRecoParam->GetWindowScaleFact();
290 Float_t dyMax=fRecoParam->GetWindowSizeMaxY();
291 Float_t dzMax=fRecoParam->GetWindowSizeMaxZ();
292 Double_t maxChi2=fRecoParam->GetMaxChi2();
293 Bool_t timeWalkCorr = fRecoParam->GetTimeWalkCorr();
294 AliDebug(1,"++++++++++++++TOF Reconstruction Parameters:++++++++++++ \n");
295 AliDebug(1,Form("TOF sens radius: %f",sensRadius));
296 AliDebug(1,Form("TOF Window scale factor: %f",scaleFact));
297 AliDebug(1,Form("TOF Window max dy: %f",dyMax));
298 AliDebug(1,Form("TOF Window max dz: %f",dzMax));
299 AliDebug(1,Form("TOF Max Chi2: %f",maxChi2));
300 AliDebug(1,Form("Time Walk Correction? : %d",timeWalkCorr));
305 for (Int_t iseed=0; iseed<fNseedsTOF; iseed++) {
307 AliTOFtrack *track =(AliTOFtrack*)fTracks->UncheckedAt(iseed);
308 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(track->GetSeedIndex());
309 if(t->GetTOFsignal()>0. ) continue;
310 AliTOFtrack *trackTOFin =new AliTOFtrack(*track);
312 // Determine a window around the track
313 Double_t x,par[5]; trackTOFin->GetExternalParameters(x,par);
314 Double_t cov[15]; trackTOFin->GetExternalCovariance(cov);
317 Double_t dz = scaleFact*3.*TMath::Sqrt(cov[2]+dZ*dZ/12.);
318 Double_t dphi = scaleFact*3.*TMath::Sqrt(cov[0]+dY*dY/12.)/sensRadius;
320 Double_t phi=TMath::ATan2(par[0],x) + trackTOFin->GetAlpha();
321 if (phi<-TMath::Pi())phi+=2*TMath::Pi();
322 if (phi>=TMath::Pi())phi-=2*TMath::Pi();
324 //upper limit on window's size.
325 if(dz> dzMax) dz=dzMax;
326 if(dphi*sensRadius> dyMax) dphi=dyMax/sensRadius;
329 // find the clusters inside the selected window
331 AliTOFcluster *clusters[kncmax]; // pointers to the clusters in the window
332 Int_t index[kncmax];//to keep track of the cluster index
333 for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
334 AliTOFcluster *c=fClusters[k];
335 // if(nc>kncmax)break; /* R+ fix (buffer overflow) */
336 if(nc>=kncmax)break; /* R+ fix (buffer overflow protection) */
337 if(c->GetZ() > z+dz) break;
338 if(c->IsUsed()) continue;
339 if(!c->GetStatus()) {
340 AliDebug(1,"Cluster in channel declared bad!");
341 continue; // skip bad channels as declared in OCDB
343 Float_t xyz[3]; c->GetGlobalXYZ(xyz);
344 Double_t clPhi=TMath::ATan2(xyz[1],xyz[0]);
345 Double_t dph=TMath::Abs(clPhi-phi);
346 if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
347 if (TMath::Abs(dph)>dphi) continue;
353 //start propagation: go to the average TOF pad middle plane at ~379.5 cm
355 Float_t xTOF = sensRadius;
356 Double_t ymax = xTOF*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
357 Bool_t skip = kFALSE;
358 Double_t ysect = trackTOFin->GetYat(xTOF,skip);
361 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
364 } else if (ysect <-ymax) {
365 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
369 if(!trackTOFin->PropagateTo(xTOF)) {
374 AliTOFcluster *bestCluster=0;
375 Double_t bestChi2=maxChi2;
377 // for (Int_t i=0; i<nc; i++){ /* R+ fix (unsafe) */
378 for (Int_t i=0; i<nc && i<kncmax; i++){ /* R+ fix (buffer overflow protection) */
379 AliTOFcluster *c=clusters[i]; // one of the preselected clusters
380 Double_t chi2=trackTOFin->GetPredictedChi2((AliCluster3D*)c);
381 if (chi2 >= bestChi2) continue;
387 if (!bestCluster) { // no matching , go to the next track
395 AliDebug(2, Form("%7i %7i %10i %10i %10i %10i %7i",
398 TMath::Abs(trackTOFin->GetLabel()),
399 bestCluster->GetLabel(0),
400 bestCluster->GetLabel(1),
401 bestCluster->GetLabel(2),
406 (bestCluster->GetLabel(0)==TMath::Abs(trackTOFin->GetLabel()))
408 (bestCluster->GetLabel(1)==TMath::Abs(trackTOFin->GetLabel()))
410 (bestCluster->GetLabel(2)==TMath::Abs(trackTOFin->GetLabel()))
413 AliDebug(2,Form(" track label good %5i",trackTOFin->GetLabel()));
418 AliDebug(2,Form(" track label bad %5i",trackTOFin->GetLabel()));
421 //Propagate the track to the best matched cluster
422 trackTOFin->PropagateTo(bestCluster);
425 //now take the local distance in Z from the pad center for time walk correction
426 Float_t tiltangle = AliTOFGeometry::GetAngles(bestCluster->GetDetInd(1),bestCluster->GetDetInd(2))*TMath::DegToRad();
427 Double_t dzTW=trackTOFin->GetZ()-bestCluster->GetZ(); // in cm
428 dzTW/=TMath::Cos(tiltangle);
430 //update the ESD track and delete the TOFtrack
431 t->UpdateTrackParams(trackTOFin,AliESDtrack::kTOFout);
434 // Store quantities to be used in the TOF Calibration
435 Float_t tToT=AliTOFGeometry::ToTBinWidth()*bestCluster->GetToT()*1E-3; // in ns
436 t->SetTOFsignalToT(tToT);
437 Float_t rawTime=AliTOFGeometry::TdcBinWidth()*bestCluster->GetTDCRAW()+32; // RAW time,in ps
438 t->SetTOFsignalRaw(rawTime);
439 t->SetTOFsignalDz(dzTW);
440 AliDebug(2,Form(" Setting TOF raw time: %f z distance: %f time: %f = ",rawTime,dzTW));
442 ind[0]=bestCluster->GetDetInd(0);
443 ind[1]=bestCluster->GetDetInd(1);
444 ind[2]=bestCluster->GetDetInd(2);
445 ind[3]=bestCluster->GetDetInd(3);
446 ind[4]=bestCluster->GetDetInd(4);
447 Int_t calindex = AliTOFGeometry::GetIndex(ind);
448 t->SetTOFCalChannel(calindex);
450 // keep track of the track labels in the matched cluster
452 tlab[0]=bestCluster->GetLabel(0);
453 tlab[1]=bestCluster->GetLabel(1);
454 tlab[2]=bestCluster->GetLabel(2);
455 AliDebug(2,Form(" tdc time of the matched track %i = ",bestCluster->GetTDC()));
456 Double_t tof=AliTOFGeometry::TdcBinWidth()*bestCluster->GetTDC()+32; // in ps
457 AliDebug(2,Form(" tof time of the matched track: %f = ",tof));
458 Double_t tofcorr=tof;
459 if(timeWalkCorr)tofcorr=CorrectTimeWalk(dzTW,tof);
460 AliDebug(2,Form(" tof time of the matched track, after TW corr: %f = ",tofcorr));
461 //Set TOF time signal and pointer to the matched cluster
462 t->SetTOFsignal(tofcorr);
463 t->SetTOFcluster(idclus); // pointing to the recPoints tree
464 t->SetTOFLabel(tlab);
466 Double_t mom=t->GetP();
467 // Fill Reco-QA histos for Reconstruction
468 fHRecNClus->Fill(nc);
469 fHRecChi2->Fill(bestChi2);
470 fHRecDistZ->Fill(dzTW);
471 fHRecSigYVsP->Fill(mom,TMath::Sqrt(cov[0]));
472 fHRecSigZVsP->Fill(mom,TMath::Sqrt(cov[2]));
473 fHRecSigYVsPWin->Fill(mom,dphi*sensRadius);
474 fHRecSigZVsPWin->Fill(mom,dz);
476 // Fill Tree for on-the-fly offline Calibration
477 // no longer there - all info is in the ESDs now
482 //_________________________________________________________________________
483 Int_t AliTOFtrackerV1::LoadClusters(TTree *cTree) {
484 //--------------------------------------------------------------------
485 //This function loads the TOF clusters
486 //--------------------------------------------------------------------
488 Int_t npadX = AliTOFGeometry::NpadX();
489 Int_t npadZ = AliTOFGeometry::NpadZ();
490 Int_t nStripA = AliTOFGeometry::NStripA();
491 Int_t nStripB = AliTOFGeometry::NStripB();
492 Int_t nStripC = AliTOFGeometry::NStripC();
494 TBranch *branch=cTree->GetBranch("TOF");
496 AliError("can't get the branch with the TOF clusters !");
500 static TClonesArray dummy("AliTOFcluster",10000);
502 TClonesArray *clusters=&dummy;
503 branch->SetAddress(&clusters);
506 Int_t nc=clusters->GetEntriesFast();
507 fHDigNClus->Fill(nc);
509 AliInfo(Form("Number of clusters: %d",nc));
511 for (Int_t i=0; i<nc; i++) {
512 AliTOFcluster *c=(AliTOFcluster*)clusters->UncheckedAt(i);
513 fClusters[i]=new AliTOFcluster(*c); fN++;
515 // Fill Digits QA histos
517 Int_t isector = c->GetDetInd(0);
518 Int_t iplate = c->GetDetInd(1);
519 Int_t istrip = c->GetDetInd(2);
520 Int_t ipadX = c->GetDetInd(4);
521 Int_t ipadZ = c->GetDetInd(3);
523 Float_t time =(AliTOFGeometry::TdcBinWidth()*c->GetTDC())*1E-3; // in ns
524 Float_t tot = (AliTOFGeometry::TdcBinWidth()*c->GetToT())*1E-3;//in ns
526 Int_t stripOffset = 0;
532 stripOffset = nStripC;
535 stripOffset = nStripC+nStripB;
538 stripOffset = nStripC+nStripB+nStripA;
541 stripOffset = nStripC+nStripB+nStripA+nStripB;
544 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
547 Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1);
548 Int_t phiindex=npadX*isector+ipadX+1;
549 fHDigClusMap->Fill(zindex,phiindex);
550 fHDigClusTime->Fill(time);
551 fHDigClusToT->Fill(tot);
557 //_________________________________________________________________________
558 void AliTOFtrackerV1::UnloadClusters() {
559 //--------------------------------------------------------------------
560 //This function unloads TOF clusters
561 //--------------------------------------------------------------------
562 for (Int_t i=0; i<fN; i++) {
569 //_________________________________________________________________________
570 Int_t AliTOFtrackerV1::FindClusterIndex(Double_t z) const {
571 //--------------------------------------------------------------------
572 // This function returns the index of the nearest cluster
573 //--------------------------------------------------------------------
575 //Here we need to get the Z in the tracking system
578 if (z <= fClusters[0]->GetZ()) return 0;
579 if (z > fClusters[fN-1]->GetZ()) return fN;
580 Int_t b=0, e=fN-1, m=(b+e)/2;
581 for (; b<e; m=(b+e)/2) {
582 if (z > fClusters[m]->GetZ()) b=m+1;
588 //_________________________________________________________________________
589 Bool_t AliTOFtrackerV1::GetTrackPoint(Int_t index, AliTrackPoint& p) const
591 // Get track space point with index i
592 // Coordinates are in the global system
593 AliTOFcluster *cl = fClusters[index];
595 cl->GetGlobalXYZ(xyz);
596 Float_t phi=TMath::ATan2(xyz[1],xyz[0]);
597 Float_t phiangle = (Int_t(phi*TMath::RadToDeg()/20.)+0.5)*20.*TMath::DegToRad();
598 Float_t sinphi = TMath::Sin(phiangle), cosphi = TMath::Cos(phiangle);
599 Float_t tiltangle = AliTOFGeometry::GetAngles(cl->GetDetInd(1),cl->GetDetInd(2))*TMath::DegToRad();
600 Float_t sinth = TMath::Sin(tiltangle), costh = TMath::Cos(tiltangle);
601 Float_t sigmay2 = AliTOFGeometry::XPad()*AliTOFGeometry::XPad()/12.;
602 Float_t sigmaz2 = AliTOFGeometry::ZPad()*AliTOFGeometry::ZPad()/12.;
604 cov[0] = sinphi*sinphi*sigmay2 + cosphi*cosphi*sinth*sinth*sigmaz2;
605 cov[1] = -sinphi*cosphi*sigmay2 + sinphi*cosphi*sinth*sinth*sigmaz2;
606 cov[2] = -cosphi*sinth*costh*sigmaz2;
607 cov[3] = cosphi*cosphi*sigmay2 + sinphi*sinphi*sinth*sinth*sigmaz2;
608 cov[4] = -sinphi*sinth*costh*sigmaz2;
609 cov[5] = costh*costh*sigmaz2;
610 p.SetXYZ(xyz[0],xyz[1],xyz[2],cov);
612 // Detector numbering scheme
613 Int_t nSector = AliTOFGeometry::NSectors();
614 Int_t nPlate = AliTOFGeometry::NPlates();
615 Int_t nStripA = AliTOFGeometry::NStripA();
616 Int_t nStripB = AliTOFGeometry::NStripB();
617 Int_t nStripC = AliTOFGeometry::NStripC();
619 Int_t isector = cl->GetDetInd(0);
620 if (isector >= nSector)
621 AliError(Form("Wrong sector number in TOF (%d) !",isector));
622 Int_t iplate = cl->GetDetInd(1);
623 if (iplate >= nPlate)
624 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
625 Int_t istrip = cl->GetDetInd(2);
627 Int_t stripOffset = 0;
633 stripOffset = nStripC;
636 stripOffset = nStripC+nStripB;
639 stripOffset = nStripC+nStripB+nStripA;
642 stripOffset = nStripC+nStripB+nStripA+nStripB;
645 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
649 Int_t idet = (2*(nStripC+nStripB)+nStripA)*isector +
652 UShort_t volid = AliGeomManager::LayerToVolUID(AliGeomManager::kTOF,idet);
653 p.SetVolumeID((UShort_t)volid);
656 //_________________________________________________________________________
657 void AliTOFtrackerV1::InitCheckHists() {
659 //Init histos for Digits/Reco QA and Calibration
661 TDirectory *dir = gDirectory;
662 TFile *logFileTOF = 0;
664 TSeqCollection *list = gROOT->GetListOfFiles();
665 int n = list->GetEntries();
666 Bool_t isThere=kFALSE;
667 for(int i=0; i<n; i++) {
668 logFileTOF = (TFile*)list->At(i);
669 if (strstr(logFileTOF->GetName(), "TOFQA.root")){
675 if(!isThere)logFileTOF = new TFile( "TOFQA.root","RECREATE");
679 fHDigClusMap = new TH2F("TOFDig_ClusMap", "",182,0.5,182.5,864, 0.5,864.5);
680 fHDigNClus = new TH1F("TOFDig_NClus", "",200,0.5,200.5);
681 fHDigClusTime = new TH1F("TOFDig_ClusTime", "",2000,0.,200.);
682 fHDigClusToT = new TH1F("TOFDig_ClusToT", "",500,0.,100);
685 fHRecNClus =new TH1F("TOFRec_NClusW", "",50,0.5,50.5);
686 fHRecDistZ=new TH1F("TOFRec_DistZ", "",50,0.5,10.5);
687 fHRecChi2=new TH1F("TOFRec_Chi2", "",100,0.,10.);
688 fHRecSigYVsP=new TH2F("TOFDig_SigYVsP", "",40,0.,4.,100, 0.,5.);
689 fHRecSigZVsP=new TH2F("TOFDig_SigZVsP", "",40,0.,4.,100, 0.,5.);
690 fHRecSigYVsPWin=new TH2F("TOFDig_SigYVsPWin", "",40,0.,4.,100, 0.,50.);
691 fHRecSigZVsPWin=new TH2F("TOFDig_SigZVsPWin", "",40,0.,4.,100, 0.,50.);
697 //_________________________________________________________________________
698 void AliTOFtrackerV1::SaveCheckHists() {
700 //write histos for Digits/Reco QA and Calibration
702 TDirectory *dir = gDirectory;
704 TFile *logFileTOF = 0;
706 TSeqCollection *list = gROOT->GetListOfFiles();
707 int n = list->GetEntries();
708 for(int i=0; i<n; i++) {
709 logFile = (TFile*)list->At(i);
710 if (strstr(logFile->GetName(), "AliESDs.root")) break;
713 Bool_t isThere=kFALSE;
714 for(int i=0; i<n; i++) {
715 logFileTOF = (TFile*)list->At(i);
716 if (strstr(logFileTOF->GetName(), "TOFQA.root")){
723 AliError(Form("File TOFQA.root not found!! not wring histograms...."));
727 fHDigClusMap->Write(fHDigClusMap->GetName(), TObject::kOverwrite);
728 fHDigNClus->Write(fHDigNClus->GetName(), TObject::kOverwrite);
729 fHDigClusTime->Write(fHDigClusTime->GetName(), TObject::kOverwrite);
730 fHDigClusToT->Write(fHDigClusToT->GetName(), TObject::kOverwrite);
731 fHRecNClus->Write(fHRecNClus->GetName(), TObject::kOverwrite);
732 fHRecChi2->Write(fHRecChi2->GetName(), TObject::kOverwrite);
733 fHRecDistZ->Write(fHRecDistZ->GetName(), TObject::kOverwrite);
734 fHRecSigYVsP->Write(fHRecSigYVsP->GetName(), TObject::kOverwrite);
735 fHRecSigZVsP->Write(fHRecSigZVsP->GetName(), TObject::kOverwrite);
736 fHRecSigYVsPWin->Write(fHRecSigYVsPWin->GetName(), TObject::kOverwrite);
737 fHRecSigZVsPWin->Write(fHRecSigZVsPWin->GetName(), TObject::kOverwrite);
743 //_________________________________________________________________________
744 Float_t AliTOFtrackerV1::CorrectTimeWalk( Float_t dist, Float_t tof) {
746 //dummy, for the moment
748 if(dist<AliTOFGeometry::ZPad()*0.5){
750 //place here the actual correction
756 //_________________________________________________________________________
757 Float_t AliTOFtrackerV1::GetTimeZerofromT0(AliESDEvent *event) const {
759 //Returns TimeZero as measured by T0 detector
761 return event->GetT0();
763 //_________________________________________________________________________
764 Float_t AliTOFtrackerV1::GetTimeZerofromTOF(AliESDEvent * /*event*/) const {
766 //dummy, for the moment. T0 algorithm using tracks on TOF
768 //place T0 algo here...
772 //_________________________________________________________________________
774 void AliTOFtrackerV1::FillClusterArray(TObjArray* arr) const
777 // Returns the TOF cluster array
783 for (Int_t i=0; i<fN; ++i) arr->Add(fClusters[i]);