Line data Source code
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 :
22 : #include <TGeoGlobalMagField.h>
23 :
24 : #include "AliMagF.h"
25 : #include "AliVTrack.h"
26 :
27 176 : ClassImp(AliVTrack)
28 :
29 : AliVTrack::AliVTrack(const AliVTrack& vTrack) :
30 48464 : AliVParticle(vTrack) { } // Copy constructor
31 :
32 : AliVTrack& AliVTrack::operator=(const AliVTrack& vTrack)
33 31792 : { if (this!=&vTrack) {
34 15896 : AliVParticle::operator=(vTrack);
35 15896 : }
36 :
37 15896 : return *this;
38 : }
39 :
40 0 : Bool_t AliVTrack::GetXYZ(Double_t* /*p*/) const {return kFALSE;};
41 0 : Bool_t AliVTrack::GetXYZAt(Double_t /*x*/, Double_t /*b*/, Double_t* /*r*/ ) const {return kFALSE;}
42 :
43 : Double_t AliVTrack::GetBz() const
44 : {
45 : // returns Bz component of the magnetic field (kG)
46 594654 : AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
47 297327 : if (!fld) return 0.5*kAlmost0Field;
48 : double bz;
49 297327 : if (fld->IsUniform()) bz = fld->SolenoidField();
50 : else {
51 297327 : Double_t r[3];
52 297327 : GetXYZ(r);
53 297327 : bz = fld->GetBz(r);
54 297327 : }
55 297327 : return TMath::Sign(0.5*kAlmost0Field,bz) + bz;
56 297327 : }
57 :
58 : void AliVTrack::GetBxByBz(Double_t b[3]) const
59 : {
60 : // returns the Bx, By and Bz components of the magnetic field (kG)
61 526660 : AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
62 263330 : if (!fld) {
63 0 : b[0] = b[1] = 0.;
64 0 : b[2] = 0.5*kAlmost0Field;
65 0 : return;
66 : }
67 :
68 263330 : if (fld->IsUniform()) {
69 0 : b[0] = b[1] = 0.;
70 0 : b[2] = fld->SolenoidField();
71 0 : } else {
72 263330 : Double_t r[3]; GetXYZ(r);
73 263330 : fld->Field(r,b);
74 263330 : }
75 263330 : b[2] = (TMath::Sign(0.5*kAlmost0Field,b[2]) + b[2]);
76 263330 : return;
77 263330 : }
78 :
79 : //________________________________________________________
80 0 : void AliVTrack::GetIntegratedTimes(Double_t */*times*/, Int_t /*nspec*/) const { return; }
|