ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

/* $Id$ */

///////////////////////////////////////////////////////////////////////
//  Paramter class for AliDetector                                   //
//                                                                   //
//  Origin:  Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk // 
//                                                                   //  
///////////////////////////////////////////////////////////////////////

#include <TMath.h>
#include <TObject.h>

#include "AliDetectorParam.h"


AliDetectorParam::AliDetectorParam()
                   :TNamed(),
                    fBField(0.),
                    fNPrimLoss(0.),
                    fNTotalLoss(0.)
{
  //
  //  default constructor
  //
}

Float_t * AliDetectorParam::GetAnglesAccMomentum(Float_t *x, Int_t * /*index*/, Float_t *momentum, Float_t *angle)
{
  //
  //calculates deflection angle of particle with longitudinal
  //longitudinal  momentum[0] and transversal momentum momentum[1]
  //at position (x,y,z) = (x[0],x[1],x[2]) 
  //angle[0] - deep angle
  //angle[1] - magnetic deflection angle 
  if (momentum==0) {
    Float_t rtotal =TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
    if (rtotal==0) angle[0]=0;
    else    
      angle[0] = TMath::ATan(x[2]/rtotal);
    angle[1]=0;
    return angle;
  }
  Float_t mtotal =TMath::Sqrt(momentum[0]*momentum[0]+momentum[1]*momentum[1]);
  if (mtotal==0) {
    angle[0]= 0;
    angle[1]=0;
    return angle;
  }
  angle[0]= TMath::ATan(momentum[2]/mtotal);
  Float_t radius1 = TMath::Sqrt(x[0]*x[0]+x[1]*x[1]); //axial symetry in z
  Float_t radius2 = 1000*mtotal/(3*fBField);
  if (radius1<radius2)
    angle[1]= TMath::ASin(radius1/radius2);
  else 
    angle[1]=0;
  return angle;
} 





ClassImp(AliDetectorParam)
 AliDetectorParam.cxx:1
 AliDetectorParam.cxx:2
 AliDetectorParam.cxx:3
 AliDetectorParam.cxx:4
 AliDetectorParam.cxx:5
 AliDetectorParam.cxx:6
 AliDetectorParam.cxx:7
 AliDetectorParam.cxx:8
 AliDetectorParam.cxx:9
 AliDetectorParam.cxx:10
 AliDetectorParam.cxx:11
 AliDetectorParam.cxx:12
 AliDetectorParam.cxx:13
 AliDetectorParam.cxx:14
 AliDetectorParam.cxx:15
 AliDetectorParam.cxx:16
 AliDetectorParam.cxx:17
 AliDetectorParam.cxx:18
 AliDetectorParam.cxx:19
 AliDetectorParam.cxx:20
 AliDetectorParam.cxx:21
 AliDetectorParam.cxx:22
 AliDetectorParam.cxx:23
 AliDetectorParam.cxx:24
 AliDetectorParam.cxx:25
 AliDetectorParam.cxx:26
 AliDetectorParam.cxx:27
 AliDetectorParam.cxx:28
 AliDetectorParam.cxx:29
 AliDetectorParam.cxx:30
 AliDetectorParam.cxx:31
 AliDetectorParam.cxx:32
 AliDetectorParam.cxx:33
 AliDetectorParam.cxx:34
 AliDetectorParam.cxx:35
 AliDetectorParam.cxx:36
 AliDetectorParam.cxx:37
 AliDetectorParam.cxx:38
 AliDetectorParam.cxx:39
 AliDetectorParam.cxx:40
 AliDetectorParam.cxx:41
 AliDetectorParam.cxx:42
 AliDetectorParam.cxx:43
 AliDetectorParam.cxx:44
 AliDetectorParam.cxx:45
 AliDetectorParam.cxx:46
 AliDetectorParam.cxx:47
 AliDetectorParam.cxx:48
 AliDetectorParam.cxx:49
 AliDetectorParam.cxx:50
 AliDetectorParam.cxx:51
 AliDetectorParam.cxx:52
 AliDetectorParam.cxx:53
 AliDetectorParam.cxx:54
 AliDetectorParam.cxx:55
 AliDetectorParam.cxx:56
 AliDetectorParam.cxx:57
 AliDetectorParam.cxx:58
 AliDetectorParam.cxx:59
 AliDetectorParam.cxx:60
 AliDetectorParam.cxx:61
 AliDetectorParam.cxx:62
 AliDetectorParam.cxx:63
 AliDetectorParam.cxx:64
 AliDetectorParam.cxx:65
 AliDetectorParam.cxx:66
 AliDetectorParam.cxx:67
 AliDetectorParam.cxx:68
 AliDetectorParam.cxx:69
 AliDetectorParam.cxx:70
 AliDetectorParam.cxx:71
 AliDetectorParam.cxx:72
 AliDetectorParam.cxx:73
 AliDetectorParam.cxx:74
 AliDetectorParam.cxx:75
 AliDetectorParam.cxx:76
 AliDetectorParam.cxx:77
 AliDetectorParam.cxx:78