+ AliDebug(1,Form("Execution time to read TOF digits and to write TOF clusters : R:%.4fs C:%.4fs",
+ stopwatch.RealTime(),stopwatch.CpuTime()));
+ if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes));
+
+}
+
+//______________________________________________________________________________
+
+void AliTOFClusterFinder::Digits2RecPoints(TTree* digitsTree, TTree* clusterTree)
+{
+ //
+ // Converts digits to recpoints for TOF
+ //
+
+ TStopwatch stopwatch;
+ stopwatch.Start();
+
+ Int_t inholes = 0;
+
+ /// fRunLoader->GetEvent(iEvent);
+
+ if (digitsTree == 0x0)
+ {
+ AliFatal("AliTOFClusterFinder: Can not get TreeD");
+ }
+
+ TBranch *branch = digitsTree->GetBranch("TOF");
+ if (!branch) {
+ AliError("can't get the branch with the TOF digits !");
+ return;
+ }
+
+ TClonesArray staticdigits("AliTOFdigit",10000);
+ staticdigits.Clear();
+ TClonesArray *digits = & staticdigits;
+ branch->SetAddress(&digits);
+
+ ResetRecpoint();
+
+ fTreeR=clusterTree;
+ Int_t bufsize = 32000;
+ fTreeR->Branch("TOF", &fRecPoints, bufsize);
+
+ digitsTree->GetEvent(0);
+ Int_t nDigits = digits->GetEntriesFast();
+ AliDebug(2,Form("Number of TOF digits: %d",nDigits));
+
+ Int_t ii;
+ Int_t dig[5]; //cluster detector indeces
+ Int_t parTOF[7]; //The TOF signal parameters
+ Bool_t status=kTRUE; // assume all sim channels ok in the beginning...
+ for (ii=0; ii<nDigits; ii++) {
+ AliTOFdigit *d = (AliTOFdigit*)digits->UncheckedAt(ii);
+ dig[0]=d->GetSector();
+ dig[1]=d->GetPlate();
+ dig[2]=d->GetStrip();
+ dig[3]=d->GetPadz();
+ dig[4]=d->GetPadx();
+
+ /* check valid index */
+ if (dig[0]==-1||dig[1]==-1||dig[2]==-1||dig[3]==-1||dig[4]==-1) continue;
+
+ // Do not reconstruct anything in the holes
+ if (dig[0]==13 || dig[0]==14 || dig[0]==15 ) { // sectors with holes
+ if (dig[1]==2) { // plate with holes
+ inholes++;
+ continue;
+ }
+ }
+
+ // AliDebug(2,Form(" %2d %1d %2d %1d %2d ",dig[0],dig[1],dig[2],dig[3],dig[4]));
+
+ parTOF[0] = d->GetTdc(); //the TDC signal
+ parTOF[1] = d->GetToT(); //the ToT signal
+ parTOF[2] = d->GetAdc(); // the adc charge
+ parTOF[3] = d->GetTdcND(); // non decalibrated sim time
+ parTOF[4] = d->GetTdc(); // raw time, == Tdc time for the moment
+ parTOF[5] = 0; // deltaBC
+ parTOF[6] = 0; // L0-L1 latency
+
+ Double_t posClus[3];
+ Double_t covClus[6];
+ UShort_t volIdClus=GetClusterVolIndex(dig);
+ GetClusterPars(dig,posClus,covClus);
+ AliTOFcluster *tofCluster = new AliTOFcluster(volIdClus,posClus[0],posClus[1],posClus[2],covClus[0],covClus[1],covClus[2],covClus[3],covClus[4],covClus[5],d->GetTracks(),dig,parTOF,status,ii);
+ InsertCluster(tofCluster);
+
+ }
+
+ AliDebug(1,Form("Number of found clusters: %d", fNumberOfTofClusters));
+
+ CalibrateRecPoint();
+ FillRecPoint();
+
+ clusterTree->Fill();
+ ResetRecpoint();
+
+ AliDebug(1,Form("Execution time to read TOF digits and to write TOF clusters : R:%.4fs C:%.4fs",
+ stopwatch.RealTime(),stopwatch.CpuTime()));
+ if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes));
+