LCOV - code coverage report
Current view: top level - ITS/ITSbase - AliITStrackMI.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 95 97 97.9 %
Date: 2016-06-14 17:26:59 Functions: 12 12 100.0 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : //-------------------------------------------------------------------------
      17             : //                Implementation of the ITS track class
      18             : //
      19             : //          Origin: Marian Ivanov, CERN, Marian.Ivanov@cern.ch
      20             : //     dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
      21             : //-------------------------------------------------------------------------
      22             : 
      23             : /* $Id$ */
      24             : 
      25             : #include <TMatrixD.h>
      26             : 
      27             : #include <TMath.h>
      28             : 
      29             : #include "AliITSRecoParam.h"
      30             : #include "AliCluster.h"
      31             : #include "AliESDtrack.h"
      32             : #include "AliITSgeomTGeo.h"
      33             : #include "AliITStrackMI.h"
      34             : 
      35         118 : ClassImp(AliITStrackMI)
      36             : 
      37             : const Int_t kWARN=5;
      38             : 
      39             : //____________________________________________________________________________
      40        3082 : AliITStrackMI::AliITStrackMI():AliITStrackV2(),
      41        3082 : fNUsed(0),
      42        3082 : fNSkipped(0),
      43        3082 : fNDeadZone(0),                         
      44        3082 : fReconstructed(kFALSE),
      45        3082 : fExpQ(40),
      46        3082 : fChi22(0),
      47        3082 : fdEdxMismatch(0),
      48        3082 : fConstrain(kFALSE),
      49        3082 : fWinner(0),
      50        3082 : fGoldV0(kFALSE)
      51             : 
      52       12122 : {
      53             :   //constructor
      54       43148 :     for(Int_t i=0; i<AliITSgeomTGeo::GetNLayers(); i++) fClIndex[i]=-1;
      55       43148 :     for(Int_t i=0; i<6; i++) { fNy[i]=0; fNz[i]=0; fNormQ[i]=0; fNormChi2[i]=1000; fDeadZoneProbability[i]=0;}
      56       80132 :     for(Int_t i=0; i<12; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0; fSigmaYZ[i]=0; fChi2MIP[i]=0;}
      57        3082 :     fD[0]=0; fD[1]=0;
      58        3082 :     fDnorm[0]=0; fDnorm[1]=0;
      59        4520 : }
      60             : 
      61             : //____________________________________________________________________________
      62             : AliITStrackMI::AliITStrackMI(AliESDtrack& t,Bool_t c):
      63         436 : AliITStrackV2(t,c),
      64         436 : fNUsed(0),
      65         436 : fNSkipped(0),
      66         436 : fNDeadZone(0),
      67         436 : fReconstructed(kFALSE),
      68         436 : fExpQ(40),
      69         436 : fChi22(0),
      70         436 : fdEdxMismatch(0),
      71         436 : fConstrain(kFALSE),
      72         436 : fWinner(0),
      73        1744 : fGoldV0(kFALSE) {
      74             :   //------------------------------------------------------------------
      75             :   // Conversion ESD track -> ITS track.
      76             :   // If c==kTRUE, create the ITS track out of the constrained params.
      77             :   //------------------------------------------------------------------
      78        6104 :   for(Int_t i=0; i<6; i++) {fClIndex[i]=-1; fNy[i]=0; fNz[i]=0; fNormQ[i]=0; fNormChi2[i]=1000; fDeadZoneProbability[i]=0;}
      79       11336 :   for(Int_t i=0; i<12; i++) {fDy[i]=0; fDz[i]=0; fSigmaY[i]=0; fSigmaZ[i]=0; fSigmaYZ[i]=0; fChi2MIP[i]=0;}
      80         436 :   fD[0]=0; fD[1]=0;
      81         436 :   fDnorm[0]=0; fDnorm[1]=0;
      82             : 
      83         872 : }
      84             : 
      85             : //____________________________________________________________________________
      86       15326 : AliITStrackMI::AliITStrackMI(const AliITStrackMI& t) : AliITStrackV2(t),
      87       15326 : fNUsed(t.fNUsed),
      88       15326 : fNSkipped(t.fNSkipped),
      89       15326 : fNDeadZone(t.fNDeadZone),
      90       15326 : fReconstructed(t.fReconstructed),
      91       15326 : fExpQ(t.fExpQ),
      92       15326 : fChi22(t.fChi22),
      93       15326 : fdEdxMismatch(t.fdEdxMismatch),
      94       15326 : fConstrain(t.fConstrain),
      95       15326 : fWinner(0),
      96       91884 : fGoldV0(t.fGoldV0) {
      97             :   //------------------------------------------------------------------
      98             :   //Copy constructor
      99             :   //------------------------------------------------------------------
     100       15326 :   fLab = t.fLab;
     101       15326 :   fFakeRatio = t.fFakeRatio;
     102             : 
     103       15326 :   fD[0]=t.fD[0]; fD[1]=t.fD[1];
     104       15326 :   fDnorm[0] = t.fDnorm[0]; fDnorm[1]=t.fDnorm[1];
     105      214564 :   for(Int_t i=0; i<6; i++) {
     106       91956 :     fClIndex[i]= t.fClIndex[i]; fNy[i]=t.fNy[i]; fNz[i]=t.fNz[i]; fNormQ[i]=t.fNormQ[i]; fNormChi2[i] = t.fNormChi2[i];  fDeadZoneProbability[i]=t.fDeadZoneProbability[i];
     107             :   }
     108      582388 :   for(Int_t i=0; i<12; i++) {fDy[i]=t.fDy[i]; fDz[i]=t.fDz[i]; 
     109      183912 :     fSigmaY[i]=t.fSigmaY[i]; fSigmaZ[i]=t.fSigmaZ[i]; fSigmaYZ[i]=t.fSigmaYZ[i]; fChi2MIP[i]=t.fChi2MIP[i];}
     110             :   //memcpy(fDy,t.fDy,6*sizeof(Float_t));
     111             :   //memcpy(fDz,t.fDz,6*sizeof(Float_t));
     112             :   //memcpy(fSigmaY,t.fSigmaY,6*sizeof(Float_t));
     113             :   //memcpy(fSigmaZ,t.fSigmaZ,6*sizeof(Float_t));
     114             :   //memcpy(fChi2MIP,t.fChi2MIP,12*sizeof(Float_t));  
     115       30616 : }
     116             : 
     117             : //_____________________________________________________________________________
     118             : Int_t AliITStrackMI::Compare(const TObject *o) const {
     119             :   //-----------------------------------------------------------------
     120             :   // This function compares tracks according to the their curvature
     121             :   //-----------------------------------------------------------------
     122        1784 :   AliITStrackMI *t=(AliITStrackMI*)o;
     123             :   //Double_t co=TMath::Abs(t->Get1Pt());
     124             :   //Double_t c =TMath::Abs(Get1Pt());
     125         892 :   Double_t co=t->GetSigmaY2()*t->GetSigmaZ2()*(0.5+TMath::Sqrt(0.5*t->fD[0]*t->fD[0]+t->fD[1]*t->fD[1]));
     126         892 :   Double_t c =GetSigmaY2()*GetSigmaZ2()*(0.5+TMath::Sqrt(0.5*fD[0]*fD[0]+fD[1]*fD[1]));
     127        1284 :   if (c>co) return 1;
     128        1000 :   else if (c<co) return -1;
     129           0 :   return 0;
     130         892 : }
     131             : 
     132             : 
     133             : Double_t AliITStrackMI::GetPredictedChi2MI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz, Double_t covyz) const
     134             : {
     135             :   //-----------------------------------------------------------------
     136             :   // This function calculates a predicted chi2 increment.
     137             :   //-----------------------------------------------------------------
     138       23936 :   Double_t p[2]={cy, cz};
     139       11968 :   Double_t cov[3]={cerry*cerry, covyz, cerrz*cerrz};
     140       23936 :   return AliExternalTrackParam::GetPredictedChi2(p,cov);
     141       11968 : }
     142             : 
     143             : //____________________________________________________________________________
     144             : Bool_t AliITStrackMI::UpdateMI(const AliCluster *c, Double_t chi2, Int_t index) {
     145             :   //------------------------------------------------------------------
     146             :   //This function updates track parameters
     147             :   //------------------------------------------------------------------
     148       23736 :   Double_t dy=c->GetY() - GetY(), dz=c->GetZ() - GetZ();
     149       11868 :   Int_t layer = (index & 0xf0000000) >> 28;
     150       11868 :   fDy[layer] = dy;
     151       11868 :   fDz[layer] = dz;
     152       11868 :   fSigmaY[layer] = TMath::Sqrt(c->GetSigmaY2()+GetSigmaY2());
     153       11868 :   fSigmaZ[layer] = TMath::Sqrt(c->GetSigmaZ2()+GetSigmaZ2());
     154       11868 :   fSigmaYZ[layer] = c->GetSigmaYZ()+GetSigmaZY();
     155             : 
     156             : 
     157       11868 :   return Update(c,chi2,index);
     158             : }
     159             : 
     160             : Int_t AliITStrackMI::GetProlongationFast(Double_t alp, Double_t xk,Double_t &y, Double_t &z)
     161             : {
     162             :   //-----------------------------------------------------------------------------
     163             :   //get fast prolongation 
     164             :   //-----------------------------------------------------------------------------
     165        1472 :   Double_t ca=TMath::Cos(alp-GetAlpha()), sa=TMath::Sin(alp-GetAlpha());
     166         736 :   Double_t cf=TMath::Sqrt((1.-GetSnp())*(1.+GetSnp()));  
     167             :   // **** rotation **********************  
     168         736 :   y= -GetX()*sa + GetY()*ca;
     169             :   // **** translation ******************  
     170         736 :   Double_t dx = xk- GetX()*ca - GetY()*sa;
     171         736 :   Double_t f1=GetSnp()*ca - cf*sa, f2=f1 + GetC()*dx;
     172        1472 :   if (TMath::Abs(f2) >= 0.9999 || TMath::Abs(f1) >= 0.9999) {
     173           0 :     return 0;
     174             :   }
     175         736 :   Double_t r1=TMath::Sqrt((1.-f1)*(1.+f1)), r2=TMath::Sqrt((1.-f2)*(1.+f2));  
     176         736 :   y += dx*(f1+f2)/(r1+r2);
     177         736 :   z  = GetZ()+dx*(f1+f2)/(f1*r2 + f2*r1)*GetTgl();  
     178             :   return 1;
     179         736 : }
     180             : 
     181             : 
     182             : Bool_t AliITStrackMI::IsGoldPrimary()
     183             : {
     184             :   //
     185             :   // Indicates gold pimary track
     186             :   //
     187             :   Bool_t isGold=kTRUE;
     188         474 :   if (!fConstrain) return kFALSE;                // 
     189         456 :   if (fNDeadZone+fNDeadZone<5.5) isGold =  kFALSE; // short track
     190             :   //
     191         402 :   if (fChi2MIP[0]*fChi2MIP[3]>2) isGold = kFALSE; // RS: cut on chi2*interpolated_chi2
     192         228 :   if (fChi2/Float_t(fN)>2.){
     193         126 :     if (fChi2MIP[0]+fNUsed>3.5) isGold = kFALSE;    
     194             :   }
     195         234 :   if (fChi2MIP[2]>4.5) isGold = kFALSE;         //back propagation chi2
     196             :   //
     197         456 :   if (fDnorm[0]>0&&fDnorm[1]>0){
     198             :     const Float_t distcut2 =2.5*2.5;  //normalize distance  cut 
     199         228 :     Float_t dist2 = fD[0]*fD[0]/(fDnorm[0]*fDnorm[0])+fD[1]*fD[1]/(fDnorm[1]*fDnorm[1]);  //normalize distance to the vertex (pools)
     200         270 :     if (dist2>distcut2) isGold = kFALSE;
     201         228 :   }
     202         228 :   return isGold;
     203         234 : }

Generated by: LCOV version 1.11