Version where the process for HLT and vdrift on DAQ are off(Raphaelle)
[u/mrichter/AliRoot.git] / PMD / AliPMDReconstructor.cxx
index 1851814..20743bc 100644 (file)
 
 #include "Riostream.h"
 #include "AliPMDReconstructor.h"
-#include "AliRunLoader.h"
 #include "AliRun.h"
 #include "AliPMDClusterFinder.h"
 #include "AliPMDtracker.h"
+#include "AliRawReader.h"
 #include "AliESDPmdTrack.h"
-#include "AliESD.h"
-
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliRunInfo.h"
 
 ClassImp(AliPMDReconstructor)
 
+// ------------------------------------------------------------------------ //
 
-//_____________________________________________________________________________
-void AliPMDReconstructor::Reconstruct(AliRunLoader* runLoader) const
+void AliPMDReconstructor::Reconstruct(AliRawReader *rawReader,
+                                     TTree *clustersTree) const
 {
-// reconstruct clusters
-
-  AliPMDClusterFinder *pmdClus = new AliPMDClusterFinder(runLoader);
-  pmdClus->Load();
-  for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
-    {
-      pmdClus->Digits2RecPoints(iEvent);
-    }
-  pmdClus->UnLoad();
-  delete pmdClus;
+// reconstruct clusters from Raw Data
+// Event Species Added By satyajit
+  Int_t gRecoMode = 1;
+  TString beamType = GetRunInfo()->GetBeamType();
+  
+  if (((beamType.CompareTo("pp"))==0) || 
+      ((beamType.CompareTo("p-p"))==0)||
+      ((beamType.CompareTo("PP"))==0) || 
+      ((beamType.CompareTo("P-P"))==0)) {
+    gRecoMode=1;
+  }
+  
+  else if ((beamType.CompareTo("A-A")) == 0 || 
+          (beamType.CompareTo("AA")) == 0) {
+    gRecoMode=2;
+  }
 
+    static AliPMDClusterFinder pmdClus;
+    pmdClus.Digits2RecPoints(rawReader, clustersTree, gRecoMode);
 }
 
 // ------------------------------------------------------------------------ //
-
-void AliPMDReconstructor::FillESD(AliRunLoader* runLoader,AliESD* esd) const
+void AliPMDReconstructor::Reconstruct(TTree *digitsTree,
+                                     TTree *clustersTree) const
 {
-  AliLoader* loader = runLoader->GetLoader("PMDLoader");
-  if (!loader) {
-    Error("Reconstruct", "PMD loader not found");
-    return;
+  // reconstruct clusters from Digits
+  // Setting reconstruction mode
+  // Added to Have Sepatrate Event Spcies
+  Int_t gRecoMode = 1;
+  TString beamType = GetRunInfo()->GetBeamType();
+  if (((beamType.CompareTo("pp"))==0) || 
+     ((beamType.CompareTo("p-p"))==0)||
+     ((beamType.CompareTo("PP"))==0) || 
+     ((beamType.CompareTo("P-P"))==0)) {
+    gRecoMode=1;
   }
-  loader->LoadRecPoints("READ");
+  
+  else if ((beamType.CompareTo("A-A")) == 0 || 
+          (beamType.CompareTo("AA")) == 0) {
+    gRecoMode=2;
+  }
+  
+  static AliPMDClusterFinder pmdClus;
+  pmdClus.Digits2RecPoints(digitsTree, clustersTree,gRecoMode);
+
+}
 
-  TTree *treeR = loader->TreeR();
-  AliPMDtracker pmdtracker;
-  pmdtracker.LoadClusters(treeR);
-  pmdtracker.Clusters2Tracks(esd);
-  loader->UnloadRecPoints();
+// ------------------------------------------------------------------------ //
+void AliPMDReconstructor::FillESD(AliRawReader* /*rawReader*/,
+                                 TTree* clustersTree, AliESDEvent* esd) const
+{
+    static AliPMDtracker pmdtracker;
+    pmdtracker.LoadClusters(clustersTree);
+    pmdtracker.Clusters2Tracks(esd);
+}
+// ------------------------------------------------------------------------ //
+void AliPMDReconstructor::FillESD(TTree * /*digitsTree*/,
+                                 TTree* clustersTree, AliESDEvent* esd) const
+{
+    static AliPMDtracker pmdtracker;
+    pmdtracker.LoadClusters(clustersTree);
+    pmdtracker.Clusters2Tracks(esd);
 }
+
+