1 /**************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 //-------------------------------------------------------------------------
18 // base class for ESD and AOD tracks
20 //-------------------------------------------------------------------------
22 #include <TGeoGlobalMagField.h>
25 #include "AliVTrack.h"
29 AliVTrack::AliVTrack(const AliVTrack& vTrack) :
30 AliVParticle(vTrack) { } // Copy constructor
32 AliVTrack& AliVTrack::operator=(const AliVTrack& vTrack)
33 { if (this!=&vTrack) {
34 AliVParticle::operator=(vTrack);
40 Double_t AliVTrack::GetBz() const
42 // returns Bz component of the magnetic field (kG)
43 AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
44 if (!fld) return kAlmost0Field;
46 if (fld->IsUniform()) bz = -fld->SolenoidField();
52 return TMath::Sign(kAlmost0Field,bz) + bz;