+//_____________________________________________________________________________
+void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader,
+ AliRawReader* rawReader) const
+{
+// reconstruct clusters from raw data
+
+ AliLoader* loader = runLoader->GetLoader("TPCLoader");
+ if (!loader) {
+ Error("Reconstruct", "TPC loader not found");
+ return;
+ }
+ loader->LoadRecPoints("recreate");
+
+ AliTPCParam* param = GetTPCParam(runLoader);
+ if (!param) return;
+ AliTPCclustererMI clusterer(param);
+
+ Int_t iEvent = 0;
+ while (rawReader->NextEvent()) {
+ runLoader->GetEvent(iEvent++);
+
+ TTree* treeClusters = loader->TreeR();
+ if (!treeClusters) {
+ loader->MakeTree("R");
+ treeClusters = loader->TreeR();
+ }
+
+ clusterer.SetOutput(treeClusters);
+ clusterer.Digits2Clusters(rawReader);
+
+ loader->WriteRecPoints("OVERWRITE");
+ }
+
+ loader->UnloadRecPoints();
+}
+