LCOV - code coverage report
Current view: top level - ITS/ITSbase - AliITStrackSA.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 83 105 79.0 %
Date: 2016-06-14 17:26:59 Functions: 12 16 75.0 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-2003, 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             : /* $Id$ */
      17             : 
      18             : ////////////////////////////////////////////////////
      19             : //  Stand alone track class                       //
      20             : //  Origin:  Elisabetta Crescio                   //
      21             : //  e-mail:  crescio@to.infn.it                   //
      22             : //  it is a V2 track with a possible number       //
      23             : //  of cluster equal to kMaxNumberOfClusters    //
      24             : ////////////////////////////////////////////////////
      25             : 
      26             : #include "AliITSgeomTGeo.h"
      27             : #include "AliITStrackSA.h"
      28             : 
      29             : 
      30         118 : ClassImp(AliITStrackSA)
      31             : 
      32             : //_____________________________________
      33        1626 : AliITStrackSA:: AliITStrackSA() : AliITStrackMI(),
      34        1626 : fNSA(0)
      35        8130 : {
      36             : // Default constructor  
      37        1626 :   SetNumberOfClusters(0);
      38        1626 :   SetNumberOfClustersSA(0);
      39        1626 :   ResetIndexSA();
      40       22764 :   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++){ 
      41        9756 :     SetNumberOfMarked(nlay,0);
      42             :   }
      43        1626 :   ResetMarked();
      44        3252 : }
      45             : 
      46             : 
      47             : //___________________________________________________
      48             : AliITStrackSA::AliITStrackSA(const AliITStrackMI& t) : 
      49           0 : AliITStrackMI(t),
      50           0 : fNSA(0){
      51             : // Copy a V2 track into a SA track
      52           0 :   SetNumberOfClustersSA(0);
      53           0 :   ResetIndexSA();
      54           0 :   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++){ 
      55           0 :     SetNumberOfMarked(nlay,0);
      56             :   }
      57           0 :   ResetMarked();
      58             : 
      59           0 : }
      60             : //___________________________________________________
      61             : AliITStrackSA::AliITStrackSA(const AliITStrackSA& t) : 
      62          36 : AliITStrackMI(t),
      63         180 : fNSA(t.fNSA){
      64             : // Copy constructor
      65             : 
      66             : 
      67          36 :   ResetIndexSA();
      68          36 :   ResetMarked();
      69          36 :   Int_t number = t.GetNumberOfClustersSA();
      70          36 :   SetNumberOfClustersSA(number);
      71         504 :   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++){
      72         216 :     SetNumberOfMarked(nlay,t.GetNumberOfMarked(nlay));
      73             :   }
      74          72 :   for(Int_t i=0;i<number;i++){
      75           0 :     fSain[i]=t.fSain[i];
      76             :   }
      77         504 :   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++){
      78         832 :     for(Int_t i=0;i<t.GetNumberOfMarked(nlay);i++){
      79         200 :       fCluMark[nlay][i]=t.fCluMark[nlay][i];
      80             :     }
      81             :   }
      82          72 : }
      83             : //____________________________________________________
      84          18 : AliITStrackSA::AliITStrackSA(Int_t layer, Int_t ladder, Int_t detector, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab ):
      85          18 : fNSA(0) 
      86          90 : {
      87             :   // standard constructor. Used for ITS standalone tracking
      88             : 
      89             :   // get the azimuthal angle of the detector containing the innermost
      90             :   // cluster of this track (data member fAlpha)
      91             : 
      92          36 :   TGeoHMatrix m; AliITSgeomTGeo::GetOrigMatrix(layer,ladder,detector,m);
      93          18 :   const TGeoHMatrix *tm=AliITSgeomTGeo::GetTracking2LocalMatrix(layer,ladder,detector);
      94          18 :   m.Multiply(tm);
      95          18 :   Double_t txyz[3]={0.}, xyz[3]={0.};
      96          18 :   m.LocalToMaster(txyz,xyz);
      97          18 :   Double_t sAlpha=TMath::ATan2(xyz[1],xyz[0]);
      98             : 
      99          24 :   if (sAlpha<0) sAlpha+=TMath::TwoPi();
     100          12 :   else if (sAlpha>=TMath::TwoPi()) sAlpha-=TMath::TwoPi();
     101             : 
     102          18 :   Double_t sX=TMath::Sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
     103             : 
     104          18 :   Init(sAlpha,sX,Ycoor,Zcoor,phi,tanlambda,curv,lab);
     105             : 
     106          36 : }
     107             : //____________________________________________________
     108           0 : AliITStrackSA::AliITStrackSA(Double_t alpha, Double_t radius, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab ):
     109           0 : fNSA(0) 
     110           0 : {
     111             :   // standard constructor. Used for ITS standalone tracking
     112             : 
     113             :   // get the azimuthal angle of the detector containing the innermost
     114             :   // cluster of this track (data member fAlpha)
     115             : 
     116           0 :   if (alpha<0) alpha+=TMath::TwoPi();
     117           0 :   else if (alpha>=TMath::TwoPi()) alpha-=TMath::TwoPi();
     118           0 :   Init(alpha,radius,Ycoor,Zcoor,phi,tanlambda,curv,lab);
     119           0 : }
     120             : //____________________________________________________
     121             :   void AliITStrackSA::Init(Double_t alpha, Double_t radius, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab ){
     122             :     // initialize parameters
     123             : 
     124          36 :   fdEdx = 0;
     125             : 
     126          18 :   Double_t conv=GetBz()*kB2C;
     127          36 :   Double_t sC[] = {0.000009, // 0.000009
     128             :                    0.,
     129             :                    0.000003, //0.000030
     130             :                    0.,
     131             :                    0.,
     132             :                    0.000001, //0.000001
     133             :                    0.,
     134             :                    0.,
     135             :                    0.,
     136             :                    0.000002, //0.000002
     137             :                    0.,
     138             :                    0.,
     139             :                    0.,
     140             :                    0.,
     141          18 :                    0.000001/(conv*conv)}; //0.0000001
     142             : 
     143          54 :   Double_t sP[] = {Ycoor,
     144             :                    Zcoor,
     145          18 :                    TMath::Sin(phi-alpha),
     146             :                    tanlambda,
     147          18 :                    curv/conv};
     148             : 
     149             : 
     150             :   // dealing with the case B=0 (taken from AliTPCtrack.cxx)
     151          18 :   Double_t mostProbablePt=AliExternalTrackParam::GetMostProbablePt();
     152          18 :   Double_t p0=TMath::Sign(1/mostProbablePt,sP[4]);
     153          18 :   Double_t w0=sC[14]/(sC[14] + p0*p0), w1=p0*p0/(sC[14] + p0*p0);
     154          18 :   sP[4] = w0*p0 + w1*sP[4];
     155          18 :   sC[14]*=w1;
     156             :                                                                               
     157          18 :   Set(radius,alpha,sP,sC);
     158             : 
     159         252 :   for(Int_t i=0; i<AliITSgeomTGeo::GetNLayers(); i++) fIndex[i] = 0;  // to be set explicitely
     160             : 
     161         180 :   for(Int_t i=0; i<4; i++) fdEdxSample[i] = 0; 
     162             : 
     163          18 :   SetNumberOfClusters(0);
     164          18 :   SetNumberOfClustersSA(0);
     165         252 :   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++) SetNumberOfMarked(nlay,0);
     166          18 :   ResetIndexSA();
     167          18 :   ResetMarked();
     168          18 :   SetChi2(0);
     169          18 :   SetMass(0.139);    // pion mass
     170          18 :   SetLabel(lab); 
     171             :   
     172          18 : }
     173             : 
     174             : //____________________________________________________________
     175             : void AliITStrackSA::AddClusterSA(Int_t layer, Int_t clnumb) {
     176             :   // add one clusters to the list (maximum number=kMaxNumberOfClusters)
     177        4704 :   Int_t presnum = GetNumberOfClustersSA();
     178        2352 :   if(presnum>=kMaxNumberOfClusters){
     179           0 :     Warning("AddClusterSA","Maximum number of clusters already reached. Nothing is done\n");
     180           0 :     return;
     181             :   }
     182             : 
     183        2352 :   fSain[presnum] = (layer<<28)+clnumb;  
     184        2352 :   presnum++;
     185        2352 :   SetNumberOfClustersSA(presnum);
     186        4704 : }
     187             : 
     188             : //____________________________________________________________
     189             : void AliITStrackSA::AddClusterMark(Int_t layer, Int_t clnumb) {
     190             :   // add one clusters to the list (maximum number=kMaxNumberOfClusters)
     191        4904 :   Int_t presnum = GetNumberOfMarked(layer);
     192             :   //  printf("presnum=%d\n",presnum);
     193        2452 :   if(presnum>=kMaxNumberOfClustersL){
     194           0 :     Warning("AddClusterMark","Maximum number of clusters already reached. Nothing is done\n");
     195           0 :     return;
     196             :   }
     197             : 
     198        2452 :   fCluMark[layer][presnum] = clnumb;  
     199        2452 :   presnum++;
     200        2452 :   SetNumberOfMarked(layer,presnum);
     201        4904 : }
     202             : 
     203             : //____________________________________________________________
     204             : void AliITStrackSA::AddClusterV2(Int_t layer,Int_t clnumb) {
     205             :   // add one clusters to the list (maximum number=6)
     206         200 :   Int_t presnum = GetNumberOfClusters();
     207         100 :   if(presnum>=AliITSgeomTGeo::GetNLayers()){
     208           0 :     Warning("AddClusterV2","Maximum number of clusters already reached. Nothing is done\n");
     209           0 :     return;
     210             :    }    
     211             : 
     212         100 :   fIndex[presnum] = (layer<<28)+clnumb;  
     213         100 :   presnum++;
     214         100 :   SetNumberOfClusters(presnum);
     215         200 : }
     216             : 
     217             : //_____________________________________________________________
     218             : void AliITStrackSA::ResetMarked(){
     219             : 
     220             :   //Reset array of marked clusters
     221       25200 :   for(Int_t nlay=0;nlay<AliITSgeomTGeo::GetNLayers();nlay++){
     222      100800 :     for(Int_t k=0; k<kMaxNumberOfClustersL; k++) fCluMark[nlay][k]=0;
     223             :   }
     224        1680 : }
     225             : 

Generated by: LCOV version 1.11