Double_t AliTrackerBase::GetBz()
{
AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
- if (!fld) return 0.5*kAlmost0Field;
+ if (!fld) {
+ AliFatalClass("Field is not loaded");
+ //if (!fld)
+ return 0.5*kAlmost0Field;
+ }
Double_t bz = fld->SolenoidField();
return TMath::Sign(0.5*kAlmost0Field,bz) + bz;
}
// Returns Bz (kG) at the point "r" .
//------------------------------------------------------------------
AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
- if (!fld) return 0.5*kAlmost0Field;
+ if (!fld) {
+ AliFatalClass("Field is not loaded");
+ // if (!fld)
+ return 0.5*kAlmost0Field;
+ }
Double_t bz = fld->GetBz(r);
return TMath::Sign(0.5*kAlmost0Field,bz) + bz;
}
//------------------------------------------------------------------
AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
if (!fld) {
- b[0] = b[1] = 0.;
- b[2] = 0.5*kAlmost0Field;
- return;
+ AliFatalClass("Field is not loaded");
+ // b[0] = b[1] = 0.;
+ // b[2] = 0.5*kAlmost0Field;
+ return;
}
if (fld->IsUniform()) {
for (Int_t i=0;i<6;i++) bparam[i]=0;
if (!gGeoManager) {
- AliErrorClass("No TGeo\n");
+ AliFatalClass("No TGeo\n");
return 0.;
}
//
// Propagates the track to the plane X=xk (cm) using the magnetic field map
// and correcting for the crossed material.
//
- // mass - mass used in propagation - used for energy loss correction
+ // mass - mass used in propagation - used for energy loss correction (if <0 then q = 2)
// maxStep - maximal step for propagation
//
// Origin: Marian Ivanov, Marian.Ivanov@cern.ch
// taking into account all the three components of the magnetic field
// and correcting for the crossed material.
//
- // mass - mass used in propagation - used for energy loss correction
+ // mass - mass used in propagation - used for energy loss correction (if <0 then q=2)
// maxStep - maximal step for propagation
//
// Origin: Marian Ivanov, Marian.Ivanov@cern.ch
// Initial approximation of the tangent of the track dip angle
//-----------------------------------------------------------------
//
+ const Double_t kEpsilon =0.00001;
x2-=x1;
y2-=y1;
z2-=z1;
Double_t d = TMath::Sqrt(x2*x2+y2*y2); // distance straight line
if (TMath::Abs(d*c*0.5)>1) return 0;
Double_t angle2 = TMath::ASin(d*c*0.5);
- angle2 = z2*TMath::Abs(c/(angle2*2.));
+ if (TMath::Abs(angle2)>kEpsilon) {
+ angle2 = z2*TMath::Abs(c/(angle2*2.));
+ }else{
+ angle2=z2/d;
+ }
return angle2;
}