]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCReconstructor.cxx
Print override: changed fot TObjArray in root v5-22-00. Now adapted.
[u/mrichter/AliRoot.git] / TPC / AliTPCReconstructor.cxx
index c59d414d353c397d7e062d0fdfae552f012caca4..750c3b24b81a1c199f6175db385ba3a97c14f7b8 100644 (file)
 #include "AliTPCParam.h"
 #include "AliTPCParamSR.h"
 #include "AliTPCcalibDB.h"
+#include "AliTracker.h"
+#include "AliMagF.h"
 
 ClassImp(AliTPCReconstructor)
 
 
-AliTPCRecoParam *    AliTPCReconstructor::fgkRecoParam =0;  // reconstruction parameters
 Int_t    AliTPCReconstructor::fgStreamLevel     = 0;        // stream (debug) level
 
 
@@ -47,11 +48,13 @@ fClusterer(NULL)
   //
   // default constructor
   //
-  if (!fgkRecoParam) {
-    AliError("The Reconstruction parameters nonitialized - Used default one");
-    fgkRecoParam = AliTPCRecoParam::GetHighFluxParam();
+  //
+  //
+  AliTPCcalibDB * calib = AliTPCcalibDB::Instance();
+  const AliMagF * field = AliTracker::GetFieldMap();
+  if (field) { // Set correctly the magnetic field in the ExB calculation
+    calib->SetExBField(field->SolenoidField());
   }
-
   AliTPCParam* param = GetTPCParam();
   if (!param) {
     AliWarning("Loading default TPC parameters !");
@@ -60,51 +63,26 @@ fClusterer(NULL)
   fClusterer = new AliTPCclustererMI(param);
 }
 
-//_____________________________________________________________________________
-AliTPCReconstructor::~AliTPCReconstructor()
+AliTPCReconstructor::AliTPCReconstructor(const AliTPCReconstructor& /*rec*/):
+AliReconstructor(),
+fClusterer(NULL)
 {
-  if (fgkRecoParam) delete fgkRecoParam;
-  if (fClusterer)   delete fClusterer;
+  //
+  // Dummy copu constructor
+  //
+}
+
+AliTPCReconstructor& AliTPCReconstructor::operator=(const AliTPCReconstructor&){
+  //
+  // dummy operator
+  //
+  return *this;
 }
 
 //_____________________________________________________________________________
-void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader) const
+AliTPCReconstructor::~AliTPCReconstructor()
 {
-// reconstruct clusters
-
-  AliLoader* loader = runLoader->GetLoader("TPCLoader");
-  if (!loader) {
-    Error("Reconstruct", "TPC loader not found");
-    return;
-  }
-  loader->LoadRecPoints("recreate");
-  loader->LoadDigits("read");
-
-  Int_t nEvents = runLoader->GetNumberOfEvents();
-
-  for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
-    runLoader->GetEvent(iEvent);
-
-    TTree* treeClusters = loader->TreeR();
-    if (!treeClusters) {
-      loader->MakeTree("R");
-      treeClusters = loader->TreeR();
-    }
-    TTree* treeDigits = loader->TreeD();
-    if (!treeDigits) {
-      Error("Reconstruct", "Can't get digits tree !");
-      return;
-    }
-
-    fClusterer->SetInput(treeDigits);
-    fClusterer->SetOutput(treeClusters);
-    fClusterer->Digits2Clusters();
-         
-    loader->WriteRecPoints("OVERWRITE");
-  }
-
-  loader->UnloadRecPoints();
-  loader->UnloadDigits();
+  if (fClusterer)   delete fClusterer;
 }
 
 //_____________________________________________________________________________
@@ -116,56 +94,17 @@ void AliTPCReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) co
   fClusterer->Digits2Clusters();
 }
 
-//_____________________________________________________________________________
-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");
-
-  TString option = GetOption();
-  if (option.Contains("OldRCUFormat"))
-    fClusterer->SetOldRCUFormat(kTRUE);
-  Int_t iEvent = 0;
-  while (rawReader->NextEvent()) {  
-    runLoader->GetEvent(iEvent++);
-
-    TTree* treeClusters = loader->TreeR();
-    if (!treeClusters) {
-      loader->MakeTree("R");
-      treeClusters = loader->TreeR();
-    }
-
-    fClusterer->SetOutput(treeClusters);
-    fClusterer->Digits2Clusters(rawReader);
-         
-    loader->WriteRecPoints("OVERWRITE");
-  }
-
-  loader->UnloadRecPoints();
-}
-
 //_____________________________________________________________________________
 void AliTPCReconstructor::Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const {
   // single event local reconstruction
   // of TPC data starting from raw data
-  TString option = GetOption();
-  if (option.Contains("OldRCUFormat"))
-    fClusterer->SetOldRCUFormat(kTRUE);
 
   fClusterer->SetOutput(clustersTree);
   fClusterer->Digits2Clusters(rawReader);
 }
 
 //_____________________________________________________________________________
-AliTracker* AliTPCReconstructor::CreateTracker(AliRunLoader* /* runLoader */) const
+AliTracker* AliTPCReconstructor::CreateTracker() const
 {
 // create a TPC tracker
 
@@ -179,12 +118,12 @@ AliTracker* AliTPCReconstructor::CreateTracker(AliRunLoader* /* runLoader */) co
 }
 
 //_____________________________________________________________________________
-void AliTPCReconstructor::FillESD(AliRunLoader* /*runLoader*/, 
+void AliTPCReconstructor::FillESD(TTree */*digitsTree*/, TTree */*clustersTree*/,
                                  AliESDEvent* esd) const
 {
 // make PID
 
-  Double_t parTPC[] = {47., 0.10, 10.};
+  Double_t parTPC[] = {47., 0.07, 5.};
   AliTPCpidESD tpcPID(parTPC);
   tpcPID.MakePID(esd);
 }