]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMagFMaps.cxx
Pt vs Eta correction map at different z of vertex (martin)
[u/mrichter/AliRoot.git] / STEER / AliMagFMaps.cxx
index 6de22ddb9e5babedeb52ed603d00226d99d50512..93970bff67157fac8559817d1d4fa2820c686108 100644 (file)
 #include <TFile.h>
 #include <TSystem.h>
 
+#include "AliLog.h"
 #include "AliFieldMap.h"
 #include "AliMagFMaps.h"
 
 ClassImp(AliMagFMaps)
+    
 
 //_______________________________________________________________________
 AliMagFMaps::AliMagFMaps():
   fSolenoid(0),
   fSolenoidUser(0.),
-  fL3Option(0),
-  fFieldRead(0)
+  fL3Option(0)
 {
   //
   // Default constructor
   //
+  //
+  // Don't replicate field information in gAlice
   fFieldMap[0] = fFieldMap[1] = fFieldMap[2] = 0;
 }
 
@@ -50,8 +53,7 @@ AliMagFMaps::AliMagFMaps(const char *name, const char *title, Int_t integ,
   AliMagFC(name,title,integ,factor,fmax),
   fSolenoid(0),
   fSolenoidUser(0),
-  fL3Option(l3),
-  fFieldRead(0)
+  fL3Option(l3)
 {
   //
   // Standard constructor
@@ -61,7 +63,6 @@ AliMagFMaps::AliMagFMaps(const char *name, const char *title, Int_t integ,
   fMap          = map;
   fL3Option     = l3;
   ReadField();
-  fFieldRead = 1;
   //
   // Don't replicate field information in gAlice
   for (Int_t i = 0; i < 3; i++)  fFieldMap[i]->SetWriteEnable(0);
@@ -72,8 +73,7 @@ AliMagFMaps::AliMagFMaps(const char *name, const char *title, Int_t integ,
 AliMagFMaps::AliMagFMaps(const AliMagFMaps &magf):
   AliMagFC(magf),
   fSolenoid(0),
-  fL3Option(0),
-  fFieldRead(0)
+  fL3Option(0)
 {
   //
   // Copy constructor
@@ -90,6 +90,7 @@ AliMagFMaps::~AliMagFMaps()
   delete fFieldMap[0];
   delete fFieldMap[1];
   delete fFieldMap[2];    
+  fgReadField = kTRUE;
 }
 
 //_______________________________________________________________________
@@ -99,8 +100,8 @@ void AliMagFMaps::ReadField()
   //
   //  don't read twice
   //
-  if (fFieldRead) return;
-  fFieldRead = 1;
+    if (!fgReadField) return;
+    fgReadField = 0;
   //    
   char* fname;
   TFile* file = 0;
@@ -171,7 +172,7 @@ Float_t AliMagFMaps::SolenoidField() const
   // Returns max. L3 (solenoid) field strength 
   // according to field map setting 
   //
-  return fSolenoid;
+  return -Factor()*fSolenoid;
 }
 
 //_______________________________________________________________________
@@ -207,7 +208,7 @@ void AliMagFMaps::Field(Float_t *x, Float_t *b) const
       //
       //     Constant L3 field , if this option was selected
       //
-         b[2] = - fSolenoid;
+       b[2] = (- fSolenoid)*fFactor;
          return;
       } 
   } else if (fFieldMap[1]->Inside(xm[0], xm[1], xm[2])) {
@@ -240,7 +241,7 @@ void AliMagFMaps::Copy(TObject & /* magf */) const
   //
   // Copy *this onto magf -- Not implemented
   //
-  Fatal("Copy","Not implemented!\n");
+  AliFatal("Not implemented!");
 }
 
 //_______________________________________________________________________
@@ -249,7 +250,7 @@ void AliMagFMaps::Streamer(TBuffer &R__b)
   // Stream an object of class AliMagFMaps.
   if (R__b.IsReading()) {
     AliMagFMaps::Class()->ReadBuffer(R__b, this);
-    fFieldRead = 0;
+    ReadField();
   } else {
     AliMagFMaps::Class()->WriteBuffer(R__b, this);
   }