// The debug level - different procedure produce tree for numerical debugging
// To enable them set AliTPCReconstructor::SetStreamLevel(n); where nis bigger 1
//
-
+// There are several places in the code which can be numerically debuged
+// This code is keeped in order to enable code development and to check the calibration implementtion
+//
+// 1. ErrParam stream (Log level 9) - dump information about
+// 1.a) cluster
+// 2.a) cluster error estimate
+// 3.a) cluster shape estimate
+//
+//
//-------------------------------------------------------
#include "AliAlignObj.h"
#include "AliTrackPointArray.h"
#include "TRandom.h"
-//#include "AliTPCTransform.h"
+#include "AliTPCcalibDB.h"
+#include "AliTPCTransform.h"
+#include "AliTPCClusterParam.h"
//
Double_t chi2 = track->GetPredictedChi2(track->GetCurrentCluster());
//
- track->SetErrorY2(track->GetErrorY2()*1.3);
- track->SetErrorY2(track->GetErrorY2()+0.01);
- track->SetErrorZ2(track->GetErrorZ2()*1.3);
- track->SetErrorZ2(track->GetErrorZ2()+0.005);
+// track->SetErrorY2(track->GetErrorY2()*1.3);
+// track->SetErrorY2(track->GetErrorY2()+0.01);
+// track->SetErrorZ2(track->GetErrorZ2()*1.3);
+// track->SetErrorZ2(track->GetErrorZ2()+0.005);
//}
if (accept>0) return 0;
if (track->GetNumberOfClusters()%20==0){
-Int_t AliTPCtrackerMI::AcceptCluster(AliTPCseed * seed, AliTPCclusterMI * cluster, Float_t factor,
- Float_t cory, Float_t corz)
+Int_t AliTPCtrackerMI::AcceptCluster(AliTPCseed * seed, AliTPCclusterMI * cluster)
{
//
// decide according desired precision to accept given
// cluster for tracking
- Double_t sy2=ErrY2(seed,cluster)*cory;
- Double_t sz2=ErrZ2(seed,cluster)*corz;
- //sy2=ErrY2(seed,cluster)*cory;
- //sz2=ErrZ2(seed,cluster)*cory;
+ Double_t sy2=ErrY2(seed,cluster);
+ Double_t sz2=ErrZ2(seed,cluster);
Double_t sdistancey2 = sy2+seed->GetSigmaY2();
Double_t sdistancez2 = sz2+seed->GetSigmaZ2();
Double_t rdistance2 = rdistancey2+rdistancez2;
//Int_t accept =0;
+ if (AliTPCReconstructor::StreamLevel()>5) {
+ Float_t rmsy2 = seed->GetCurrentSigmaY2();
+ Float_t rmsz2 = seed->GetCurrentSigmaZ2();
+ Float_t rmsy2p30 = seed->GetCMeanSigmaY2p30();
+ Float_t rmsz2p30 = seed->GetCMeanSigmaZ2p30();
+ Float_t rmsy2p30R = seed->GetCMeanSigmaY2p30R();
+ Float_t rmsz2p30R = seed->GetCMeanSigmaZ2p30R();
+
+ AliExternalTrackParam param(*seed);
+ (*fDebugStreamer)<<"ErrParam"<<
+ "Cl.="<<cluster<<
+ "T.="<<¶m<<
+ "erry2="<<sy2<<
+ "errz2="<<sz2<<
+ "rmsy2="<<rmsy2<<
+ "rmsz2="<<rmsz2<<
+ "rmsy2p30="<<rmsy2p30<<
+ "rmsz2p30="<<rmsz2p30<<
+ "rmsy2p30R="<<rmsy2p30R<<
+ "rmsz2p30R="<<rmsz2p30R<<
+ "\n";
+ }
+
if (rdistance2>16) return 3;
- if ((rdistancey2>9.*factor || rdistancez2>9.*factor) && cluster->GetType()==0)
+ if ((rdistancey2>9. || rdistancez2>9.) && cluster->GetType()==0)
return 2; //suspisiouce - will be changed
- if ((rdistancey2>6.25*factor || rdistancez2>6.25*factor) && cluster->GetType()>0)
+ if ((rdistancey2>6.25 || rdistancez2>6.25) && cluster->GetType()>0)
// strict cut on overlaped cluster
return 2; //suspisiouce - will be changed
- if ( (rdistancey2>1.*factor || rdistancez2>6.25*factor )
+ if ( (rdistancey2>1. || rdistancez2>6.25 )
&& cluster->GetType()<0){
seed->SetNFoundable(seed->GetNFoundable()-1);
return 2;
if (fDebugStreamer) delete fDebugStreamer;
}
-void AliTPCtrackerMI::SetIO()
-{
- //
- fNewIO = kTRUE;
- fInput = AliRunLoader::GetTreeR("TPC", kFALSE,AliConfig::GetDefaultEventFolderName());
-
- fOutput = AliRunLoader::GetTreeT("TPC", kTRUE,AliConfig::GetDefaultEventFolderName());
- if (fOutput){
- AliTPCtrack *iotrack= new AliTPCtrack;
- fOutput->Branch("tracks","AliTPCtrack",&iotrack,32000,100);
- delete iotrack;
- }
-}
-
-
-void AliTPCtrackerMI::SetIO(TTree * input, TTree * output, AliESDEvent * event)
-{
-
- // set input
- fNewIO = kFALSE;
- fInput = 0;
- fOutput = 0;
- fSeedTree = 0;
- fTreeDebug =0;
- fInput = input;
- if (input==0){
- return;
- }
- //set output
- fOutput = output;
- if (output){
- AliTPCtrack *iotrack= new AliTPCtrack;
- // iotrack->fHelixIn = new TClonesArray("AliHelix");
- //iotrack->fHelixOut = new TClonesArray("AliHelix");
- fOutput->Branch("tracks","AliTPCtrack",&iotrack,32000,100);
- delete iotrack;
- }
- if (output && (fDebug&2)){
- //write the full seed information if specified in debug mode
- //
- fSeedTree = new TTree("Seeds","Seeds");
- AliTPCseed * vseed = new AliTPCseed;
- //
- TClonesArray * arrtr = new TClonesArray("AliTPCTrackPoint",160);
- arrtr->ExpandCreateFast(160);
- TClonesArray * arre = new TClonesArray("AliTPCExactPoint",160);
- //
- vseed->SetPoints(arrtr);
- vseed->SetEPoints(arre);
- // vseed->fClusterPoints = arrcl;
- fSeedTree->Branch("seeds","AliTPCseed",&vseed,32000,99);
- delete arrtr;
- delete arre;
- fTreeDebug = new TTree("trackDebug","trackDebug");
- TClonesArray * arrd = new TClonesArray("AliTPCTrackPoint2",0);
- fTreeDebug->Branch("debug",&arrd,32000,99);
- }
-
-
- //set ESD event
- fEvent = event;
-}
void AliTPCtrackerMI::FillESD(TObjArray* arr)
{
printf("Number of filled ESDs-\t%d\n",fEvent->GetNumberOfTracks());
}
-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;
- //}
- //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;
- AliTPCtrack * track = new AliTPCtrack(*pt);
- iotrack = track;
- pt->SetLab2(i);
- // br->SetAddress(&iotrack);
- fOutput->Fill();
- delete track;
- iotrack =0;
- }
- //fOutput->GetDirectory()->cd();
- //fOutput->Write();
- }
- // delete iotrack;
- //
- if (fSeedTree){
- //write the full seed information if specified in debug mode
-
- AliTPCseed * vseed = new AliTPCseed;
- //
- TClonesArray * arrtr = new TClonesArray("AliTPCTrackPoint",160);
- arrtr->ExpandCreateFast(160);
- //TClonesArray * arrcl = new TClonesArray("AliTPCclusterMI",160);
- //arrcl->ExpandCreateFast(160);
- TClonesArray * arre = new TClonesArray("AliTPCExactPoint",160);
- //
- vseed->SetPoints(arrtr);
- vseed->SetEPoints(arre);
- // vseed->fClusterPoints = arrcl;
- //TBranch * brseed = seedtree->Branch("seeds","AliTPCseed",&vseed,32000,99);
- TBranch * brseed = fSeedTree->GetBranch("seeds");
-
- Int_t nseed=fSeeds->GetEntriesFast();
-
- for (Int_t i=0; i<nseed; i++) {
- AliTPCseed *pt=(AliTPCseed*)fSeeds->UncheckedAt(i);
- if (!pt) continue;
- pt->SetPoints(arrtr);
- // pt->fClusterPoints = arrcl;
- pt->SetEPoints(arre);
- pt->RebuildSeed();
- vseed = pt;
- brseed->SetAddress(&vseed);
- fSeedTree->Fill();
- pt->SetPoints(0);
- pt->SetEPoints(0);
- // pt->fClusterPoints = 0;
- }
- fSeedTree->Write();
- if (fTreeDebug) fTreeDebug->Write();
- }
-}
-
Double_t AliTPCtrackerMI::ErrY2(AliTPCseed* seed, AliTPCclusterMI * cl){
//
//
- //seed->SetErrorY2(0.1);
- //return 0.1;
- //calculate look-up table at the beginning
- static Bool_t ginit = kFALSE;
- static Float_t gnoise1,gnoise2,gnoise3;
- static Float_t ggg1[10000];
- static Float_t ggg2[10000];
- static Float_t ggg3[10000];
- static Float_t glandau1[10000];
- static Float_t glandau2[10000];
- static Float_t glandau3[10000];
- //
- static Float_t gcor01[500];
- static Float_t gcor02[500];
- static Float_t gcorp[500];
+ // Use calibrated cluster error from OCDB
//
-
+ AliTPCClusterParam * clparam = AliTPCcalibDB::Instance()->GetClusterParam();
//
- if (ginit==kFALSE){
- for (Int_t i=1;i<500;i++){
- Float_t rsigma = float(i)/100.;
- gcor02[i] = TMath::Max(0.78 +TMath::Exp(7.4*(rsigma-1.2)),0.6);
- gcor01[i] = TMath::Max(0.72 +TMath::Exp(3.36*(rsigma-1.2)),0.6);
- gcorp[i] = TMath::Max(TMath::Power((rsigma+0.5),1.5),1.2);
- }
-
- //
- for (Int_t i=3;i<10000;i++){
- //
- //
- // inner sector
- Float_t amp = float(i);
- Float_t padlength =0.75;
- gnoise1 = 0.0004/padlength;
- Float_t nel = 0.268*amp;
- Float_t nprim = 0.155*amp;
- ggg1[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.001*nel/(padlength*padlength))/nel;
- glandau1[i] = (2.+0.12*nprim)*0.5* (2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
- if (glandau1[i]>1) glandau1[i]=1;
- glandau1[i]*=padlength*padlength/12.;
- //
- // outer short
- padlength =1.;
- gnoise2 = 0.0004/padlength;
- nel = 0.3*amp;
- nprim = 0.133*amp;
- ggg2[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.0008*nel/(padlength*padlength))/nel;
- glandau2[i] = (2.+0.12*nprim)*0.5*(2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
- if (glandau2[i]>1) glandau2[i]=1;
- glandau2[i]*=padlength*padlength/12.;
- //
- //
- // outer long
- padlength =1.5;
- gnoise3 = 0.0004/padlength;
- nel = 0.3*amp;
- nprim = 0.133*amp;
- ggg3[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.0008*nel/(padlength*padlength))/nel;
- glandau3[i] = (2.+0.12*nprim)*0.5*(2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
- if (glandau3[i]>1) glandau3[i]=1;
- glandau3[i]*=padlength*padlength/12.;
- //
- }
- ginit = kTRUE;
- }
- //
- //
- //
- Int_t amp = int(TMath::Abs(cl->GetQ()));
- if (amp>9999) {
- seed->SetErrorY2(1.);
- return 1.;
- }
- Float_t snoise2;
Float_t z = TMath::Abs(fParam->GetZLength(0)-TMath::Abs(seed->GetZ()));
Int_t ctype = cl->GetType();
- Float_t padlength= GetPadPitchLength(seed->GetRow());
- Double_t angle2 = seed->GetSnp()*seed->GetSnp();
- angle2 = angle2/(1-angle2);
- //
- //cluster "quality"
- Int_t rsigmay = int(100.*cl->GetSigmaY2()/(seed->GetCurrentSigmaY2()));
- Float_t res;
- //
- if (fSectors==fInnerSec){
- snoise2 = gnoise1;
- res = ggg1[amp]*z+glandau1[amp]*angle2;
- if (ctype==0) res *= gcor01[rsigmay];
- if ((ctype>0)){
- res+=0.002;
- res*= gcorp[rsigmay];
- }
- }
- else {
- if (padlength<1.1){
- snoise2 = gnoise2;
- res = ggg2[amp]*z+glandau2[amp]*angle2;
- if (ctype==0) res *= gcor02[rsigmay];
- if ((ctype>0)){
- res+=0.002;
- res*= gcorp[rsigmay];
- }
- }
- else{
- snoise2 = gnoise3;
- res = ggg3[amp]*z+glandau3[amp]*angle2;
- if (ctype==0) res *= gcor02[rsigmay];
- if ((ctype>0)){
- res+=0.002;
- res*= gcorp[rsigmay];
- }
- }
- }
+ Int_t type = (cl->GetRow()<63) ? 0: (cl->GetRow()>126) ? 1:2;
+ Double_t angle = seed->GetSnp()*seed->GetSnp();
+ angle = TMath::Sqrt(TMath::Abs(angle/(1.-angle)));
+ Double_t erry2 = clparam->GetError0Par(0,type, z,angle);
+ if (ctype<0) {
+ erry2+=0.5; // edge cluster
+ }
+ erry2*=erry2;
+ seed->SetErrorY2(erry2);
+ //
+ return erry2;
+
+//calculate look-up table at the beginning
+// static Bool_t ginit = kFALSE;
+// static Float_t gnoise1,gnoise2,gnoise3;
+// static Float_t ggg1[10000];
+// static Float_t ggg2[10000];
+// static Float_t ggg3[10000];
+// static Float_t glandau1[10000];
+// static Float_t glandau2[10000];
+// static Float_t glandau3[10000];
+// //
+// static Float_t gcor01[500];
+// static Float_t gcor02[500];
+// static Float_t gcorp[500];
+// //
- if (ctype<0){
- res+=0.005;
- res*=2.4; // overestimate error 2 times
- }
- res+= snoise2;
+// //
+// if (ginit==kFALSE){
+// for (Int_t i=1;i<500;i++){
+// Float_t rsigma = float(i)/100.;
+// gcor02[i] = TMath::Max(0.78 +TMath::Exp(7.4*(rsigma-1.2)),0.6);
+// gcor01[i] = TMath::Max(0.72 +TMath::Exp(3.36*(rsigma-1.2)),0.6);
+// gcorp[i] = TMath::Max(TMath::Power((rsigma+0.5),1.5),1.2);
+// }
+
+// //
+// for (Int_t i=3;i<10000;i++){
+// //
+// //
+// // inner sector
+// Float_t amp = float(i);
+// Float_t padlength =0.75;
+// gnoise1 = 0.0004/padlength;
+// Float_t nel = 0.268*amp;
+// Float_t nprim = 0.155*amp;
+// ggg1[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.001*nel/(padlength*padlength))/nel;
+// glandau1[i] = (2.+0.12*nprim)*0.5* (2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
+// if (glandau1[i]>1) glandau1[i]=1;
+// glandau1[i]*=padlength*padlength/12.;
+// //
+// // outer short
+// padlength =1.;
+// gnoise2 = 0.0004/padlength;
+// nel = 0.3*amp;
+// nprim = 0.133*amp;
+// ggg2[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.0008*nel/(padlength*padlength))/nel;
+// glandau2[i] = (2.+0.12*nprim)*0.5*(2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
+// if (glandau2[i]>1) glandau2[i]=1;
+// glandau2[i]*=padlength*padlength/12.;
+// //
+// //
+// // outer long
+// padlength =1.5;
+// gnoise3 = 0.0004/padlength;
+// nel = 0.3*amp;
+// nprim = 0.133*amp;
+// ggg3[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.0008*nel/(padlength*padlength))/nel;
+// glandau3[i] = (2.+0.12*nprim)*0.5*(2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
+// if (glandau3[i]>1) glandau3[i]=1;
+// glandau3[i]*=padlength*padlength/12.;
+// //
+// }
+// ginit = kTRUE;
+// }
+// //
+// //
+// //
+// Int_t amp = int(TMath::Abs(cl->GetQ()));
+// if (amp>9999) {
+// seed->SetErrorY2(1.);
+// return 1.;
+// }
+// Float_t snoise2;
+// Float_t z = TMath::Abs(fParam->GetZLength(0)-TMath::Abs(seed->GetZ()));
+// Int_t ctype = cl->GetType();
+// Float_t padlength= GetPadPitchLength(seed->GetRow());
+// Double_t angle2 = seed->GetSnp()*seed->GetSnp();
+// angle2 = angle2/(1-angle2);
+// //
+// //cluster "quality"
+// Int_t rsigmay = int(100.*cl->GetSigmaY2()/(seed->GetCurrentSigmaY2()));
+// Float_t res;
+// //
+// if (fSectors==fInnerSec){
+// snoise2 = gnoise1;
+// res = ggg1[amp]*z+glandau1[amp]*angle2;
+// if (ctype==0) res *= gcor01[rsigmay];
+// if ((ctype>0)){
+// res+=0.002;
+// res*= gcorp[rsigmay];
+// }
+// }
+// else {
+// if (padlength<1.1){
+// snoise2 = gnoise2;
+// res = ggg2[amp]*z+glandau2[amp]*angle2;
+// if (ctype==0) res *= gcor02[rsigmay];
+// if ((ctype>0)){
+// res+=0.002;
+// res*= gcorp[rsigmay];
+// }
+// }
+// else{
+// snoise2 = gnoise3;
+// res = ggg3[amp]*z+glandau3[amp]*angle2;
+// if (ctype==0) res *= gcor02[rsigmay];
+// if ((ctype>0)){
+// res+=0.002;
+// res*= gcorp[rsigmay];
+// }
+// }
+// }
+
+// if (ctype<0){
+// res+=0.005;
+// res*=2.4; // overestimate error 2 times
+// }
+// res+= snoise2;
- if (res<2*snoise2)
- res = 2*snoise2;
+// if (res<2*snoise2)
+// res = 2*snoise2;
- seed->SetErrorY2(res);
- return res;
+// seed->SetErrorY2(res);
+// return res;
}
Double_t AliTPCtrackerMI::ErrZ2(AliTPCseed* seed, AliTPCclusterMI * cl){
//
//
- //seed->SetErrorY2(0.1);
- //return 0.1;
- //calculate look-up table at the beginning
- static Bool_t ginit = kFALSE;
- static Float_t gnoise1,gnoise2,gnoise3;
- static Float_t ggg1[10000];
- static Float_t ggg2[10000];
- static Float_t ggg3[10000];
- static Float_t glandau1[10000];
- static Float_t glandau2[10000];
- static Float_t glandau3[10000];
- //
- static Float_t gcor01[1000];
- static Float_t gcor02[1000];
- static Float_t gcorp[1000];
+ // Use calibrated cluster error from OCDB
//
-
+ AliTPCClusterParam * clparam = AliTPCcalibDB::Instance()->GetClusterParam();
//
- if (ginit==kFALSE){
- for (Int_t i=1;i<1000;i++){
- Float_t rsigma = float(i)/100.;
- gcor02[i] = TMath::Max(0.81 +TMath::Exp(6.8*(rsigma-1.2)),0.6);
- gcor01[i] = TMath::Max(0.72 +TMath::Exp(2.04*(rsigma-1.2)),0.6);
- gcorp[i] = TMath::Max(TMath::Power((rsigma+0.5),1.5),1.2);
- }
-
- //
- for (Int_t i=3;i<10000;i++){
- //
- //
- // inner sector
- Float_t amp = float(i);
- Float_t padlength =0.75;
- gnoise1 = 0.0004/padlength;
- Float_t nel = 0.268*amp;
- Float_t nprim = 0.155*amp;
- ggg1[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.001*nel/(padlength*padlength))/nel;
- glandau1[i] = (2.+0.12*nprim)*0.5* (2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
- if (glandau1[i]>1) glandau1[i]=1;
- glandau1[i]*=padlength*padlength/12.;
- //
- // outer short
- padlength =1.;
- gnoise2 = 0.0004/padlength;
- nel = 0.3*amp;
- nprim = 0.133*amp;
- ggg2[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.0008*nel/(padlength*padlength))/nel;
- glandau2[i] = (2.+0.12*nprim)*0.5*(2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
- if (glandau2[i]>1) glandau2[i]=1;
- glandau2[i]*=padlength*padlength/12.;
- //
- //
- // outer long
- padlength =1.5;
- gnoise3 = 0.0004/padlength;
- nel = 0.3*amp;
- nprim = 0.133*amp;
- ggg3[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.0008*nel/(padlength*padlength))/nel;
- glandau3[i] = (2.+0.12*nprim)*0.5*(2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
- if (glandau3[i]>1) glandau3[i]=1;
- glandau3[i]*=padlength*padlength/12.;
- //
- }
- ginit = kTRUE;
- }
- //
- //
- //
- Int_t amp = int(TMath::Abs(cl->GetQ()));
- if (amp>9999) {
- seed->SetErrorY2(1.);
- return 1.;
- }
- Float_t snoise2;
Float_t z = TMath::Abs(fParam->GetZLength(0)-TMath::Abs(seed->GetZ()));
Int_t ctype = cl->GetType();
- Float_t padlength= GetPadPitchLength(seed->GetRow());
+ Int_t type = (cl->GetRow()<63) ? 0: (cl->GetRow()>126) ? 1:2;
//
Double_t angle2 = seed->GetSnp()*seed->GetSnp();
- // if (angle2<0.6) angle2 = 0.6;
angle2 = seed->GetTgl()*seed->GetTgl()*(1+angle2/(1-angle2));
- //
- //cluster "quality"
- Int_t rsigmaz = int(100.*cl->GetSigmaZ2()/(seed->GetCurrentSigmaZ2()));
- Float_t res;
- //
- if (fSectors==fInnerSec){
- snoise2 = gnoise1;
- res = ggg1[amp]*z+glandau1[amp]*angle2;
- if (ctype==0) res *= gcor01[rsigmaz];
- if ((ctype>0)){
- res+=0.002;
- res*= gcorp[rsigmaz];
- }
+ Double_t angle = TMath::Sqrt(TMath::Abs(angle2));
+ Double_t errz2 = clparam->GetError0Par(1,type, z,angle);
+ if (ctype<0) {
+ errz2+=0.5; // edge cluster
}
- else {
- if (padlength<1.1){
- snoise2 = gnoise2;
- res = ggg2[amp]*z+glandau2[amp]*angle2;
- if (ctype==0) res *= gcor02[rsigmaz];
- if ((ctype>0)){
- res+=0.002;
- res*= gcorp[rsigmaz];
- }
- }
- else{
- snoise2 = gnoise3;
- res = ggg3[amp]*z+glandau3[amp]*angle2;
- if (ctype==0) res *= gcor02[rsigmaz];
- if ((ctype>0)){
- res+=0.002;
- res*= gcorp[rsigmaz];
- }
- }
- }
-
- if (ctype<0){
- res+=0.002;
- res*=1.3;
- }
- if ((ctype<0) &&<70){
- res+=0.002;
- res*=1.3;
- }
- res += snoise2;
- if (res<2*snoise2)
- res = 2*snoise2;
- if (res>3) res =3;
- seed->SetErrorZ2(res);
- return res;
-}
-
-
-
-/*
-Double_t AliTPCtrackerMI::ErrZ2(AliTPCseed* seed, AliTPCclusterMI * cl){
- //
- //
- //seed->SetErrorZ2(0.1);
- //return 0.1;
-
- Float_t snoise2;
- Float_t z = TMath::Abs(fParam->GetZLength(0)-TMath::Abs(seed->GetZ()));
- //
- Float_t rsigmaz = cl->GetSigmaZ2()/(seed->fCurrentSigmaZ2);
- Int_t ctype = cl->GetType();
- Float_t amp = TMath::Abs(cl->GetQ());
-
- Float_t nel;
- Float_t nprim;
- //
- Float_t landau=2 ; //landau fluctuation part
- Float_t gg=2; // gg fluctuation part
- Float_t padlength= GetPadPitchLength(seed->GetX());
-
- if (fSectors==fInnerSec){
- snoise2 = 0.0004/padlength;
- nel = 0.268*amp;
- nprim = 0.155*amp;
- gg = (2+0.001*nel/(padlength*padlength))/nel;
- landau = (2.+0.12*nprim)*0.5*(2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
- if (landau>1) landau=1;
- }
- else {
- snoise2 = 0.0004/padlength;
- nel = 0.3*amp;
- nprim = 0.133*amp;
- gg = (2+0.0008*nel/(padlength*padlength))/nel;
- landau = (2.+0.12*nprim)*0.5*(2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
- if (landau>1) landau=1;
- }
- Float_t sdiff = gg*fParam->GetDiffT()*fParam->GetDiffT()*z;
-
+ errz2*=errz2;
+ seed->SetErrorZ2(errz2);
//
- Float_t angle2 = seed->GetSnp()*seed->GetSnp();
- angle2 = TMath::Sqrt((1-angle2));
- if (angle2<0.6) angle2 = 0.6;
- //angle2 = 1;
+ return errz2;
- Float_t angle = seed->GetTgl()/angle2;
- Float_t angular = landau*angle*angle*padlength*padlength/12.;
- Float_t res = sdiff + angular;
-
- if ((ctype==0) && (fSectors ==fOuterSec))
- res *= 0.81 +TMath::Exp(6.8*(rsigmaz-1.2));
- if ((ctype==0) && (fSectors ==fInnerSec))
- res *= 0.72 +TMath::Exp(2.04*(rsigmaz-1.2));
-
- if ((ctype>0)){
- res+=0.005;
- res*= TMath::Power(rsigmaz+0.5,1.5); //0.31+0.147*ctype;
- }
- if (ctype<0){
- res+=0.002;
- res*=1.3;
- }
- if ((ctype<0) &&<70){
- res+=0.002;
- res*=1.3;
- }
- res += snoise2;
- if (res<2*snoise2)
- res = 2*snoise2;
+// //seed->SetErrorY2(0.1);
+// //return 0.1;
+// //calculate look-up table at the beginning
+// static Bool_t ginit = kFALSE;
+// static Float_t gnoise1,gnoise2,gnoise3;
+// static Float_t ggg1[10000];
+// static Float_t ggg2[10000];
+// static Float_t ggg3[10000];
+// static Float_t glandau1[10000];
+// static Float_t glandau2[10000];
+// static Float_t glandau3[10000];
+// //
+// static Float_t gcor01[1000];
+// static Float_t gcor02[1000];
+// static Float_t gcorp[1000];
+// //
- seed->SetErrorZ2(res);
- return res;
+// //
+// if (ginit==kFALSE){
+// for (Int_t i=1;i<1000;i++){
+// Float_t rsigma = float(i)/100.;
+// gcor02[i] = TMath::Max(0.81 +TMath::Exp(6.8*(rsigma-1.2)),0.6);
+// gcor01[i] = TMath::Max(0.72 +TMath::Exp(2.04*(rsigma-1.2)),0.6);
+// gcorp[i] = TMath::Max(TMath::Power((rsigma+0.5),1.5),1.2);
+// }
+
+// //
+// for (Int_t i=3;i<10000;i++){
+// //
+// //
+// // inner sector
+// Float_t amp = float(i);
+// Float_t padlength =0.75;
+// gnoise1 = 0.0004/padlength;
+// Float_t nel = 0.268*amp;
+// Float_t nprim = 0.155*amp;
+// ggg1[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.001*nel/(padlength*padlength))/nel;
+// glandau1[i] = (2.+0.12*nprim)*0.5* (2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
+// if (glandau1[i]>1) glandau1[i]=1;
+// glandau1[i]*=padlength*padlength/12.;
+// //
+// // outer short
+// padlength =1.;
+// gnoise2 = 0.0004/padlength;
+// nel = 0.3*amp;
+// nprim = 0.133*amp;
+// ggg2[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.0008*nel/(padlength*padlength))/nel;
+// glandau2[i] = (2.+0.12*nprim)*0.5*(2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
+// if (glandau2[i]>1) glandau2[i]=1;
+// glandau2[i]*=padlength*padlength/12.;
+// //
+// //
+// // outer long
+// padlength =1.5;
+// gnoise3 = 0.0004/padlength;
+// nel = 0.3*amp;
+// nprim = 0.133*amp;
+// ggg3[i] = fParam->GetDiffT()*fParam->GetDiffT()*(2+0.0008*nel/(padlength*padlength))/nel;
+// glandau3[i] = (2.+0.12*nprim)*0.5*(2.+nprim*nprim*0.001/(padlength*padlength))/nprim;
+// if (glandau3[i]>1) glandau3[i]=1;
+// glandau3[i]*=padlength*padlength/12.;
+// //
+// }
+// ginit = kTRUE;
+// }
+// //
+// //
+// //
+// Int_t amp = int(TMath::Abs(cl->GetQ()));
+// if (amp>9999) {
+// seed->SetErrorY2(1.);
+// return 1.;
+// }
+// Float_t snoise2;
+// Float_t z = TMath::Abs(fParam->GetZLength(0)-TMath::Abs(seed->GetZ()));
+// Int_t ctype = cl->GetType();
+// Float_t padlength= GetPadPitchLength(seed->GetRow());
+// //
+// Double_t angle2 = seed->GetSnp()*seed->GetSnp();
+// // if (angle2<0.6) angle2 = 0.6;
+// angle2 = seed->GetTgl()*seed->GetTgl()*(1+angle2/(1-angle2));
+// //
+// //cluster "quality"
+// Int_t rsigmaz = int(100.*cl->GetSigmaZ2()/(seed->GetCurrentSigmaZ2()));
+// Float_t res;
+// //
+// if (fSectors==fInnerSec){
+// snoise2 = gnoise1;
+// res = ggg1[amp]*z+glandau1[amp]*angle2;
+// if (ctype==0) res *= gcor01[rsigmaz];
+// if ((ctype>0)){
+// res+=0.002;
+// res*= gcorp[rsigmaz];
+// }
+// }
+// else {
+// if (padlength<1.1){
+// snoise2 = gnoise2;
+// res = ggg2[amp]*z+glandau2[amp]*angle2;
+// if (ctype==0) res *= gcor02[rsigmaz];
+// if ((ctype>0)){
+// res+=0.002;
+// res*= gcorp[rsigmaz];
+// }
+// }
+// else{
+// snoise2 = gnoise3;
+// res = ggg3[amp]*z+glandau3[amp]*angle2;
+// if (ctype==0) res *= gcor02[rsigmaz];
+// if ((ctype>0)){
+// res+=0.002;
+// res*= gcorp[rsigmaz];
+// }
+// }
+// }
+
+// if (ctype<0){
+// res+=0.002;
+// res*=1.3;
+// }
+// if ((ctype<0) &&<70){
+// res+=0.002;
+// res*=1.3;
+// }
+// res += snoise2;
+// if (res<2*snoise2)
+// res = 2*snoise2;
+// if (res>3) res =3;
+// seed->SetErrorZ2(res);
+// return res;
}
-*/
+
//
//
//
-// AliTPCTransform trafo;
-
-// Double_t x[3]={cluster->GetX(),cluster->GetY(),cluster->GetZ()};
-// Int_t i[1]={cluster->GetDetector()};
-
-// trafo.Transform(x,i,0,1);
-
-// cluster->SetX(x[0]);
-// cluster->SetY(x[1]);
-// cluster->SetZ(x[2]);
-
-// return;
+ AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
+ if (!transform) {
+ AliFatal("Tranformations not in calibDB");
+ }
+ Double_t x[3]={cluster->GetRow(),cluster->GetPad(),cluster->GetTimeBin()};
+ Int_t i[1]={cluster->GetDetector()};
+ transform->Transform(x,i,0,1);
+ if (!AliTPCReconstructor::GetRecoParam()->GetBYMirror()){
+ if (cluster->GetDetector()%36>17){
+ x[1]*=-1;
+ }
+ }
+ //
+ // in debug mode check the transformation
+ //
+ if (AliTPCReconstructor::StreamLevel()>1) {
+ TTreeSRedirector &cstream = *fDebugStreamer;
+ cstream<<"Transform"<<
+ "x0="<<x[0]<<
+ "x1="<<x[1]<<
+ "x2="<<x[2]<<
+ "Cl.="<<cluster<<
+ "\n";
+ }
+ cluster->SetX(x[0]);
+ cluster->SetY(x[1]);
+ cluster->SetZ(x[2]);
// The old stuff:
//
else{
// chack Loading of Geo matrices from GeoManager - TEMPORARY FIX
}
- //cluster->SetX(posC[0]);
- //cluster->SetY(posC[1]);
- //cluster->SetZ(posC[2]);
+ cluster->SetX(posC[0]);
+ cluster->SetY(posC[1]);
+ cluster->SetZ(posC[2]);
}
//_____________________________________________________________________________
//
t.SetCurrentCluster(cl);
t.SetRow(nr);
- Int_t accept = AcceptCluster(&t,t.GetCurrentCluster(),1.);
+ Int_t accept = AcceptCluster(&t,t.GetCurrentCluster());
if ((tpcindex&0x8000)==0) accept =0;
if (accept<3) {
//if founded cluster is acceptible
t.SetCurrentCluster(cl);
t.SetRow(nr);
if (fIteration==2&&cl->IsUsed(10)) return 0;
- Int_t accept = AcceptCluster(&t,t.GetCurrentCluster(),1.);
+ Int_t accept = AcceptCluster(&t,t.GetCurrentCluster());
if (fIteration==2&&cl->IsUsed(11)) {
t.SetErrorY2(t.GetErrorY2()+0.03);
t.SetErrorZ2(t.GetErrorZ2()+0.03);
t.GetProlongation(x,y,z);
}
//
- // update current shape info every 3 pad-row
- if ( (nr%6==0) || t.GetNumberOfClusters()<2 || (t.GetCurrentSigmaY2()<0.0001) ){
+ // update current shape info every 2 pad-row
+ if ( (nr%2==0) || t.GetNumberOfClusters()<2 || (t.GetCurrentSigmaY2()<0.0001) ){
// t.fCurrentSigmaY = GetSigmaY(&t);
//t.fCurrentSigmaZ = GetSigmaZ(&t);
GetShape(&t,nr);
if (cl) {
t.SetCurrentCluster(cl);
- // Int_t accept = AcceptCluster(&t,t.fCurrentCluster,1.);
+ // Int_t accept = AcceptCluster(&t,t.fCurrentCluster);
//if (accept<3){
t.SetClusterIndex2(row,index);
t.SetClusterPointer(row, cl);
}
// update current
- if ( (nr%6==0) || t.GetNumberOfClusters()<2){
+ if ( (nr%2==0) || t.GetNumberOfClusters()<2){
// t.fCurrentSigmaY = GetSigmaY(&t);
//t.fCurrentSigmaZ = GetSigmaZ(&t);
GetShape(&t,nr);
if (t.GetCurrentCluster()) {
t.SetRow(nr);
- Int_t accept = AcceptCluster(&t,t.GetCurrentCluster(),1.);
+ Int_t accept = AcceptCluster(&t,t.GetCurrentCluster());
if (t.GetCurrentCluster()->IsUsed(10)){
//
//FindKinks(fSeeds,event);
Info("RefitInward","Number of refitted tracks %d",ntracks);
fEvent =0;
- //WriteTracks();
return 0;
}
//FindKinks(fSeeds,event);
Info("PropagateBack","Number of back propagated tracks %d",ntracks);
fEvent =0;
- //WriteTracks();
return 0;
}
-void AliTPCtrackerMI::FindCurling(TObjArray * array, AliESDEvent *esd, Int_t iter)
+void AliTPCtrackerMI::FindCurling(TObjArray * array, AliESDEvent */*esd*/, Int_t iter)
{
//
// find Curling tracks
ParallelTracking(fSeeds,fOuterSec->GetNRows()+fInnerSec->GetNRows()-1,fInnerSec->GetNRows());
fSectors = fInnerSec;
ParallelTracking(fSeeds,fInnerSec->GetNRows()-1,0);
- //WriteTracks();
return 1;
}
void AliTPCtrackerMI::GetShape(AliTPCseed * seed, Int_t row)
{
//
- //
- Float_t sd2 = TMath::Abs((fParam->GetZLength(0)-TMath::Abs(seed->GetZ())))*fParam->GetDiffL()*fParam->GetDiffL();
- // Float_t padlength = fParam->GetPadPitchLength(seed->fSector);
- Float_t padlength = GetPadPitchLength(row);
- //
- Float_t sresy = (seed->GetSector() < fParam->GetNSector()/2) ? 0.2 :0.3;
+ //
+ AliTPCClusterParam * clparam = AliTPCcalibDB::Instance()->GetClusterParam();
+ Float_t zdrift = TMath::Abs((fParam->GetZLength(0)-TMath::Abs(seed->GetZ())));
+ Int_t type = (seed->GetSector() < fParam->GetNSector()/2) ? 0: (row>126) ? 1:2;
Double_t angulary = seed->GetSnp();
- angulary = angulary*angulary/(1-angulary*angulary);
- seed->SetCurrentSigmaY2(sd2+padlength*padlength*angulary/12.+sresy*sresy);
- //
- Float_t sresz = fParam->GetZSigma();
- Float_t angularz = seed->GetTgl();
- seed->SetCurrentSigmaZ2(sd2+padlength*padlength*angularz*angularz*(1+angulary)/12.+sresz*sresz);
+ angulary = angulary*angulary/(1.-angulary*angulary);
+ Double_t angularz = seed->GetTgl()*seed->GetTgl()*(1.+angulary);
+
+ Double_t sigmay = clparam->GetRMS0(0,type,zdrift,TMath::Sqrt(TMath::Abs(angulary)));
+ Double_t sigmaz = clparam->GetRMS0(1,type,zdrift,TMath::Sqrt(TMath::Abs(angularz)));
+ seed->SetCurrentSigmaY2(sigmay*sigmay);
+ seed->SetCurrentSigmaZ2(sigmaz*sigmaz);
+ // Float_t sd2 = TMath::Abs((fParam->GetZLength(0)-TMath::Abs(seed->GetZ())))*fParam->GetDiffL()*fParam->GetDiffL();
+// // Float_t padlength = fParam->GetPadPitchLength(seed->fSector);
+// Float_t padlength = GetPadPitchLength(row);
+// //
+// Float_t sresy = (seed->GetSector() < fParam->GetNSector()/2) ? 0.2 :0.3;
+// seed->SetCurrentSigmaY2(sd2+padlength*padlength*angulary/12.+sresy*sresy);
+// //
+// Float_t sresz = fParam->GetZSigma();
+// seed->SetCurrentSigmaZ2(sd2+padlength*padlength*angularz*angularz*(1+angulary)/12.+sresz*sresz);
/*
Float_t wy = GetSigmaY(seed);
Float_t wz = GetSigmaZ(seed);
}
-Float_t AliTPCtrackerMI::GetSigmaY(AliTPCseed * seed)
-{
- //
- //
- Float_t sd2 = TMath::Abs((fParam->GetZLength(0)-TMath::Abs(seed->GetZ())))*fParam->GetDiffL()*fParam->GetDiffL();
- Float_t padlength = fParam->GetPadPitchLength(seed->GetSector());
- Float_t sres = (seed->GetSector() < fParam->GetNSector()/2) ? 0.2 :0.3;
- Float_t angular = seed->GetSnp();
- angular = angular*angular/(1-angular*angular);
- // angular*=angular;
- //angular = TMath::Sqrt(angular/(1-angular));
- Float_t res = TMath::Sqrt(sd2+padlength*padlength*angular/12.+sres*sres);
- return res;
-}
-Float_t AliTPCtrackerMI::GetSigmaZ(AliTPCseed * seed)
-{
- //
- //
- Float_t sd2 = TMath::Abs((fParam->GetZLength(0)-TMath::Abs(seed->GetZ())))*fParam->GetDiffL()*fParam->GetDiffL();
- Float_t padlength = fParam->GetPadPitchLength(seed->GetSector());
- Float_t sres = fParam->GetZSigma();
- Float_t angular = seed->GetTgl();
- Float_t res = TMath::Sqrt(sd2+padlength*padlength*angular*angular/12.+sres*sres);
- return res;
-}
-
//__________________________________________________________________________
void AliTPCtrackerMI::CookLabel(AliKalmanTrack *tk, Float_t wrong) const {
// Insert a cluster into this pad row in accordence with its y-coordinate
//-----------------------------------------------------------------------
if (fN==kMaxClusterPerRow) {
- cerr<<"AliTPCRow::InsertCluster(): Too many clusters !\n"; return;
+ //AliInfo("AliTPCRow::InsertCluster(): Too many clusters");
+ return;
}
+ if (fN>=fN1+fN2) {
+ //AliInfo("AliTPCRow::InsertCluster(): Too many clusters !");
+ }
+
if (fN==0) {fIndex[0]=index; fClusters[fN++]=c; return;}
Int_t i=Find(c->GetZ());
memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTPCclusterMI*));
}
+void AliTPCtrackerMI::AliTPCRow::SetFastCluster(Int_t i, Short_t cl){
+ //
+ // Set cluster info for fast navigation
+ //
+ if (i>510|| i<0){
+ }else{
+ fFastCluster[i]=cl;
+ }
+}
+