]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMagF.cxx
Fix fixed-string length bug
[u/mrichter/AliRoot.git] / STEER / AliMagF.cxx
index 41e8085b8626eed12f08201d3b8d2e60f4a628b9..3c188813cff91f231f798ed18ac84b36a7d81625 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Header$ */
+/* $Id$ */
 
+//----------------------------------------------------------------------
+// Basic magnetic field class
+// Used in all the detectors, and also in the traking classes
+// Author:
+//----------------------------------------------------------------------
 
+#include "AliLog.h"
 #include "AliMagF.h"
 
 ClassImp(AliMagF)
@@ -25,9 +31,10 @@ AliMagF::AliMagF():
   fMap(0),
   fType(0),
   fInteg(0),
+  fPrecInteg(1),
   fFactor(0),
   fMax(0),
-  fDebug(0)
+  fReadField(1)
 {
   //
   // Default constructor
@@ -35,38 +42,103 @@ AliMagF::AliMagF():
 }
 
 //_______________________________________________________________________
-AliMagF::AliMagF(const char *name, const char *title, const Int_t integ, 
-                 const Float_t factor, const Float_t fmax):
+AliMagF::AliMagF(const char *name, const char *title, Int_t integ, 
+                 Float_t factor, Float_t fmax):
   TNamed(name,title),
   fMap(0),
   fType(0),
   fInteg(0),
+  fPrecInteg(1),
   fFactor(factor),
   fMax(fmax),
-  fDebug(0)
+  fReadField(1)
 {
   //
   // Standard constructor
   //
     if(integ<0 || integ > 2) {
-      Warning("SetField",
-              "Invalid magnetic field flag: %5d; Helix tracking chosen instead\n"
-              ,integ);
+      AliWarning(Form(
+              "Invalid magnetic field flag: %5d; Helix tracking chosen instead"
+              ,integ));
       fInteg = 2;
     } else {
       fInteg = integ;
     }
+   
+    if (fInteg == 0) fPrecInteg = 0;
+    
     fType = kUndef;
     //
-    fDebug = 0;
 }
 
 //_______________________________________________________________________
-void AliMagF::Field(Float_t*, Float_t *b)
+AliMagF::AliMagF(const AliMagF &src):
+  TNamed(src),
+  fMap(src.fMap),
+  fType(src.fType),
+  fInteg(src.fInteg),
+  fPrecInteg(src.fPrecInteg),
+  fFactor(src.fFactor),
+  fMax(src.fMax),
+  fReadField(src.fReadField)
+{
+    // Copy constructor
+}
+
+//_______________________________________________________________________
+void AliMagF::Field(Float_t*, Float_t *b) const
 {
   //
   // Method to return the field in one point -- dummy in this case
   //
-  Warning("Field","Undefined MagF Field called, returning 0\n");
+  AliWarning("Undefined MagF Field called, returning 0");
+  b[0]=b[1]=b[2]=0;
+}
+
+//_______________________________________________________________________
+void AliMagF::GetTPCInt(Float_t *, Float_t *b) const
+{
+//
+// Obtain the integral of the field components in the TPC from given point
+// to the closest cathod plane
+//
+  AliWarning("Undefined MagF TPCIntegral called, returning 0");
   b[0]=b[1]=b[2]=0;
 }
+
+//_______________________________________________________________________
+void AliMagF::GetTPCIntCyl(Float_t *, Float_t *b) const
+{
+//    
+// Obtain the integral of the field components in the TPC from given point
+// to the closest cathod plane
+//
+  AliWarning("Undefined MagF TPCIntegral called, returning 0");
+  b[0]=b[1]=b[2]=0;
+}
+
+//_______________________________________________________________________
+AliMagF& AliMagF::operator=(const AliMagF& rhs)
+{
+    // Asignment operator
+    fMap       = rhs.fMap;
+    fType      = rhs.fType;
+    fInteg     = rhs.fInteg;
+    fPrecInteg = rhs.fPrecInteg;
+    fFactor    = rhs.fFactor;
+    fMax       = rhs.fMax;
+    fReadField = rhs.fReadField;
+    return *this;
+}
+
+void AliMagF::SetPrecInteg(Int_t integ)
+{
+    if (fInteg > 0) {
+       fPrecInteg = integ;
+    }
+    else if (integ != 0)
+    {
+       AliWarning("Precision integration flag set to 0 \n");
+       fPrecInteg = 0;
+    }
+}