]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCReconstructor.cxx
Coverity
[u/mrichter/AliRoot.git] / TPC / AliTPCReconstructor.cxx
index 7add769d1225318246ae6b996ac6765363024936..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(),
@@ -47,11 +62,11 @@ fClusterer(NULL)
   //
   // default constructor
   //
-  if (!fgkRecoParam) {
-    AliError("The Reconstruction parameters nonitialized - Used default one");
-    fgkRecoParam = AliTPCRecoParam::GetHighFluxParam();
-  }
-
+  //
+  //
+  AliTPCcalibDB * calib = AliTPCcalibDB::Instance();
+  const AliMagF * field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+  calib->SetExBField(field);
   AliTPCParam* param = GetTPCParam();
   if (!param) {
     AliWarning("Loading default TPC parameters !");
@@ -60,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;
 }
 
@@ -80,9 +110,6 @@ void AliTPCReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) co
 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);
@@ -99,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);
+*/
 }
 
 
@@ -123,3 +156,39 @@ AliTPCParam* AliTPCReconstructor::GetTPCParam() const
 
   return param;
 }
+
+
+//_____________________________________________________________________________
+void AliTPCReconstructor::ParseOptions( AliTPCtrackerMI* tracker ) const
+{
+// parse options from rec.C and set in clusterer and tracker
+  
+  TString option = GetOption();
+  
+  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;
+}