]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCExBConical.cxx
Update timestamps for new AMANDA simulation (17/02/2015)
[u/mrichter/AliRoot.git] / TPC / AliTPCExBConical.cxx
index b601e1da36ed54dd523b954a48f97812ccb2593f..3693ebc27f234f1e28696094d93c009b97818886 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-////////////////////////////////////////////////////////////////////////////
-//                                                                        //
-// AliTPCExBConical class                                                   //
-// The class calculates the space point distortions due to the conical shape 
-// of ALICE TPC:
-//
-// Becasue of mechanical deformation ALICE TPC, chambers are misaligned in z direction
-// TPC has roughly conical shape
-//
-// For the moment ONLY efective correction used - NOT EDGE EFFECT calcualted //  
-//                                                           //
-//                     //
-// The class allows "effective Omega Tau" corrections.                    // 
-// 
-//                                                                        //
-// date: 02/05/2010                                                       //
-// Authors: Marian Ivanov, Jim Thomas, Magnus Mager, Stefan Rossegger     //
-//                                                                        //
-// Example usage:                                                         //
-//  AliTPCExBConical conical;                                                //
-//  conical.SetOmegaTauT1T2(0.32,1.,1.); // values ideally from OCDB         //
-//  conical.SetXConical(0.001);   // set conical in X direction (in rad)     //
-//  // plot dRPhi distortions ...                                            //
-//  conical.CreateHistoDRPhiinZR(1.,100,100)->Draw("surf2");                //
-////////////////////////////////////////////////////////////////////////////
+/// \class AliTPCExBConical
+///
+/// Calculates the space point distortions due to the conical shape of ALICE TPC.
+///
+/// Becasue of mechanical deformation ALICE TPC, chambers are misaligned in z direction
+/// TPC has roughly conical shape
+///
+/// For the moment ONLY efective correction used - NOT EDGE EFFECT calcualted
+///
+/// The class allows "effective Omega Tau" corrections.
+///
+/// Example usage:
+///
+/// ~~~{.cxx}
+/// AliTPCExBConical conical;
+/// conical.SetOmegaTauT1T2(0.32,1.,1.); // values ideally from OCDB
+/// conical.SetXConical(0.001);   // set conical in X direction (in rad)
+/// // plot dRPhi distortions ...
+/// conical.CreateHistoDRPhiinZR(1.,100,100)->Draw("surf2");
+/// ~~~
+///
+/// \author Marian Ivanov, Jim Thomas, Magnus Mager, Stefan Rossegger
+/// \date 02/05/2010
+
+#include "AliMagF.h"
+#include "TGeoGlobalMagField.h"
+#include "AliTPCcalibDB.h"
+#include "AliTPCParam.h"
+#include "AliLog.h"
 
 #include "TMath.h"
 #include "AliTPCROC.h"
 #include "AliTPCExBConical.h"
+/// \cond CLASSIMP
 ClassImp(AliTPCExBConical)
+/// \endcond
 
 AliTPCExBConical::AliTPCExBConical()
   : AliTPCCorrection("exb_conical","ExB conical"),
@@ -58,57 +64,51 @@ AliTPCExBConical::AliTPCExBConical()
 }
 
 AliTPCExBConical::~AliTPCExBConical() {
-  //
-  // default destructor
-  //
+  /// default destructor
+
 }
 
+
+
 void AliTPCExBConical::Init() {
-  //
-  // Initialization funtion (not used at the moment)
-  //
-  
-  // Set default parameters
-  // FIXME: Ask the database for these entries
-  
-  Double_t vdrift = 2.6; // [cm/us]   // From dataBase: to be updated: per second (ideally)
-  Double_t bzField = -0.5; // [Tesla] // From dataBase: to be updated: per run
-
-  Double_t ezField = 400; // [V/cm]   // to be updated: never (hopefully)
+  /// Initialization funtion
+
+  AliMagF* magF= (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+  if (!magF) AliError("Magneticd field - not initialized");
+  Double_t bzField = magF->SolenoidField()/10.; ///< field in T
+  AliTPCParam *param= AliTPCcalibDB::Instance()->GetParameters();
+  if (!param) AliError("Parameters - not initialized");
+  Double_t vdrift = param->GetDriftV()/1000000.; ///< [cm/us]   // From dataBase: to be updated: per second (ideally)
+  Double_t ezField = 400; ///< [V/cm]   // to be updated: never (hopefully)
   Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ; 
-
   // Correction Terms for effective omegaTau; obtained by a laser calibration run
-  Double_t t1 = 0.9;   // ideally from database
-  Double_t t2 = 1.5;   // ideally from database
+  SetOmegaTauT1T2(wt,fT1,fT2);
 
-  SetOmegaTauT1T2(wt,t1,t2);
 
 }
 
 void AliTPCExBConical::Update(const TTimeStamp &/*timeStamp*/) {
-  //
-  // Update function 
-  //
-
-  Double_t vdrift = 2.6; // [cm/us]   // From dataBase: to be updated: per second (ideally)
-  Double_t bzField = -0.5; // [Tesla] // From dataBase: to be updated: per run
-
-  Double_t ezField = 400; // [V/cm]   // to be updated: never (hopefully)
+  /// Update function
+
+  AliMagF* magF= (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+  if (!magF) AliError("Magneticd field - not initialized");
+  Double_t bzField = magF->SolenoidField()/10.; ///< field in T
+  AliTPCParam *param= AliTPCcalibDB::Instance()->GetParameters();
+  if (!param) AliError("Parameters - not initialized");
+  Double_t vdrift = param->GetDriftV()/1000000.; ///< [cm/us]   // From dataBase: to be updated: per second (ideally)
+  Double_t ezField = 400; ///< [V/cm]   // to be updated: never (hopefully)
   Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ; 
-
   // Correction Terms for effective omegaTau; obtained by a laser calibration run
-  Double_t t1 = 0.9;   // ideally from database
-  Double_t t2 = 1.5;   // ideally from database
+  SetOmegaTauT1T2(wt,fT1,fT2);
+
 
- SetOmegaTauT1T2(wt,t1,t2); 
 }
 
 
 
 void AliTPCExBConical::GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]) {
-  //
-  // Calculates the correction due conical shape
-  //   
+  /// Calculates the correction due conical shape
+
   AliTPCROC * calROC = AliTPCROC::Instance();
   const Double_t kRTPC0  =calROC->GetPadRowRadii(0,0);
   const Double_t kRTPC1  =calROC->GetPadRowRadii(36,calROC->GetNRows(36)-1);
@@ -127,19 +127,17 @@ void AliTPCExBConical::GetCorrection(const Float_t x[],const Short_t roc,Float_t
   Double_t dr   =fC2*corr;
   dx[0]= TMath::Cos(phi)*dr-TMath::Sin(phi)*drphi;
   dx[1]= TMath::Sin(phi)*dr+TMath::Cos(phi)*drphi;
-  dx[2]= 0.001*dTheta*(r-rmiddle); // dtheta in mrad
+  dx[2]= -0.001*dTheta*(r-rmiddle); // dtheta in mrad
 
 }
 
-void AliTPCExBConical::Print(Option_t* option) const {
-  //
-  // Print function to check the settings (e.g. the conical in the X direction)
-  // option=="a" prints the C0 and C1 coefficents for calibration purposes
-  //
+void AliTPCExBConical::Print(const Option_t* option) const {
+  /// Print function to check the settings (e.g. the conical in the X direction)
+  /// option=="a" prints the C0 and C1 coefficents for calibration purposes
 
   TString opt = option; opt.ToLower();
-  printf("%s\n",GetTitle());
-  
+  printf("%s:%s\n",GetTitle(), GetName());
+  printf(" - T1: %1.4f, T2: %1.4f \n",fT1,fT2);  
   printf("Conical settings: Empirical: %1.5f mm/mrad\n",fConicalFactor);
   printf("Conical settings: A-Conical: %1.5f mrad:%1.5f mrad:%1.5f mrad \n",fConicalA[0],fConicalA[1],fConicalA[2]);
   printf("Conical settings: C-Conical: %1.5f mrad:%1.5f mrad:%1.5f mrad \n",fConicalC[0],fConicalC[1],fConicalC[2]);
@@ -148,17 +146,15 @@ void AliTPCExBConical::Print(Option_t* option) const {
 
 
 void AliTPCExBConical::SetConicalA(Float_t conicalA[3]){
-  //
-  // set paramters of conical shape - A side - obtained from alignment
-  //
+  /// set paramters of conical shape - A side - obtained from alignment
+
   fConicalA[0]= conicalA[0];  // constant
   fConicalA[1]= conicalA[1];  // cos 
   fConicalA[2]= conicalA[2];  // sin
 }
 void AliTPCExBConical::SetConicalC(Float_t conicalC[3]){
-  //
-  // set paramters of conical shape -C side obtained form the alignemnt
-  // 
+  /// set paramters of conical shape -C side obtained form the alignemnt
+
   fConicalC[0]= conicalC[0];  // constant
   fConicalC[1]= conicalC[1];  // cos 
   fConicalC[2]= conicalC[2];  // sin