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(const AliTOFtrackerV1 &t):
100 fTracks(new TClonesArray("AliTOFtrack")),
101 fSeeds(new TClonesArray("AliESDtrack")),
111 fHRecSigYVsPWin(0x0),
114 //AliTOFtrackerV1 copy Ctor
118 fNseedsTOF=t.fNseedsTOF;
119 fngoodmatch=t.fngoodmatch;
120 fnbadmatch=t.fnbadmatch;
121 fnunmatch=t.fnunmatch;
123 fRecoParam=t.fRecoParam;
130 //_____________________________________________________________________________
131 AliTOFtrackerV1& AliTOFtrackerV1::operator=(const AliTOFtrackerV1 &t)
133 //AliTOFtrackerV1 assignment operator
135 this->fNseeds=t.fNseeds;
136 this->fNseedsTOF=t.fNseedsTOF;
137 this->fngoodmatch=t.fngoodmatch;
138 this->fnbadmatch=t.fnbadmatch;
139 this->fnunmatch=t.fnunmatch;
140 this->fnmatch=t.fnmatch;
141 this->fRecoParam = t.fRecoParam;
143 this->fSeeds=t.fSeeds;
144 this->fTracks=t.fTracks;
149 //_____________________________________________________________________________
150 AliTOFtrackerV1::~AliTOFtrackerV1() {
157 if(!(AliCDBManager::Instance()->GetCacheFlag())){
163 delete fHDigClusTime;
170 delete fHRecSigYVsPWin;
171 delete fHRecSigZVsPWin;
183 //_____________________________________________________________________________
184 Int_t AliTOFtrackerV1::PropagateBack(AliESDEvent* event) {
186 // Gets seeds from ESD event and Match with TOF Clusters
189 // initialize RecoParam for current event
191 AliInfo("Initializing params for TOF... ");
193 fRecoParam = AliTOFReconstructor::GetRecoParam(); // instantiate reco param from STEER...
194 if (fRecoParam == 0x0) {
195 AliFatal("No Reco Param found for TOF!!!");
197 //fRecoParam->Dump();
198 if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
200 parPID[0]=fRecoParam->GetTimeResolution();
201 parPID[1]=fRecoParam->GetTimeNSigma();
202 fPid=new AliTOFpidESD(parPID);
204 //Initialise some counters
213 Int_t ntrk=event->GetNumberOfTracks();
215 TClonesArray &aESDTrack = *fSeeds;
218 //Load ESD tracks into a local Array of ESD Seeds
220 for (Int_t i=0; i<fNseeds; i++) {
221 AliESDtrack *t=event->GetTrack(i);
222 new(aESDTrack[i]) AliESDtrack(*t);
225 //Prepare ESD tracks candidates for TOF Matching
231 AliInfo(Form("Number of matched tracks: %d",fnmatch));
232 AliInfo(Form("Number of good matched tracks: %d",fngoodmatch));
233 AliInfo(Form("Number of bad matched tracks: %d",fnbadmatch));
235 //Update the matched ESD tracks
237 for (Int_t i=0; i<ntrk; i++) {
238 AliESDtrack *t=event->GetTrack(i);
239 AliESDtrack *seed =(AliESDtrack*)fSeeds->UncheckedAt(i);
240 if(seed->GetTOFsignal()>0){
241 t->SetTOFsignal(seed->GetTOFsignal());
242 t->SetTOFcluster(seed->GetTOFcluster());
243 t->SetTOFsignalToT(seed->GetTOFsignalToT());
244 t->SetTOFsignalRaw(seed->GetTOFsignalRaw());
245 t->SetTOFsignalDz(seed->GetTOFsignalDz());
246 t->SetTOFCalChannel(seed->GetTOFCalChannel());
247 Int_t tlab[3]; seed->GetTOFLabel(tlab);
248 t->SetTOFLabel(tlab);
249 AliTOFtrack *track = new AliTOFtrack(*seed);
250 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
255 //Handle Time Zero information
257 Double_t timeZero=0.;
258 Double_t timeZeroMax=99999.;
259 Bool_t usetimeZero = fRecoParam->UseTimeZero();
260 Bool_t timeZeroFromT0 = fRecoParam->GetTimeZerofromT0();
261 Bool_t timeZeroFromTOF = fRecoParam->GetTimeZerofromTOF();
263 AliDebug(1,Form("Use Time Zero?: %d",usetimeZero));
264 AliDebug(1,Form("Time Zero from T0? : %d",timeZeroFromT0));
265 AliDebug(1,Form("Time Zero From TOF? : %d",timeZeroFromTOF));
269 timeZero=GetTimeZerofromT0(event);
271 if(timeZeroFromTOF && (timeZero>timeZeroMax || !timeZeroFromT0)){
272 timeZero=GetTimeZerofromTOF(event);
275 AliDebug(2,Form("time Zero used in PID: %f",timeZero));
277 fPid->MakePID(event,timeZero);
284 //_________________________________________________________________________
285 void AliTOFtrackerV1::CollectESD() {
286 //prepare the set of ESD tracks to be matched to clusters in TOF
291 TClonesArray &aTOFTrack = *fTracks;
292 for (Int_t i=0; i<fNseeds; i++) {
294 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(i);
295 if ((t->GetStatus()&AliESDtrack::kTPCout)==0)continue;
297 // TRD 'good' tracks, already propagated at 372 cm
299 AliTOFtrack *track = new AliTOFtrack(*t); // New
300 Double_t x = track->GetX(); //New
302 if (((t->GetStatus()&AliESDtrack::kTRDout)!=0 ) &&
303 ( x >= AliTOFGeometry::RinTOF()) ){
304 track->SetSeedIndex(i);
305 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
306 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
312 // Propagate the rest of TPCbp
315 if(track->PropagateToInnerTOF()){
316 track->SetSeedIndex(i);
317 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
318 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
326 AliInfo(Form("Number of TOF seeds %i",fNseedsTOF));
327 AliInfo(Form("Number of TOF seeds Type 1 %i",seedsTOF1));
328 AliInfo(Form("Number of TOF seeds Type 2 %i",seedsTOF2));
330 // Sort according uncertainties on track position
334 //_________________________________________________________________________
335 void AliTOFtrackerV1::MatchTracks( ){
337 //Match ESD tracks to clusters in TOF
341 // Parameters regulating the reconstruction
342 Float_t dY=AliTOFGeometry::XPad();
343 Float_t dZ=AliTOFGeometry::ZPad();
345 const Int_t kncmax = 100;
346 Float_t sensRadius = fRecoParam->GetSensRadius();
347 Float_t scaleFact = fRecoParam->GetWindowScaleFact();
348 Float_t dyMax=fRecoParam->GetWindowSizeMaxY();
349 Float_t dzMax=fRecoParam->GetWindowSizeMaxZ();
350 Double_t maxChi2=fRecoParam->GetMaxChi2();
351 Bool_t timeWalkCorr = fRecoParam->GetTimeWalkCorr();
352 AliDebug(1,"++++++++++++++TOF Reconstruction Parameters:++++++++++++ \n");
353 AliDebug(1,Form("TOF sens radius: %f",sensRadius));
354 AliDebug(1,Form("TOF Window scale factor: %f",scaleFact));
355 AliDebug(1,Form("TOF Window max dy: %f",dyMax));
356 AliDebug(1,Form("TOF Window max dz: %f",dzMax));
357 AliDebug(1,Form("TOF Max Chi2: %f",maxChi2));
358 AliDebug(1,Form("Time Walk Correction? : %d",timeWalkCorr));
363 for (Int_t iseed=0; iseed<fNseedsTOF; iseed++) {
365 AliTOFtrack *track =(AliTOFtrack*)fTracks->UncheckedAt(iseed);
366 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(track->GetSeedIndex());
367 if(t->GetTOFsignal()>0. ) continue;
368 AliTOFtrack *trackTOFin =new AliTOFtrack(*track);
370 // Determine a window around the track
371 Double_t x,par[5]; trackTOFin->GetExternalParameters(x,par);
372 Double_t cov[15]; trackTOFin->GetExternalCovariance(cov);
375 Double_t dz = scaleFact*3.*TMath::Sqrt(cov[2]+dZ*dZ/12.);
376 Double_t dphi = scaleFact*3.*TMath::Sqrt(cov[0]+dY*dY/12.)/sensRadius;
378 Double_t phi=TMath::ATan2(par[0],x) + trackTOFin->GetAlpha();
379 if (phi<-TMath::Pi())phi+=2*TMath::Pi();
380 if (phi>=TMath::Pi())phi-=2*TMath::Pi();
382 //upper limit on window's size.
383 if(dz> dzMax) dz=dzMax;
384 if(dphi*sensRadius> dyMax) dphi=dyMax/sensRadius;
387 // find the clusters inside the selected window
389 AliTOFcluster *clusters[kncmax]; // pointers to the clusters in the window
390 Int_t index[kncmax];//to keep track of the cluster index
391 for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
392 AliTOFcluster *c=fClusters[k];
394 if(c->GetZ() > z+dz) break;
395 if(c->IsUsed()) continue;
396 if(!c->GetStatus()) {
397 AliDebug(1,"Cluster in channel declared bad!");
398 continue; // skip bad channels as declared in OCDB
400 Float_t xyz[3]; c->GetGlobalXYZ(xyz);
401 Double_t clPhi=TMath::ATan2(xyz[1],xyz[0]);
402 Double_t dph=TMath::Abs(clPhi-phi);
403 if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
404 if (TMath::Abs(dph)>dphi) continue;
410 //start propagation: go to the average TOF pad middle plane at ~379.5 cm
412 Float_t xTOF = sensRadius;
413 Double_t ymax = xTOF*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
414 Bool_t skip = kFALSE;
415 Double_t ysect = trackTOFin->GetYat(xTOF,skip);
418 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
421 } else if (ysect <-ymax) {
422 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
426 if(!trackTOFin->PropagateTo(xTOF)) {
431 AliTOFcluster *bestCluster=0;
432 Double_t bestChi2=maxChi2;
434 for (Int_t i=0; i<nc; i++){
435 AliTOFcluster *c=clusters[i]; // one of the preselected clusters
436 Double_t chi2=trackTOFin->GetPredictedChi2((AliCluster3D*)c);
437 if (chi2 >= bestChi2) continue;
443 if (!bestCluster) { // no matching , go to the next track
451 AliDebug(2, Form("%7i %7i %10i %10i %10i %10i %7i",
454 TMath::Abs(trackTOFin->GetLabel()),
455 bestCluster->GetLabel(0),
456 bestCluster->GetLabel(1),
457 bestCluster->GetLabel(2),
462 (bestCluster->GetLabel(0)==TMath::Abs(trackTOFin->GetLabel()))
464 (bestCluster->GetLabel(1)==TMath::Abs(trackTOFin->GetLabel()))
466 (bestCluster->GetLabel(2)==TMath::Abs(trackTOFin->GetLabel()))
469 AliDebug(2,Form(" track label good %5i",trackTOFin->GetLabel()));
474 AliDebug(2,Form(" track label bad %5i",trackTOFin->GetLabel()));
477 //Propagate the track to the best matched cluster
478 trackTOFin->PropagateTo(bestCluster);
481 //now take the local distance in Z from the pad center for time walk correction
482 Float_t tiltangle = AliTOFGeometry::GetAngles(bestCluster->GetDetInd(1),bestCluster->GetDetInd(2))*TMath::DegToRad();
483 Double_t dzTW=trackTOFin->GetZ()-bestCluster->GetZ(); // in cm
484 dzTW/=TMath::Cos(tiltangle);
486 //update the ESD track and delete the TOFtrack
487 t->UpdateTrackParams(trackTOFin,AliESDtrack::kTOFout);
490 // Store quantities to be used in the TOF Calibration
491 Float_t tToT=AliTOFGeometry::ToTBinWidth()*bestCluster->GetToT()*1E-3; // in ns
492 t->SetTOFsignalToT(tToT);
493 Float_t rawTime=AliTOFGeometry::TdcBinWidth()*bestCluster->GetTDCRAW()+32; // RAW time,in ps
494 t->SetTOFsignalRaw(rawTime);
495 t->SetTOFsignalDz(dzTW);
496 AliDebug(2,Form(" Setting TOF raw time: %f z distance: %f time: %f = ",rawTime,dzTW));
498 ind[0]=bestCluster->GetDetInd(0);
499 ind[1]=bestCluster->GetDetInd(1);
500 ind[2]=bestCluster->GetDetInd(2);
501 ind[3]=bestCluster->GetDetInd(3);
502 ind[4]=bestCluster->GetDetInd(4);
503 Int_t calindex = AliTOFGeometry::GetIndex(ind);
504 t->SetTOFCalChannel(calindex);
506 // keep track of the track labels in the matched cluster
508 tlab[0]=bestCluster->GetLabel(0);
509 tlab[1]=bestCluster->GetLabel(1);
510 tlab[2]=bestCluster->GetLabel(2);
511 AliDebug(2,Form(" tdc time of the matched track %i = ",bestCluster->GetTDC()));
512 Double_t tof=AliTOFGeometry::TdcBinWidth()*bestCluster->GetTDC()+32; // in ps
513 AliDebug(2,Form(" tof time of the matched track: %f = ",tof));
514 Double_t tofcorr=tof;
515 if(timeWalkCorr)tofcorr=CorrectTimeWalk(dzTW,tof);
516 AliDebug(2,Form(" tof time of the matched track, after TW corr: %f = ",tofcorr));
517 //Set TOF time signal and pointer to the matched cluster
518 t->SetTOFsignal(tofcorr);
519 t->SetTOFcluster(idclus); // pointing to the recPoints tree
520 t->SetTOFLabel(tlab);
522 Double_t mom=t->GetP();
523 // Fill Reco-QA histos for Reconstruction
524 fHRecNClus->Fill(nc);
525 fHRecChi2->Fill(bestChi2);
526 fHRecDistZ->Fill(dzTW);
527 fHRecSigYVsP->Fill(mom,TMath::Sqrt(cov[0]));
528 fHRecSigZVsP->Fill(mom,TMath::Sqrt(cov[2]));
529 fHRecSigYVsPWin->Fill(mom,dphi*sensRadius);
530 fHRecSigZVsPWin->Fill(mom,dz);
532 // Fill Tree for on-the-fly offline Calibration
533 // no longer there - all info is in the ESDs now
538 //_________________________________________________________________________
539 Int_t AliTOFtrackerV1::LoadClusters(TTree *cTree) {
540 //--------------------------------------------------------------------
541 //This function loads the TOF clusters
542 //--------------------------------------------------------------------
544 Int_t npadX = AliTOFGeometry::NpadX();
545 Int_t npadZ = AliTOFGeometry::NpadZ();
546 Int_t nStripA = AliTOFGeometry::NStripA();
547 Int_t nStripB = AliTOFGeometry::NStripB();
548 Int_t nStripC = AliTOFGeometry::NStripC();
550 TBranch *branch=cTree->GetBranch("TOF");
552 AliError("can't get the branch with the TOF clusters !");
556 static TClonesArray dummy("AliTOFcluster",10000);
558 TClonesArray *clusters=&dummy;
559 branch->SetAddress(&clusters);
562 Int_t nc=clusters->GetEntriesFast();
563 fHDigNClus->Fill(nc);
565 AliInfo(Form("Number of clusters: %d",nc));
567 for (Int_t i=0; i<nc; i++) {
568 AliTOFcluster *c=(AliTOFcluster*)clusters->UncheckedAt(i);
569 fClusters[i]=new AliTOFcluster(*c); fN++;
571 // Fill Digits QA histos
573 Int_t isector = c->GetDetInd(0);
574 Int_t iplate = c->GetDetInd(1);
575 Int_t istrip = c->GetDetInd(2);
576 Int_t ipadX = c->GetDetInd(4);
577 Int_t ipadZ = c->GetDetInd(3);
579 Float_t time =(AliTOFGeometry::TdcBinWidth()*c->GetTDC())*1E-3; // in ns
580 Float_t tot = (AliTOFGeometry::TdcBinWidth()*c->GetToT())*1E-3;//in ns
582 Int_t stripOffset = 0;
588 stripOffset = nStripC;
591 stripOffset = nStripC+nStripB;
594 stripOffset = nStripC+nStripB+nStripA;
597 stripOffset = nStripC+nStripB+nStripA+nStripB;
600 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
603 Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1);
604 Int_t phiindex=npadX*isector+ipadX+1;
605 fHDigClusMap->Fill(zindex,phiindex);
606 fHDigClusTime->Fill(time);
607 fHDigClusToT->Fill(tot);
613 //_________________________________________________________________________
614 void AliTOFtrackerV1::UnloadClusters() {
615 //--------------------------------------------------------------------
616 //This function unloads TOF clusters
617 //--------------------------------------------------------------------
618 for (Int_t i=0; i<fN; i++) {
625 //_________________________________________________________________________
626 Int_t AliTOFtrackerV1::FindClusterIndex(Double_t z) const {
627 //--------------------------------------------------------------------
628 // This function returns the index of the nearest cluster
629 //--------------------------------------------------------------------
631 //Here we need to get the Z in the tracking system
634 if (z <= fClusters[0]->GetZ()) return 0;
635 if (z > fClusters[fN-1]->GetZ()) return fN;
636 Int_t b=0, e=fN-1, m=(b+e)/2;
637 for (; b<e; m=(b+e)/2) {
638 if (z > fClusters[m]->GetZ()) b=m+1;
644 //_________________________________________________________________________
645 Bool_t AliTOFtrackerV1::GetTrackPoint(Int_t index, AliTrackPoint& p) const
647 // Get track space point with index i
648 // Coordinates are in the global system
649 AliTOFcluster *cl = fClusters[index];
651 cl->GetGlobalXYZ(xyz);
652 Float_t phi=TMath::ATan2(xyz[1],xyz[0]);
653 Float_t phiangle = (Int_t(phi*TMath::RadToDeg()/20.)+0.5)*20.*TMath::DegToRad();
654 Float_t sinphi = TMath::Sin(phiangle), cosphi = TMath::Cos(phiangle);
655 Float_t tiltangle = AliTOFGeometry::GetAngles(cl->GetDetInd(1),cl->GetDetInd(2))*TMath::DegToRad();
656 Float_t sinth = TMath::Sin(tiltangle), costh = TMath::Cos(tiltangle);
657 Float_t sigmay2 = AliTOFGeometry::XPad()*AliTOFGeometry::XPad()/12.;
658 Float_t sigmaz2 = AliTOFGeometry::ZPad()*AliTOFGeometry::ZPad()/12.;
660 cov[0] = sinphi*sinphi*sigmay2 + cosphi*cosphi*sinth*sinth*sigmaz2;
661 cov[1] = -sinphi*cosphi*sigmay2 + sinphi*cosphi*sinth*sinth*sigmaz2;
662 cov[2] = -cosphi*sinth*costh*sigmaz2;
663 cov[3] = cosphi*cosphi*sigmay2 + sinphi*sinphi*sinth*sinth*sigmaz2;
664 cov[4] = -sinphi*sinth*costh*sigmaz2;
665 cov[5] = costh*costh*sigmaz2;
666 p.SetXYZ(xyz[0],xyz[1],xyz[2],cov);
668 // Detector numbering scheme
669 Int_t nSector = AliTOFGeometry::NSectors();
670 Int_t nPlate = AliTOFGeometry::NPlates();
671 Int_t nStripA = AliTOFGeometry::NStripA();
672 Int_t nStripB = AliTOFGeometry::NStripB();
673 Int_t nStripC = AliTOFGeometry::NStripC();
675 Int_t isector = cl->GetDetInd(0);
676 if (isector >= nSector)
677 AliError(Form("Wrong sector number in TOF (%d) !",isector));
678 Int_t iplate = cl->GetDetInd(1);
679 if (iplate >= nPlate)
680 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
681 Int_t istrip = cl->GetDetInd(2);
683 Int_t stripOffset = 0;
689 stripOffset = nStripC;
692 stripOffset = nStripC+nStripB;
695 stripOffset = nStripC+nStripB+nStripA;
698 stripOffset = nStripC+nStripB+nStripA+nStripB;
701 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
705 Int_t idet = (2*(nStripC+nStripB)+nStripA)*isector +
708 UShort_t volid = AliGeomManager::LayerToVolUID(AliGeomManager::kTOF,idet);
709 p.SetVolumeID((UShort_t)volid);
712 //_________________________________________________________________________
713 void AliTOFtrackerV1::InitCheckHists() {
715 //Init histos for Digits/Reco QA and Calibration
717 TDirectory *dir = gDirectory;
718 TFile *logFileTOF = 0;
720 TSeqCollection *list = gROOT->GetListOfFiles();
721 int n = list->GetEntries();
722 Bool_t isThere=kFALSE;
723 for(int i=0; i<n; i++) {
724 logFileTOF = (TFile*)list->At(i);
725 if (strstr(logFileTOF->GetName(), "TOFQA.root")){
731 if(!isThere)logFileTOF = new TFile( "TOFQA.root","RECREATE");
735 fHDigClusMap = new TH2F("TOFDig_ClusMap", "",182,0.5,182.5,864, 0.5,864.5);
736 fHDigNClus = new TH1F("TOFDig_NClus", "",200,0.5,200.5);
737 fHDigClusTime = new TH1F("TOFDig_ClusTime", "",2000,0.,200.);
738 fHDigClusToT = new TH1F("TOFDig_ClusToT", "",500,0.,100);
741 fHRecNClus =new TH1F("TOFRec_NClusW", "",50,0.5,50.5);
742 fHRecDistZ=new TH1F("TOFRec_DistZ", "",50,0.5,10.5);
743 fHRecChi2=new TH1F("TOFRec_Chi2", "",100,0.,10.);
744 fHRecSigYVsP=new TH2F("TOFDig_SigYVsP", "",40,0.,4.,100, 0.,5.);
745 fHRecSigZVsP=new TH2F("TOFDig_SigZVsP", "",40,0.,4.,100, 0.,5.);
746 fHRecSigYVsPWin=new TH2F("TOFDig_SigYVsPWin", "",40,0.,4.,100, 0.,50.);
747 fHRecSigZVsPWin=new TH2F("TOFDig_SigZVsPWin", "",40,0.,4.,100, 0.,50.);
753 //_________________________________________________________________________
754 void AliTOFtrackerV1::SaveCheckHists() {
756 //write histos for Digits/Reco QA and Calibration
758 TDirectory *dir = gDirectory;
760 TFile *logFileTOF = 0;
762 TSeqCollection *list = gROOT->GetListOfFiles();
763 int n = list->GetEntries();
764 for(int i=0; i<n; i++) {
765 logFile = (TFile*)list->At(i);
766 if (strstr(logFile->GetName(), "AliESDs.root")) break;
769 Bool_t isThere=kFALSE;
770 for(int i=0; i<n; i++) {
771 logFileTOF = (TFile*)list->At(i);
772 if (strstr(logFileTOF->GetName(), "TOFQA.root")){
779 AliError(Form("File TOFQA.root not found!! not wring histograms...."));
783 fHDigClusMap->Write(fHDigClusMap->GetName(), TObject::kOverwrite);
784 fHDigNClus->Write(fHDigNClus->GetName(), TObject::kOverwrite);
785 fHDigClusTime->Write(fHDigClusTime->GetName(), TObject::kOverwrite);
786 fHDigClusToT->Write(fHDigClusToT->GetName(), TObject::kOverwrite);
787 fHRecNClus->Write(fHRecNClus->GetName(), TObject::kOverwrite);
788 fHRecChi2->Write(fHRecChi2->GetName(), TObject::kOverwrite);
789 fHRecDistZ->Write(fHRecDistZ->GetName(), TObject::kOverwrite);
790 fHRecSigYVsP->Write(fHRecSigYVsP->GetName(), TObject::kOverwrite);
791 fHRecSigZVsP->Write(fHRecSigZVsP->GetName(), TObject::kOverwrite);
792 fHRecSigYVsPWin->Write(fHRecSigYVsPWin->GetName(), TObject::kOverwrite);
793 fHRecSigZVsPWin->Write(fHRecSigZVsPWin->GetName(), TObject::kOverwrite);
799 //_________________________________________________________________________
800 Float_t AliTOFtrackerV1::CorrectTimeWalk( Float_t dist, Float_t tof) {
802 //dummy, for the moment
804 if(dist<AliTOFGeometry::ZPad()*0.5){
806 //place here the actual correction
812 //_________________________________________________________________________
813 Float_t AliTOFtrackerV1::GetTimeZerofromT0(AliESDEvent *event) const {
815 //Returns TimeZero as measured by T0 detector
817 return event->GetT0();
819 //_________________________________________________________________________
820 Float_t AliTOFtrackerV1::GetTimeZerofromTOF(AliESDEvent * /*event*/) const {
822 //dummy, for the moment. T0 algorithm using tracks on TOF
824 //place T0 algo here...
828 //_________________________________________________________________________
830 void AliTOFtrackerV1::FillClusterArray(TObjArray* arr) const
833 // Returns the TOF cluster array
839 for (Int_t i=0; i<fN; ++i) arr->Add(fClusters[i]);