LCOV - code coverage report
Current view: top level - STEER/ESD - AliV0vertexer.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 58 65 89.2 %
Date: 2016-06-14 17:26:59 Functions: 2 2 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 V0 vertexer class
      18             : //                  reads tracks writes out V0 vertices
      19             : //                      fills the ESD with the V0s       
      20             : //     Origin: Iouri Belikov, IPHC, Strasbourg, Jouri.Belikov@cern.ch
      21             : //-------------------------------------------------------------------------
      22             : 
      23             : 
      24             : #include "AliESDEvent.h"
      25             : #include "AliESDv0.h"
      26             : #include "AliV0vertexer.h"
      27             : 
      28         172 : ClassImp(AliV0vertexer)
      29             : 
      30             : 
      31             : //A set of very loose cuts 
      32             : Double_t AliV0vertexer::fgChi2max=33.; //max chi2
      33             : Double_t AliV0vertexer::fgDNmin=0.05;  //min imp parameter for the 1st daughter
      34             : Double_t AliV0vertexer::fgDPmin=0.05;  //min imp parameter for the 2nd daughter
      35             : Double_t AliV0vertexer::fgDCAmax=1.5;  //max DCA between the daughter tracks
      36             : Double_t AliV0vertexer::fgCPAmin=0.9;  //min cosine of V0's pointing angle
      37             : Double_t AliV0vertexer::fgRmin=0.2;    //min radius of the fiducial volume
      38             : Double_t AliV0vertexer::fgRmax=200.;   //max radius of the fiducial volume
      39             : 
      40             : Int_t AliV0vertexer::Tracks2V0vertices(AliESDEvent *event) {
      41             :   //--------------------------------------------------------------------
      42             :   //This function reconstructs V0 vertices
      43             :   //--------------------------------------------------------------------
      44             : 
      45          16 :    const AliESDVertex *vtxT3D=event->GetPrimaryVertex();
      46             : 
      47           8 :    Double_t xPrimaryVertex=vtxT3D->GetX();
      48           8 :    Double_t yPrimaryVertex=vtxT3D->GetY();
      49           8 :    Double_t zPrimaryVertex=vtxT3D->GetZ();
      50             : 
      51           8 :    Int_t nentr=event->GetNumberOfTracks();
      52           8 :    Double_t b=event->GetMagneticField();
      53             : 
      54           8 :    if (nentr<2) return 0; 
      55             : 
      56           8 :    TArrayI neg(nentr);
      57           8 :    TArrayI pos(nentr);
      58             : 
      59             :    Int_t nneg=0, npos=0, nvtx=0;
      60             : 
      61             :    Int_t i;
      62         320 :    for (i=0; i<nentr; i++) {
      63         152 :      AliESDtrack *esdTrack=event->GetTrack(i);
      64         152 :      ULong_t status=esdTrack->GetStatus();
      65             : 
      66             :      //if ((status&AliESDtrack::kITSrefit)==0)//not to accept the ITS SA tracks
      67         168 :         if ((status&AliESDtrack::kTPCrefit)==0) continue;
      68             : 
      69         136 :      Double_t d=esdTrack->GetD(xPrimaryVertex,yPrimaryVertex,b);
      70         208 :      if (TMath::Abs(d)<fDPmin) continue;
      71          64 :      if (TMath::Abs(d)>fRmax) continue;
      72             : 
      73         184 :      if (esdTrack->GetSign() < 0.) neg[nneg++]=i;
      74          72 :      else pos[npos++]=i;
      75          64 :    }   
      76             : 
      77             : 
      78          72 :    for (i=0; i<nneg; i++) {
      79          56 :       Int_t nidx=neg[i];
      80          28 :       AliESDtrack *ntrk=event->GetTrack(nidx);
      81             : 
      82         384 :       for (Int_t k=0; k<npos; k++) {
      83         328 :          Int_t pidx=pos[k];
      84         164 :          AliESDtrack *ptrk=event->GetTrack(pidx);
      85             : 
      86         328 :          if (TMath::Abs(ntrk->GetD(xPrimaryVertex,yPrimaryVertex,b))<fDNmin)
      87           0 :            if (TMath::Abs(ptrk->GetD(xPrimaryVertex,yPrimaryVertex,b))<fDNmin) continue;
      88             : 
      89         164 :          Double_t xn, xp, dca=ntrk->GetDCA(ptrk,b,xn,xp);
      90         298 :          if (dca > fDCAmax) continue;
      91          30 :          if ((xn+xp) > 2*fRmax) continue;
      92          36 :          if ((xn+xp) < 2*fRmin) continue;
      93             :    
      94          48 :          AliExternalTrackParam nt(*ntrk), pt(*ptrk);
      95             :          Bool_t corrected=kFALSE;
      96          24 :          if ((nt.GetX() > 3.) && (xn < 3.)) {
      97             :            //correct for the beam pipe material
      98             :            corrected=kTRUE;
      99           0 :          }
     100          24 :          if ((pt.GetX() > 3.) && (xp < 3.)) {
     101             :            //correct for the beam pipe material
     102             :            corrected=kTRUE;
     103           0 :          }
     104          24 :          if (corrected) {
     105           0 :            dca=nt.GetDCA(&pt,b,xn,xp);
     106           0 :            if (dca > fDCAmax) continue;
     107           0 :            if ((xn+xp) > 2*fRmax) continue;
     108           0 :            if ((xn+xp) < 2*fRmin) continue;
     109             :          }
     110             : 
     111          48 :          nt.PropagateTo(xn,b); pt.PropagateTo(xp,b);
     112             : 
     113          24 :          AliESDv0 vertex(nt,nidx,pt,pidx);
     114          24 :          if (vertex.GetChi2V0() > fChi2max) continue;
     115             :          
     116          24 :          Double_t x=vertex.Xv(), y=vertex.Yv();
     117          24 :          Double_t r2=x*x + y*y;
     118          24 :          if (r2 < fRmin*fRmin) continue;
     119          24 :          if (r2 > fRmax*fRmax) continue;
     120             : 
     121          24 :          Float_t cpa=vertex.GetV0CosineOfPointingAngle(xPrimaryVertex,yPrimaryVertex,zPrimaryVertex);
     122             :          const Double_t pThr=1.5;
     123          24 :          Double_t pv0=vertex.P();
     124          24 :          if (pv0<pThr) {
     125             :            //Below the threshold "pThr", try a momentum dependent cos(PA) cut 
     126             :            const Double_t bend=0.03; // approximate Xi bending angle
     127             :            const Double_t qt=0.211;  // max Lambda pT in Omega decay
     128          12 :            const Double_t cpaThr=TMath::Cos(TMath::ATan(qt/pThr) + bend);
     129             :            Double_t 
     130          12 :            cpaCut=(fCPAmin/cpaThr)*TMath::Cos(TMath::ATan(qt/pv0) + bend); 
     131          20 :            if (cpa < cpaCut) continue;
     132           4 :          } else
     133          14 :          if (cpa < fCPAmin) continue;
     134             : 
     135          14 :          vertex.SetDcaV0Daughters(dca);
     136          14 :          vertex.SetV0CosineOfPointingAngle(cpa);
     137          14 :          vertex.ChangeMassHypothesis(kK0Short);
     138             : 
     139          14 :          event->AddV0(&vertex);
     140             : 
     141          14 :          nvtx++;
     142         226 :       }
     143             :    }
     144             : 
     145           8 :    Info("Tracks2V0vertices","Number of reconstructed V0 vertices: %d",nvtx);
     146             : 
     147             :    return nvtx;
     148          16 : }
     149             : 
     150             : 
     151             : 
     152             : 
     153             : 
     154             : 
     155             : 
     156             : 
     157             : 
     158             : 
     159             : 
     160             : 
     161             : 
     162             : 

Generated by: LCOV version 1.11