* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.18 2003/10/17 15:42:14 kowal2
-Back to the previous version. The warning was erronously generated
-by the compiler
-
-Revision 1.17 2003/10/17 12:28:02 kowal2
-Removed "always true" comparison
-
-Revision 1.16 2003/10/17 12:01:16 kowal2
-Removed compiler warning.
-
-Revision 1.15 2003/09/29 11:56:58 kowal2
-bug fix2
-
-Revision 1.14 2003/09/29 11:39:43 kowal2
-bug fix
-
-Revision 1.13 2003/09/29 11:28:19 kowal2
-completly rewritten
-
-Revision 1.9.4.3 2003/06/23 14:47:10 hristov
-Minor fix
-
-Revision 1.9.4.2 2003/06/23 10:06:13 hristov
-Updated information about the overlapping clusters (M.Ivanov)
-
-Revision 1.9.4.1 2003/06/19 06:59:58 hristov
-Updated version of parallel tracking (M.Ivanov)
-
-Revision 1.9 2003/03/19 17:14:11 hristov
-Load/UnloadClusters added to the base class and the derived classes changed correspondingly. Possibility to give 2 input files for ITS and TPC tracks in PropagateBack. TRD tracker uses fEventN from the base class (T.Kuhr)
-
-Revision 1.8 2003/03/05 11:16:15 kowal2
-Logs added
-
-*/
-
-
-
-
-
-
-
-/*
- AliTPC parallel tracker -
- How to use? -
- run AliTPCFindClusters.C macro - clusters neccessary for tracker are founded
- run AliTPCFindTracksMI.C macro - to find tracks
- tracks are written to AliTPCtracks.root file
- for comparison also seeds are written to the same file - to special branch
-*/
//-------------------------------------------------------
// Implementation of the TPC tracker
//
// Origin: Marian Ivanov Marian.Ivanov@cern.ch
//
+// AliTPC parallel tracker -
+// How to use? -
+// run AliTPCFindClusters.C macro - clusters neccessary for tracker are founded
+// run AliTPCFindTracksMI.C macro - to find tracks
+// tracks are written to AliTPCtracks.root file
+// for comparison also seeds are written to the same file - to special branch
//-------------------------------------------------------
+
+
+/* $Id$ */
+
+
#include <TObjArray.h>
#include <TFile.h>
#include <TTree.h>
+#include <TClonesArray.h>
+
#include "Riostream.h"
-#include "AliTPCtrackerMI.h"
#include "AliTPCclusterMI.h"
+#include "AliComplexCluster.h"
#include "AliTPCParam.h"
#include "AliTPCClustersRow.h"
-#include "AliComplexCluster.h"
#include "AliTPCpolyTrack.h"
#include "TStopwatch.h"
#include "AliESD.h"
#include "AliHelix.h"
-#include "TGraph.h"
//
#include "AliRunLoader.h"
+//
+#include "AliTPCreco.h"
+#include "AliTPCtrackerMI.h"
ClassImp(AliTPCtrackerMI)
-class TPCFastMath {
+class AliTPCFastMath {
public:
- TPCFastMath();
+ AliTPCFastMath();
static Double_t FastAsin(Double_t x);
private:
- static Double_t fgFastAsin[20000];
+ static Double_t fgFastAsin[20000]; //lookup table for fast asin computation
};
-Double_t TPCFastMath::fgFastAsin[20000];
+Double_t AliTPCFastMath::fgFastAsin[20000];
+AliTPCFastMath gAliTPCFastMath;
-TPCFastMath::TPCFastMath(){
+AliTPCFastMath::AliTPCFastMath(){
+ //
+ // initialized lookup table;
for (Int_t i=0;i<10000;i++){
fgFastAsin[2*i] = TMath::ASin(i/10000.);
fgFastAsin[2*i+1] = (TMath::ASin((i+1)/10000.)-fgFastAsin[2*i]);
}
}
-Double_t TPCFastMath::FastAsin(Double_t x){
+Double_t AliTPCFastMath::FastAsin(Double_t x){
+ //
+ // return asin using lookup table
if (x>0){
Int_t index = int(x*10000);
return fgFastAsin[2*index]+(x*10000.-index)*fgFastAsin[2*index+1];
return -(fgFastAsin[2*index]+(x*10000.-index)*fgFastAsin[2*index+1]);
}
-TPCFastMath gTPCMath;
Int_t AliTPCtrackerMI::UpdateTrack(AliTPCseed * track, Int_t accept){
+ //
+ //update track information using current cluster - track->fCurrentCluster
+
AliTPCclusterMI* c =track->fCurrentCluster;
if (accept>0) track->fCurrentClusterIndex1 |=0x8000; //sign not accepted clusters
track->fSector = sec;
// Int_t index = i&0xFFFF;
if (sec>=fParam->GetNInnerSector()) track->fRow += fParam->GetNRowLow();
- track->SetClusterIndex2(track->fRow, i);
-
+ track->SetClusterIndex2(track->fRow, i);
//track->fFirstPoint = row;
//if ( track->fLastPoint<row) track->fLastPoint =row;
// if (track->fRow<0 || track->fRow>160) {
//
fNewIO = kTRUE;
fInput = AliRunLoader::GetTreeR("TPC", kFALSE,AliConfig::fgkDefaultEventFolderName);
+
fOutput = AliRunLoader::GetTreeT("TPC", kTRUE,AliConfig::fgkDefaultEventFolderName);
- AliTPCtrack *iotrack= new AliTPCtrack;
- // iotrack->fHelixIn = new TClonesArray("AliHelix");
- //iotrack->fHelixOut = new TClonesArray("AliHelix");
- fOutput->Branch("tracks","AliTPCtrack",&iotrack,32000,100);
- delete iotrack;
+ if (fOutput){
+ AliTPCtrack *iotrack= new AliTPCtrack;
+ fOutput->Branch("tracks","AliTPCtrack",&iotrack,32000,100);
+ delete iotrack;
+ }
}
+
void AliTPCtrackerMI::SetIO(TTree * input, TTree * output, AliESD * event)
{
fEvent = event;
}
-void AliTPCtrackerMI::WriteTracks()
+void AliTPCtrackerMI::FillESD(TObjArray* arr)
{
//
- // write tracks to the given output tree -
- // output specified with SetIO routine
- if (!fSeeds) return;
+ //
+ //fill esds using updated tracks
if (fEvent){
// write tracks to the event
// store index of the track
- Int_t nseed=fSeeds->GetEntriesFast();
+ Int_t nseed=arr->GetEntriesFast();
for (Int_t i=0; i<nseed; i++) {
- AliTPCseed *pt=(AliTPCseed*)fSeeds->UncheckedAt(i);
+ AliTPCseed *pt=(AliTPCseed*)arr->UncheckedAt(i);
if (!pt) continue;
- AliESDtrack iotrack;
- iotrack.UpdateTrackParams(pt,AliESDtrack::kTPCin);
- //iotrack.SetTPCindex(i);
- fEvent->AddTrack(&iotrack);
+ pt->PropagateTo(fParam->GetInnerRadiusLow());
+ if (pt->GetNumberOfClusters()>70) {
+ AliESDtrack iotrack;
+ iotrack.UpdateTrackParams(pt,AliESDtrack::kTPCin);
+ //iotrack.SetTPCindex(i);
+ fEvent->AddTrack(&iotrack);
+ }
}
}
+}
+
+void AliTPCtrackerMI::WriteTracks(TTree * tree)
+{
+ //
+ // write tracks from seed array to selected tree
+ //
+ fOutput = tree;
+ if (fOutput){
+ AliTPCtrack *iotrack= new AliTPCtrack;
+ fOutput->Branch("tracks","AliTPCtrack",&iotrack,32000,100);
+ }
+ WriteTracks();
+}
+
+void AliTPCtrackerMI::WriteTracks()
+{
+ //
+ // write tracks to the given output tree -
+ // output specified with SetIO routine
+ if (!fSeeds) return;
+ if (!fOutput){
+ SetIO();
+ }
-
if (fOutput){
AliTPCtrack *iotrack= 0;
Int_t nseed=fSeeds->GetEntriesFast();
- for (Int_t i=0; i<nseed; i++) {
- iotrack= (AliTPCtrack*)fSeeds->UncheckedAt(i);
- if (iotrack) break;
- }
-
+ //for (Int_t i=0; i<nseed; i++) {
+ // iotrack= (AliTPCtrack*)fSeeds->UncheckedAt(i);
+ // if (iotrack) break;
+ //}
//TBranch * br = fOutput->Branch("tracks","AliTPCtrack",&iotrack,32000,100);
TBranch * br = fOutput->GetBranch("tracks");
br->SetAddress(&iotrack);
for (Int_t i=0; i<nseed; i++) {
AliTPCseed *pt=(AliTPCseed*)fSeeds->UncheckedAt(i);
if (!pt) continue;
- iotrack = pt;
+ AliTPCtrack * track = new AliTPCtrack(*pt);
+ iotrack = track;
pt->fLab2 =i;
// br->SetAddress(&iotrack);
fOutput->Fill();
+ delete track;
iotrack =0;
}
+ //fOutput->GetDirectory()->cd();
+ //fOutput->Write();
}
- // delete iotrack;
- //
+ // delete iotrack;
+ //
if (fSeedTree){
//write the full seed information if specified in debug mode
return;
}
fC00*=factor;
- fC10*=factor; fC11*=factor;
- fC20*=factor; fC21*=factor; fC22*=factor;
- fC30*=factor; fC31*=factor; fC32*=factor; fC33*=factor;
- fC40*=factor; fC41*=factor; fC42*=factor; fC43*=factor; fC44*=factor;
+ fC10*=0; fC11*=factor;
+ fC20*=0; fC21*=0; fC22*=factor;
+ fC30*=0; fC31*=0; fC32*=0; fC33*=factor;
+ fC40*=0; fC41*=0; fC42*=0; fC43*=0; fC44*=factor;
SetNumberOfClusters(0);
fNFoundable =0;
SetChi2(0);
dz = dx*fP3*(c1+c2)/(c1*r2 + c2*r1);
}
*/
- dz = fP3*TPCFastMath::FastAsin(delta)/fP4;
+ dz = fP3*AliTPCFastMath::FastAsin(delta)/fP4;
//
y+=dy;
z+=dz;
//_____________________________________________________________________________
-Double_t AliTPCtrackerMI::f1old(Double_t x1,Double_t y1,
+Double_t AliTPCtrackerMI::F1old(Double_t x1,Double_t y1,
Double_t x2,Double_t y2,
Double_t x3,Double_t y3)
{
//_____________________________________________________________________________
-Double_t AliTPCtrackerMI::f1(Double_t x1,Double_t y1,
+Double_t AliTPCtrackerMI::F1(Double_t x1,Double_t y1,
Double_t x2,Double_t y2,
Double_t x3,Double_t y3)
{
}
-Double_t AliTPCtrackerMI::f2(Double_t x1,Double_t y1,
+Double_t AliTPCtrackerMI::F2(Double_t x1,Double_t y1,
Double_t x2,Double_t y2,
Double_t x3,Double_t y3)
{
//_____________________________________________________________________________
-Double_t AliTPCtrackerMI::f2old(Double_t x1,Double_t y1,
+Double_t AliTPCtrackerMI::F2old(Double_t x1,Double_t y1,
Double_t x2,Double_t y2,
Double_t x3,Double_t y3)
{
}
//_____________________________________________________________________________
-Double_t AliTPCtrackerMI::f3(Double_t x1,Double_t y1,
+Double_t AliTPCtrackerMI::F3(Double_t x1,Double_t y1,
Double_t x2,Double_t y2,
Double_t z1,Double_t z2)
{
}
-Double_t AliTPCtrackerMI::f3n(Double_t x1,Double_t y1,
+Double_t AliTPCtrackerMI::F3n(Double_t x1,Double_t y1,
Double_t x2,Double_t y2,
Double_t z1,Double_t z2, Double_t c)
{
Double_t d = TMath::Sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
if (TMath::Abs(d*c*0.5)>1) return 0;
// Double_t angle2 = TMath::ASin(d*c*0.5);
- // Double_t angle2 = TPCFastMath::FastAsin(d*c*0.5);
- Double_t angle2 = (d*c*0.5>0.1)? TMath::ASin(d*c*0.5): TPCFastMath::FastAsin(d*c*0.5);
+ // Double_t angle2 = AliTPCFastMath::FastAsin(d*c*0.5);
+ Double_t angle2 = (d*c*0.5>0.1)? TMath::ASin(d*c*0.5): AliTPCFastMath::FastAsin(d*c*0.5);
angle2 = (z1-z2)*c/(angle2*2.);
return angle2;
if (TMath::Abs(delta)>0.01){
dz = x[3]*TMath::ASin(delta)/x[4];
}else{
- dz = x[3]*TPCFastMath::FastAsin(delta)/x[4];
+ dz = x[3]*AliTPCFastMath::FastAsin(delta)/x[4];
}
- //dz = x[3]*TPCFastMath::FastAsin(delta)/x[4];
+ //dz = x[3]*AliTPCFastMath::FastAsin(delta)/x[4];
y+=dy;
z+=dz;
return kTRUE;
}
-
+Int_t AliTPCtrackerMI::LoadClusters (TTree *tree)
+{
+ //
+ //
+ fInput = tree;
+ return LoadClusters();
+}
Int_t AliTPCtrackerMI::LoadClusters()
{
for (Int_t sec = 0;sec<fkNOS;sec++)
for (Int_t row = 0;row<nrows;row++){
AliTPCRow* tpcrow = &(fOuterSec[sec%fkNOS][row]);
- if (tpcrow){
- if (tpcrow->fClusters1) delete []tpcrow->fClusters1;
- if (tpcrow->fClusters2) delete []tpcrow->fClusters2;
- }
+ // if (tpcrow){
+ // if (tpcrow->fClusters1) delete []tpcrow->fClusters1;
+ // if (tpcrow->fClusters2) delete []tpcrow->fClusters2;
+ //}
+ tpcrow->ResetClusters();
}
//
nrows = fInnerSec->GetNRows();
for (Int_t sec = 0;sec<fkNIS;sec++)
for (Int_t row = 0;row<nrows;row++){
AliTPCRow* tpcrow = &(fInnerSec[sec%fkNIS][row]);
- if (tpcrow){
- if (tpcrow->fClusters1) delete []tpcrow->fClusters1;
- if (tpcrow->fClusters2) delete []tpcrow->fClusters2;
- }
+ //if (tpcrow){
+ // if (tpcrow->fClusters1) delete []tpcrow->fClusters1;
+ //if (tpcrow->fClusters2) delete []tpcrow->fClusters2;
+ //}
+ tpcrow->ResetClusters();
}
return ;
//--------------------------------------------------------------------
Int_t sec=(index&0xff000000)>>24;
Int_t row=(index&0x00ff0000)>>16;
- Int_t ncl=(index&0x0000ffff)>>00;
+ Int_t ncl=(index&0x00007fff)>>00;
const AliTPCRow * tpcrow=0;
AliTPCclusterMI * clrow =0;
if (!t.Rotate(-fSectors->GetAlpha()))
return 0;
}
- if (!t.PropagateTo(x)) {
- return 0;
- }
- y=t.GetY();
+ //if (!t.PropagateTo(x)) {
+ // return 0;
+ //}
+ return 1;
}
//
// update current shape info every 3 pad-row
t.fCurrentCluster = cl;
t.fRow = nr;
Int_t accept = AcceptCluster(&t,t.fCurrentCluster,1.);
+ if (fIteration>0) accept =0;
if (accept<3) {
//if founded cluster is acceptible
UpdateTrack(&t,accept);
t.fCurrentCluster = cl;
t.fRow = nr;
Int_t accept = AcceptCluster(&t,t.fCurrentCluster,1.);
-
+ /*
if (t.fCurrentCluster->IsUsed(10)){
//
//
return 0;
}
}
-
+ */
if (accept<3) UpdateTrack(&t,accept);
} else {
- if (t.fNFoundable*0.5 > t.GetNumberOfClusters()) t.fRemoval=10;
+ if ( fIteration==0 && t.fNFoundable*0.5 > t.GetNumberOfClusters()) t.fRemoval=10;
}
return 1;
//
//
if (TMath::Abs(y)>ymax){
- return 0;
if (y > ymax) {
t.fRelativeSector= (t.fRelativeSector+1) % fN;
if (!t.Rotate(-fSectors->GetAlpha()))
return 0;
}
- if (!t.PropagateTo(x)){
- return 0;
- }
- y = t.GetY();
+ // if (!t.PropagateTo(x)){
+ // return 0;
+ //}
+ return 1;
+ //y = t.GetY();
}
//
Double_t roady = 1.;
Double_t roadz = 1.;
//
+
+ if (!cl){
+ index = t.GetClusterIndex2(nr);
+ if ( (index>0) && (index&0x8000)==0){
+ cl = t.fClusterPointer[nr];
+ if ( (cl==0) && (index>0)) cl = GetClusterMI(index);
+ t.fCurrentClusterIndex1 = index;
+ if (cl) {
+ t.fCurrentCluster = cl;
+ return 1;
+ }
+ }
+ }
+
if (krow) {
//cl = krow.FindNearest2(y+10,z,roady,roadz,index);
cl = krow.FindNearest2(y,z,roady,roadz,index);
}
- t.fCurrentCluster = cl;
+
if (cl) t.fCurrentClusterIndex1 = krow.GetIndex(index);
+ t.fCurrentCluster = cl;
+
return 1;
}
return 0;
}
}
-
+ if (fIteration>0) accept = 0;
if (accept<3) UpdateTrack(&t,accept);
} else {
Int_t first = GetRowNumber(xt)-1;
for (Int_t nr= first; nr>=rf; nr-=step) {
+ if (nr<fInnerSec->GetNRows())
+ fSectors = fInnerSec;
+ else
+ fSectors = fOuterSec;
if (FollowToNext(t,nr)==0)
if (!t.IsActive()) return 0;
if (first<0) first=0;
for (Int_t nr=first+1; nr<=rf; nr++) {
//if ( (t.GetSnp()<0.9))
- FollowToNext(t,nr);
+ if (nr<fInnerSec->GetNRows())
+ fSectors = fInnerSec;
+ else
+ fSectors = fOuterSec;
+ FollowToNext(t,nr);
}
return 1;
}
-void AliTPCtrackerMI::SortTracks(TObjArray * arr, Int_t mode)
+void AliTPCtrackerMI::SortTracks(TObjArray * arr, Int_t mode) const
{
//
//sort tracks in array according mode criteria
}
-void AliTPCtrackerMI::StopNotActive(TObjArray * arr, Int_t row0, Float_t th0, Float_t th1, Float_t th2)
+void AliTPCtrackerMI::StopNotActive(TObjArray * arr, Int_t row0, Float_t th0, Float_t th1, Float_t th2) const
{
// stop not active tracks
// take th1 as threshold for number of founded to number of foundable on last 10 active rows
void AliTPCtrackerMI::StopNotActive(AliTPCseed * seed, Int_t row0, Float_t th0, Float_t th1,
- Float_t th2)
+ Float_t th2) const
{
// stop not active tracks
// take th1 as threshold for number of founded to number of foundable on last 10 active rows
}
+Int_t AliTPCtrackerMI::RefitInward(AliESD *event)
+{
+ //
+ // back propagation of ESD tracks
+ //
+ //return 0;
+ fEvent = event;
+ ReadSeeds(event,2);
+ fIteration=2;
+ //PrepareForProlongation(fSeeds,1);
+ PropagateForward2(fSeeds);
+ Int_t nseed = fSeeds->GetEntriesFast();
+ for (Int_t i=0;i<nseed;i++){
+ AliTPCseed * seed = (AliTPCseed*) fSeeds->UncheckedAt(i);
+ seed->PropagateTo(fParam->GetInnerRadiusLow());
+ AliESDtrack *esd=event->GetTrack(i);
+ seed->CookdEdx(0.02,0.6);
+ CookLabel(seed,0.1); //For comparison only
+ if (seed->GetNumberOfClusters()>20){
+ esd->UpdateTrackParams(seed,AliESDtrack::kTPCrefit);
+ }
+ else{
+ //printf("problem\n");
+ }
+ }
+ fEvent =0;
+ //WriteTracks();
+ return 0;
+}
+
Int_t AliTPCtrackerMI::PropagateBack(AliESD *event)
{
//
fEvent = event;
- ReadSeeds(event);
+ fIteration = 1;
+ ReadSeeds(event,0);
PropagateBack(fSeeds);
Int_t nseed = fSeeds->GetEntriesFast();
for (Int_t i=0;i<nseed;i++){
AliTPCseed * seed = (AliTPCseed*) fSeeds->UncheckedAt(i);
AliESDtrack *esd=event->GetTrack(i);
- seed->CookdEdx(0.02,0.06);
+ seed->CookdEdx(0.02,0.6);
CookLabel(seed,0.1); //For comparison only
esd->UpdateTrackParams(seed,AliESDtrack::kTPCout);
}
fEvent =0;
- WriteTracks();
+ //WriteTracks();
return 0;
}
void AliTPCtrackerMI::DeleteSeeds()
{
+ //
+ //delete Seeds
Int_t nseed = fSeeds->GetEntriesFast();
for (Int_t i=0;i<nseed;i++){
AliTPCseed * seed = (AliTPCseed*)fSeeds->At(i);
fSeeds =0;
}
-void AliTPCtrackerMI::ReadSeeds(AliESD *event)
+void AliTPCtrackerMI::ReadSeeds(AliESD *event, Int_t direction)
{
//
//read seeds from the event
for (Int_t i=0; i<nentr; i++) {
AliESDtrack *esd=event->GetTrack(i);
ULong_t status=esd->GetStatus();
- const AliTPCtrack t(*esd);
+ AliTPCtrack t(*esd);
AliTPCseed *seed = new AliTPCseed(t,t.GetAlpha());
- if (status==AliESDtrack::kTPCin) seed->Modify(0.8);
+ if ((status==AliESDtrack::kTPCin)&&(direction==1)) seed->ResetCovariance();
+ if ( direction ==2 &&(status & AliESDtrack::kTRDrefit) == 0 ) seed->ResetCovariance();
+
//
//
// rotate to the local coordinate system
alpha =ns*fSectors->GetAlpha() + fSectors->GetAlphaShift();
alpha-=seed->GetAlpha();
if (!seed->Rotate(alpha)) continue;
+ seed->fEsd = esd;
//
- seed->PropagateTo(fSectors->GetX(0));
+ //seed->PropagateTo(fSectors->GetX(0));
//
// Int_t index = esd->GetTPCindex();
//AliTPCseed * seed2= (AliTPCseed*)fSeeds->At(index);
+ //if (direction==2){
+ // AliTPCseed * seed2 = ReSeed(seed,0.,0.5,1.);
+ // if (seed2) {
+ // delete seed;
+ // seed = seed2;
+ // }
+ //}
fSeeds->AddLast(seed);
}
//Double_t dfi0 = 2.*TMath::ASin(dvertex*c0*0.5);
//Double_t dfi1 = 2.*TMath::ASin(TMath::Sqrt(yy0*yy0+(1-xx0)*(1-xx0))*dvertex*c0*0.5);
- Double_t dfi0 = 2.*TPCFastMath::FastAsin(dvertex*c0*0.5);
- Double_t dfi1 = 2.*TPCFastMath::FastAsin(TMath::Sqrt(yy0*yy0+(1-xx0)*(1-xx0))*dvertex*c0*0.5);
+ Double_t dfi0 = 2.*AliTPCFastMath::FastAsin(dvertex*c0*0.5);
+ Double_t dfi1 = 2.*AliTPCFastMath::FastAsin(TMath::Sqrt(yy0*yy0+(1-xx0)*(1-xx0))*dvertex*c0*0.5);
//
//
Double_t z0 = kcl->GetZ();
Double_t sy3=25000*x[4]*x[4]+0.1, sy=0.1, sz=0.1;
//Double_t sy3=25000*x[4]*x[4]*60+0.5, sy=0.1, sz=0.1;
- Double_t f40=(f1(x1,y1+sy,x2,y2,x3,y3)-x[4])/sy;
- Double_t f42=(f1(x1,y1,x2,y2+sy,x3,y3)-x[4])/sy;
- Double_t f43=(f1(x1,y1,x2,y2,x3,y3+sy)-x[4])/sy;
- Double_t f20=(f2(x1,y1+sy,x2,y2,x3,y3)-x[2])/sy;
- Double_t f22=(f2(x1,y1,x2,y2+sy,x3,y3)-x[2])/sy;
- Double_t f23=(f2(x1,y1,x2,y2,x3,y3+sy)-x[2])/sy;
+ Double_t f40=(F1(x1,y1+sy,x2,y2,x3,y3)-x[4])/sy;
+ Double_t f42=(F1(x1,y1,x2,y2+sy,x3,y3)-x[4])/sy;
+ Double_t f43=(F1(x1,y1,x2,y2,x3,y3+sy)-x[4])/sy;
+ Double_t f20=(F2(x1,y1+sy,x2,y2,x3,y3)-x[2])/sy;
+ Double_t f22=(F2(x1,y1,x2,y2+sy,x3,y3)-x[2])/sy;
+ Double_t f23=(F2(x1,y1,x2,y2,x3,y3+sy)-x[2])/sy;
- Double_t f30=(f3(x1,y1+sy,x2,y2,z1,z2)-x[3])/sy;
- Double_t f31=(f3(x1,y1,x2,y2,z1+sz,z2)-x[3])/sz;
- Double_t f32=(f3(x1,y1,x2,y2+sy,z1,z2)-x[3])/sy;
- Double_t f34=(f3(x1,y1,x2,y2,z1,z2+sz)-x[3])/sz;
+ Double_t f30=(F3(x1,y1+sy,x2,y2,z1,z2)-x[3])/sy;
+ Double_t f31=(F3(x1,y1,x2,y2,z1+sz,z2)-x[3])/sz;
+ Double_t f32=(F3(x1,y1,x2,y2+sy,z1,z2)-x[3])/sy;
+ Double_t f34=(F3(x1,y1,x2,y2,z1,z2+sz)-x[3])/sz;
c[0]=sy1;
c[1]=0.; c[2]=sz1;
x[0]=y1;
x[1]=z1;
- x[4]=f1(x1,y1,x2,y2,x3,y3);
+ x[4]=F1(x1,y1,x2,y2,x3,y3);
//if (TMath::Abs(x[4]) >= cuts[0]) continue;
nin0++;
//
- x[2]=f2(x1,y1,x2,y2,x3,y3);
+ x[2]=F2(x1,y1,x2,y2,x3,y3);
nin1++;
//
- x[3]=f3n(x1,y1,x2,y2,z1,z2,x[4]);
+ x[3]=F3n(x1,y1,x2,y2,z1,z2,x[4]);
//if (TMath::Abs(x[3]) > cuts[3]) continue;
nin2++;
//
Double_t sy2=0.1, sz2=0.1;
Double_t sy3=0.1, sy=0.1, sz=0.1;
- Double_t f40=(f1(x1,y1+sy,x2,y2,x3,y3)-x[4])/sy;
- Double_t f42=(f1(x1,y1,x2,y2+sy,x3,y3)-x[4])/sy;
- Double_t f43=(f1(x1,y1,x2,y2,x3,y3+sy)-x[4])/sy;
- Double_t f20=(f2(x1,y1+sy,x2,y2,x3,y3)-x[2])/sy;
- Double_t f22=(f2(x1,y1,x2,y2+sy,x3,y3)-x[2])/sy;
- Double_t f23=(f2(x1,y1,x2,y2,x3,y3+sy)-x[2])/sy;
+ Double_t f40=(F1(x1,y1+sy,x2,y2,x3,y3)-x[4])/sy;
+ Double_t f42=(F1(x1,y1,x2,y2+sy,x3,y3)-x[4])/sy;
+ Double_t f43=(F1(x1,y1,x2,y2,x3,y3+sy)-x[4])/sy;
+ Double_t f20=(F2(x1,y1+sy,x2,y2,x3,y3)-x[2])/sy;
+ Double_t f22=(F2(x1,y1,x2,y2+sy,x3,y3)-x[2])/sy;
+ Double_t f23=(F2(x1,y1,x2,y2,x3,y3+sy)-x[2])/sy;
- Double_t f30=(f3(x1,y1+sy,x2,y2,z1,z2)-x[3])/sy;
- Double_t f31=(f3(x1,y1,x2,y2,z1+sz,z2)-x[3])/sz;
- Double_t f32=(f3(x1,y1,x2,y2+sy,z1,z2)-x[3])/sy;
- Double_t f34=(f3(x1,y1,x2,y2,z1,z2+sz)-x[3])/sz;
+ Double_t f30=(F3(x1,y1+sy,x2,y2,z1,z2)-x[3])/sy;
+ Double_t f31=(F3(x1,y1,x2,y2,z1+sz,z2)-x[3])/sz;
+ Double_t f32=(F3(x1,y1,x2,y2+sy,z1,z2)-x[3])/sy;
+ Double_t f34=(F3(x1,y1,x2,y2,z1,z2+sz)-x[3])/sz;
c[0]=sy1;
c[1]=0.; c[2]=sz1;
}
x[0]=y1;
x[1]=z1;
- x[4]=f1(x1,y1,x2,y2,x3,y3);
+ x[4]=F1(x1,y1,x2,y2,x3,y3);
// if (TMath::Abs(x[4]) >= cuts[0]) continue; //
- x[2]=f2(x1,y1,x2,y2,x3,y3);
+ x[2]=F2(x1,y1,x2,y2,x3,y3);
//if (TMath::Abs(x[4]*x1-x[2]) >= cuts[1]) continue;
- //x[3]=f3(x1,y1,x2,y2,z1,z2);
- x[3]=f3n(x1,y1,x3,y3,z1,z3,x[4]);
+ //x[3]=F3(x1,y1,x2,y2,z1,z2);
+ x[3]=F3n(x1,y1,x3,y3,z1,z3,x[4]);
//if (TMath::Abs(x[3]) > cuts[3]) continue;
sy3=25000*x[4]*x[4]+0.1, sy=0.1, sz=0.1;
}
- Double_t f40=(f1(x1,y1+sy,x2,y2,x3,y3)-x[4])/sy;
- Double_t f42=(f1(x1,y1,x2,y2+sy,x3,y3)-x[4])/sy;
- Double_t f43=(f1(x1,y1,x2,y2,x3,y3+sy)-x[4])/sy;
- Double_t f20=(f2(x1,y1+sy,x2,y2,x3,y3)-x[2])/sy;
- Double_t f22=(f2(x1,y1,x2,y2+sy,x3,y3)-x[2])/sy;
- Double_t f23=(f2(x1,y1,x2,y2,x3,y3+sy)-x[2])/sy;
-
- Double_t f30=(f3(x1,y1+sy,x3,y3,z1,z3)-x[3])/sy;
- Double_t f31=(f3(x1,y1,x3,y3,z1+sz,z3)-x[3])/sz;
- Double_t f32=(f3(x1,y1,x3,y3+sy,z1,z3)-x[3])/sy;
- Double_t f34=(f3(x1,y1,x3,y3,z1,z3+sz)-x[3])/sz;
+ Double_t f40=(F1(x1,y1+sy,x2,y2,x3,y3)-x[4])/sy;
+ Double_t f42=(F1(x1,y1,x2,y2+sy,x3,y3)-x[4])/sy;
+ Double_t f43=(F1(x1,y1,x2,y2,x3,y3+sy)-x[4])/sy;
+ Double_t f20=(F2(x1,y1+sy,x2,y2,x3,y3)-x[2])/sy;
+ Double_t f22=(F2(x1,y1,x2,y2+sy,x3,y3)-x[2])/sy;
+ Double_t f23=(F2(x1,y1,x2,y2,x3,y3+sy)-x[2])/sy;
+
+ Double_t f30=(F3(x1,y1+sy,x3,y3,z1,z3)-x[3])/sy;
+ Double_t f31=(F3(x1,y1,x3,y3,z1+sz,z3)-x[3])/sz;
+ Double_t f32=(F3(x1,y1,x3,y3+sy,z1,z3)-x[3])/sy;
+ Double_t f34=(F3(x1,y1,x3,y3,z1,z3+sz)-x[3])/sz;
c[0]=sy1;
{
//
//
- //reseed
+ //reseed using track points
Int_t p0 = int(r0*track->GetNumberOfClusters()); // point 0
Int_t p1 = int(r1*track->GetNumberOfClusters());
Int_t p2 = int(r2*track->GetNumberOfClusters()); // last point
//
x[0]=x2[1];
x[1]=x2[2];
- x[4]=f1(x2[0],x2[1],x1[0],x1[1],x0[0],x0[1]);
+ x[4]=F1(x2[0],x2[1],x1[0],x1[1],x0[0],x0[1]);
// if (x[4]>1) return 0;
- x[2]=f2(x2[0],x2[1],x1[0],x1[1],x0[0],x0[1]);
- x[3]=f3n(x2[0],x2[1],x0[0],x0[1],x2[2],x0[2],x[4]);
+ x[2]=F2(x2[0],x2[1],x1[0],x1[1],x0[0],x0[1]);
+ x[3]=F3n(x2[0],x2[1],x0[0],x0[1],x2[2],x0[2],x[4]);
//if (TMath::Abs(x[3]) > 2.2) return 0;
//if (TMath::Abs(x[2]) > 1.99) return 0;
//
Double_t sy2=0.01+track->GetSigmaY2(), sz2=0.01+track->GetSigmaZ2();
Double_t sy3=0.01+track->GetSigmaY2();
//
- Double_t f40=(f1(x2[0],x2[1]+sy,x1[0],x1[1],x0[0],x0[1])-x[4])/sy;
- Double_t f42=(f1(x2[0],x2[1],x1[0],x1[1]+sy,x0[0],x0[1])-x[4])/sy;
- Double_t f43=(f1(x2[0],x2[1],x1[0],x1[1],x0[0],x0[1]+sy)-x[4])/sy;
- Double_t f20=(f2(x2[0],x2[1]+sy,x1[0],x1[1],x0[0],x0[1])-x[2])/sy;
- Double_t f22=(f2(x2[0],x2[1],x1[0],x1[1]+sy,x0[0],x0[1])-x[2])/sy;
- Double_t f23=(f2(x2[0],x2[1],x1[0],x1[1],x0[0],x0[1]+sy)-x[2])/sy;
- //
- Double_t f30=(f3(x2[0],x2[1]+sy,x0[0],x0[1],x2[2],x0[2])-x[3])/sy;
- Double_t f31=(f3(x2[0],x2[1],x0[0],x0[1],x2[2]+sz,x0[2])-x[3])/sz;
- Double_t f32=(f3(x2[0],x2[1],x0[0],x0[1]+sy,x2[2],x0[2])-x[3])/sy;
- Double_t f34=(f3(x2[0],x2[1],x0[0],x0[1],x2[2],x0[2]+sz)-x[3])/sz;
+ Double_t f40=(F1(x2[0],x2[1]+sy,x1[0],x1[1],x0[0],x0[1])-x[4])/sy;
+ Double_t f42=(F1(x2[0],x2[1],x1[0],x1[1]+sy,x0[0],x0[1])-x[4])/sy;
+ Double_t f43=(F1(x2[0],x2[1],x1[0],x1[1],x0[0],x0[1]+sy)-x[4])/sy;
+ Double_t f20=(F2(x2[0],x2[1]+sy,x1[0],x1[1],x0[0],x0[1])-x[2])/sy;
+ Double_t f22=(F2(x2[0],x2[1],x1[0],x1[1]+sy,x0[0],x0[1])-x[2])/sy;
+ Double_t f23=(F2(x2[0],x2[1],x1[0],x1[1],x0[0],x0[1]+sy)-x[2])/sy;
+ //
+ Double_t f30=(F3(x2[0],x2[1]+sy,x0[0],x0[1],x2[2],x0[2])-x[3])/sy;
+ Double_t f31=(F3(x2[0],x2[1],x0[0],x0[1],x2[2]+sz,x0[2])-x[3])/sz;
+ Double_t f32=(F3(x2[0],x2[1],x0[0],x0[1]+sy,x2[2],x0[2])-x[3])/sy;
+ Double_t f34=(F3(x2[0],x2[1],x0[0],x0[1],x2[2],x0[2]+sz)-x[3])/sz;
c[0]=sy1;
return seed;
}
+
+AliTPCseed *AliTPCtrackerMI::ReSeed(AliTPCseed *track, Float_t r0, Float_t r1, Float_t r2)
+{
+ //
+ //
+ //reseed using founded clusters
+ //
+ // Find the number of clusters
+ Int_t nclusters = 0;
+ for (Int_t irow=0;irow<160;irow++){
+ if (track->GetClusterIndex(irow)>0) nclusters++;
+ }
+ //
+ Int_t ipos[3];
+ ipos[0] = TMath::Max(int(r0*nclusters),0); // point 0 cluster
+ ipos[1] = TMath::Min(int(r1*nclusters),nclusters-1); //
+ ipos[2] = TMath::Min(int(r2*nclusters),nclusters-1); // last point
+ //
+ //
+ Double_t xyz[3][3];
+ Int_t row[3],sec[3]={0,0,0};
+ //
+ // find track row position at given ratio of the length
+ Int_t index=-1;
+ for (Int_t irow=0;irow<160;irow++){
+ if (track->GetClusterIndex2(irow)<0) continue;
+ index++;
+ for (Int_t ipoint=0;ipoint<3;ipoint++){
+ if (index<=ipos[ipoint]) row[ipoint] = irow;
+ }
+ }
+ //
+ //Get cluster and sector position
+ for (Int_t ipoint=0;ipoint<3;ipoint++){
+ Int_t clindex = track->GetClusterIndex2(row[ipoint]);
+ AliTPCclusterMI * cl = GetClusterMI(clindex);
+ if (cl==0) {
+ printf("Bug\n");
+ // AliTPCclusterMI * cl = GetClusterMI(clindex);
+ return 0;
+ }
+ sec[ipoint] = ((clindex&0xff000000)>>24)%18;
+ xyz[ipoint][0] = GetXrow(row[ipoint]);
+ xyz[ipoint][1] = cl->GetY();
+ xyz[ipoint][2] = cl->GetZ();
+ }
+ //
+ //
+ // Calculate seed state vector and covariance matrix
+
+ Double_t alpha, cs,sn, xx2,yy2;
+ //
+ alpha = (sec[1]-sec[2])*fSectors->GetAlpha();
+ cs = TMath::Cos(alpha);
+ sn = TMath::Sin(alpha);
+ xx2= xyz[1][0]*cs-xyz[1][1]*sn;
+ yy2= xyz[1][0]*sn+xyz[1][1]*cs;
+ xyz[1][0] = xx2;
+ xyz[1][1] = yy2;
+ //
+ alpha = (sec[0]-sec[2])*fSectors->GetAlpha();
+ cs = TMath::Cos(alpha);
+ sn = TMath::Sin(alpha);
+ xx2= xyz[0][0]*cs-xyz[0][1]*sn;
+ yy2= xyz[0][0]*sn+xyz[0][1]*cs;
+ xyz[0][0] = xx2;
+ xyz[0][1] = yy2;
+ //
+ //
+ //
+ Double_t x[5],c[15];
+ //
+ x[0]=xyz[2][1];
+ x[1]=xyz[2][2];
+ x[4]=F1(xyz[2][0],xyz[2][1],xyz[1][0],xyz[1][1],xyz[0][0],xyz[0][1]);
+ x[2]=F2(xyz[2][0],xyz[2][1],xyz[1][0],xyz[1][1],xyz[0][0],xyz[0][1]);
+ x[3]=F3n(xyz[2][0],xyz[2][1],xyz[0][0],xyz[0][1],xyz[2][2],xyz[0][2],x[4]);
+ //
+ Double_t sy =0.1, sz =0.1;
+ //
+ Double_t sy1=0.2, sz1=0.2;
+ Double_t sy2=0.2, sz2=0.2;
+ Double_t sy3=0.2;
+ //
+ Double_t f40=(F1(xyz[2][0],xyz[2][1]+sy,xyz[1][0],xyz[1][1],xyz[0][0],xyz[0][1])-x[4])/sy;
+ Double_t f42=(F1(xyz[2][0],xyz[2][1],xyz[1][0],xyz[1][1]+sy,xyz[0][0],xyz[0][1])-x[4])/sy;
+ Double_t f43=(F1(xyz[2][0],xyz[2][1],xyz[1][0],xyz[1][1],xyz[0][0],xyz[0][1]+sy)-x[4])/sy;
+ Double_t f20=(F2(xyz[2][0],xyz[2][1]+sy,xyz[1][0],xyz[1][1],xyz[0][0],xyz[0][1])-x[2])/sy;
+ Double_t f22=(F2(xyz[2][0],xyz[2][1],xyz[1][0],xyz[1][1]+sy,xyz[0][0],xyz[0][1])-x[2])/sy;
+ Double_t f23=(F2(xyz[2][0],xyz[2][1],xyz[1][0],xyz[1][1],xyz[0][0],xyz[0][1]+sy)-x[2])/sy;
+ //
+ Double_t f30=(F3(xyz[2][0],xyz[2][1]+sy,xyz[0][0],xyz[0][1],xyz[2][2],xyz[0][2])-x[3])/sy;
+ Double_t f31=(F3(xyz[2][0],xyz[2][1],xyz[0][0],xyz[0][1],xyz[2][2]+sz,xyz[0][2])-x[3])/sz;
+ Double_t f32=(F3(xyz[2][0],xyz[2][1],xyz[0][0],xyz[0][1]+sy,xyz[2][2],xyz[0][2])-x[3])/sy;
+ Double_t f34=(F3(xyz[2][0],xyz[2][1],xyz[0][0],xyz[0][1],xyz[2][2],xyz[0][2]+sz)-x[3])/sz;
+
+
+ c[0]=sy1;
+ c[1]=0.; c[2]=sz1;
+ c[3]=f20*sy1; c[4]=0.; c[5]=f20*sy1*f20+f22*sy2*f22+f23*sy3*f23;
+ c[6]=f30*sy1; c[7]=f31*sz1; c[8]=f30*sy1*f20+f32*sy2*f22;
+ c[9]=f30*sy1*f30+f31*sz1*f31+f32*sy2*f32+f34*sz2*f34;
+ c[10]=f40*sy1; c[11]=0.; c[12]=f40*sy1*f20+f42*sy2*f22+f43*sy3*f23;
+ c[13]=f30*sy1*f40+f32*sy2*f42;
+ c[14]=f40*sy1*f40+f42*sy2*f42+f43*sy3*f43;
+
+ // Int_t row1 = fSectors->GetRowNumber(xyz[2][0]);
+ AliTPCseed *seed=new AliTPCseed(0, x, c, xyz[2][0], sec[2]*fSectors->GetAlpha()+fSectors->GetAlphaShift());
+ seed->fLastPoint = row[2];
+ seed->fFirstPoint = row[2];
+ return seed;
+}
+
Int_t AliTPCtrackerMI::CheckKinkPoint(AliTPCseed*seed, Float_t th)
{
//
Double_t xh[5],xm = x[padm];
xh[0]=yt[i2];
xh[1]=zt[i2];
- xh[4]=f1(xt[i2],yt[i2],xt[padm],yt[padm],xt[i1],yt[i1]);
- xh[2]=f2(xt[i2],yt[i2],xt[padm],yt[padm],xt[i1],yt[i1]);
- xh[3]=f3n(xt[i2],yt[i2],xt[i1],yt[i1],zt[i2],zt[i1],xh[4]);
+ xh[4]=F1(xt[i2],yt[i2],xt[padm],yt[padm],xt[i1],yt[i1]);
+ xh[2]=F2(xt[i2],yt[i2],xt[padm],yt[padm],xt[i1],yt[i1]);
+ xh[3]=F3n(xt[i2],yt[i2],xt[i1],yt[i1],zt[i2],zt[i1],xh[4]);
//
//
for (Int_t i=i1;i<=i2;i++){
GetProlongation(x[i2], x[i],xh,yy,zz);
if (TMath::Abs(y[i]-yy)>4||TMath::Abs(z[i]-zz)>4){
//Double_t xxh[5];
- //xxh[4]=f1old(x[i2],y[i2],x[padm],y[padm],x[i1],y[i1]);
- //xxh[2]=f2old(x[i2],y[i2],x[padm],y[padm],x[i1],y[i1]);
+ //xxh[4]=F1old(x[i2],y[i2],x[padm],y[padm],x[i1],y[i1]);
+ //xxh[2]=F2old(x[i2],y[i2],x[padm],y[padm],x[i1],y[i1]);
printf("problem\n");
}
y[i] = y[i] - yy;
return 0;
}
+Int_t AliTPCtrackerMI::Clusters2Tracks (AliESD *esd)
+{
+ //
+ fEvent = esd;
+ Clusters2Tracks();
+ if (!fSeeds) return 1;
+ FillESD(fSeeds);
+ return 0;
+ //
+}
+
+
//_____________________________________________________________________________
Int_t AliTPCtrackerMI::Clusters2Tracks() {
//-----------------------------------------------------------------
//-----------------------------------------------------------------
TDirectory *savedir=gDirectory;
TStopwatch timer;
- //
- if (!fInput) SetIO(); //set default IO using loaders
- if (!fInput){
- cerr<<"AliTPCtrackerMI::Clusters2Tracks(): input file is not open !\n";
- return 1;
- }
- LoadClusters();
- //
+
fIteration = 0;
fSeeds = Tracking();
}
}
RemoveDouble(fSeeds,0.2,0.6,11);
- //RemoveUsed(fSeeds,0.9,0.9,6);
- //RemoveUsed(fSeeds,0.8,0.8,6);
- //RemoveUsed(fSeeds,0.7,0.7,6);
RemoveUsed(fSeeds,0.5,0.5,6);
//
//if ((pt->IsActive() || (pt->fRemoval==10) )&& nc>50 &&pt->GetNumberOfClusters()>0.4*pt->fNFoundable){
if ((pt->IsActive() || (pt->fRemoval==10) )){
cerr<<found++<<'\r';
+ pt->fLab2 = i;
}
else
delete fSeeds->RemoveAt(i);
- pt->fLab2 = i;
}
//if ((pt->IsActive() || (pt->fRemoval==10) )&& nc>50 &&pt->GetNumberOfClusters()>0.4*pt->fNFoundable){
if ((pt->IsActive() || (pt->fRemoval==10) )){
cerr<<found++<<'\r';
+ pt->fLab2 = i;
}
else
delete fSeeds->RemoveAt(i);
- pt->fLab2 = i;
+ //AliTPCseed * seed1 = ReSeed(pt,0.05,0.5,1);
+ //if (seed1){
+ // FollowProlongation(*seed1,0);
+ // Int_t n = seed1->GetNumberOfClusters();
+ // printf("fP4\t%f\t%f\n",seed1->GetC(),pt->GetC());
+ // printf("fN\t%d\t%d\n", seed1->GetNumberOfClusters(),pt->GetNumberOfClusters());
+ //
+ //}
+ //AliTPCseed * seed2 = ReSeed(pt,0.95,0.5,0.05);
+
}
SortTracks(fSeeds, 1);
- /*
+ /*
fIteration = 1;
- PrepareForBackProlongation(fSeeds,0.5);
+ PrepareForBackProlongation(fSeeds,5.);
PropagateBack(fSeeds);
printf("Time for back propagation: \t");timer.Print();timer.Start();
fIteration = 2;
- PrepareForProlongation(fSeeds,1.);
- PropagateForward();
-
- fSectors = fOuterSec;
- ParallelTracking(fSeeds,fSectors->GetNRows()-1,0);
- fSectors = fInnerSec;
- ParallelTracking(fSeeds,fSectors->GetNRows()-1,0);
+ PrepareForProlongation(fSeeds,5.);
+ PropagateForward2(fSeeds);
+
printf("Time for FORWARD propagation: \t");timer.Print();timer.Start();
// RemoveUsed(fSeeds,0.7,0.7,6);
//RemoveOverlap(fSeeds,0.9,7,kTRUE);
-
+
nseed=fSeeds->GetEntriesFast();
found = 0;
for (Int_t i=0; i<nseed; i++) {
// fNTracks = found;
printf("Time for overlap removal, track writing and dedx cooking: \t"); timer.Print();timer.Start();
//
- if (fOutput) {
- WriteTracks();
- }
- if (!fNewIO) fOutput->Write();
- else
- AliRunLoader::GetDetectorLoader("TPC",AliConfig::fgkDefaultEventFolderName)->WriteTracks("OVERWRITE");
-
-
cerr<<"Number of found tracks : "<<"\t"<<found<<endl;
savedir->cd();
- //if (seedtree) delete seedtree;
// UnloadClusters();
- //printf("Time for unloading cluster: \t"); timer.Print();timer.Start();
-
+ //
return 0;
}
}
-void AliTPCtrackerMI::SumTracks(TObjArray *arr1,TObjArray *arr2)
+void AliTPCtrackerMI::SumTracks(TObjArray *arr1,TObjArray *arr2) const
{
//
//sum tracks to common container
//
- for (Int_t nr=rfirst; nr>=rlast; nr--){
+ for (Int_t nr=rfirst; nr>=rlast; nr--){
+ if (nr<fInnerSec->GetNRows())
+ fSectors = fInnerSec;
+ else
+ fSectors = fOuterSec;
// make indexes with the cluster tracks for given
// find nearest cluster
}
}
-void AliTPCtrackerMI::PrepareForBackProlongation(TObjArray * arr,Float_t fac)
+void AliTPCtrackerMI::PrepareForBackProlongation(TObjArray * arr,Float_t fac) const
{
//
//
}
-void AliTPCtrackerMI::PrepareForProlongation(TObjArray * arr, Float_t fac)
+void AliTPCtrackerMI::PrepareForProlongation(TObjArray * arr, Float_t fac) const
{
//
//
if (pt) {
AliTPCseed *pt2 = new AliTPCseed(*pt);
fSectors = fInnerSec;
- FollowBackProlongation(*pt,fSectors->GetNRows()-1);
- fSectors = fOuterSec;
- FollowBackProlongation(*pt,fSectors->GetNRows()-1);
- fSectors = fOuterSec;
- if (pt->GetNumberOfClusters()<35 && pt->GetLabel()>0 ){
+ //FollowBackProlongation(*pt,fInnerSec->GetNRows()-1);
+ //fSectors = fOuterSec;
+ FollowBackProlongation(*pt,fInnerSec->GetNRows()+fOuterSec->GetNRows()-1);
+
+ if (pt->GetNumberOfClusters()<20 && pt->GetLabel()>0 ){
printf("\n%d",pt->GetLabel());
fSectors = fInnerSec;
- FollowBackProlongation(*pt2,fSectors->GetNRows()-1);
- fSectors = fOuterSec;
- FollowBackProlongation(*pt2,fSectors->GetNRows()-1);
- fSectors = fOuterSec;
+ //FollowBackProlongation(*pt2,fInnerSec->GetNRows()-1);
+ //fSectors = fOuterSec;
+ FollowBackProlongation(*pt2,fInnerSec->GetNRows()+fOuterSec->GetNRows()-1);
}
}
}
AliTPCseed *pt = (AliTPCseed*)arr->UncheckedAt(i);
if (pt) {
AliTPCseed *pt2 = new AliTPCseed(*pt);
- fSectors = fOuterSec;
- FollowProlongation(*pt,0);
- fSectors = fOuterSec;
FollowProlongation(*pt,0);
- fSectors = fInnerSec;
if (pt->GetNumberOfClusters()<35 && pt->GetLabel()>0 ){
- printf("\n%d",pt->GetLabel());
- fSectors = fOuterSec;
FollowProlongation(*pt2,0);
- fSectors = fOuterSec;
- FollowProlongation(*pt2,0);
- fSectors = fOuterSec;
}
+ delete pt2;
}
}
return 0;
Int_t AliTPCtrackerMI::PropagateForward()
{
+ //
+ // propagate track forward
+ UnsignClusters();
+ Int_t nseed = fSeeds->GetEntriesFast();
+ for (Int_t i=0;i<nseed;i++){
+ AliTPCseed *pt = (AliTPCseed*)fSeeds->UncheckedAt(i);
+ if (pt){
+ AliTPCseed &t = *pt;
+ Double_t alpha=t.GetAlpha() - fSectors->GetAlphaShift();
+ if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
+ if (alpha < 0. ) alpha += 2.*TMath::Pi();
+ t.fRelativeSector = Int_t(alpha/fSectors->GetAlpha()+0.0001)%fN;
+ }
+ }
+
fSectors = fOuterSec;
- ParallelTracking(fSeeds,fSectors->GetNRows()-1,0);
+ ParallelTracking(fSeeds,fOuterSec->GetNRows()+fInnerSec->GetNRows()-1,fInnerSec->GetNRows());
fSectors = fInnerSec;
- ParallelTracking(fSeeds,fSectors->GetNRows()-1,0);
+ ParallelTracking(fSeeds,fInnerSec->GetNRows()-1,0);
//WriteTracks();
return 1;
}
//--------------------------------------------------------------------
Int_t noc=t->GetNumberOfClusters();
if (noc<10){
- printf("\nnot founded prolongation\n\n\n");
- t->Dump();
+ //printf("\nnot founded prolongation\n\n\n");
+ //t->Dump();
return ;
}
Int_t lb[160];
//delete[] clusters;
}
+
+Int_t AliTPCtrackerMI::AliTPCSector::GetRowNumber(Double_t x) const
+{
+ //return pad row number for this x
+ Double_t r;
+ if (fN < 64){
+ r=fRow[fN-1].GetX();
+ if (x > r) return fN;
+ r=fRow[0].GetX();
+ if (x < r) return -1;
+ return Int_t((x-r)/fPadPitchLength + 0.5);}
+ else{
+ r=fRow[fN-1].GetX();
+ if (x > r) return fN;
+ r=fRow[0].GetX();
+ if (x < r) return -1;
+ Double_t r1=fRow[64].GetX();
+ if(x<r1){
+ return Int_t((x-r)/f1PadPitchLength + 0.5);}
+ else{
+ return (Int_t((x-r1)/f2PadPitchLength + 0.5)+64);}
+ }
+}
+
//_________________________________________________________________________
void AliTPCtrackerMI::AliTPCSector::Setup(const AliTPCParam *par, Int_t f) {
//-----------------------------------------------------------------------
}
}
+AliTPCtrackerMI::AliTPCRow::AliTPCRow() {
+ //
+ // default constructor
+ fN=0;
+ fN1=0;
+ fN2=0;
+ fClusters1=0;
+ fClusters2=0;
+}
AliTPCtrackerMI::AliTPCRow::~AliTPCRow(){
//
+
}
fIndex[i]=index; fClusters[i]=c; fN++;
}
+void AliTPCtrackerMI::AliTPCRow::ResetClusters() {
+ //
+ // reset clusters
+ fN = 0;
+ fN1 = 0;
+ fN2 = 0;
+ //delete[] fClusterArray;
+ if (fClusters1) delete []fClusters1;
+ if (fClusters2) delete []fClusters2;
+ //fClusterArray=0;
+ fClusters1 = 0;
+ fClusters2 = 0;
+}
+
//___________________________________________________________________
Int_t AliTPCtrackerMI::AliTPCRow::Find(Double_t z) const {
fEPoints = 0;
fNFoundable =0;
fNShared =0;
- // fTrackPoints =0;
fRemoval = 0;
fSort =0;
fFirstPoint =0;
fBSigned = kFALSE;
fSeed1 =-1;
fSeed2 =-1;
+ fCurrentCluster =0;
}
AliTPCseed::AliTPCseed(const AliTPCtrack &t):AliTPCtrack(t){
+ //
+ //copy constructor
fPoints = 0;
fEPoints = 0;
fNShared =0;
fBSigned = kFALSE;
fSeed1 =-1;
fSeed2 =-1;
+ fCurrentCluster =0;
+
}
AliTPCseed::AliTPCseed(const AliKalmanTrack &t, Double_t a):AliTPCtrack(t,a){
+ //
+ //copy constructor
fRow=0;
for (Int_t i=0;i<160;i++) {
fClusterPointer[i] = 0;
fBSigned = kFALSE;
fSeed1 =-1;
fSeed2 =-1;
+ fCurrentCluster =0;
}
AliTPCseed::AliTPCseed(UInt_t index, const Double_t xx[5], const Double_t cc[15],
AliTPCtrack(index, xx, cc, xr, alpha) {
//
//
+ //constructor
fRow =0;
for (Int_t i=0;i<200;i++) SetClusterIndex2(i,-3);
for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
fBSigned = kFALSE;
fSeed1 =-1;
fSeed2 =-1;
+ fCurrentCluster =0;
+
}
AliTPCseed::~AliTPCseed(){
+ //
+ // destructor
if (fPoints) delete fPoints;
fPoints =0;
if (fEPoints) delete fEPoints;