New methods Reconstruct and FillESD added
authorbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Jan 2005 06:20:43 +0000 (06:20 +0000)
committerbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Jan 2005 06:20:43 +0000 (06:20 +0000)
PMD/AliPMDReconstructor.cxx
PMD/AliPMDReconstructor.h

index d90e2ed..69138b0 100644 (file)
 #include "AliRawReader.h"
 #include "AliESDPmdTrack.h"
 #include "AliESD.h"
+#include "AliLog.h"
 
 ClassImp(AliPMDReconstructor)
 
-
+//_____________________________________________________________________________
+void AliPMDReconstructor::Init(AliRunLoader* runLoader) 
+{
+  // Initialize the reconstructor 
+  AliDebug(1, Form("Init called with runloader 0x%x", runLoader));
+  if (!runLoader)
+    { 
+      AliWarning("Init : No run loader");
+      return;
+    }
+}
+    
 //_____________________________________________________________________________
 void AliPMDReconstructor::Reconstruct(AliRunLoader* runLoader) const
 {
@@ -39,7 +51,6 @@ void AliPMDReconstructor::Reconstruct(AliRunLoader* runLoader) const
 
   AliPMDClusterFinder *pmdClus = new AliPMDClusterFinder(runLoader);
   pmdClus->Load();
-  //  pmdClus->SetDebug(1);
   for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
     {
       pmdClus->Digits2RecPoints(iEvent);
@@ -48,7 +59,8 @@ void AliPMDReconstructor::Reconstruct(AliRunLoader* runLoader) const
   delete pmdClus;
 
 }
-//_____________________________________________________________________________
+// ------------------------------------------------------------------------ //
+
 void AliPMDReconstructor::Reconstruct(AliRunLoader* runLoader,
                                      AliRawReader *rawReader) const
 {
@@ -59,29 +71,50 @@ void AliPMDReconstructor::Reconstruct(AliRunLoader* runLoader,
 
   Int_t iEvent = 0;
   while (rawReader->NextEvent()) {
-    //    pmdClus.SetDebug(1);
     pmdClus.Digits2RecPoints(iEvent,rawReader);
-    
     iEvent++;
   }
   pmdClus.UnLoadClusters();
   
 }
 
+
 // ------------------------------------------------------------------------ //
 
-void AliPMDReconstructor::FillESD(AliRunLoader* runLoader,AliESD* esd) const
+void AliPMDReconstructor::Reconstruct(AliRawReader *rawReader,
+                                     TTree *clustersTree) const
 {
-  AliLoader* loader = runLoader->GetLoader("PMDLoader");
-  if (!loader) {
-    Error("Reconstruct", "PMD loader not found");
-    return;
-  }
-  loader->LoadRecPoints("READ");
+// reconstruct clusters from Raw Data
+
+  AliPMDClusterFinder pmdClus;
+  pmdClus.Digits2RecPoints(rawReader, clustersTree);
+
+}
+
+// ------------------------------------------------------------------------ //
 
-  TTree *treeR = loader->TreeR();
+//void AliPMDReconstructor::FillESD(AliRunLoader* runLoader,AliESD* esd) const
+//{
+//  AliLoader* loader = runLoader->GetLoader("PMDLoader");
+//  if (!loader) {
+//    AliError("PMD loader not found");
+//    return;
+//  }
+//  loader->LoadRecPoints("READ");
+//  TTree *treeR = loader->TreeR();
+//  AliPMDtracker pmdtracker;
+//  pmdtracker.LoadClusters(treeR);
+//  pmdtracker.Clusters2Tracks(esd);
+//  loader->UnloadRecPoints();
+//}
+
+// ------------------------------------------------------------------------ //
+void AliPMDReconstructor::FillESD(AliRawReader* /*rawReader*/,
+                                 TTree* clustersTree, AliESD* esd) const
+{
   AliPMDtracker pmdtracker;
-  pmdtracker.LoadClusters(treeR);
+  pmdtracker.LoadClusters(clustersTree);
   pmdtracker.Clusters2Tracks(esd);
-  loader->UnloadRecPoints();
 }
+
+
index 3a36dc7..21c73c1 100644 (file)
@@ -7,14 +7,21 @@
 
 class AliPMDReconstructor: public AliReconstructor {
 public:
-  virtual void Reconstruct(AliRunLoader* runLoader) const;
-  virtual void Reconstruct(AliRunLoader* runLoader,
-                          AliRawReader *rawReader) const;
-  virtual void FillESD(AliRunLoader* runLoader, AliESD* esd) const;
+  virtual void   Init(AliRunLoader* runLoader);
+  virtual void   Reconstruct(AliRunLoader* runLoader) const;
+  virtual void   Reconstruct(AliRunLoader* runLoader,
+                            AliRawReader *rawReader) const;
+  virtual void   Reconstruct(AliRawReader* rawReader,
+                            TTree* clustersTree) const;
+  virtual Bool_t HasLocalReconstruction() const { return kTRUE; }
 
+  //virtual void   FillESD(AliRunLoader* runLoader, AliESD* esd) const;
+  virtual void   FillESD(AliRawReader* /*rawReader*/, TTree* clustersTree, 
+                        AliESD* esd) const;
 private:
 
-  ClassDef(AliPMDReconstructor, 2)   // class for the PMD reconstruction
+  ClassDef(AliPMDReconstructor, 3)   // class for the PMD reconstruction
 };
 
 #endif