Reconstruction of raw data (T.Kuhr)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Jul 2004 14:07:35 +0000 (14:07 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Jul 2004 14:07:35 +0000 (14:07 +0000)
TPC/AliTPCReconstructor.cxx
TPC/AliTPCReconstructor.h

index 8e284e2..a491a17 100644 (file)
@@ -25,6 +25,7 @@
 #include "AliTPCReconstructor.h"
 #include "AliRunLoader.h"
 #include "AliRun.h"
+#include "AliRawReader.h"
 #include "AliTPCclustererMI.h"
 #include "AliTPCtrackerMI.h"
 #include "AliTPCpidESD.h"
@@ -78,6 +79,42 @@ void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader) const
 }
 
 //_____________________________________________________________________________
+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();
+}
+
+//_____________________________________________________________________________
 AliTracker* AliTPCReconstructor::CreateTracker(AliRunLoader* runLoader) const
 {
 // create a TPC tracker
index babcf6a..52baafc 100644 (file)
@@ -16,6 +16,8 @@ public:
   virtual ~AliTPCReconstructor() {};
 
   virtual void         Reconstruct(AliRunLoader* runLoader) const;
+  virtual void         Reconstruct(AliRunLoader* runLoader,
+                                  AliRawReader* rawReader) const;
   virtual AliTracker*  CreateTracker(AliRunLoader* runLoader) const;
   virtual void         FillESD(AliRunLoader* runLoader, AliESD* esd) const;