LCOV - code coverage report
Current view: top level - STEER/ESD - AliESDkink.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 54 86 62.8 %
Date: 2016-06-14 17:26:59 Functions: 8 11 72.7 %

          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             : /* $Id$ */
      17             : 
      18             : //-------------------------------------------------------------------------
      19             : //    Origin: Marian Ivanov marian.ivanov@cern.ch
      20             : //-------------------------------------------------------------------------
      21             : 
      22             : #include <Riostream.h>
      23             : #include <TMath.h>
      24             : #include <TPDGCode.h>
      25             : #include "AliESDkink.h"
      26             : 
      27             : 
      28         172 : ClassImp(AliESDkink)
      29             : 
      30             : //____________________________________________________________________
      31             : AliESDkink::AliESDkink() :
      32        1066 :   TObject(),
      33        1066 :   fParamDaughter(),
      34        1066 :   fParamMother(),
      35        1066 :   fDist1(-1),
      36        1066 :   fDist2(-1),
      37        1066 :   fRr(0),
      38        1066 :   fShapeFactor(0),
      39        1066 :   fID(0),
      40        1066 :   fRow0(0)
      41        3218 : {
      42             :   //
      43             :   //Default constructor
      44             :   //
      45       27716 :   for (Int_t i=0;i<12;i++) fStatus[i]=0;
      46        6396 :   for (Int_t i=0;i<2;i++)
      47       12792 :     for (Int_t j=0;j<2;j++){
      48        4264 :       fTPCdensity[i][j]=0;
      49             :     }
      50        1066 :   fTPCncls[0]=fTPCncls[1]=0;
      51             : 
      52        8528 :   for (Int_t i=0; i<3; i++) {
      53        3198 :     fPdr[i] = 0;
      54        3198 :     fXr[i] = 0;
      55        3198 :     fPm[i] = 0;
      56        3198 :     fAngle[i] = 0;
      57             :   }
      58        1066 :   fLab[0]=fLab[1]=0;
      59        1066 :   fIndex[0]=fIndex[1]=-1;
      60        1066 :   fMultiple[0]=fMultiple[1]=0;
      61        1076 : }
      62             : 
      63             : AliESDkink::AliESDkink(const AliESDkink &source):
      64           4 :   TObject(source),
      65           4 :   fParamDaughter(source.fParamDaughter),
      66           4 :   fParamMother(source.fParamMother),
      67           4 :   fDist1(source.fDist1),
      68           4 :   fDist2(source.fDist1),
      69           4 :   fRr(source.fRr),
      70           4 :   fShapeFactor(source.fShapeFactor),
      71           4 :   fID(source.fID),
      72           4 :   fRow0(source.fRow0)
      73          20 : {
      74             :   //
      75             :   //Copy constructor
      76             :   //
      77         104 :   for (Int_t i=0;i<12;i++) fStatus[i]=source.fStatus[i];
      78          24 :   for (Int_t i=0;i<2;i++){
      79           8 :     fTPCncls[i] = source.fTPCncls[i];
      80           8 :     fLab[i]     = source.fLab[i];
      81           8 :     fIndex[i]   = source.fIndex[i];
      82           8 :     fMultiple[i]= source.fMultiple[i];
      83          48 :     for (Int_t j=0;j<2;j++){
      84          16 :       fTPCdensity[i][j] = source.fTPCdensity[i][j];
      85             :     }
      86             :   }
      87          32 :   for (Int_t i=0; i<3; i++) {
      88          12 :     fPdr[i] = source.fPdr[i];
      89          12 :     fXr[i] = source.fXr[i];
      90          12 :     fPm[i] = source.fPm[i];
      91          12 :     fAngle[i] = source.fAngle[i];
      92             :   }
      93           8 : }
      94             : 
      95             : //_____________________________________________________________________________
      96             : AliESDkink& AliESDkink::operator=(const AliESDkink &source)
      97             : {
      98             :   //
      99             :   // assignment operator
     100             :   //
     101             :   
     102           0 :   if (this!=&source) {
     103           0 :     TObject::operator=(source);
     104           0 :     fParamDaughter = source.fParamDaughter;
     105           0 :     fParamMother = source.fParamMother;
     106           0 :     fDist1 = source.fDist1;
     107           0 :     fDist2 = source.fDist1;
     108           0 :     fRr = source.fRr;
     109           0 :     fShapeFactor = source.fShapeFactor;
     110           0 :     fID = source.fID;
     111           0 :     fRow0 = source.fRow0;
     112           0 :     for (Int_t i=0;i<12;i++) fStatus[i]=source.fStatus[i];
     113           0 :     for (Int_t i=0;i<2;i++){
     114           0 :       fTPCncls[i] = source.fTPCncls[i];
     115           0 :       fLab[i]     = source.fLab[i];
     116           0 :       fIndex[i]   = source.fIndex[i];
     117           0 :       fMultiple[i]= source.fMultiple[i];
     118           0 :       for (Int_t j=0;j<2;j++){
     119           0 :         fTPCdensity[i][j] = source.fTPCdensity[i][j];
     120             :       }
     121             :     }
     122           0 :     for (Int_t i=0; i<3; i++) {
     123           0 :       fPdr[i] = source.fPdr[i];
     124           0 :       fXr[i] = source.fXr[i];
     125           0 :       fPm[i] = source.fPm[i];
     126           0 :       fAngle[i] = source.fAngle[i];
     127             :     }
     128           0 :   }
     129             : 
     130           0 :   return *this;
     131             : }
     132             : 
     133             : void AliESDkink::Copy(TObject &obj) const {
     134             :   
     135             :   // this overwrites the virtual TOBject::Copy()
     136             :   // to allow run time copying without casting
     137             :   // in AliESDEvent
     138             : 
     139           0 :   if(this==&obj)return;
     140           0 :   AliESDkink *robj = dynamic_cast<AliESDkink*>(&obj);
     141           0 :   if(!robj)return; // not an AliESDkink
     142           0 :   *robj = *this;
     143             : 
     144           0 : }
     145             : 
     146             : 
     147             : void AliESDkink::SetMother(const AliExternalTrackParam & pmother)  {
     148             :   //
     149             :   // set mother
     150             :   //
     151        4080 :   fParamMother   = pmother;
     152        2040 : }
     153             : 
     154             : void AliESDkink::SetDaughter(const AliExternalTrackParam & pdaughter){
     155             :   //
     156             :   //set daughter
     157             :   //
     158        4072 :   fParamDaughter = pdaughter;
     159             : 
     160        2036 : }
     161             :   
     162             : Double_t AliESDkink::GetTPCDensityFactor() const
     163             : {
     164             :   //
     165             :   //
     166          16 :   return fTPCdensity[0][0]+fTPCdensity[1][1]-TMath::Max(fTPCdensity[0][1],Double_t(0.0))-TMath::Max(fTPCdensity[1][0],Double_t(0.0)); 
     167             : }
     168             : 
     169             : Float_t AliESDkink::GetQt() const
     170             : {
     171           0 :   Float_t dmomentum = TMath::Sqrt(fPdr[0]*fPdr[0]+fPdr[1]*fPdr[1]+fPdr[2]*fPdr[2]);
     172           0 :   return TMath::Sin(fAngle[2])*dmomentum;
     173             : }

Generated by: LCOV version 1.11