]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITStrackerSA.cxx
load AddTaskEmcalJet.C
[u/mrichter/AliRoot.git] / ITS / AliITStrackerSA.cxx
index 8d8555b71340894a8a75c2dd4acae86b5fcdd299..ea8abebb330c94bfd3515b6d7877e8c36e4c35eb 100644 (file)
@@ -27,7 +27,7 @@
 #include <TBranch.h>
 #include <TObjArray.h>
 #include <TTree.h>
-#include "AliSysInfo.h" // memory snapshots
+
 #include "AliESDEvent.h"
 #include "AliESDVertex.h"
 #include "AliESDtrack.h"
@@ -40,8 +40,6 @@
 #include "AliITSReconstructor.h"
 #include "AliLog.h"
 #include "AliRun.h"
-#include "AliClonesPool.h"
-#include "AliPoolsSet.h"
 
 ClassImp(AliITStrackerSA)
 
@@ -130,12 +128,9 @@ Int_t AliITStrackerSA::Clusters2Tracks(AliESDEvent *event){
 // is done in the ITS only. In the standard reconstruction chain this option
 // can be set via AliReconstruction::SetOption("ITS","onlyITS")
   Int_t rc=0;
-  if (fPools && !fPools->GetPoolTrITS()) fPools->SetPool(new AliClonesPool("AliITStrackMI",5000), AliPoolsSet::kPoolTrITS);
-  //
-  static int eventNr = 0;
+
   if(!fITSStandAlone){
     rc=AliITStrackerMI::Clusters2Tracks(event);
-    AliSysInfo::AddStamp(Form("TracMI_%d",eventNr), -1,1,-1);
   }
   else {
     AliDebug(1,"Stand Alone flag set: doing tracking in ITS alone\n");
@@ -150,7 +145,6 @@ Int_t AliITStrackerSA::Clusters2Tracks(AliESDEvent *event){
       rc=FindTracks(event,kTRUE);
     }
   }
-  eventNr++;
   return rc;
 }
 
@@ -207,7 +201,6 @@ void AliITStrackerSA::ResetForFinding(){
 Int_t AliITStrackerSA::FindTracks(AliESDEvent* event, Bool_t useAllClusters){
 
 // Track finder using the ESD object
-  static int eventNr = 0;
 
   AliDebug(2,Form(" field is %f",event->GetMagneticField()));
   AliDebug(2,Form("SKIPPING %d %d %d %d %d %d",ForceSkippingOfLayer(0),ForceSkippingOfLayer(1),ForceSkippingOfLayer(2),ForceSkippingOfLayer(3),ForceSkippingOfLayer(4),ForceSkippingOfLayer(5)));
@@ -457,8 +450,6 @@ Int_t AliITStrackerSA::FindTracks(AliESDEvent* event, Bool_t useAllClusters){
   
   if(!useAllClusters) AliInfo(Form("Number of found tracks: %d",event->GetNumberOfTracks()));
   ResetForFinding();
-  AliSysInfo::AddStamp(Form("TracSA_%d",eventNr), useAllClusters ? 1:0,1,-1);
-  eventNr++;
   return 0;
 
 }
@@ -785,11 +776,18 @@ Int_t AliITStrackerSA::FindEquation(Double_t x1, Double_t y1, Double_t x2, Doubl
 
    //given (x,y) of three recpoints (in global coordinates) 
    //returns the parameters a,b,c of circonference x*x + y*y +a*x + b*y +c
-
-   Double_t den = (x3-x1)*(y2-y1)-(x2-x1)*(y3-y1);
+   double dx31=x3-x1,dy31=y3-y1,dx21=x2-x1,dy21=y2-y1;
+   Double_t den = dx31*dy21-dx21*dy31;
    if(den==0) return 0;
-   a = ((y3-y1)*(x2*x2+y2*y2-x1*x1-y1*y1)-(y2-y1)*(x3*x3+y3*y3-x1*x1-y1*y1))/den;
-   b = -(x2*x2-x1*x1+y2*y2-y1*y1+a*(x2-x1))/(y2-y1);
+   else den = 1./den;
+   //
+   double r31 = -dx31*(x1+x3) - dy31*(y1+y3);
+   double r21 = -dx21*(x1+x2) - dy21*(y1+y2);
+   //
+   double da = r31*dy21 - r21*dy31;
+   double db = r21*dx31 - r31*dx21;
+   a = da*den;
+   b = db*den;
    c = -x1*x1-y1*y1-a*x1-b*y1;
    return 1;
  }