+//_________________________________________________________________________
+void AliTOFtracker::InitCheckHists() {
+
+ //Init histos for Digits/Reco QA and Calibration
+
+
+ TDirectory *dir = gDirectory;
+ TFile *logFileTOF = 0;
+
+ TSeqCollection *list = gROOT->GetListOfFiles();
+ int n = list->GetEntries();
+ Bool_t isThere=kFALSE;
+ for(int i=0; i<n; i++) {
+ logFileTOF = (TFile*)list->At(i);
+ if (strstr(logFileTOF->GetName(), "TOFQA.root")){
+ isThere=kTRUE;
+ break;
+ }
+ }
+
+ if(!isThere)logFileTOF = new TFile( "TOFQA.root","RECREATE");
+ logFileTOF->cd();
+
+ fCalTree = new TTree("CalTree", "Tree for TOF calibration");
+ fCalTree->Branch("TOFchannelindex",&fIch,"iTOFch/I");
+ fCalTree->Branch("ToT",&fToT,"TOFToT/F");
+ fCalTree->Branch("TOFtime",&fTime,"TOFtime/F");
+ fCalTree->Branch("PionExpTime",&fExpTimePi,"PiExpTime/F");
+ fCalTree->Branch("KaonExpTime",&fExpTimeKa,"KaExpTime/F");
+ fCalTree->Branch("ProtonExpTime",&fExpTimePr,"PrExpTime/F");
+
+ //Digits "QA"
+ fHDigClusMap = new TH2F("TOFDig_ClusMap", "",182,0.5,182.5,864, 0.5,864.5);
+ fHDigNClus = new TH1F("TOFDig_NClus", "",200,0.5,200.5);
+ fHDigClusTime = new TH1F("TOFDig_ClusTime", "",2000,0.,200.);
+ fHDigClusToT = new TH1F("TOFDig_ClusToT", "",500,0.,100);
+
+ //Reco "QA"
+ fHRecNClus =new TH1F("TOFRec_NClusW", "",50,0.5,50.5);
+ fHRecDist=new TH1F("TOFRec_Dist", "",50,0.5,10.5);
+ fHRecSigYVsP=new TH2F("TOFDig_SigYVsP", "",40,0.,4.,100, 0.,5.);
+ fHRecSigZVsP=new TH2F("TOFDig_SigZVsP", "",40,0.,4.,100, 0.,5.);
+ fHRecSigYVsPWin=new TH2F("TOFDig_SigYVsPWin", "",40,0.,4.,100, 0.,50.);
+ fHRecSigZVsPWin=new TH2F("TOFDig_SigZVsPWin", "",40,0.,4.,100, 0.,50.);
+
+ dir->cd();
+
+}
+
+//_________________________________________________________________________
+void AliTOFtracker::SaveCheckHists() {
+
+ //write histos for Digits/Reco QA and Calibration
+
+ TDirectory *dir = gDirectory;
+ TFile *logFileTOF = 0;
+
+ TSeqCollection *list = gROOT->GetListOfFiles();
+ int n = list->GetEntries();
+ Bool_t isThere=kFALSE;
+ for(int i=0; i<n; i++) {
+ logFileTOF = (TFile*)list->At(i);
+ if (strstr(logFileTOF->GetName(), "TOFQA.root")){
+ isThere=kTRUE;
+ break;
+ }
+ }
+
+ if(!isThere) {
+ AliError(Form("File TOFQA.root not found!! not wring histograms...."));
+ return;
+ }
+ logFileTOF->cd();
+ fHDigClusMap->Write(fHDigClusMap->GetName(), TObject::kOverwrite);
+ fHDigNClus->Write(fHDigNClus->GetName(), TObject::kOverwrite);
+ fHDigClusTime->Write(fHDigClusTime->GetName(), TObject::kOverwrite);
+ fHDigClusToT->Write(fHDigClusToT->GetName(), TObject::kOverwrite);
+ fHRecNClus->Write(fHRecNClus->GetName(), TObject::kOverwrite);
+ fHRecDist->Write(fHRecDist->GetName(), TObject::kOverwrite);
+ fHRecSigYVsP->Write(fHRecSigYVsP->GetName(), TObject::kOverwrite);
+ fHRecSigZVsP->Write(fHRecSigZVsP->GetName(), TObject::kOverwrite);
+ fHRecSigYVsPWin->Write(fHRecSigYVsPWin->GetName(), TObject::kOverwrite);
+ fHRecSigZVsPWin->Write(fHRecSigZVsPWin->GetName(), TObject::kOverwrite);
+ fCalTree->Write(fCalTree->GetName(),TObject::kOverwrite);
+ logFileTOF->Flush();
+
+ dir->cd();
+ }
+//_________________________________________________________________________
+Float_t AliTOFtracker::CorrectTimeWalk( Float_t dist, Float_t tof) const {
+
+ //dummy, for the moment
+ Float_t tofcorr=0.;
+ if(dist<AliTOFGeometry::ZPad()*0.5){
+ tofcorr=tof;
+ //place here the actual correction
+ }else{
+ tofcorr=tof;
+ }
+ return tofcorr;
+}
+//_________________________________________________________________________
+
+void AliTOFtracker::FillClusterArray(TObjArray* arr) const
+{
+ //
+ // Returns the TOF cluster array
+ //
+
+ if (fN==0)
+ arr = 0x0;
+ else
+ for (Int_t i=0; i<fN; ++i) arr->Add(fClusters[i]);
+
+}
+//_________________________________________________________________________
+