AliTPCReconstructor.cxx - MIP at channel 50
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 1 Mar 2009 18:42:04 +0000 (18:42 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 1 Mar 2009 18:42:04 +0000 (18:42 +0000)
AliTPCpidESD.cxx        - Using TMathBase to calculate BetheBlochAleph
                        - dNprim/dx =>dNtot/dx correction hardwired- to be 2 database entries

AliTPCseed.cxx AliTPCseed.h AliTPCtrackerMI.cxx
                        - Using CookdEdxNorm
                        - RMS and Number of clusters also calculated

TPC/AliTPCReconstructor.cxx
TPC/AliTPCpidESD.cxx
TPC/AliTPCseed.cxx
TPC/AliTPCseed.h
TPC/AliTPCtrackerMI.cxx

index 89171d9..0d92648 100644 (file)
@@ -121,7 +121,7 @@ void AliTPCReconstructor::FillESD(TTree */*digitsTree*/, TTree */*clustersTree*/
 {
 // make PID
 
-  Double_t parTPC[] = {47., 0.07, 5.};
+  Double_t parTPC[] = {50., 0.07, 5.};  // MIP nnormalized to channel 50 -MI
   AliTPCpidESD tpcPID(parTPC);
   tpcPID.MakePID(esd);
 }
index cc64763..66dc38e 100644 (file)
@@ -22,6 +22,7 @@
 #include "AliTPCpidESD.h"
 #include "AliESDEvent.h"
 #include "AliESDtrack.h"
+#include "AliMathBase.h"
 
 ClassImp(AliTPCpidESD)
 
@@ -39,14 +40,23 @@ ClassImp(AliTPCpidESD)
   fRange=param[2];
 }
 
-Double_t AliTPCpidESD::Bethe(Double_t bg) {
+Double_t AliTPCpidESD::Bethe(Double_t betaGamma) {
   //
   // This is the Bethe-Bloch function normalised to 1 at the minimum
+  // WARNING
+  // Simulated and reconstructed Bethe-Bloch differs 
+  //           Simulated  curve is the dNprim/dx
+  //           Reconstructed is proportianal dNtot/dx
+  // Temporary fix for production -  Simple linear correction function
+  // Future    2 Bethe Bloch formulas needed
+  //           1. for simulation
+  //           2. for reconstructed PID
   //
-  Double_t bg2=bg*bg;
-  Double_t beta2 = bg2/(1.+ bg2);
-
-  return 8.62702e-2*(9.14550 - beta2 - TMath::Log(3.51000e-5 + 1./bg2))/beta2;
+  const Float_t kmeanCorrection =0.1;
+  Double_t bb = AliMathBase::BetheBlochAleph(betaGamma);
+  Double_t meanCorrection =(1+(bb-1)*kmeanCorrection);
+  bb *= meanCorrection;
+  return bb;
 }
 
 //_________________________________________________________________________
index 7c07cba..3d0e4ab 100644 (file)
@@ -566,10 +566,30 @@ Float_t AliTPCseed::CookdEdx(Double_t low, Double_t up,Int_t i1, Int_t i2, Bool_
   //-----------------------------------------------------------------
   // This funtion calculates dE/dX within the "low" and "up" cuts.
   //-----------------------------------------------------------------
+  AliTPCParam *param = AliTPCcalibDB::Instance()->GetParameters();
+  Int_t row0 = param->GetNRowLow();
+  Int_t row1 = row0+param->GetNRowUp1();
+  Int_t row2 = row1+param->GetNRowUp2();
+  //
+  //
+  //
+  fDEDX[0]      = CookdEdxNorm(low,up,0 ,i1  ,i2,  kTRUE,kFALSE,2,0);
+  fDEDX[1]      = CookdEdxNorm(low,up,0 ,0   ,row0,kTRUE,kFALSE,2,0);
+  fDEDX[2]      = CookdEdxNorm(low,up,0 ,row0,row1,kTRUE,kFALSE,2,0);
+  fDEDX[3]      = CookdEdxNorm(low,up,0 ,row1,row2,kTRUE,kFALSE,2,0);
+  //
+  fSDEDX[0]     = CookdEdxNorm(low,up,0 ,i1  ,i2,  kTRUE,kFALSE,2,1);
+  fSDEDX[1]     = CookdEdxNorm(low,up,0 ,0   ,row0,kTRUE,kFALSE,2,1);
+  fSDEDX[2]     = CookdEdxNorm(low,up,0 ,row0,row1,kTRUE,kFALSE,2,1);
+  fSDEDX[3]     = CookdEdxNorm(low,up,0 ,row1,row2,kTRUE,kFALSE,2,1);
+  //
+  fNCDEDX[0]    = TMath::Nint(CookdEdxNorm(low,up,0 ,i1  ,i2,  kTRUE,kFALSE,2,2));
+  fNCDEDX[1]    = TMath::Nint(CookdEdxNorm(low,up,0 ,0   ,row0,kTRUE,kFALSE,2,2));
+  fNCDEDX[2]    = TMath::Nint(CookdEdxNorm(low,up,0 ,row0,row1,kTRUE,kFALSE,2,2));
+  fNCDEDX[3]    = TMath::Nint(CookdEdxNorm(low,up,0 ,row1,row2,kTRUE,kFALSE,2,2));
 
-  Float_t dedx = CookdEdxNorm(low,up,0,i1,i2,1,0,2);
-  SetdEdx(dedx);
-  return dedx;
+  SetdEdx(fDEDX[0]);
+  return fDEDX[0];
 
 //  return CookdEdxNorm(low,up,0,i1,i2,1,0,2);
 
@@ -886,7 +906,7 @@ Bool_t AliTPCseed::GetSharedMapBit(int ibit)
 
 
 
-Float_t  AliTPCseed::CookdEdxNorm(Double_t low, Double_t up, Int_t type, Int_t i1, Int_t i2, Bool_t shapeNorm,Bool_t posNorm, Int_t padNorm){
+Float_t  AliTPCseed::CookdEdxNorm(Double_t low, Double_t up, Int_t type, Int_t i1, Int_t i2, Bool_t shapeNorm,Bool_t posNorm, Int_t padNorm, Int_t returnVal){
  
   //
   // calculates dedx using the cluster
@@ -897,14 +917,20 @@ Float_t  AliTPCseed::CookdEdxNorm(Double_t low, Double_t up, Int_t type, Int_t i
   // shapeNorm - kTRUE  -taken from OCDB
   //           
   // posNorm   - usage of pos normalization 
-  //
-  // 
+  // padNorm   - pad type normalization
+  // returnVal - 0 return mean
+  //           - 1 return RMS
+  //           - 2 return number of clusters
+  //           
   // normalization parametrization taken from AliTPCClusterParam
   //
   AliTPCClusterParam * parcl = AliTPCcalibDB::Instance()->GetClusterParam();
   AliTPCParam * param = AliTPCcalibDB::Instance()->GetParameters();
   if (!parcl)  return 0;
   if (!param) return 0;
+  Int_t row0 = param->GetNRowLow();
+  Int_t row1 = row0+param->GetNRowUp1();
+
   Float_t amp[160];
   Int_t   indexes[160];
   Int_t   ncl=0;
@@ -912,7 +938,7 @@ Float_t  AliTPCseed::CookdEdxNorm(Double_t low, Double_t up, Int_t type, Int_t i
   //
   Float_t gainGG      = 1;  // gas gain factor -always enabled
   Float_t gainPad     = 1;  // gain map  - used always
-  Float_t corrShape   = 1;  // 
+  Float_t corrShape   = 1;  // correction due angular effect, diffusion and electron attachment
   Float_t corrPos     = 1;  // local position correction - if posNorm enabled
   Float_t corrPadType = 1;  // pad type correction - if padNorm enabled
   Float_t corrNorm    = 1;  // normalization factor - set Q to channel 50
@@ -933,8 +959,8 @@ Float_t  AliTPCseed::CookdEdxNorm(Double_t low, Double_t up, Int_t type, Int_t i
     if (TMath::Abs(cluster->GetY())>cluster->GetX()*ktany-kedgey) continue; // edge cluster
     Float_t charge= (type%2)? cluster->GetMax():cluster->GetQ();
     Int_t  ipad= 0;
-    if (irow>62) ipad=1;
-    if (irow>127) ipad=2;    
+    if (irow>=row0) ipad=1;
+    if (irow>=row1) ipad=2;    
     //
     //
     //
@@ -945,10 +971,10 @@ Float_t  AliTPCseed::CookdEdxNorm(Double_t low, Double_t up, Int_t type, Int_t i
       //
       Float_t factor = 1;      
       AliTPCCalROC * roc = gainMap->GetCalROC(cluster->GetDetector());
-      if (irow < 63) { // IROC
+      if (irow < row0) { // IROC
        factor = roc->GetValue(irow, TMath::Nint(cluster->GetPad()));
       } else {         // OROC
-       factor = roc->GetValue(irow - 63, TMath::Nint(cluster->GetPad()));
+       factor = roc->GetValue(irow - row0, TMath::Nint(cluster->GetPad()));
       }
       if (factor>0.5) gainPad=factor;
     }
@@ -960,7 +986,7 @@ Float_t  AliTPCseed::CookdEdxNorm(Double_t low, Double_t up, Int_t type, Int_t i
        //      
        AliTPCTrackerPoint * point = GetTrackPoint(irow);
        Float_t              ty = TMath::Abs(point->GetAngleY());
-       Float_t              tz = TMath::Abs(point->GetAngleZ());
+       Float_t              tz = TMath::Abs(point->GetAngleZ()*TMath::Sqrt(1+ty*ty));
        
        Float_t dr    = (250.-TMath::Abs(cluster->GetZ()))/250.;
        corrShape  = parcl->Qnorm(ipad,type,dr,ty,tz);
@@ -1007,17 +1033,23 @@ Float_t  AliTPCseed::CookdEdxNorm(Double_t low, Double_t up, Int_t type, Int_t i
   if (ncl<10) return 0;
   
   Float_t suma=0;
+  Float_t suma2=0;  
   Float_t sumn=0;
   Int_t icl0=TMath::Nint(ncl*low);
   Int_t icl1=TMath::Nint(ncl*up);
   for (Int_t icl=icl0; icl<icl1;icl++){
     suma+=amp[indexes[icl]];
+    suma2+=amp[indexes[icl]]*amp[indexes[icl]];
     sumn++;
   }
-  return suma/sumn;
-
+  Float_t mean =suma/sumn;
+  Float_t rms  =TMath::Sqrt(TMath::Abs(suma2/sumn-mean*mean));
+  if (returnVal==1) return rms;
+  if (returnVal==2) return ncl;
+  return mean;
 }
 
+
 Double_t AliTPCseed::BetheMass(Double_t mass){
   //
   // return bethe-bloch
@@ -1263,7 +1295,7 @@ Double_t AliTPCseed::GetQCorrGeom(Float_t ty, Float_t tz){
   return norm;
 }
 
-Double_t AliTPCseed::GetQCorrShape(Int_t ipad, Int_t type,Float_t z, Float_t ty, Float_t tz, Float_t q, Float_t thr){
+Double_t AliTPCseed::GetQCorrShape(Int_t ipad, Int_t type,Float_t z, Float_t ty, Float_t tz, Float_t /*q*/, Float_t /*thr*/){
   //
   // Q normalization
   //
index 018fccd..1efef8b 100644 (file)
@@ -139,7 +139,7 @@ class AliTPCseed : public AliTPCtrack {
      const TBits& GetClusterMap() const { return fClusterMap; };
      const TBits& GetSharedMap() const { return fSharedMap; };
 
-  Float_t  CookdEdxNorm(Double_t low=0.05, Double_t up=0.70, Int_t type=0, Int_t i1=0, Int_t i2=159, Bool_t shapeNorm=kTRUE, Bool_t posNorm=kFALSE, Int_t padNorm=0);
+  Float_t  CookdEdxNorm(Double_t low=0.05, Double_t up=0.70, Int_t type=0, Int_t i1=0, Int_t i2=159, Bool_t shapeNorm=kTRUE, Bool_t posNorm=kFALSE, Int_t padNorm=0,Int_t returnVal=0);
  static   void GetError(AliTPCclusterMI* cluster, AliExternalTrackParam * param, 
                         Double_t& erry, Double_t &errz);
  static   void GetShape(AliTPCclusterMI* cluster, AliExternalTrackParam * param, 
index 11ab62d..ea6dea1 100644 (file)
@@ -2610,8 +2610,8 @@ Int_t AliTPCtrackerMI::RefitInward(AliESDEvent *event)
       esd->UpdateTrackParams(seed,AliESDtrack::kTPCrefit); 
       esd->SetTPCPoints(seed->GetPoints());
       esd->SetTPCPointsF(seed->GetNFoundable());
-      Int_t ndedx   = seed->GetNCDEDX(0)+seed->GetNCDEDX(1)+seed->GetNCDEDX(2)+seed->GetNCDEDX(3);
-      Float_t sdedx = (seed->GetSDEDX(0)+seed->GetSDEDX(1)+seed->GetSDEDX(2)+seed->GetSDEDX(3))*0.25;
+      Int_t   ndedx = seed->GetNCDEDX(0);
+      Float_t sdedx = seed->GetSDEDX(0);
       Float_t dedx  = seed->GetdEdx();
       esd->SetTPCsignal(dedx, sdedx, ndedx);
       //
@@ -2683,8 +2683,8 @@ Int_t AliTPCtrackerMI::PropagateBack(AliESDEvent *event)
       esd->UpdateTrackParams(seed,AliESDtrack::kTPCout);
       esd->SetTPCPoints(seed->GetPoints());
       esd->SetTPCPointsF(seed->GetNFoundable());
-      Int_t ndedx   = seed->GetNCDEDX(0)+seed->GetNCDEDX(1)+seed->GetNCDEDX(2)+seed->GetNCDEDX(3);
-      Float_t sdedx = (seed->GetSDEDX(0)+seed->GetSDEDX(1)+seed->GetSDEDX(2)+seed->GetSDEDX(3))*0.25;
+      Int_t   ndedx = seed->GetNCDEDX(0);
+      Float_t sdedx = seed->GetSDEDX(0);
       Float_t dedx  = seed->GetdEdx();
       esd->SetTPCsignal(dedx, sdedx, ndedx);
       ntracks++;