LCOV - code coverage report
Current view: top level - PHOS/PHOSbase - AliPHOSTrackSegment.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 35 99 35.4 %
Date: 2016-06-14 17:26:59 Functions: 6 16 37.5 %

          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             : /* $Id$ */
      16             : 
      17             : /* History of cvs commits:
      18             :  *
      19             :  * $Log$
      20             :  * Revision 1.30  2006/08/28 10:01:56  kharlov
      21             :  * Effective C++ warnings fixed (Timur Pocheptsov)
      22             :  *
      23             :  * Revision 1.29  2005/05/28 14:19:05  schutz
      24             :  * Compilation warnings fixed by T.P.
      25             :  *
      26             :  */
      27             : 
      28             : //_________________________________________________________________________
      29             : //  Track segment in PHOS
      30             : //  Can be : 1 EmcRecPoint
      31             : //           1 EmcRecPoint + 1 CPV
      32             : //           1 EmcRecPoint + 1 CPV + 1 charged track
      33             : //                  
      34             : //*-- Author:  Dmitri Peressounko (RRC KI & SUBATECH)
      35             : 
      36             : // --- ROOT system ---
      37             :  
      38             : 
      39             : // --- Standard library ---
      40             : 
      41             : // --- AliRoot header files ---
      42             : #include "AliPHOSEmcRecPoint.h" 
      43             : #include "AliPHOSTrackSegment.h" 
      44             : #include "AliESDtrack.h" 
      45             : #include "AliLog.h" 
      46             : 
      47          22 : ClassImp(AliPHOSTrackSegment)
      48             : 
      49             : //____________________________________________________________________________
      50           0 : AliPHOSTrackSegment::AliPHOSTrackSegment()
      51           0 :                         : fEmcRecPoint(0),
      52           0 :                           fIndexInList(0),
      53           0 :                           fCpvRecPoint(0),
      54           0 :                           fTrack(0)
      55           0 : {
      56             :   //def ctor
      57           0 :   fDcpv[0]=999. ;
      58           0 :   fDcpv[1]=999. ;
      59           0 : }
      60             : 
      61             : //____________________________________________________________________________
      62           6 : AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , 
      63             :                                           AliPHOSRecPoint * cpvrp1)
      64           6 :                         : fEmcRecPoint(0),
      65           6 :                           fIndexInList(0),
      66           6 :                           fCpvRecPoint(0),
      67           6 :                           fTrack(0)
      68          30 : {
      69             :   // ctor
      70             : 
      71           6 :   if( emc )   
      72           6 :     fEmcRecPoint =  emc->GetIndexInList() ;
      73             :   else 
      74           0 :     fEmcRecPoint = -1 ;
      75             : 
      76           6 :   if( cpvrp1 )  
      77           0 :     fCpvRecPoint = cpvrp1->GetIndexInList() ;
      78             :  else 
      79           6 :     fCpvRecPoint = -1 ;
      80             : 
      81           6 :   fTrack = -1 ; 
      82             : 
      83           6 :   fIndexInList = -1 ;
      84           6 :   fDcpv[0]=999. ;
      85           6 :   fDcpv[1]=999. ;
      86          12 : }
      87             : 
      88             : //____________________________________________________________________________
      89           0 : AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , 
      90             :                                           AliPHOSRecPoint * cpvrp1, 
      91             :                                           Int_t track)
      92           0 :                         : fEmcRecPoint(0),
      93           0 :                           fIndexInList(0),
      94           0 :                           fCpvRecPoint(0),
      95           0 :                           fTrack(0)
      96           0 : {
      97             :   // ctor
      98             : 
      99           0 :   if( emc )   
     100           0 :     fEmcRecPoint =  emc->GetIndexInList() ;
     101             :   else 
     102           0 :     fEmcRecPoint = -1 ;
     103             : 
     104           0 :   if( cpvrp1 )  
     105           0 :     fCpvRecPoint = cpvrp1->GetIndexInList() ;
     106             :  else 
     107           0 :     fCpvRecPoint = -1 ;
     108             :   
     109           0 :   fTrack = track ; 
     110             : 
     111           0 :   fIndexInList = -1 ;
     112           0 :   fDcpv[0]=999. ;
     113           0 :   fDcpv[1]=999. ;
     114           0 : }
     115             : 
     116             : //____________________________________________________________________________
     117           4 : AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , 
     118             :                                           AliPHOSRecPoint * cpvrp1, 
     119             :                                           Int_t track, Float_t dx,Float_t dz)
     120           4 :                         : fEmcRecPoint(0),
     121           4 :                           fIndexInList(0),
     122           4 :                           fCpvRecPoint(0),
     123           4 :                           fTrack(0)
     124          20 : {
     125             :   // ctor
     126             : 
     127           4 :   if( emc )   
     128           4 :     fEmcRecPoint =  emc->GetIndexInList() ;
     129             :   else 
     130           0 :     fEmcRecPoint = -1 ;
     131             : 
     132           4 :   if( cpvrp1 )  
     133           0 :     fCpvRecPoint = cpvrp1->GetIndexInList() ;
     134             :  else 
     135           4 :     fCpvRecPoint = -1 ;
     136             :   
     137           4 :   fTrack = track ; 
     138             : 
     139           4 :   fIndexInList = -1 ;
     140             : 
     141           4 :   fDcpv[0] = dx ;
     142           4 :   fDcpv[1] = dz ;
     143           8 : }
     144             : 
     145             : //____________________________________________________________________________
     146             : AliPHOSTrackSegment::AliPHOSTrackSegment( const AliPHOSTrackSegment & ts) 
     147           0 :   : TObject(ts),
     148           0 :     fEmcRecPoint(0),
     149           0 :     fIndexInList(0),
     150           0 :     fCpvRecPoint(0),
     151           0 :     fTrack(0)
     152           0 : {
     153             :   // Copy ctor
     154             : 
     155           0 :   ( (AliPHOSTrackSegment &)ts ).Copy(*this) ; 
     156           0 : }
     157             : 
     158             : 
     159             : //____________________________________________________________________________
     160             : AliPHOSTrackSegment & AliPHOSTrackSegment::operator = (const AliPHOSTrackSegment &)
     161             : {
     162           0 :   Fatal("operator =", "not implemented");
     163           0 :   return *this;
     164             : }
     165             : 
     166             : //____________________________________________________________________________
     167             : void AliPHOSTrackSegment::Copy(TObject & obj) const
     168             : {
     169             :   // Copy of a track segment into another track segment
     170             : 
     171           0 :    TObject::Copy(obj) ;
     172           0 :    ( (AliPHOSTrackSegment &)obj ).fEmcRecPoint     = fEmcRecPoint ; 
     173           0 :    ( (AliPHOSTrackSegment &)obj ).fCpvRecPoint     = fCpvRecPoint ; 
     174           0 :    ( (AliPHOSTrackSegment &)obj ).fIndexInList     = fIndexInList ; 
     175           0 :    ( (AliPHOSTrackSegment &)obj ).fTrack           = fTrack ;
     176           0 :    ( (AliPHOSTrackSegment &)obj ).fDcpv[0]         = fDcpv[0] ;
     177           0 :    ( (AliPHOSTrackSegment &)obj ).fDcpv[1]         = fDcpv[1] ;
     178           0 : } 
     179             : 
     180             : 
     181             : //____________________________________________________________________________
     182             : void AliPHOSTrackSegment::Print(const Option_t *) const
     183             : {
     184             :   // Print all information on this track Segment
     185             :   
     186             : 
     187           0 :   AliInfo("Track segment");
     188           0 :   printf("Stored at position %d\n", fIndexInList) ;
     189           0 :   printf(" Emc RecPoint #     %d\n", fEmcRecPoint) ;
     190           0 :   if(fCpvRecPoint >= 0)
     191           0 :     printf(" CPV RecPoint #     %d\n", fCpvRecPoint) ;
     192             :   else
     193           0 :     printf(" No CPV RecPoint\n");
     194           0 :   if (fTrack >= 0) 
     195           0 :     printf(" Charged track #     %d\n", fTrack) ;
     196             :   else
     197           0 :     printf(" No Charged track\n");
     198           0 :   printf(" Distance to CPV: x=%f, z=%f\n",fDcpv[0],fDcpv[1]) ;
     199           0 : }
     200             : 
     201             : //____________________________________________________________________________
     202             : void AliPHOSTrackSegment::SetCpvRecPoint(AliPHOSRecPoint * cpvRecPoint) 
     203             : {
     204             :   // gives an id from its position in the list
     205           0 :   if( cpvRecPoint )  
     206           0 :     fCpvRecPoint = cpvRecPoint->GetIndexInList() ;
     207             :  else 
     208           0 :     fCpvRecPoint = -1 ;
     209           0 : }
     210             : //____________________________________________________________________________
     211             : Float_t AliPHOSTrackSegment::GetCpvDistance(const Option_t* dr) const
     212             : {
     213         370 :  if(strcmp(dr,"x")==0||strcmp(dr,"X")==0) return fDcpv[0] ; 
     214         160 :  if(strcmp(dr,"z")==0||strcmp(dr,"Z")==0) return fDcpv[1] ; 
     215          20 :  if(strcmp(dr,"r")==0||strcmp(dr,"R")==0) return TMath::Sqrt(fDcpv[0]*fDcpv[0]+fDcpv[1]*fDcpv[1]) ; 
     216           0 :  return 999. ;
     217             : 
     218         110 : }

Generated by: LCOV version 1.11