]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding possibility to use custom ExB correction map
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Feb 2009 10:11:46 +0000 (10:11 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Feb 2009 10:11:46 +0000 (10:11 +0000)
User should SetInstance of AliTPCExB::SetInstance()

TPC/AliTPCExB.cxx

index 53a0d67d8f1d4b23fbf79255ed9d1c61c8e7c144..1ec7ec29a27fe3d9a6159d30de78553829dc2b3d 100644 (file)
@@ -157,7 +157,8 @@ Double_t AliTPCExB::GetDr(Double_t r, Double_t phi, Double_t z, Double_t bz){
   // Posibble to us it for visualization 
   // 
   //
-  AliTPCExB *exb = AliTPCcalibDB::GetExB(bz,kFALSE);
+  AliTPCExB *exb = Instance();
+  if (!exb) exb = AliTPCcalibDB::GetExB(bz,kFALSE);
   if (!exb) return 0;
   Double_t pos0[3] = {r*TMath::Cos(phi), r*TMath::Sin(phi),z};
   Double_t pos1[3];
@@ -175,12 +176,15 @@ Double_t AliTPCExB::GetDrphi(Double_t r, Double_t phi, Double_t z, Double_t bz){
   //
   //
   //
-  AliTPCExB *exb = AliTPCcalibDB::GetExB(bz,kFALSE);
+  AliTPCExB *exb = Instance();
+  if (!exb) exb = AliTPCcalibDB::GetExB(bz,kFALSE);
   if (!exb) return 0;
   Double_t pos0[3] = {r*TMath::Cos(phi), r*TMath::Sin(phi),z};
   Double_t pos1[3];
   exb->Correct(pos0,pos1);
   Double_t dphi=TMath::ATan2(pos1[1],pos1[0])-TMath::ATan2(pos0[1],pos0[0]);
+  if (dphi>TMath::Pi()) dphi-=TMath::TwoPi();
+  if (dphi<-TMath::Pi()) dphi+=TMath::TwoPi();
   return r*dphi;  
 
 }
@@ -190,7 +194,8 @@ Double_t AliTPCExB::GetDphi(Double_t r, Double_t phi, Double_t z, Double_t bz){
   //
   //
   // 
-  AliTPCExB *exb = AliTPCcalibDB::GetExB(bz,kFALSE);
+  AliTPCExB *exb = Instance();
+  if (!exb) exb = AliTPCcalibDB::GetExB(bz,kFALSE);
   if (!exb) return 0;
   Double_t pos0[3] = {r*TMath::Cos(phi), r*TMath::Sin(phi),z};
   Double_t pos1[3];
@@ -204,7 +209,8 @@ Double_t AliTPCExB::GetDz(Double_t r, Double_t phi, Double_t z, Double_t bz){
   //
   //
   //
-  AliTPCExB *exb = AliTPCcalibDB::GetExB(bz,kFALSE);
+  AliTPCExB *exb = Instance();
+  if (!exb) exb = AliTPCcalibDB::GetExB(bz,kFALSE);
   if (!exb) return 0;
   Double_t pos0[3] = {r*TMath::Cos(phi), r*TMath::Sin(phi),z};
   Double_t pos1[3];