]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCseed.cxx
Removing obsolete macros which used the AliTPCtracker
[u/mrichter/AliRoot.git] / TPC / AliTPCseed.cxx
index e4923ee49b6c229b391faaa6d96cf78ca229891e..b5c30f4fe2df1f834e9fa72e725f28a08476422c 100644 (file)
@@ -542,15 +542,30 @@ Bool_t AliTPCseed::Update(const AliCluster *c, Double_t chisq, Int_t index)
   Int_t n=GetNumberOfClusters();
   Int_t idx=GetClusterIndex(n);    // save the current cluster index
 
-  AliCluster cl(*c);  cl.SetSigmaY2(fErrorY2); cl.SetSigmaZ2(fErrorZ2);
+  AliTPCclusterMI cl(*(AliTPCclusterMI*)c);  cl.SetSigmaY2(fErrorY2); cl.SetSigmaZ2(fErrorZ2);
+
+  AliTPCClusterParam * parcl = AliTPCcalibDB::Instance()->GetClusterParam();
+  
+  Float_t ty = TMath::Tan(TMath::ASin(GetSnp()));
+  
+  if(  parcl ){
+    Int_t padSize = 0;                          // short pads
+    if (cl.GetDetector() >= 36) {
+      padSize = 1;                              // medium pads 
+      if (cl.GetRow() > 63) padSize = 2; // long pads
+    }
+    Float_t waveCorr = parcl->GetWaveCorrection( padSize, cl.GetZ(), cl.GetMax(),cl.GetPad(), ty );
+    cl.SetY( cl.GetY() - waveCorr ); 
+  }
+
   Float_t dx = ((AliTPCclusterMI*)c)->GetX()-GetX();
   if (TMath::Abs(dx)>0){
-    Float_t ty = TMath::Tan(TMath::ASin(GetSnp()));
     Float_t dy = dx*ty;
     Float_t dz = dx*TMath::Sqrt(1.+ty*ty)*GetTgl();
-    cl.SetY(c->GetY()-dy);  
-    cl.SetZ(c->GetZ()-dz);  
-  }
+    cl.SetY(cl.GetY()-dy);  
+    cl.SetZ(cl.GetZ()-dz);  
+  }  
 
   if (!AliTPCtrack::Update(&cl,chisq,index)) return kFALSE;
   
@@ -1143,6 +1158,7 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
   Float_t corrTimeGain = 1;
   TObjArray * timeGainSplines = 0x0;
   TGraphErrors * grPadEqual = 0x0;
+  TGraphErrors*  grChamberGain[3]={0x0,0x0,0x0};
   //
   AliTPCTransform * trans = AliTPCcalibDB::Instance()->GetTransform();
   const AliTPCRecoParam * recoParam = AliTPCcalibDB::Instance()->GetTransform()->GetCurrentRecoParam();
@@ -1165,8 +1181,11 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
        //
        if (type==1) grPadEqual = (TGraphErrors * ) timeGainSplines->FindObject("TGRAPHERRORS_MEANQMAX_PADREGIONGAIN_BEAM_ALL");
        if (type==0) grPadEqual = (TGraphErrors * ) timeGainSplines->FindObject("TGRAPHERRORS_MEANQTOT_PADREGIONGAIN_BEAM_ALL");
+        const char* names[3]={"SHORT","MEDIUM","LONG"};
+        for (Int_t iPadRegion=0; iPadRegion<3; ++iPadRegion)
+          grChamberGain[iPadRegion]=(TGraphErrors*)timeGainSplines->FindObject(Form("TGRAPHERRORS_MEAN_CHAMBERGAIN_%s_BEAM_ALL",names[iPadRegion]));
       }
-  }   
+  }
   
   const Float_t kClusterShapeCut = 1.5; // IMPPRTANT TO DO: move value to AliTPCRecoParam
   const Float_t ktany = TMath::Tan(TMath::DegToRad()*10);
@@ -1258,13 +1277,19 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
     // pad region equalization outside of cluster param
     //
     Float_t gainEqualPadRegion = 1;
-    if (grPadEqual) gainEqualPadRegion = grPadEqual->Eval(ipad);
+    if (grPadEqual && recoParam->GetUseGainCorrectionTime()>0) gainEqualPadRegion = grPadEqual->Eval(ipad);
+    //
+    // chamber-by-chamber equalization outside gain map
+    //
+    Float_t gainChamber = 1;
+    if (grChamberGain[ipad] && recoParam->GetUseGainCorrectionTime()>0) gainChamber = grChamberGain[ipad]->Eval(cluster->GetDetector());
     //
     amp[ncl]=charge;
     amp[ncl]/=gainGG;
     amp[ncl]/=gainPad;
     amp[ncl]/=corrPos;
     amp[ncl]/=gainEqualPadRegion;
+    amp[ncl]/=gainChamber;
     //
     ncl++;
   }
@@ -1424,7 +1449,7 @@ Int_t  AliTPCseed::RefitTrack(AliTPCseed *seed, AliExternalTrackParam * parin, A
   Int_t imin=158, imax=0;
   for (Int_t i=0;i<160;i++) {
     AliTPCclusterMI *c=track->GetClusterPointer(i);
-    if (!c) continue;
+    if (!c || (track->GetClusterIndex(i) & 0x8000)) continue; 
     if (sector<0) sector = c->GetDetector();
     if (c->GetX()<xmin) xmin=c->GetX();
     if (c->GetX()>xmax) xmax=c->GetX();
@@ -1453,7 +1478,7 @@ Int_t  AliTPCseed::RefitTrack(AliTPCseed *seed, AliExternalTrackParam * parin, A
   //
   for (Int_t i=imin; i<=imax; i++){
     AliTPCclusterMI *c=track->GetClusterPointer(i);
-    if (!c) continue;
+    if (!c || (track->GetClusterIndex(i) & 0x8000)) continue; 
     //    if (RejectCluster(c,track)) continue;
     sector = (c->GetDetector()%18);
     if (!track->Rotate(TMath::DegToRad()*(sector%18*20.+10.)-track->GetAlpha())) {
@@ -1473,7 +1498,7 @@ Int_t  AliTPCseed::RefitTrack(AliTPCseed *seed, AliExternalTrackParam * parin, A
   //
   for (Int_t i=imax; i>=imin; i--){
     AliTPCclusterMI *c=track->GetClusterPointer(i);
-    if (!c) continue;
+    if (!c || (track->GetClusterIndex(i) & 0x8000)) continue;
     //if (RejectCluster(c,track)) continue;
     sector = (c->GetDetector()%18);
     if (!track->Rotate(TMath::DegToRad()*(sector%18*20.+10.)-track->GetAlpha())) {
@@ -1493,7 +1518,7 @@ Int_t  AliTPCseed::RefitTrack(AliTPCseed *seed, AliExternalTrackParam * parin, A
   //
   for (Int_t i=imin; i<=imax; i++){
     AliTPCclusterMI *c=track->GetClusterPointer(i);
-    if (!c) continue;
+    if (!c || (track->GetClusterIndex(i) & 0x8000)) continue; 
     sector = (c->GetDetector()%18);
     if (!track->Rotate(TMath::DegToRad()*(sector%18*20.+10.)-track->GetAlpha())) {
       //continue;
@@ -1701,6 +1726,15 @@ Float_t AliTPCseed::GetTPCClustInfo(Int_t nNeighbours, Int_t type, Int_t row0, I
     return ncl+nclBelowThr;
   return 0;
 }
+//_______________________________________________________________________
+Int_t AliTPCseed::GetNumberOfClustersIndices() {
+  Int_t ncls = 0;
+  for (int i=0; i < 160; i++) {
+    if ((fIndex[i] & 0x8000) == 0)
+      ncls++;
+  }
+  return ncls;
+}
 
 //_______________________________________________________________________
 void AliTPCseed::Clear(Option_t*)