-
/**************************************************************************
* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
* *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+/* $Id$ */
+
////////////////////////////////////////////////////
// Stand alone tracker class //
// Origin: Elisabetta Crescio //
////////////////////////////////////////////////////
#include <stdlib.h>
-#include "TArrayI.h"
+
+#include <TArrayI.h>
#include <TBranch.h>
#include <TMath.h>
#include <TObjArray.h>
#include <TTree.h>
-#include "AliRun.h"
+
+#include "AliESD.h"
+#include "AliESDVertex.h"
+#include "AliESDtrack.h"
+#include "AliITSRiemannFit.h"
+#include "AliITSVertexer.h"
#include "AliITSclusterTable.h"
#include "AliITSclusterV2.h"
#include "AliITSgeom.h"
-#include "AliITSRiemannFit.h"
-#include "AliITStrackerSA.h"
#include "AliITStrackSA.h"
-#include "AliITSVertexer.h"
-#include "AliESDVertex.h"
-#include "AliESD.h"
-#include "AliESDtrack.h"
+#include "AliITStrackerSA.h"
+#include "AliRun.h"
ClassImp(AliITStrackerSA)
//____________________________________________________________________________
-AliITStrackerSA::AliITStrackerSA():AliITStrackerV2(){
+AliITStrackerSA::AliITStrackerSA():AliITStrackerMI(){
// Default constructor
Init();
+
}
//____________________________________________________________________________
-AliITStrackerSA::AliITStrackerSA(AliITSgeom *geom):AliITStrackerV2(geom)
+AliITStrackerSA::AliITStrackerSA(AliITSgeom *geom):AliITStrackerMI(geom)
{
// Standard constructor (Vertex is known and passed to this obj.)
Init();
fVert = 0;
fGeom = geom;
+
}
//____________________________________________________________________________
-AliITStrackerSA::AliITStrackerSA(AliITSgeom *geom, AliESDVertex *vert):AliITStrackerV2(geom)
+AliITStrackerSA::AliITStrackerSA(AliITSgeom *geom, AliESDVertex *vert):AliITStrackerMI(geom)
{
// Standard constructor (Vertex is known and passed to this obj.)
Init();
fVert = vert;
fGeom = geom;
-}
-
-//______________________________________________________________________
-AliITStrackerSA::AliITStrackerSA(const AliITStrackerSA &trkr) :
- AliITStrackerV2(trkr) {
- // Copy constructor
- // Copies are not allowed. The method is protected to avoid misuse.
- Error("AliITStrackerSA","Copy constructor not allowed\n");
-}
-
-//______________________________________________________________________
-AliITStrackerSA& AliITStrackerSA::operator=(const
- AliITStrackerSA& /* trkr */){
- // Assignment operator
- // Assignment is not allowed. The method is protected to avoid misuse.
- Error("= operator","Assignment operator not allowed\n");
- return *this;
+
}
//____________________________________________________________________________
-AliITStrackerSA::AliITStrackerSA(AliITSgeom *geom, AliITSVertexer *vertexer):AliITStrackerV2(geom)
+AliITStrackerSA::AliITStrackerSA(AliITSgeom *geom, AliITSVertexer *vertexer):AliITStrackerMI(geom)
{
// Standard constructor (Vertex is unknown - vertexer is passed to this obj)
Init();
fVertexer = vertexer;
fGeom = geom;
+
}
//____________________________________________________________________________
-AliITStrackerSA::AliITStrackerSA(AliITStrackerSA& tracker):AliITStrackerV2(){
+AliITStrackerSA::AliITStrackerSA(AliITStrackerSA& tracker):AliITStrackerMI(){
// Copy constructor
fPhiEstimate = tracker.fPhiEstimate;
for(Int_t i=0;i<2;i++){
if(fLambdaWin)delete []fLambdaWin;
fTable =0;
fListOfTracks->Delete();
- }
+ }
//____________________________________________________________________________
void AliITStrackerSA::Init(){
fITSclusters = 0;
SetSixPoints();
fListOfTracks=new TObjArray(0,0);
-}
+ }
//_______________________________________________________________________
void AliITStrackerSA::ResetForFinding(){
// Reset data members used in all loops during track finding
ResetForFinding();
Int_t pflag=0;
AliITSclusterV2* cl = layer.GetCluster(ncl);
- if(cl->IsUsed()==1) continue;
+ if(cl->IsUsed()==1) continue;
+ if(cl->TestBit(kSAflag)==kTRUE) continue;
+
fPhic = fTable->GetPhiCluster(0,ncl);
fLambdac = fTable->GetLambdaCluster(0,ncl);
fPhiEstimate = fPhic;
Int_t * nn = new Int_t[fGeom->GetNlayers()];//counter for clusters on each layer
for(Int_t i=0;i<fGeom->GetNlayers();i++){ nn[i]=0;}
- nn[0] = SearchClusters(0,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
- nn[1] = SearchClusters(1,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[0] = SearchClusters(0,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
+ nn[1] = SearchClusters(1,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
if(nn[1]>0){
pflag=1;
fPoint3[0] = fPointc[0];
fPoint3[1] = fPointc[1];
}
- nn[2] = SearchClusters(2,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[2] = SearchClusters(2,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
if(nn[1]==0 && nn[2]==0) pflag=0;
if(nn[2]!=0 && nn[1]!=0){ pflag=1; UpdatePoints();}
if(nn[2]!=0 && nn[1]==0){
fPoint3[1]=fPointc[1];
}
- nn[3] = SearchClusters(3,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[3] = SearchClusters(3,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
pflag=1;
if(nn[3]!=0) UpdatePoints();
- nn[4] = SearchClusters(4,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[4] = SearchClusters(4,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
pflag=1;
if(nn[4]!=0) UpdatePoints();
- nn[5] = SearchClusters(5,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[5] = SearchClusters(5,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
Int_t layOK=0;
while(nct--){
Int_t index = trs->GetClusterIndexSA(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
- if(kl->IsUsed()==1) kl->Use();
+ if(kl->TestBit(kSAflag)==kTRUE) kl->ResetBit(kSAflag);
}
+ delete [] nn;
+ delete trs;
continue;
}
outrack=tr2;
while(nct--){
Int_t index = tr2->GetClusterIndex(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
- if(kl->IsUsed()==0) kl->Use();
+ kl->SetBit(kSAflag);
}
}
while(nct--){
Int_t index = trs->GetClusterIndexSA(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
- if(kl->IsUsed()==1) kl->Use();
+ if(kl->TestBit(kSAflag)==kTRUE) kl->ResetBit(kSAflag);
}
}
+ delete [] nn;
delete trs;
}//end loop on clusters of layer1
Int_t pflag=0;
AliITSclusterV2* cl = layer2.GetCluster(ncl2);
if(cl->IsUsed()==1) continue;
+ if(cl->TestBit(kSAflag)==kTRUE) continue;
fPhic = fTable->GetPhiCluster(1,ncl2);
fLambdac = fTable->GetLambdaCluster(1,ncl2);
fPhiEstimate = fPhic;
for(Int_t kk=0;kk<fGeom->GetNlayers()-1;kk++)nn[kk] = 0;
for(Int_t kk=0;kk<fGeom->GetNlayers()-1;kk++){
nn[kk] = SearchClusters(kk+1,fPhiWin[nloop],fLambdaWin[nloop],
- trs,primaryVertex[2],pflag,fTable);
+ trs,primaryVertex[2],pflag);
if(nn[kk]==0)break;
if(kk>0){
UpdatePoints();
while(nct--){
Int_t index = trs->GetClusterIndexSA(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
- if(kl->IsUsed()==1) kl->Use();
+ if(kl->TestBit(kSAflag)==kTRUE) kl->ResetBit(kSAflag);
}
+ delete trs;
continue;
}
outrack=tr2;
Int_t index = tr2->GetClusterIndex(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
if(kl==0) continue;
- if(kl->IsUsed()==0) kl->Use();
+ kl->SetBit(kSAflag);
}
}
else{
Int_t index = trs->GetClusterIndexSA(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
if(kl==0) continue;
- if(kl->IsUsed()==1) kl->Use();
- }
+ if(kl->TestBit(kSAflag)==kTRUE) kl->ResetBit(kSAflag);
+ }
}
delete trs;
}//end loop on clusters of layer2
} // if(!fSixPoints....
delete [] firstmod;
- delete fTable;
+ delete fTable; fTable=0;
}
fTable = new AliITSclusterTable(fGeom,this,primaryVertex);
fTable->FillArray(fITSclusters);
fTable->FillArrayCoorAngles();
- }
+ }
Int_t * firstmod = new Int_t[fGeom->GetNlayers()];
for(Int_t i=0;i<fGeom->GetNlayers();i++){
// firstmod [i] number of the first module in the ITS layer i.
- AliITSlayer &layer=fgLayers[0]; // first layer
+ AliITSlayer &layer=fgLayers[0];
Int_t ntrack=0;
-
- Int_t dim=layer.GetNumberOfClusters();
+ Int_t dim=layer.GetNumberOfClusters();
//loop on the different windows
for(Int_t nloop=0;nloop<fNloop;nloop++){
for(Int_t ncl=0;ncl<dim;ncl++){ //loop starting from layer 0
+
ResetForFinding();
Int_t pflag=0;
AliITSclusterV2* cl = (AliITSclusterV2*)layer.GetCluster(ncl);
if(cl==0) continue;
if(cl->IsUsed()==1) continue;
+ if(cl->TestBit(kSAflag)==kTRUE) continue;
+ if (cl->GetQ()<=0) continue;
+
fPhic = fTable->GetPhiCluster(0,ncl);
fLambdac = fTable->GetLambdaCluster(0,ncl);
+
+ if (TMath::Abs(fLambdac)>0.26*TMath::Pi()) continue;
+
fPhiEstimate = fPhic;
AliITStrackSA* trs = new AliITStrackSA();
fPoint1[0]=primaryVertex[0];
fPoint2[1]=fTable->GetYCluster(0,ncl);
Int_t * nn = new Int_t[fGeom->GetNlayers()];//counter for clusters on each layer
for(Int_t i=0;i<fGeom->GetNlayers();i++){ nn[i]=0;}
- nn[0] = SearchClusters(0,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[0] = SearchClusters(0,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
- nn[1] = SearchClusters(1,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[1] = SearchClusters(1,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
if(nn[1]>0){
pflag=1;
fPoint3[0] = fPointc[0];
fPoint3[1] = fPointc[1];
}
- nn[2] = SearchClusters(2,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[2] = SearchClusters(2,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
if(nn[1]==0 && nn[2]==0) pflag=0;
if(nn[2]!=0 && nn[1]!=0){ pflag=1; UpdatePoints();}
if(nn[2]!=0 && nn[1]==0){
fPoint3[1]=fPointc[1];
}
- nn[3] = SearchClusters(3,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[3] = SearchClusters(3,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
pflag=1;
if(nn[3]!=0) UpdatePoints();
- nn[4] = SearchClusters(4,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[4] = SearchClusters(4,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
pflag=1;
if(nn[4]!=0) UpdatePoints();
- nn[5] = SearchClusters(5,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag,fTable);
+ nn[5] = SearchClusters(5,fPhiWin[nloop],fLambdaWin[nloop],trs,primaryVertex[2],pflag);
Int_t layOK=0;
while(nct--){
Int_t index = trs->GetClusterIndexSA(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
- if(kl->IsUsed()==1) kl->Use();
+ if(kl->TestBit(kSAflag)==kTRUE) kl->ResetBit(kSAflag);
+
}
continue;
}
outtrack.UpdateTrackParams(tr2,AliESDtrack::kITSin);
event->AddTrack(&outtrack);
ntrack++;
- Int_t nct = tr2->GetNumberOfClusters();
+ Int_t nct = tr2->GetNumberOfClusters();
while(nct--){
Int_t index = tr2->GetClusterIndex(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
- if(kl->IsUsed()==0) kl->Use();
-
- }
- }
+ kl->SetBit(kSAflag);
+
+ }
+ }
else{
- Int_t nct = trs->GetNumberOfClustersSA();
- while(nct--){
- Int_t index = trs->GetClusterIndexSA(nct);
- AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
- if(kl->IsUsed()==1) kl->Use();
+ Int_t nct = trs->GetNumberOfClustersSA();
+ while(nct--){
+ Int_t index = trs->GetClusterIndexSA(nct);
+ AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
+ if(kl->TestBit(kSAflag)==kTRUE) kl->ResetBit(kSAflag);
+
}
}
delete trs;
delete[] nn;
-
+
}//end loop on clusters of layer1
-
+
}//end loop2
+
+
//if 5/6 points are required, second loop starting
//from second layer, to find tracks with point of
//layer 1 missing
// counter for clusters on each layer
Int_t * nn = new Int_t[fGeom->GetNlayers()-1];
for(Int_t nloop=0;nloop<fNloop;nloop++){
- AliITSlayer &layer2=fgLayers[1]; //loop on layer 2
+ AliITSlayer &layer2=fgLayers[1];
Int_t ncl2=layer2.GetNumberOfClusters();
while(ncl2--){ //loop starting from layer 2
ResetForFinding();
Int_t pflag=0;
AliITSclusterV2* cl = layer2.GetCluster(ncl2);
if(cl->IsUsed()==1) continue;
+ if(cl->TestBit(kSAflag)==kTRUE) continue;
fPhic = fTable->GetPhiCluster(1,ncl2);
fLambdac = fTable->GetLambdaCluster(1,ncl2);
fPhiEstimate = fPhic;
for(Int_t kk=0;kk<fGeom->GetNlayers()-1;kk++)nn[kk] = 0;
for(Int_t kk=0;kk<fGeom->GetNlayers()-1;kk++){
nn[kk] = SearchClusters(kk+1,fPhiWin[nloop],fLambdaWin[nloop],
- trs,primaryVertex[2],pflag,fTable);
+ trs,primaryVertex[2],pflag);
if(nn[kk]==0)break;
if(kk>0){
UpdatePoints();
if(fl>=5){ // 5/6
AliITStrackV2* tr2 = FitTrack(trs,primaryVertex,errorsprimvert);
if(tr2==0){
- ntrack++;
- Int_t nct = trs->GetNumberOfClustersSA();
+ Int_t nct = trs->GetNumberOfClustersSA();
while(nct--){
Int_t index = trs->GetClusterIndexSA(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
- if(kl->IsUsed()==1) kl->Use();
+ if(kl->TestBit(kSAflag)==kTRUE) kl->ResetBit(kSAflag);
+
}
continue;
AliESDtrack outtrack;
outtrack.UpdateTrackParams(tr2,AliESDtrack::kITSin);
event->AddTrack(&outtrack);
+ ntrack++;
Int_t nct = tr2->GetNumberOfClusters();
while(nct--){
Int_t index = tr2->GetClusterIndex(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
if(kl==0) continue;
- if(kl->IsUsed()==0) kl->Use();
- }
+ kl->SetBit(kSAflag);
+ }
}
else{
Int_t nct = trs->GetNumberOfClustersSA();
Int_t index = trs->GetClusterIndexSA(nct);
AliITSclusterV2* kl = (AliITSclusterV2*)GetCluster(index);
if(kl==0) continue;
- if(kl->IsUsed()==1) kl->Use();
+ if(kl->TestBit(kSAflag)==kTRUE) kl->ResetBit(kSAflag);
+
}
}
delete trs;
} //end opt="5/6"
delete [] firstmod;
- delete fTable;
+ delete fTable;fTable=0;
Info("FindTracks","Number of found tracks: %d",event->GetNumberOfTracks());
-
return 0;
}
for(Int_t i=0;i<fGeom->GetNlayers();i++){
firstmod[i]=fGeom->GetModuleIndex(i+1,1,1);
}
- AliITStrackV2* otrack2;
+
Int_t nclusters = tr->GetNumberOfClustersSA();
TObjArray** listlayer = new TObjArray*[fGeom->GetNlayers()];
for(Int_t i=0;i<fGeom->GetNlayers();i++){
Int_t index = tr->GetClusterIndexSA(ncl);
AliITSclusterV2* cl = (AliITSclusterV2*)GetCluster(index);
- if(cl->IsUsed()==1) cl->Use();
+ if(cl->TestBit(kSAflag)==kTRUE) cl->ResetBit(kSAflag);
Int_t lay = (index & 0xf0000000) >> 28;
if(lay==0) { listlayer[0]->AddLast(cl); clind0[nnn[0]]=index;nnn[0]++;}
if(lay==1) { listlayer[1]->AddLast(cl); clind1[nnn[1]]=index;nnn[1]++;}
Float_t seed1,seed2,seed3;
AliITSRiemannFit fit;
Int_t rf = fit.FitHelix(3,recp,errs,seed1,seed2,seed3); //this gives phi,tgl,curvature to start Kalman Filter
- if(rf==0) continue;
+ if(rf==0) {
+ for(Int_t i=1;i<3;i++){
+ delete recp[i];
+ delete errs[i];
+ }
+ continue;
+ }
Double_t phi=seed1;
Double_t tgl=seed2;
if(cl1!=0) trac->AddClusterV2(1,(clind1[l2] & 0x0fffffff)>>0);
if(cl0!=0) trac->AddClusterV2(0,(clind0[l1] & 0x0fffffff)>>0);
- //fit with Kalman filter using AliITStrackerV2::RefitAt()
+ //fit with Kalman filter using AliITStrackerMI::RefitAt()
- AliITStrackV2* ot = new AliITStrackV2(*trac);
+ AliITStrackMI* ot = new AliITStrackSA(*trac);
ot->ResetCovariance();
ot->ResetClusters();
if(RefitAt(49.,ot,trac)){ //fit from layer 1 to layer 6
- otrack2 = new AliITStrackV2(*ot);
+ AliITStrackMI *otrack2 = new AliITStrackMI(*ot);
otrack2->ResetCovariance();
otrack2->ResetClusters();
//fit from layer 6 to layer 1
- if(RefitAt(3.7,otrack2,ot)) fListOfTracks->AddLast(otrack2);
+ if(RefitAt(3.7,otrack2,ot)) {
+ fListOfTracks->AddLast(otrack2);
+ } else {
+ delete otrack2;
+ }
}
for(Int_t i=0;i<fGeom->GetNlayers();i++){
delete listlayer[i];
}
- delete listlayer;
+ delete [] listlayer;
+ delete [] firstmod;
return 0;
}
AliITStrackV2* otrack =(AliITStrackV2*)FindTrackLowChiSquare(fListOfTracks,dim);
- if(otrack==0) return 0;
+ if(otrack==0) {
+ for(Int_t i=0;i<fGeom->GetNlayers();i++){
+ delete listlayer[i];
+ }
+ delete [] listlayer;
+ delete [] firstmod;
+ return 0;
+ }
Int_t * indexc = new Int_t[fGeom->GetNlayers()];
for(Int_t i=0;i<fGeom->GetNlayers();i++) indexc[i]=0;
for(Int_t nind=0;nind<otrack->GetNumberOfClusters();nind++){
Int_t numberofpoints;
if(fSixPoints) numberofpoints=6;
else numberofpoints=5;
+ CookLabel(otrack,0.); //MI change - to see fake ratio
Int_t label = Label(cl0->GetLabel(0),cl1->GetLabel(0),
cl2->GetLabel(0),cl3->GetLabel(0),
cl4->GetLabel(0),labl[0],
for(Int_t i=0;i<fGeom->GetNlayers();i++){
delete listlayer[i];
}
- delete listlayer;
+ delete [] listlayer;
delete [] firstmod;
return otrack;
for(Int_t k=0;k<ncl;k++){
Int_t index = ttrrt->GetClusterIndex(k);
AliITSclusterV2* clui = (AliITSclusterV2*)GetCluster(index);
- if(clui->IsUsed()==0) clui->Use();
+ if(clui->IsUsed()==0) clui->Use();
+
}
}
delete ttrrt;
}
+/*
//_______________________________________________________
-Int_t AliITStrackerSA::SearchClusters(Int_t layer,Double_t phiwindow,Double_t lambdawindow, AliITStrackSA* trs,Double_t zvertex,Int_t pflag,AliITSclusterTable* table){
+Int_t AliITStrackerSA::SearchClusters(Int_t layer,Double_t phiwindow,Double_t lambdawindow, AliITStrackSA* trs,Double_t zvertex,Int_t pflag){
//function used to to find the clusters associated to the track
Int_t nc=0;
AliITSlayer &lay = fgLayers[layer];
delete[] firstmod;
return 0;
}
+
Double_t fi1 =TMath::ATan2(cy1,cx1);
Double_t fi2 =TMath::ATan2(cy2,cx2);
fPhiEstimate = ChoosePoint(fi1,fi2,fPhic);
Int_t nn=0;
- TArrayI* array =(TArrayI*)table->GetListOfClusters(nmod);
+ TArrayI* array =(TArrayI*)fTable->GetListOfClusters(nmod);
TArrayI* listc = new TArrayI(array->GetSize());
for(Int_t i=0;i<array->GetSize();i++){
Int_t in=(Int_t)array->At(i);
listc->AddAt(in,nn);
nn++;
}
-
+
Int_t k=0;
Int_t val;
while(k<8){
for(Int_t ii=0;ii<8;ii++){
if(nm[ii]!=value && nm[ii]!=nmod && nm[ii]>=0){
- TArrayI* ar =(TArrayI*)table->GetListOfClusters(nm[ii]+firstmod[layer]);
+ TArrayI* ar =(TArrayI*)fTable->GetListOfClusters(nm[ii]+firstmod[layer]);
listc->Set(listc->GetSize()+ar->GetSize());
for(Int_t j=0;j<ar->GetSize();j++){
Int_t in=(Int_t)ar->At(j);
Int_t index = (Int_t)listc->At(i);
AliITSclusterV2* cllay = lay.GetCluster(index);
if(cllay==0) continue;
- if(cllay->IsUsed()==1) continue;
+ if(cllay->IsUsed()==1) continue;
+ if(cllay->TestBit(kSAflag)==kTRUE) continue;
Double_t phi = fTable->GetPhiCluster(layer,index);
Double_t lambda= fTable->GetLambdaCluster(layer,index);
return 0;
}
trs->AddClusterSA(layer,index);
- cllay->Use();
+ cllay->SetBit(kSAflag);
fPhiEstimate=phi;
fPointc[0]=fTable->GetXCluster(layer,index);
fPointc[1]=fTable->GetYCluster(layer,index);
return nc;
}
+*/
+
+//_______________________________________________________
+Int_t AliITStrackerSA::SearchClusters(Int_t layer,Double_t phiwindow,Double_t lambdawindow, AliITStrackSA* trs,Double_t zvertex,Int_t pflag){
+ //function used to to find the clusters associated to the track
+ Int_t nc=0;
+ AliITSlayer &lay = fgLayers[layer];
+ Double_t r=lay.GetR(),tgl=TMath::Tan(fLambdac);
+
+ if(pflag==1){
+ Float_t cx1,cx2,cy1,cy2;
+ FindEquation(fPoint1[0],fPoint1[1],fPoint2[0],fPoint2[1],fPoint3[0],fPoint3[1],fCoef1,fCoef2,fCoef3);
+ if (FindIntersection(fCoef1,fCoef2,fCoef3,-r*r,cx1,cy1,cx2,cy2)==0)
+ return 0;
+ Double_t fi1=TMath::ATan2(cy1,cx1);
+ Double_t fi2=TMath::ATan2(cy2,cx2);
+ fPhiEstimate=ChoosePoint(fi1,fi2,fPhic);
+ }
+
+ Double_t dz=r*lambdawindow*TMath::Sqrt(1+tgl*tgl) + 0.3*TMath::Abs(tgl);
+ Double_t zmax=r*tgl + zvertex + dz;
+ Double_t zmin=r*tgl + zvertex - dz;
+
+ Int_t indmin = lay.FindClusterIndex(zmin);
+ Int_t indmax = lay.FindClusterIndex(zmax);
+ for (Int_t index=indmin; index<indmax; index++) {
+ AliITSclusterV2 *c=lay.GetCluster(index);
+ if (c->IsUsed()) continue;
+ if (c->GetQ()<=0) continue;
+ if (c->TestBit(kSAflag)==kTRUE) continue;
+
+ Double_t phi =fTable->GetPhiCluster(layer,index);
+ if (TMath::Abs(phi-fPhiEstimate)>phiwindow) continue;
+
+ Double_t lambda=fTable->GetLambdaCluster(layer,index);
+ if (TMath::Abs(lambda-fLambdac)>lambdawindow) continue;
+
+ if(trs->GetNumberOfClustersSA()==15) return 0;
+
+ trs->AddClusterSA(layer,index);
+ nc++;
+ fLambdac=lambda;
+ fPhiEstimate=phi;
+ fPointc[0]=fTable->GetXCluster(layer,index);
+ fPointc[1]=fTable->GetYCluster(layer,index);
+
+ c->SetBit(kSAflag);
+ }
+ return nc;
+}
//________________________________________________________________
void AliITStrackerSA::UpdatePoints(){
//update of points for the estimation of the curvature
- fPoint1[0]=fPoint2[0];
- fPoint1[1]=fPoint2[1];
+ //fPoint1[0]=fPoint2[0];
+ //fPoint1[1]=fPoint2[1];
fPoint2[0]=fPoint3[0];
fPoint2[1]=fPoint3[1];
fPoint3[0]=fPointc[0];
}
-
-
//___________________________________________________________________
Int_t AliITStrackerSA::FindEquation(Float_t x1, Float_t y1, Float_t x2, Float_t y2, Float_t x3, Float_t y3,Float_t& a, Float_t& b, Float_t& c){
//c2 is -rlayer*rlayer
if(a1==0) return 0;
- Float_t m = c2-c1;
- Float_t aA = (b1*b1)/(a1*a1)+1;
- Float_t bB = (-2*m*b1/(a1*a1));
- Float_t cC = c2+(m*m)/(a1*a1);
- if((bB*bB-4*aA*cC)<0) return 0;
+ Double_t m = c2-c1;
+ Double_t aA = (b1*b1)/(a1*a1)+1;
+ Double_t bB = (-2*m*b1/(a1*a1));
+ Double_t cC = c2+(m*m)/(a1*a1);
+ Double_t dD = bB*bB-4*aA*cC;
+ if(dD<0) return 0;
- y1 = (-bB+TMath::Sqrt(bB*bB-4*aA*cC))/(2*aA);
- y2 = (-bB-TMath::Sqrt(bB*bB-4*aA*cC))/(2*aA);
+ y1 = (-bB+TMath::Sqrt(dD))/(2*aA);
+ y2 = (-bB-TMath::Sqrt(dD))/(2*aA);
x1 = (c2-c1-b1*y1)/a1;
x2 = (c2-c1-b1*y2)/a1;
}
}
else { // default values
-
- Double_t phid[32] = {0.002,0.003,0.004,0.0045,0.0047,
+
+ Double_t phid[33] = {0.002,0.003,0.004,0.0045,0.0047,
0.005,0.0053,0.0055,
0.006,0.0063,0.0065,0.007,0.0073,0.0075,0.0077,
0.008,0.0083,0.0085,0.0087,0.009,0.0095,0.0097,
- 0.01,0.0105,0.011,0.0115,0.012,0.0125,0.013,0.0135,
- 0.014};
- Double_t lambdad[32] = {0.002,0.003,0.004,0.0045,0.0047,
- 0.005,0.0053,0.0055,
- 0.006,0.0063,0.0065,0.007,0.0073,0.0075,0.0077,
- 0.008,0.0083,0.0085,0.0087,0.009,0.0095,0.0097,
- 0.01,0.015,0.011,0.0115,0.012,0.0125,0.013,0.0135,
- 0.014};
+ 0.01,0.0105,0.011,0.0115,0.012,0.0125,0.013,0.0135,0.0140,0.0145};
+ Double_t lambdad[33] = {0.003,0.004,0.005,0.005,0.005,
+ 0.005,0.005,0.006,
+ 0.006,0.006,0.006,0.007,0.007,0.007,0.007,
+ 0.007,0.007,0.007,0.007,0.007,0.007,0.007,
+ 0.008,0.008,0.008,0.008,0.008,0.008,0.008,0.008,0.008,0.008};
- if(fNloop!=32){
- fNloop = 32;
+ if(fNloop!=33){
+ fNloop = 33;
}
-
+
+
fPhiWin = new Double_t[fNloop];
fLambdaWin = new Double_t[fNloop];
}
-