]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCtrackerMI.cxx
Removing error message in SetFastCluster (Marian)
[u/mrichter/AliRoot.git] / TPC / AliTPCtrackerMI.cxx
index 9d519cc3945cd031f585db589faf9b6587cda26c..2434d24f34e788c035dc5f42bc2721bcd2d6765c 100644 (file)
 #include "AliAlignObj.h"
 #include "AliTrackPointArray.h"
 #include "TRandom.h"
-//#include "AliTPCTransform.h"
+#include "AliTPCcalibDB.h"
+#include "AliTPCTransform.h"
 
 //
 
@@ -1301,19 +1302,34 @@ void   AliTPCtrackerMI::Transform(AliTPCclusterMI * cluster){
   //
   //
   //
-//   AliTPCTransform trafo;
-
-//   Double_t x[3]={cluster->GetX(),cluster->GetY(),cluster->GetZ()};
-//   Int_t i[1]={cluster->GetDetector()};
-
-//   trafo.Transform(x,i,0,1);
-
-//   cluster->SetX(x[0]);
-//   cluster->SetY(x[1]);
-//   cluster->SetZ(x[2]);
-
-//   return;
+  AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
+  if (!transform) {
+    AliFatal("Tranformations not in calibDB");
+  }
+  Double_t x[3]={cluster->GetRow(),cluster->GetPad(),cluster->GetTimeBin()};
+  Int_t i[1]={cluster->GetDetector()};
+  transform->Transform(x,i,0,1);  
+  if (!AliTPCReconstructor::GetRecoParam()->GetBYMirror()){
+    if (cluster->GetDetector()%36>17){
+      x[1]*=-1;
+    }
+  }
 
+  //
+  // in debug mode  check the transformation
+  //
+  if (AliTPCReconstructor::StreamLevel()>1) {
+    TTreeSRedirector &cstream = *fDebugStreamer;
+    cstream<<"Transform"<<
+      "x0="<<x[0]<<
+      "x1="<<x[1]<<
+      "x2="<<x[2]<<
+      "Cl.="<<cluster<<
+      "\n"; 
+  }
+  cluster->SetX(x[0]);
+  cluster->SetY(x[1]);
+  cluster->SetZ(x[2]);
   // The old stuff:
 
   //
@@ -1328,9 +1344,9 @@ void   AliTPCtrackerMI::Transform(AliTPCclusterMI * cluster){
   else{
     // chack Loading of Geo matrices from GeoManager - TEMPORARY FIX
   }
-  //cluster->SetX(posC[0]);
-  //cluster->SetY(posC[1]);
-  //cluster->SetZ(posC[2]);
+  cluster->SetX(posC[0]);
+  cluster->SetY(posC[1]);
+  cluster->SetZ(posC[2]);
 }
 
 //_____________________________________________________________________________
@@ -4425,7 +4441,7 @@ void  AliTPCtrackerMI::FindSplitted(TObjArray * array, AliESDEvent */*esd*/, Int
 
 
 
-void  AliTPCtrackerMI::FindCurling(TObjArray * array, AliESDEvent *esd, Int_t iter)
+void  AliTPCtrackerMI::FindCurling(TObjArray * array, AliESDEvent */*esd*/, Int_t iter)
 {
   //
   //  find Curling tracks
@@ -7045,6 +7061,10 @@ AliTPCtrackerMI::AliTPCRow::InsertCluster(const AliTPCclusterMI* c, UInt_t index
   if (fN==kMaxClusterPerRow) {
     cerr<<"AliTPCRow::InsertCluster(): Too many clusters !\n"; return;
   }
+  if (fN>=fN1+fN2) {
+    cout<<"AliTPCRow::InsertCluster(): Too many clusters !\n";
+  }
+
   if (fN==0) {fIndex[0]=index; fClusters[fN++]=c; return;}
   Int_t i=Find(c->GetZ());
   memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTPCclusterMI*));
@@ -7147,6 +7167,16 @@ AliTPCclusterMI * AliTPCtrackerMI::AliTPCRow::FindNearest2(Double_t y, Double_t
 }
 
 
+void AliTPCtrackerMI::AliTPCRow::SetFastCluster(Int_t i, Short_t cl){
+  //
+  // Set cluster info for fast navigation
+  //
+  if (i>510|| i<0){
+  }else{
+    fFastCluster[i]=cl;
+  }
+}
+