]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Possibility to reaplay alignment
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 28 Feb 2010 10:39:08 +0000 (10:39 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 28 Feb 2010 10:39:08 +0000 (10:39 +0000)
Marian

TPC/AliTPCcalibCalib.cxx

index bc599cf3a7b9672899088888336acfbdd18aff88..088cef603998193ccd6d561247b1d412b42af28b 100644 (file)
@@ -55,6 +55,7 @@
 #include "AliESDtrack.h"
 #include "AliTracker.h"
 #include "AliTPCClusterParam.h"
+#include "AliTPCParam.h"
 
 #include "AliTPCcalibDB.h"
 #include "AliTPCTransform.h"
@@ -62,6 +63,8 @@
 #include "AliTPCclusterMI.h"
 #include "AliTPCseed.h"
 #include "AliTPCPointCorrection.h"
+#include <TGeoManager.h>
+#include <TGeoPhysicalNode.h>
 
 ClassImp(AliTPCcalibCalib)
 
@@ -221,7 +224,7 @@ Bool_t  AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Floa
                                                               cluster->GetY(),cluster->GetZ());
     Double_t dzq = AliTPCPointCorrection::SGetCorrectionSector(2,cluster->GetDetector()%36,cluster->GetX(),
                                                               cluster->GetY(),cluster->GetZ());
-    if (fApplySectorAlignment){
+    if (0&fApplySectorAlignment){
       x[0]-=dxq;
       x[1]-=dyq;
       x[2]-=dzq;
@@ -235,11 +238,11 @@ Bool_t  AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Floa
     // R correction
     Double_t corrR   = corr->CorrectionOutR0(kFALSE,kFALSE,cluster->GetX(),cluster->GetY(),cluster->GetZ(),cluster->GetDetector());
 
-    if (fApplyRPhiCorrection){
+    if (0&fApplyRPhiCorrection){
       if (cluster->GetY()>0) x[1]+=corrclY;  // rphi correction
       if (cluster->GetY()<0) x[1]-=corrclY;  // rphi correction
     }
-    if (fApplyRCorrection){      
+    if (0&fApplyRCorrection){      
       x[0]+=corrR;                           // radial correction
     }
 
@@ -253,20 +256,20 @@ Bool_t  AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Floa
     //
     // Apply alignemnt
     //
-    
-//     if (!param->IsGeoRead()) param->ReadGeoMatrices();
-//     TGeoHMatrix  *mat = param->GetClusterMatrix(cluster->GetDetector());
-//     //TGeoHMatrix  mat;
-//     Double_t pos[3]= {cluster->GetX(),cluster->GetY(),cluster->GetZ()};
-//     Double_t posC[3]={cluster->GetX(),cluster->GetY(),cluster->GetZ()};
-//     if (mat) mat->LocalToMaster(pos,posC);
-//     else{
-//       // chack Loading of Geo matrices from GeoManager - TEMPORARY FIX
-//     }
-//     cluster->SetX(posC[0]);
-//     cluster->SetY(posC[1]);
-//     cluster->SetZ(posC[2]);
-
+    if (1){
+      if (!param->IsGeoRead()) param->ReadGeoMatrices();
+      TGeoHMatrix  *mat = param->GetClusterMatrix(cluster->GetDetector());
+      //TGeoHMatrix  mat;
+      Double_t pos[3]= {cluster->GetX(),cluster->GetY(),cluster->GetZ()};
+      Double_t posC[3]={cluster->GetX(),cluster->GetY(),cluster->GetZ()};
+      if (mat) mat->LocalToMaster(pos,posC);
+      else{
+       // chack Loading of Geo matrices from GeoManager - TEMPORARY FIX
+      }
+      cluster->SetX(posC[0]);
+      cluster->SetY(posC[1]);
+      cluster->SetZ(posC[2]);
+    }
 
 
 
@@ -297,13 +300,15 @@ Bool_t  AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Floa
   //
   //
   Int_t ncl = seed->GetNumberOfClusters();
+  const Double_t kResetCov=4.;
+  const Double_t kSigma=5.;
   Double_t covar[15];
   for (Int_t i=0;i<15;i++) covar[i]=0;
-  covar[0]=10.*10.;
-  covar[2]=10.*10.;
-  covar[5]=10.*10./(64.*64.);
-  covar[9]=10.*10./(64.*64.);
-  covar[14]=0.3*0.3;
+  covar[0]=kSigma*kSigma;
+  covar[2]=kSigma*kSigma;
+  covar[5]=kSigma*kSigma/Float_t(ncl*ncl);
+  covar[9]=kSigma*kSigma/Float_t(ncl*ncl);
+  covar[14]=0.2*0.2;
   if (TMath::Abs(magesd)<0.05) {
      covar[14]=0.025*0.025;
   }
@@ -315,11 +320,13 @@ Bool_t  AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Floa
 
 
   AliExternalTrackParam trackIn  = *trackOutOld;
+  trackIn.ResetCovariance(kResetCov);
+  trackIn.AddCovariance(covar);
   if (TMath::Abs(magesd)<0.05) {
     ((Double_t&)(trackIn.GetParameter()[4]))=0.000000001;
+    ((Double_t&)(trackIn.GetCovariance()[14]))=covar[14];  // fix the line
   }  
-  trackIn.ResetCovariance(20.);
-  trackIn.AddCovariance(covar);
+
   Double_t xyz[3];
   Int_t nclIn=0,nclOut=0;
   //
@@ -350,11 +357,13 @@ Bool_t  AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Floa
   }
   //
   AliExternalTrackParam trackOut = trackIn;
+  trackOut.ResetCovariance(kResetCov);
+  trackOut.AddCovariance(covar);
   if (TMath::Abs(magesd)<0.05) {
     ((Double_t&)(trackOut.GetParameter()[4]))=0.000000001;
+    ((Double_t&)(trackOut.GetCovariance()[14]))=covar[14];  // fix the line
   }
-  trackOut.ResetCovariance(20.);
-  trackOut.AddCovariance(covar);
+
   //
   // Refit out
   //
@@ -389,7 +398,11 @@ Bool_t  AliTPCcalibCalib::RefitTrack(AliESDtrack * track, AliTPCseed *seed, Floa
   //
   nclIn=0;
   trackIn  = trackOut;
-  trackIn.ResetCovariance(10.);
+  trackIn.ResetCovariance(kResetCov);
+  if (TMath::Abs(magesd)<0.05) {
+    ((Double_t&)(trackIn.GetParameter()[4]))=0.000000001;
+    ((Double_t&)(trackIn.GetCovariance()[14]))=covar[14];  // fix the line
+  }
   //
   // Refit in one more time
   //