]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/STEERBase/AliVTrack.cxx
ALIROOT-5633 o limit the momentum range for deuteron and triton in ITSnSigma o Simpli...
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliVTrack.cxx
CommitLineData
4f6e22bd 1/**************************************************************************
2 * Copyright(c) 1998-2008, 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
17//-------------------------------------------------------------------------
18// base class for ESD and AOD tracks
19// Author: A. Dainese
20//-------------------------------------------------------------------------
21
f7a1cc68 22#include <TGeoGlobalMagField.h>
23
24#include "AliMagF.h"
4f6e22bd 25#include "AliVTrack.h"
26
27ClassImp(AliVTrack)
28
29AliVTrack::AliVTrack(const AliVTrack& vTrack) :
30 AliVParticle(vTrack) { } // Copy constructor
31
32AliVTrack& AliVTrack::operator=(const AliVTrack& vTrack)
33{ if (this!=&vTrack) {
34 AliVParticle::operator=(vTrack);
35 }
36
37 return *this;
38}
39
08f45a9c 40Bool_t AliVTrack::GetXYZ(Double_t* /*p*/) const {return kFALSE;};
41Bool_t AliVTrack::GetXYZAt(Double_t /*x*/, Double_t /*b*/, Double_t* /*r*/ ) const {return kFALSE;}
42
f7a1cc68 43Double_t AliVTrack::GetBz() const
44{
45 // returns Bz component of the magnetic field (kG)
46 AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
663c89cf 47 if (!fld) return 0.5*kAlmost0Field;
ee5b41f1 48 double bz;
49 if (fld->IsUniform()) bz = fld->SolenoidField();
50 else {
51 Double_t r[3];
52 GetXYZ(r);
53 bz = fld->GetBz(r);
54 }
663c89cf 55 return TMath::Sign(0.5*kAlmost0Field,bz) + bz;
f7a1cc68 56}
8b6e3369 57
58void AliVTrack::GetBxByBz(Double_t b[3]) const
59{
7d2fb6f7 60 // returns the Bx, By and Bz components of the magnetic field (kG)
8b6e3369 61 AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
62 if (!fld) {
63 b[0] = b[1] = 0.;
663c89cf 64 b[2] = 0.5*kAlmost0Field;
8b6e3369 65 return;
66 }
67
68 if (fld->IsUniform()) {
69 b[0] = b[1] = 0.;
02d77919 70 b[2] = fld->SolenoidField();
8b6e3369 71 } else {
72 Double_t r[3]; GetXYZ(r);
02d77919 73 fld->Field(r,b);
8b6e3369 74 }
663c89cf 75 b[2] = (TMath::Sign(0.5*kAlmost0Field,b[2]) + b[2]);
8b6e3369 76 return;
77}
02d77919 78
fc9b31a7 79//________________________________________________________
80void AliVTrack::GetIntegratedTimes(Double_t */*times*/, Int_t /*nspec*/) const { return; }