+ if (pClusterAccess->FindObject("clusterarray")==NULL) {
+ AliError("HLT clusters requested, but not cluster array not present");
+ return -4;
+ }
+
+ TClonesArray* clusterArray=dynamic_cast<TClonesArray*>(pClusterAccess->FindObject("clusterarray"));
+ if (!clusterArray) {
+ AliError("HLT cluster array is not of class type TClonesArray");
+ return -5;
+ }
+
+ AliDebug(4,Form("Reading %d clusters from HLT for sector %d", clusterArray->GetEntriesFast(), fSector));
+
+ Int_t nClusterSector=0;
+ Int_t nRows=fParam->GetNRow(fSector);
+
+ for (fRow = 0; fRow < nRows; fRow++) {
+ fRowCl->SetID(fParam->GetIndex(fSector, fRow));
+ if (fOutput) fOutput->GetBranch("Segment")->SetAddress(&fRowCl);
+ fNcluster=0; // reset clusters per row
+
+ fRx = fParam->GetPadRowRadii(fSector, fRow);
+ fPadLength = fParam->GetPadPitchLength(fSector, fRow);
+ fPadWidth = fParam->GetPadPitchWidth();
+ fMaxPad = fParam->GetNPads(fSector,fRow);
+ fMaxBin = fMaxTime*(fMaxPad+6); // add 3 virtual pads before and 3 after
+
+ fBins = fAllBins[fRow];
+ fSigBins = fAllSigBins[fRow];
+ fNSigBins = fAllNSigBins[fRow];
+
+ for (Int_t i=0; i<clusterArray->GetEntriesFast(); i++) {
+ if (!clusterArray->At(i))
+ continue;
+
+ AliTPCclusterMI* cluster=dynamic_cast<AliTPCclusterMI*>(clusterArray->At(i));
+ if (!cluster) continue;
+ if (cluster->GetRow()!=fRow) continue;
+ nClusterSector++;
+ AddCluster(*cluster, NULL, 0);
+ }
+
+ FillRow();
+ fRowCl->GetArray()->Clear("c");
+
+ } // for (fRow = 0; fRow < nRows; fRow++) {
+ if (nClusterSector!=clusterArray->GetEntriesFast()) {
+ AliError(Form("Failed to read %d out of %d HLT clusters",
+ clusterArray->GetEntriesFast()-nClusterSector,
+ clusterArray->GetEntriesFast()));
+ }
+ fNclusters+=nClusterSector;
+ } // for(fSector = 0; fSector < kNS; fSector++) {
+
+ delete pClusterAccess;
+
+ Info("Digits2Clusters", "Number of converted HLT clusters : %d", fNclusters);
+
+ return 0;
+}