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...
195 if (fRecoParam == 0x0) {
196 AliFatal("No Reco Param found for TOF!!!");
198 //fRecoParam->Dump();
199 if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
200 //fRecoParam->PrintParameters();
203 parPID[0]=fRecoParam->GetTimeResolution();
204 parPID[1]=fRecoParam->GetTimeNSigma();
205 fPid=new AliTOFpidESD(parPID);
207 //Initialise some counters
216 Int_t ntrk=event->GetNumberOfTracks();
218 TClonesArray &aESDTrack = *fSeeds;
221 //Load ESD tracks into a local Array of ESD Seeds
223 for (Int_t i=0; i<fNseeds; i++) {
224 AliESDtrack *t=event->GetTrack(i);
225 new(aESDTrack[i]) AliESDtrack(*t);
228 //Prepare ESD tracks candidates for TOF Matching
234 AliInfo(Form("Number of matched tracks: %d",fnmatch));
235 AliInfo(Form("Number of good matched tracks: %d",fngoodmatch));
236 AliInfo(Form("Number of bad matched tracks: %d",fnbadmatch));
238 //Update the matched ESD tracks
240 for (Int_t i=0; i<ntrk; i++) {
241 AliESDtrack *t=event->GetTrack(i);
242 AliESDtrack *seed =(AliESDtrack*)fSeeds->UncheckedAt(i);
243 if(seed->GetTOFsignal()>0){
244 t->SetTOFsignal(seed->GetTOFsignal());
245 t->SetTOFcluster(seed->GetTOFcluster());
246 t->SetTOFsignalToT(seed->GetTOFsignalToT());
247 t->SetTOFsignalRaw(seed->GetTOFsignalRaw());
248 t->SetTOFsignalDz(seed->GetTOFsignalDz());
249 t->SetTOFCalChannel(seed->GetTOFCalChannel());
250 Int_t tlab[3]; seed->GetTOFLabel(tlab);
251 t->SetTOFLabel(tlab);
252 AliTOFtrack *track = new AliTOFtrack(*seed);
253 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
258 //Handle Time Zero information
260 Double_t timeZero=0.;
261 Double_t timeZeroMax=99999.;
262 Bool_t usetimeZero = fRecoParam->UseTimeZero();
263 Bool_t timeZeroFromT0 = fRecoParam->GetTimeZerofromT0();
264 Bool_t timeZeroFromTOF = fRecoParam->GetTimeZerofromTOF();
266 AliDebug(1,Form("Use Time Zero?: %d",usetimeZero));
267 AliDebug(1,Form("Time Zero from T0? : %d",timeZeroFromT0));
268 AliDebug(1,Form("Time Zero From TOF? : %d",timeZeroFromTOF));
272 timeZero=GetTimeZerofromT0(event);
274 if(timeZeroFromTOF && (timeZero>timeZeroMax || !timeZeroFromT0)){
275 timeZero=GetTimeZerofromTOF(event);
278 AliDebug(2,Form("time Zero used in PID: %f",timeZero));
280 fPid->MakePID(event,timeZero);
287 //_________________________________________________________________________
288 void AliTOFtrackerV1::CollectESD() {
289 //prepare the set of ESD tracks to be matched to clusters in TOF
294 TClonesArray &aTOFTrack = *fTracks;
295 for (Int_t i=0; i<fNseeds; i++) {
297 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(i);
298 if ((t->GetStatus()&AliESDtrack::kTPCout)==0)continue;
300 // TRD 'good' tracks, already propagated at 372 cm
302 AliTOFtrack *track = new AliTOFtrack(*t); // New
303 Double_t x = track->GetX(); //New
305 if (((t->GetStatus()&AliESDtrack::kTRDout)!=0 ) &&
306 ( x >= AliTOFGeometry::RinTOF()) ){
307 track->SetSeedIndex(i);
308 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
309 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
315 // Propagate the rest of TPCbp
318 if(track->PropagateToInnerTOF()){
319 track->SetSeedIndex(i);
320 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
321 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
329 AliInfo(Form("Number of TOF seeds %i",fNseedsTOF));
330 AliInfo(Form("Number of TOF seeds Type 1 %i",seedsTOF1));
331 AliInfo(Form("Number of TOF seeds Type 2 %i",seedsTOF2));
333 // Sort according uncertainties on track position
337 //_________________________________________________________________________
338 void AliTOFtrackerV1::MatchTracks( ){
340 //Match ESD tracks to clusters in TOF
344 // Parameters regulating the reconstruction
345 Float_t dY=AliTOFGeometry::XPad();
346 Float_t dZ=AliTOFGeometry::ZPad();
348 const Int_t kncmax = 100;
349 Float_t sensRadius = fRecoParam->GetSensRadius();
350 Float_t scaleFact = fRecoParam->GetWindowScaleFact();
351 Float_t dyMax=fRecoParam->GetWindowSizeMaxY();
352 Float_t dzMax=fRecoParam->GetWindowSizeMaxZ();
353 Double_t maxChi2=fRecoParam->GetMaxChi2();
354 Bool_t timeWalkCorr = fRecoParam->GetTimeWalkCorr();
355 AliDebug(1,"++++++++++++++TOF Reconstruction Parameters:++++++++++++ \n");
356 AliDebug(1,Form("TOF sens radius: %f",sensRadius));
357 AliDebug(1,Form("TOF Window scale factor: %f",scaleFact));
358 AliDebug(1,Form("TOF Window max dy: %f",dyMax));
359 AliDebug(1,Form("TOF Window max dz: %f",dzMax));
360 AliDebug(1,Form("TOF Max Chi2: %f",maxChi2));
361 AliDebug(1,Form("Time Walk Correction? : %d",timeWalkCorr));
366 for (Int_t iseed=0; iseed<fNseedsTOF; iseed++) {
368 AliTOFtrack *track =(AliTOFtrack*)fTracks->UncheckedAt(iseed);
369 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(track->GetSeedIndex());
370 if(t->GetTOFsignal()>0. ) continue;
371 AliTOFtrack *trackTOFin =new AliTOFtrack(*track);
373 // Determine a window around the track
374 Double_t x,par[5]; trackTOFin->GetExternalParameters(x,par);
375 Double_t cov[15]; trackTOFin->GetExternalCovariance(cov);
378 Double_t dz = scaleFact*3.*TMath::Sqrt(cov[2]+dZ*dZ/12.);
379 Double_t dphi = scaleFact*3.*TMath::Sqrt(cov[0]+dY*dY/12.)/sensRadius;
381 Double_t phi=TMath::ATan2(par[0],x) + trackTOFin->GetAlpha();
382 if (phi<-TMath::Pi())phi+=2*TMath::Pi();
383 if (phi>=TMath::Pi())phi-=2*TMath::Pi();
385 //upper limit on window's size.
386 if(dz> dzMax) dz=dzMax;
387 if(dphi*sensRadius> dyMax) dphi=dyMax/sensRadius;
390 // find the clusters inside the selected window
392 AliTOFcluster *clusters[kncmax]; // pointers to the clusters in the window
393 Int_t index[kncmax];//to keep track of the cluster index
394 for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
395 AliTOFcluster *c=fClusters[k];
397 if(c->GetZ() > z+dz) break;
398 if(c->IsUsed()) continue;
399 if(!c->GetStatus()) {
400 AliDebug(1,"Cluster in channel declared bad!");
401 continue; // skip bad channels as declared in OCDB
403 Float_t xyz[3]; c->GetGlobalXYZ(xyz);
404 Double_t clPhi=TMath::ATan2(xyz[1],xyz[0]);
405 Double_t dph=TMath::Abs(clPhi-phi);
406 if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
407 if (TMath::Abs(dph)>dphi) continue;
413 //start propagation: go to the average TOF pad middle plane at ~379.5 cm
415 Float_t xTOF = sensRadius;
416 Double_t ymax = xTOF*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
417 Bool_t skip = kFALSE;
418 Double_t ysect = trackTOFin->GetYat(xTOF,skip);
421 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
424 } else if (ysect <-ymax) {
425 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
429 if(!trackTOFin->PropagateTo(xTOF)) {
434 AliTOFcluster *bestCluster=0;
435 Double_t bestChi2=maxChi2;
437 for (Int_t i=0; i<nc; i++){
438 AliTOFcluster *c=clusters[i]; // one of the preselected clusters
439 Double_t chi2=trackTOFin->GetPredictedChi2((AliCluster3D*)c);
440 if (chi2 >= bestChi2) continue;
446 if (!bestCluster) { // no matching , go to the next track
454 AliDebug(2, Form("%7i %7i %10i %10i %10i %10i %7i",
457 TMath::Abs(trackTOFin->GetLabel()),
458 bestCluster->GetLabel(0),
459 bestCluster->GetLabel(1),
460 bestCluster->GetLabel(2),
465 (bestCluster->GetLabel(0)==TMath::Abs(trackTOFin->GetLabel()))
467 (bestCluster->GetLabel(1)==TMath::Abs(trackTOFin->GetLabel()))
469 (bestCluster->GetLabel(2)==TMath::Abs(trackTOFin->GetLabel()))
472 AliDebug(2,Form(" track label good %5i",trackTOFin->GetLabel()));
477 AliDebug(2,Form(" track label bad %5i",trackTOFin->GetLabel()));
480 //Propagate the track to the best matched cluster
481 trackTOFin->PropagateTo(bestCluster);
484 //now take the local distance in Z from the pad center for time walk correction
485 Float_t tiltangle = AliTOFGeometry::GetAngles(bestCluster->GetDetInd(1),bestCluster->GetDetInd(2))*TMath::DegToRad();
486 Double_t dzTW=trackTOFin->GetZ()-bestCluster->GetZ(); // in cm
487 dzTW/=TMath::Cos(tiltangle);
489 //update the ESD track and delete the TOFtrack
490 t->UpdateTrackParams(trackTOFin,AliESDtrack::kTOFout);
493 // Store quantities to be used in the TOF Calibration
494 Float_t tToT=AliTOFGeometry::ToTBinWidth()*bestCluster->GetToT()*1E-3; // in ns
495 t->SetTOFsignalToT(tToT);
496 Float_t rawTime=AliTOFGeometry::TdcBinWidth()*bestCluster->GetTDCRAW()+32; // RAW time,in ps
497 t->SetTOFsignalRaw(rawTime);
498 t->SetTOFsignalDz(dzTW);
499 AliDebug(2,Form(" Setting TOF raw time: %f z distance: %f time: %f = ",rawTime,dzTW));
501 ind[0]=bestCluster->GetDetInd(0);
502 ind[1]=bestCluster->GetDetInd(1);
503 ind[2]=bestCluster->GetDetInd(2);
504 ind[3]=bestCluster->GetDetInd(3);
505 ind[4]=bestCluster->GetDetInd(4);
506 Int_t calindex = AliTOFGeometry::GetIndex(ind);
507 t->SetTOFCalChannel(calindex);
509 // keep track of the track labels in the matched cluster
511 tlab[0]=bestCluster->GetLabel(0);
512 tlab[1]=bestCluster->GetLabel(1);
513 tlab[2]=bestCluster->GetLabel(2);
514 AliDebug(2,Form(" tdc time of the matched track %i = ",bestCluster->GetTDC()));
515 Double_t tof=AliTOFGeometry::TdcBinWidth()*bestCluster->GetTDC()+32; // in ps
516 AliDebug(2,Form(" tof time of the matched track: %f = ",tof));
517 Double_t tofcorr=tof;
518 if(timeWalkCorr)tofcorr=CorrectTimeWalk(dzTW,tof);
519 AliDebug(2,Form(" tof time of the matched track, after TW corr: %f = ",tofcorr));
520 //Set TOF time signal and pointer to the matched cluster
521 t->SetTOFsignal(tofcorr);
522 t->SetTOFcluster(idclus); // pointing to the recPoints tree
523 t->SetTOFLabel(tlab);
525 Double_t mom=t->GetP();
526 // Fill Reco-QA histos for Reconstruction
527 fHRecNClus->Fill(nc);
528 fHRecChi2->Fill(bestChi2);
529 fHRecDistZ->Fill(dzTW);
530 fHRecSigYVsP->Fill(mom,TMath::Sqrt(cov[0]));
531 fHRecSigZVsP->Fill(mom,TMath::Sqrt(cov[2]));
532 fHRecSigYVsPWin->Fill(mom,dphi*sensRadius);
533 fHRecSigZVsPWin->Fill(mom,dz);
535 // Fill Tree for on-the-fly offline Calibration
536 // no longer there - all info is in the ESDs now
541 //_________________________________________________________________________
542 Int_t AliTOFtrackerV1::LoadClusters(TTree *cTree) {
543 //--------------------------------------------------------------------
544 //This function loads the TOF clusters
545 //--------------------------------------------------------------------
547 Int_t npadX = AliTOFGeometry::NpadX();
548 Int_t npadZ = AliTOFGeometry::NpadZ();
549 Int_t nStripA = AliTOFGeometry::NStripA();
550 Int_t nStripB = AliTOFGeometry::NStripB();
551 Int_t nStripC = AliTOFGeometry::NStripC();
553 TBranch *branch=cTree->GetBranch("TOF");
555 AliError("can't get the branch with the TOF clusters !");
559 static TClonesArray dummy("AliTOFcluster",10000);
561 TClonesArray *clusters=&dummy;
562 branch->SetAddress(&clusters);
565 Int_t nc=clusters->GetEntriesFast();
566 fHDigNClus->Fill(nc);
568 AliInfo(Form("Number of clusters: %d",nc));
570 for (Int_t i=0; i<nc; i++) {
571 AliTOFcluster *c=(AliTOFcluster*)clusters->UncheckedAt(i);
572 fClusters[i]=new AliTOFcluster(*c); fN++;
574 // Fill Digits QA histos
576 Int_t isector = c->GetDetInd(0);
577 Int_t iplate = c->GetDetInd(1);
578 Int_t istrip = c->GetDetInd(2);
579 Int_t ipadX = c->GetDetInd(4);
580 Int_t ipadZ = c->GetDetInd(3);
582 Float_t time =(AliTOFGeometry::TdcBinWidth()*c->GetTDC())*1E-3; // in ns
583 Float_t tot = (AliTOFGeometry::TdcBinWidth()*c->GetToT())*1E-3;//in ns
585 Int_t stripOffset = 0;
591 stripOffset = nStripC;
594 stripOffset = nStripC+nStripB;
597 stripOffset = nStripC+nStripB+nStripA;
600 stripOffset = nStripC+nStripB+nStripA+nStripB;
603 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
606 Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1);
607 Int_t phiindex=npadX*isector+ipadX+1;
608 fHDigClusMap->Fill(zindex,phiindex);
609 fHDigClusTime->Fill(time);
610 fHDigClusToT->Fill(tot);
616 //_________________________________________________________________________
617 void AliTOFtrackerV1::UnloadClusters() {
618 //--------------------------------------------------------------------
619 //This function unloads TOF clusters
620 //--------------------------------------------------------------------
621 for (Int_t i=0; i<fN; i++) {
628 //_________________________________________________________________________
629 Int_t AliTOFtrackerV1::FindClusterIndex(Double_t z) const {
630 //--------------------------------------------------------------------
631 // This function returns the index of the nearest cluster
632 //--------------------------------------------------------------------
634 //Here we need to get the Z in the tracking system
637 if (z <= fClusters[0]->GetZ()) return 0;
638 if (z > fClusters[fN-1]->GetZ()) return fN;
639 Int_t b=0, e=fN-1, m=(b+e)/2;
640 for (; b<e; m=(b+e)/2) {
641 if (z > fClusters[m]->GetZ()) b=m+1;
647 //_________________________________________________________________________
648 Bool_t AliTOFtrackerV1::GetTrackPoint(Int_t index, AliTrackPoint& p) const
650 // Get track space point with index i
651 // Coordinates are in the global system
652 AliTOFcluster *cl = fClusters[index];
654 cl->GetGlobalXYZ(xyz);
655 Float_t phi=TMath::ATan2(xyz[1],xyz[0]);
656 Float_t phiangle = (Int_t(phi*TMath::RadToDeg()/20.)+0.5)*20.*TMath::DegToRad();
657 Float_t sinphi = TMath::Sin(phiangle), cosphi = TMath::Cos(phiangle);
658 Float_t tiltangle = AliTOFGeometry::GetAngles(cl->GetDetInd(1),cl->GetDetInd(2))*TMath::DegToRad();
659 Float_t sinth = TMath::Sin(tiltangle), costh = TMath::Cos(tiltangle);
660 Float_t sigmay2 = AliTOFGeometry::XPad()*AliTOFGeometry::XPad()/12.;
661 Float_t sigmaz2 = AliTOFGeometry::ZPad()*AliTOFGeometry::ZPad()/12.;
663 cov[0] = sinphi*sinphi*sigmay2 + cosphi*cosphi*sinth*sinth*sigmaz2;
664 cov[1] = -sinphi*cosphi*sigmay2 + sinphi*cosphi*sinth*sinth*sigmaz2;
665 cov[2] = -cosphi*sinth*costh*sigmaz2;
666 cov[3] = cosphi*cosphi*sigmay2 + sinphi*sinphi*sinth*sinth*sigmaz2;
667 cov[4] = -sinphi*sinth*costh*sigmaz2;
668 cov[5] = costh*costh*sigmaz2;
669 p.SetXYZ(xyz[0],xyz[1],xyz[2],cov);
671 // Detector numbering scheme
672 Int_t nSector = AliTOFGeometry::NSectors();
673 Int_t nPlate = AliTOFGeometry::NPlates();
674 Int_t nStripA = AliTOFGeometry::NStripA();
675 Int_t nStripB = AliTOFGeometry::NStripB();
676 Int_t nStripC = AliTOFGeometry::NStripC();
678 Int_t isector = cl->GetDetInd(0);
679 if (isector >= nSector)
680 AliError(Form("Wrong sector number in TOF (%d) !",isector));
681 Int_t iplate = cl->GetDetInd(1);
682 if (iplate >= nPlate)
683 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
684 Int_t istrip = cl->GetDetInd(2);
686 Int_t stripOffset = 0;
692 stripOffset = nStripC;
695 stripOffset = nStripC+nStripB;
698 stripOffset = nStripC+nStripB+nStripA;
701 stripOffset = nStripC+nStripB+nStripA+nStripB;
704 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
708 Int_t idet = (2*(nStripC+nStripB)+nStripA)*isector +
711 UShort_t volid = AliGeomManager::LayerToVolUID(AliGeomManager::kTOF,idet);
712 p.SetVolumeID((UShort_t)volid);
715 //_________________________________________________________________________
716 void AliTOFtrackerV1::InitCheckHists() {
718 //Init histos for Digits/Reco QA and Calibration
720 TDirectory *dir = gDirectory;
721 TFile *logFileTOF = 0;
723 TSeqCollection *list = gROOT->GetListOfFiles();
724 int n = list->GetEntries();
725 Bool_t isThere=kFALSE;
726 for(int i=0; i<n; i++) {
727 logFileTOF = (TFile*)list->At(i);
728 if (strstr(logFileTOF->GetName(), "TOFQA.root")){
734 if(!isThere)logFileTOF = new TFile( "TOFQA.root","RECREATE");
738 fHDigClusMap = new TH2F("TOFDig_ClusMap", "",182,0.5,182.5,864, 0.5,864.5);
739 fHDigNClus = new TH1F("TOFDig_NClus", "",200,0.5,200.5);
740 fHDigClusTime = new TH1F("TOFDig_ClusTime", "",2000,0.,200.);
741 fHDigClusToT = new TH1F("TOFDig_ClusToT", "",500,0.,100);
744 fHRecNClus =new TH1F("TOFRec_NClusW", "",50,0.5,50.5);
745 fHRecDistZ=new TH1F("TOFRec_DistZ", "",50,0.5,10.5);
746 fHRecChi2=new TH1F("TOFRec_Chi2", "",100,0.,10.);
747 fHRecSigYVsP=new TH2F("TOFDig_SigYVsP", "",40,0.,4.,100, 0.,5.);
748 fHRecSigZVsP=new TH2F("TOFDig_SigZVsP", "",40,0.,4.,100, 0.,5.);
749 fHRecSigYVsPWin=new TH2F("TOFDig_SigYVsPWin", "",40,0.,4.,100, 0.,50.);
750 fHRecSigZVsPWin=new TH2F("TOFDig_SigZVsPWin", "",40,0.,4.,100, 0.,50.);
756 //_________________________________________________________________________
757 void AliTOFtrackerV1::SaveCheckHists() {
759 //write histos for Digits/Reco QA and Calibration
761 TDirectory *dir = gDirectory;
763 TFile *logFileTOF = 0;
765 TSeqCollection *list = gROOT->GetListOfFiles();
766 int n = list->GetEntries();
767 for(int i=0; i<n; i++) {
768 logFile = (TFile*)list->At(i);
769 if (strstr(logFile->GetName(), "AliESDs.root")) break;
772 Bool_t isThere=kFALSE;
773 for(int i=0; i<n; i++) {
774 logFileTOF = (TFile*)list->At(i);
775 if (strstr(logFileTOF->GetName(), "TOFQA.root")){
782 AliError(Form("File TOFQA.root not found!! not wring histograms...."));
786 fHDigClusMap->Write(fHDigClusMap->GetName(), TObject::kOverwrite);
787 fHDigNClus->Write(fHDigNClus->GetName(), TObject::kOverwrite);
788 fHDigClusTime->Write(fHDigClusTime->GetName(), TObject::kOverwrite);
789 fHDigClusToT->Write(fHDigClusToT->GetName(), TObject::kOverwrite);
790 fHRecNClus->Write(fHRecNClus->GetName(), TObject::kOverwrite);
791 fHRecChi2->Write(fHRecChi2->GetName(), TObject::kOverwrite);
792 fHRecDistZ->Write(fHRecDistZ->GetName(), TObject::kOverwrite);
793 fHRecSigYVsP->Write(fHRecSigYVsP->GetName(), TObject::kOverwrite);
794 fHRecSigZVsP->Write(fHRecSigZVsP->GetName(), TObject::kOverwrite);
795 fHRecSigYVsPWin->Write(fHRecSigYVsPWin->GetName(), TObject::kOverwrite);
796 fHRecSigZVsPWin->Write(fHRecSigZVsPWin->GetName(), TObject::kOverwrite);
802 //_________________________________________________________________________
803 Float_t AliTOFtrackerV1::CorrectTimeWalk( Float_t dist, Float_t tof) {
805 //dummy, for the moment
807 if(dist<AliTOFGeometry::ZPad()*0.5){
809 //place here the actual correction
815 //_________________________________________________________________________
816 Float_t AliTOFtrackerV1::GetTimeZerofromT0(AliESDEvent *event) const {
818 //Returns TimeZero as measured by T0 detector
820 return event->GetT0();
822 //_________________________________________________________________________
823 Float_t AliTOFtrackerV1::GetTimeZerofromTOF(AliESDEvent * /*event*/) const {
825 //dummy, for the moment. T0 algorithm using tracks on TOF
827 //place T0 algo here...
831 //_________________________________________________________________________
833 void AliTOFtrackerV1::FillClusterArray(TObjArray* arr) const
836 // Returns the TOF cluster array
842 for (Int_t i=0; i<fN; ++i) arr->Add(fClusters[i]);