]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliReconstructor.cxx
Bug fix. Removed delete statement
[u/mrichter/AliRoot.git] / STEER / AliReconstructor.cxx
index 5f8fbfbf1b013f0aee79d1b64c825041d6f45e4c..72de1f77e3a323ce8dbdfbc229c4b19fe188bf7a 100644 (file)
 
 #include "AliLog.h"
 #include "AliReconstructor.h"
+#include <TClass.h>
 #include <TString.h>
 
 
 ClassImp(AliReconstructor)
 
+const AliDetectorRecoParam* AliReconstructor::fgRecoParam[AliReconstruction::kNDetectors] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
 
 //_____________________________________________________________________________
 void AliReconstructor::ConvertDigits(AliRawReader* /*rawReader*/, 
@@ -70,27 +72,9 @@ void AliReconstructor::Reconstruct(AliRawReader* /*rawReader*/,
   AliError("local event reconstruction not implemented for raw data input");
 }
 
-//_____________________________________________________________________________
-void AliReconstructor::Reconstruct(AliRunLoader* /*runLoader*/) const
-{
-// run the local reconstruction
-
-  AliError("local reconstruction not implemented");
-}
-
-//_____________________________________________________________________________
-void AliReconstructor::Reconstruct(AliRunLoader* /*runLoader*/, 
-                                  AliRawReader* /*rawReader*/) const
-{
-// run the local reconstruction with raw data input
-
-  AliError("local reconstruction not implemented for raw data input");
-}
-
-
 //_____________________________________________________________________________
 void AliReconstructor::FillESD(TTree* /*digitsTree*/, TTree* /*clustersTree*/,
-                              AliESD* /*esd*/) const
+                              AliESDEvent* /*esd*/) const
 {
 // fill the ESD.
 // by default nothing is done
@@ -99,7 +83,7 @@ void AliReconstructor::FillESD(TTree* /*digitsTree*/, TTree* /*clustersTree*/,
 
 //_____________________________________________________________________________
 void AliReconstructor::FillESD(AliRawReader* /*rawReader*/, 
-                              TTree* clustersTree, AliESD* esd) const
+                              TTree* clustersTree, AliESDEvent* esd) const
 {
 // fill the ESD in case of raw data input.
 // by default the FillESD method for MC is called
@@ -108,33 +92,44 @@ void AliReconstructor::FillESD(AliRawReader* /*rawReader*/,
 }
 
 //_____________________________________________________________________________
-void AliReconstructor::FillESD(AliRunLoader* /*runLoader*/, 
-                              AliESD* /*esd*/) const
+const char* AliReconstructor::GetDetectorName() const
 {
-// fill the ESD.
-// by default nothing is done
+// get the name of the detector
 
+  static TString detName;
+  detName = GetName();
+  detName.Remove(0, 3);
+  detName.Remove(detName.Index("Reconstructor"));
+  return detName.Data();
 }
 
 //_____________________________________________________________________________
-void AliReconstructor::FillESD(AliRunLoader* runLoader, 
-                              AliRawReader* /*rawReader*/, AliESD* esd) const
+void AliReconstructor::SetRecoParam(const AliDetectorRecoParam *par)
 {
-// fill the ESD in case of raw data input.
-// by default the FillESD method for MC is called
-
-  FillESD(runLoader, esd);
+  // To be implemented by the detectors.
+  // As soon as we manage to remove the static members
+  // and method in the detector reconstructors, we will
+  // implemented this method in the base class and remove
+  // the detectors implementations.
+  Int_t iDet = AliReconstruction::GetDetIndex(GetDetectorName());
+
+  if (iDet >= 0)
+    fgRecoParam[iDet] = par;
+  else
+    AliError(Form("Invalid detector index for (%s)",GetDetectorName()));
+
+  return;
 }
 
-
 //_____________________________________________________________________________
-const char* AliReconstructor::GetDetectorName() const
+const AliDetectorRecoParam* AliReconstructor::GetRecoParam(Int_t iDet)
 {
-// get the name of the detector
-
-  static TString detName;
-  detName = GetName();
-  detName.Remove(0, 3);
-  detName.Remove(detName.Index("Reconstructor"));
-  return detName.Data();
+  // Get the current reconstruciton parameters
+  // for a given detector 
+  if (iDet >= 0 && iDet < AliReconstruction::kNDetectors)
+    return fgRecoParam[iDet];
+  else {
+    AliErrorClass(Form("Invalid detector index (%d)",iDet));
+    return NULL;
+  }
 }