LCOV - code coverage report
Current view: top level - TPC/TPCbase - AliDetectorParam.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 7 24 29.2 %
Date: 2016-06-14 17:26:59 Functions: 2 4 50.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             : /// \class AliDetectorParam
      17             : ///
      18             : /// Paramter class for AliDetector
      19             : ///
      20             : /// \author Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk
      21             : 
      22             : #include <TMath.h>
      23             : #include <TObject.h>
      24             : 
      25             : #include "AliDetectorParam.h"
      26             : 
      27             : 
      28             : AliDetectorParam::AliDetectorParam()
      29          18 :                    :TNamed(),
      30          18 :                     fBField(0.),
      31          18 :                     fNPrimLoss(0.),
      32          18 :                     fNTotalLoss(0.)
      33          54 : {
      34             :   ///  default constructor
      35             : 
      36          18 : }
      37             : 
      38             : Float_t * AliDetectorParam::GetAnglesAccMomentum(Float_t *x, Int_t * /*index*/, Float_t *momentum, Float_t *angle)
      39             : {
      40             :   /// calculates deflection angle of particle with longitudinal
      41             :   /// longitudinal  momentum[0] and transversal momentum momentum[1]
      42             :   /// at position (x,y,z) = (x[0],x[1],x[2])
      43             :   /// angle[0] - deep angle
      44             :   /// angle[1] - magnetic deflection angle
      45             : 
      46           0 :   if (momentum==0) {
      47           0 :     Float_t rtotal =TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
      48           0 :     if (rtotal==0) angle[0]=0;
      49             :     else
      50           0 :       angle[0] = TMath::ATan(x[2]/rtotal);
      51           0 :     angle[1]=0;
      52             :     return angle;
      53             :   }
      54           0 :   Float_t mtotal =TMath::Sqrt(momentum[0]*momentum[0]+momentum[1]*momentum[1]);
      55           0 :   if (mtotal==0) {
      56           0 :     angle[0]= 0;
      57           0 :     angle[1]=0;
      58           0 :     return angle;
      59             :   }
      60           0 :   angle[0]= TMath::ATan(momentum[2]/mtotal);
      61           0 :   Float_t radius1 = TMath::Sqrt(x[0]*x[0]+x[1]*x[1]); //axial symetry in z
      62           0 :   Float_t radius2 = 1000*mtotal/(3*fBField);
      63           0 :   if (radius1<radius2)
      64           0 :     angle[1]= TMath::ASin(radius1/radius2);
      65             :   else
      66           0 :     angle[1]=0;
      67             :   return angle;
      68           0 : }
      69             : 
      70          24 : ClassImp(AliDetectorParam);

Generated by: LCOV version 1.11