]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterParam.cxx
CreateVertexer now instantiates by default a AliITSVertexer3D object.
[u/mrichter/AliRoot.git] / ITS / AliITSClusterParam.cxx
index 6a4cda84bcc583af0e0515dd36d0afe1cb6b78f1..3e8982cf295b15a7bf3f076f8f2c50f073a7d427 100644 (file)
@@ -112,26 +112,38 @@ void AliITSClusterParam::GetNTeor(Int_t layer,const AliITSRecPoint* /*cl*/,
 Int_t AliITSClusterParam::GetError(Int_t layer,
                                   const AliITSRecPoint *cl,
                                   Float_t tgl,Float_t tgphitr,Float_t expQ,
-                                  Float_t &erry,Float_t &errz)
+                                  Float_t &erry,Float_t &errz,
+                                  Bool_t addMisalErr)
 {
   //
   // Calculate cluster position error
   //
+  Int_t retval=0;
   switch(AliITSReconstructor::GetRecoParam()->GetClusterErrorsParam()) {
   case 0: 
-    return GetErrorOrigRecPoint(cl,erry,errz);
+    retval = GetErrorOrigRecPoint(cl,erry,errz);
     break;
   case 1: 
-    return GetErrorParamMI(layer,cl,tgl,tgphitr,expQ,erry,errz);
+    retval = GetErrorParamMI(layer,cl,tgl,tgphitr,expQ,erry,errz);
     break;
   case 2: 
-    return GetErrorParamAngle(layer,cl,tgl,tgphitr,erry,errz);
+    retval = GetErrorParamAngle(layer,cl,tgl,tgphitr,erry,errz);
     break;
   default: 
-    return GetErrorParamMI(layer,cl,tgl,tgphitr,expQ,erry,errz);
+    retval = GetErrorParamMI(layer,cl,tgl,tgphitr,expQ,erry,errz);
     break;
   }
 
+  if(addMisalErr) {
+    // add error due to misalignment (to be improved)
+    Float_t errmisal2 = AliITSReconstructor::GetRecoParam()->GetClusterMisalError()
+      *AliITSReconstructor::GetRecoParam()->GetClusterMisalError();
+    erry = TMath::Sqrt(erry*erry+errmisal2);
+    errz = TMath::Sqrt(errz*errz+errmisal2);
+  }
+
+  return retval;
+
 }
 //--------------------------------------------------------------------------
 Int_t AliITSClusterParam::GetErrorOrigRecPoint(const AliITSRecPoint*cl,
@@ -344,10 +356,10 @@ Int_t AliITSClusterParam::GetErrorParamAngle(Int_t layer,
   p[1] = TMath::Sin(phiglob);
   p[2] = tgl;
   TVector3 pvec(p[0],p[1],p[2]);
-  TVector3 normvec(rot[1],-rot[0],0.);
+  TVector3 normvec(rot[1],rot[4],rot[7]);
   Double_t angle = pvec.Angle(normvec);
   if(angle>0.5*TMath::Pi()) angle = TMath::Pi()-angle;
-  Double_t angleDeg = angle*TMath::Pi()/180.;
+  Double_t angleDeg = angle*180./TMath::Pi();
   
   if(layer==0 || layer==1) { // SPD