#include "AliESDtrack.h"
#include "AliTracker.h"
#include "AliTPCClusterParam.h"
+#include "AliTPCParam.h"
#include "AliTPCcalibDB.h"
#include "AliTPCTransform.h"
#include "AliTPCclusterMI.h"
#include "AliTPCseed.h"
#include "AliTPCPointCorrection.h"
+#include <TGeoManager.h>
+#include <TGeoPhysicalNode.h>
ClassImp(AliTPCcalibCalib)
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;
// 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
}
//
// 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]);
+ }
//
//
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;
}
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;
//
}
//
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
//
//
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
//