]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCReconstructor.cxx
skim task first usable version
[u/mrichter/AliRoot.git] / TPC / AliTPCReconstructor.cxx
index 3f2b51e3719da6d11334d7f5b220978c6e86134b..784616b294bb41edbfe1b91bb12d75d4febe1c33 100644 (file)
 
 /* $Id$ */
 
+//--------------------------------------------------------------------
+//          Options for the TPC Reconstruction in rec.C
+//
+//  4 options can be set to change the input for TPC reconstruction
+//  which overwrites the usage of fUseHLTClusters of the AliTPCRecoParam
+//
+//  1) useRAW        - use RAW, if not present -> do nothing
+//  2) useRAWorHLT   - use RAW, if not present -> use HLT clusters
+//  3) useHLT        - use HLT clusters, if not present -> do nothing
+//  4) useHLTorRAW   - use HLT clusters, if not present -> use RAW
+//
+//  -> The current default is useHLTorRAW
+//--------------------------------------------------------------------
+
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 // class for TPC reconstruction                                              //
 #include "AliRawReader.h"
 #include "AliTPCclustererMI.h"
 #include "AliTPCtrackerMI.h"
-#include "AliTPCpidESD.h"
+//#include "AliTPCpidESD.h"
 #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
-
+Int_t    AliTPCReconstructor::fgStreamLevel     = 1;        // stream (debug) level
+AliTPCAltroEmulator *  AliTPCReconstructor::fAltroEmulator=0;    // ALTRO emulator
 
 AliTPCReconstructor::AliTPCReconstructor():
 AliReconstructor(),
@@ -49,7 +64,9 @@ fClusterer(NULL)
   //
   //
   //
+  AliTPCcalibDB * calib = AliTPCcalibDB::Instance();
+  const AliMagF * field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+  calib->SetExBField(field);
   AliTPCParam* param = GetTPCParam();
   if (!param) {
     AliWarning("Loading default TPC parameters !");
@@ -58,10 +75,25 @@ fClusterer(NULL)
   fClusterer = new AliTPCclustererMI(param);
 }
 
+AliTPCReconstructor::AliTPCReconstructor(const AliTPCReconstructor& /*rec*/):
+AliReconstructor(),
+fClusterer(NULL)
+{
+  //
+  // Dummy copu constructor
+  //
+}
+
+AliTPCReconstructor& AliTPCReconstructor::operator=(const AliTPCReconstructor&){
+  //
+  // dummy operator
+  //
+  return *this;
+}
+
 //_____________________________________________________________________________
 AliTPCReconstructor::~AliTPCReconstructor()
 {
-  if (fgkRecoParam) delete fgkRecoParam;
   if (fClusterer)   delete fClusterer;
 }
 
@@ -94,18 +126,24 @@ AliTracker* AliTPCReconstructor::CreateTracker() const
     param = new AliTPCParamSR;
   }
   param->ReadGeoMatrices();
-  return new AliTPCtrackerMI(param);
+  
+  AliTPCtrackerMI* tracker = new AliTPCtrackerMI(param);
+
+  ParseOptions(tracker);
+
+  return tracker;
 }
 
 //_____________________________________________________________________________
 void AliTPCReconstructor::FillESD(TTree */*digitsTree*/, TTree */*clustersTree*/,
-                                 AliESDEvent* esd) const
+                                 AliESDEvent* /*esd*/) const
 {
 // make PID
-
-  Double_t parTPC[] = {47., 0.07, 5.};
+/*  Now done in AliESDpid
+  Double_t parTPC[] = {50., 0.07, 5.};  // MIP nnormalized to channel 50 -MI
   AliTPCpidESD tpcPID(parTPC);
   tpcPID.MakePID(esd);
+*/
 }
 
 
@@ -120,27 +158,37 @@ AliTPCParam* AliTPCReconstructor::GetTPCParam() const
 }
 
 
-
-
-const AliTPCRecoParam* AliTPCReconstructor::GetRecoParam(){ 
-  //
-  // Get reconstruction parameters
-  //
+//_____________________________________________________________________________
+void AliTPCReconstructor::ParseOptions( AliTPCtrackerMI* tracker ) const
+{
+// parse options from rec.C and set in clusterer and tracker
+  
+  TString option = GetOption();
   
-   if (!fgkRecoParam) {
-    //
-    // 1. try to get reco parameters from OCDB 
-    //
-    fgkRecoParam = AliTPCcalibDB::Instance()->GetRecoParam(0);
-    //Info("","Reconstruction parameters from OCDB used");
-    //
-    // 2. If not initialized take default
-    //
-    if (!fgkRecoParam){
-      fgkRecoParam = AliTPCRecoParam::GetHighFluxParam();
-      //Error("","Default reconstruction parameters  used");
-    }
+  Int_t useHLTClusters = 3;
+
+  if (option.Contains("use")) {
+    
+    AliInfo(Form("Overide TPC RecoParam with option %s",option.Data()));
+    
+    if (!option.CompareTo("useRAW"))
+      useHLTClusters = 1;
+    if (!option.CompareTo("useRAWorHLT"))
+      useHLTClusters = 2;
+    if (!option.CompareTo("useHLT"))
+      useHLTClusters = 3;
+    if (!option.CompareTo("useHLTorRAW"))
+      useHLTClusters = 4;
   }
+  else {
+    const AliTPCRecoParam* param = GetRecoParam();
+    useHLTClusters = param->GetUseHLTClusters();
+  }
+
+  AliInfo(Form("Usage of HLT clusters in TPC reconstruction : %d", useHLTClusters));
+
+  fClusterer->SetUseHLTClusters(useHLTClusters);
+  tracker->SetUseHLTClusters(useHLTClusters);
 
-  return fgkRecoParam;
+  return;
 }