]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixes for bug #52499: Field polarities inconsistiency
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 2 Sep 2009 11:32:23 +0000 (11:32 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 2 Sep 2009 11:32:23 +0000 (11:32 +0000)
45 files changed:
ACORDE/macros/Config.C
EMCAL/macros/Config.C
FMD/Config.C
MUON/Config.C
PHOS/macros/AlignmentDB/Config.C
PHOS/macros/Embed/Config.C
STEER/AliGRPManager.cxx
STEER/AliGRPManager.h
STEER/AliGRPObject.h
STEER/AliMagF.h
STEER/AliReconstruction.cxx
STEER/AliReconstruction.h
STEER/AliSimulation.cxx
doc/aliroot-primer/scripts/Config.C
macros/Config.C
prod/LHC08d10/Config.C
prod/LHC08d11/Config.C
prod/LHC08d12/Config.C
prod/LHC08d13/Config.C
prod/LHC08d14/Config.C
prod/LHC08d15/Config.C
prod/LHC08d16/Config.C
prod/LHC08d17/Config.C
prod/LHC08d5/Config.C
prod/LHC08d6/Config.C
prod/LHC08d8/Config.C
prod/LHC08d9/Config.C
prod/LHC09a1/Config.C
prod/LHC09a10/Config.C
prod/LHC09a11/Config.C
prod/LHC09a12/Config.C
prod/LHC09a13/Config.C
prod/LHC09a14/Config.C
prod/LHC09a16/Config.C
test/PbPbbench/Config.C
test/QA/Config.C
test/embedding/Config.C
test/fpprod/Config.C
test/genkine/sim/Config.C
test/gun/Config.C
test/merge/backgr/Config.C
test/merge/signal/Config.C
test/pileup/Config.C
test/ppbench/Config.C
test/pploadlibs/Config.C

index 463459f027fb3bc05721aa781f981202e6bf4e72..d2e11a6aca7781f865c61fcb34c8c54ec5938831 100644 (file)
@@ -184,8 +184,7 @@ void Config()
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
     
-  AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,mag);
-  field->SetL3ConstField(0); //Using const. field in the barrel
+  AliMagF* field = new AliMagF("Maps","Maps",2, -1.,-1., 10.,mag);
   TGeoGlobalMagField::Instance()->SetField(field);
 
   rl->CdGAFile();
index 4868042b6253a58c8355c96ea7f5edc3b8526547..494bde41a6e0acd10940f045efa83c7f813f6820 100755 (executable)
@@ -151,8 +151,8 @@ void Config()
     // track by track
     //
     //gener->SetVertexSmear(perTrack); 
-    // Field (L3 0.4 T)
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
+    // Field (L3 0.5 T)
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG));
 
     Int_t   iABSO  =  0;
     Int_t   iDIPO  =  0;
index efbf03da3ec4255db5b42510ede3d0e5bc0497f3..adeb94981517b4d09b7a18a810ab7db6278e166b 100644 (file)
@@ -361,8 +361,7 @@ Config()
     
   //__________________________________________________________________
   // Field (L3 0.4 T)
-  AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
-  // field->SetL3ConstField(0); //Using const. field in the barrel
+  AliMagF* field = new AliMagF("Maps","Maps",2, -1., -1., 10.,mag);
   TGeoGlobalMagField::Instance()->SetField(field);
 
   rl->CdGAFile();
index beb66e478ab547adc0a8e02a7e8383e592876515..5413b1d61861004586f82bc99cf91e0e91c25f3e 100644 (file)
@@ -187,7 +187,7 @@ void Config(char directory[100]="", char option[6]="param", const char* digitsto
   }  
   //============================================================= 
   // Field (L3 0.5 T)
-  TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1, 10., AliMagF::k5kG));
+  TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1, 10., AliMagF::k5kG));
   //============================================================= 
   //=================== Alice BODY parameters =============================
   AliBODY *BODY = new AliBODY("BODY","Alice envelop");
index e775cb06c12ee54e82476d0be9a741d44d487adf..c9b744e56d0177c11df4fff5407c807e8478de67 100644 (file)
@@ -157,8 +157,8 @@ void Config()
     // track by track
     //
     //gener->SetVertexSmear(perTrack); 
-    // Field (L3 0.4 T)
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
+    // Field (L3 0.5 T)
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG));
 
     Int_t   iABSO  =  0;
     Int_t   iDIPO  =  0;
index 5c856cbdcb40cd778be97b3efb37a295333f767f..5da8fa447aa6dfd4e195391c770667422c5da43d 100644 (file)
@@ -168,8 +168,8 @@ void Config()
                                                                                 
 // Field (L3 0.4 T)
     //Zero magnetic field
-    AliMagF* field = new AliMagF("Maps","Maps", 2, 0., 1., 10., AliMagF::k5kG);
-    field->SetL3ConstField(0); //Using const. field in the barrel
+    AliMagF* field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
+    //    AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., smag);
     TGeoGlobalMagField::Instance()->SetField(field);
 
     rl->CdGAFile();
index b8b9fc3bfadb111530ba20eee60dfdc95b265f5c..5a2affdf40dfee1a3320f4921aaec3418cbe319e 100644 (file)
@@ -138,8 +138,28 @@ Bool_t AliGRPManager::SetMagField()
       ok = kFALSE;
     }
 
+    TString beamType = fGRPData->GetBeamType();
+    if (beamType==AliGRPObject::GetInvalidString()) {
+      AliError("GRP/GRP/Data entry:  missing value for the beam type ! Using UNKNOWN");
+      beamType = "UNKNOWN";
+      ok = kFALSE;
+    }
+
+    Float_t beamEnergy = fGRPData->GetBeamEnergy();
+    if (beamEnergy==AliGRPObject::GetInvalidFloat()) {
+      AliError("GRP/GRP/Data entry:  missing value for the beam energy ! Using 0");
+      beamEnergy = 0;
+      ok = kFALSE;
+    }
+    beamEnergy /= 120E3;       // energy is provided in MeV*120
+
+    // read special bits for the polarity convention and map type
+    Int_t  polConvention = fGRPData->IsPolarityConventionLHC() ? AliMagF::kConvLHC : AliMagF::kConvDCS2008;
+    Bool_t uniformB = fGRPData->IsUniformBMap();
+
     if (ok) { 
-      if ( !SetFieldMap(l3Current, diCurrent, l3Polarity ? -1:1, diPolarity ? -1:1) ) {
+      if ( !SetFieldMap(l3Current, diCurrent, l3Polarity ? -1:1, diPolarity ? -1:1, 
+                       polConvention,uniformB,beamEnergy, beamType.Data())) {
        AliError("Failed to create a B field map !");
        ok = kFALSE;
       }
@@ -198,15 +218,16 @@ AliRunInfo* AliGRPManager::GetRunInfo()
 
 //_____________________________________________________________________________
 Bool_t AliGRPManager::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Pol, 
-                                 Float_t diPol, Float_t beamenergy, 
-                                 const Char_t *beamtype, const Char_t *path) 
+                                 Float_t diPol, Int_t convention, Bool_t uniform,
+                                 Float_t beamenergy, const Char_t *beamtype, const Char_t *path) 
 {
   //------------------------------------------------
   // The magnetic field map, defined externally...
   // L3 current 30000 A  -> 0.5 T
   // L3 current 12000 A  -> 0.2 T
   // dipole current 6000 A
-  // The polarities must be the same
+  // The polarities must match the convention (LHC or DCS2008) 
+  // unless the special uniform map was used for MC
   //------------------------------------------------
   const Float_t l3NominalCurrent1=30000.; // (A)
   const Float_t l3NominalCurrent2=12000.; // (A)
@@ -215,55 +236,46 @@ Bool_t AliGRPManager::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Pol,
   const Float_t tolerance=0.03; // relative current tolerance
   const Float_t zero=77.;       // "zero" current (A)
   //
-  TString s=(l3Pol < 0) ? "L3: -" : "L3: +";
-  //
-  AliMagF::BMap_t map = AliMagF::k5kG;
-  //
-  double fcL3,fcDip;
+  AliMagF::BMap_t map;
+  double sclL3,sclDip;
   //
   l3Cur = TMath::Abs(l3Cur);
-  if (TMath::Abs(l3Cur-l3NominalCurrent1)/l3NominalCurrent1 < tolerance) {
-    fcL3 = l3Cur/l3NominalCurrent1;
-    map  = AliMagF::k5kG;
-    s   += "0.5 T;  ";
-  } else if (TMath::Abs(l3Cur-l3NominalCurrent2)/l3NominalCurrent2 < tolerance) {
-    fcL3 = l3Cur/l3NominalCurrent2;
-    map  = AliMagF::k2kG;
-    s   += "0.2 T;  ";
-  } else if (l3Cur <= zero) {
-    fcL3 = 0;
-    map  = AliMagF::k5kGUniform;
-    s   += "0.0 T;  ";
-    //    fUniformField=kTRUE;        // track with the uniform (zero) B field
-  } else {
-    AliError(Form("Wrong L3 current (%f A)!",l3Cur));
-    return kFALSE;
+  diCur = TMath::Abs(diCur);
+  //
+  if (TMath::Abs((sclDip=diCur/diNominalCurrent)-1.) > tolerance && !uniform) {
+    if (diCur <= zero) sclDip = 0.; // some small current.. -> Dipole OFF
+    else {
+      AliError(Form("Wrong dipole current (%f A)!",diCur));
+      return kFALSE;
+    }
   }
   //
-  diCur = TMath::Abs(diCur);
-  if (TMath::Abs(diCur-diNominalCurrent)/diNominalCurrent < tolerance) {
-    // 3% current tolerance...
-    fcDip = diCur/diNominalCurrent;
-    s    += "Dipole ON";
-  } else if (diCur <= zero) { // some small current..
-    fcDip = 0.;
-    s    += "Dipole OFF";
-  } else {
-    AliError(Form("Wrong dipole current (%f A)!",diCur));
-    return kFALSE;
+  if (uniform) { 
+    // special treatment of special MC with uniform mag field (normalized to 0.5 T)
+    // no check for scaling/polarities are done
+    map   = AliMagF::k5kGUniform;
+    sclL3 = l3Cur/l3NominalCurrent1; 
+  }
+  else {
+    if      (TMath::Abs((sclL3=l3Cur/l3NominalCurrent1)-1.) < tolerance) map  = AliMagF::k5kG;
+    else if (TMath::Abs((sclL3=l3Cur/l3NominalCurrent2)-1.) < tolerance) map  = AliMagF::k2kG;
+    else if (l3Cur <= zero)                                { sclL3 = 0;  map  = AliMagF::k5kGUniform;}
+    else {
+      AliError(Form("Wrong L3 current (%f A)!",l3Cur));
+      return kFALSE;
+    }
   }
   //
-  if (fcDip!=0 && (map==AliMagF::k5kG || map==AliMagF::k2kG) && 
-      ((AliMagF::GetPolarityConvention()==AliMagF::kConvMap2005 && l3Pol!=diPol) ||
-       (AliMagF::GetPolarityConvention()==AliMagF::kConvDCS2008 && l3Pol==diPol) ||
-       (AliMagF::GetPolarityConvention()==AliMagF::kConvLHC     && l3Pol!=diPol)) ) {
+  if (sclDip!=0 && (map==AliMagF::k5kG || map==AliMagF::k2kG) &&
+      ((convention==AliMagF::kConvLHC     && l3Pol!=diPol) ||
+       (convention==AliMagF::kConvDCS2008 && l3Pol==diPol)) ) { 
     AliError(Form("Wrong combination for L3/Dipole polarities (%c/%c) for convention %d",
                  l3Pol>0?'+':'-',diPol>0?'+':'-',AliMagF::GetPolarityConvention()));
     return kFALSE;
   }
   //
-  if (l3Pol<0) fcL3  = -fcL3;
-  if (diPol<0) fcDip = -fcDip;
+  if (l3Pol<0) sclL3  = -sclL3;
+  if (diPol<0) sclDip = -sclDip;
   //
   AliMagF::BeamType_t btype = AliMagF::kNoBeamField;
   TString btypestr = beamtype;
@@ -275,8 +287,10 @@ Bool_t AliGRPManager::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Pol,
   else {
     AliInfo(Form("Cannot determine the beam type from %s, assume no LHC magnet field",beamtype));
   }
-  
-  AliMagF* fld = new AliMagF("MagneticFieldMap", s.Data(), 2, fcL3, fcDip, 10., map, path, 
+  char ttl[50];
+  sprintf(ttl,"L3: %+5d Dip: %+4d kA; %s",(int)TMath::Sign(l3Cur,float(sclL3)),
+         (int)TMath::Sign(diCur,float(sclDip)),uniform ? " Constant":"");
+  AliMagF* fld = new AliMagF("MagneticFieldMap", ttl, 2, sclL3, sclDip, 10., map, path, 
                             btype,beamenergy);
   TGeoGlobalMagField::Instance()->SetField( fld );
   TGeoGlobalMagField::Instance()->Lock();
index 9a2ac45a72bdc4a239437bc924c8ec3959db74b9..66aa653d9469f8382f0c309e06bc4d6c4c823737 100644 (file)
@@ -33,10 +33,11 @@ public:
 
 private:
   Bool_t SetFieldMap(Float_t l3Current=30000., Float_t diCurrent=6000., 
-                    Float_t l3Pol=1., Float_t dipPol=1., Float_t benergy=7000., 
-                    const Char_t* btype="pp",  
+                    Float_t l3Pol=-1., Float_t dipPol=-1.,
+                    Int_t convention=0, Bool_t uniform = kFALSE, 
+                    Float_t benergy=7000., const Char_t* btype="pp",
                     const Char_t* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
-
+  
   AliGRPObject*  fGRPData;        // Data from the GRP/GRP/Data CDB folder
 
   AliGRPManager(const AliGRPManager& man);
index 9f8f2c65b77afb24866e6a1b9e368c753d2d1574..8e79c12e4e1427561c1a0db373d430dc7e4984ee 100644 (file)
@@ -24,6 +24,8 @@ class AliGRPObject : public TObject {
  public:\r
 \r
        enum Stats {kMean = 0, kTruncMean = 1, kMedian = 2, kSDMean = 3, kSDMedian = 4};\r
+       \r
+       enum StatusBits {kPolConvLHC = BIT(14), kUniformBMap = BIT(15)};\r
 \r
        enum DP_HallProbes { \r
                 khpL3bsf17H1= 0 , khpL3bsf17H2, khpL3bsf17H3, khpL3bsf17Temperature, \r
@@ -45,6 +47,8 @@ class AliGRPObject : public TObject {
 \r
        // getters\r
 \r
+       Bool_t    IsPolarityConventionLHC() const {return TestBit(kPolConvLHC);}\r
+       Bool_t    IsUniformBMap() const {return TestBit(kUniformBMap);}\r
        time_t    GetTimeStart() const {return fTimeStart;}\r
        time_t    GetTimeEnd() const {return fTimeEnd;}\r
        Float_t   GetBeamEnergy() const {return fBeamEnergy;}\r
@@ -80,6 +84,8 @@ class AliGRPObject : public TObject {
 \r
        // setters\r
 \r
+       void SetPolarityConventionLHC(Bool_t v=kTRUE) {return SetBit(kPolConvLHC,v);}\r
+       void SetUniformBMap(Bool_t v=kTRUE) {return SetBit(kUniformBMap,v);}\r
        void SetTimeStart(time_t timeStart)  {fTimeStart = timeStart;}\r
        void SetTimeEnd(time_t timeEnd)  {fTimeEnd = timeEnd;}\r
        void SetBeamEnergy(Float_t beamEnergy)  {fBeamEnergy = beamEnergy;}\r
index b875756ce7383296dd632ed5481f4a9797c5a1ce..1085a3498ba26cbd32ef40d4e827c6ebb7e85177 100644 (file)
@@ -20,7 +20,7 @@ class AliMagF : public TVirtualMagField
  public:
   enum BMap_t      {k2kG, k5kG, k5kGUniform};
   enum BeamType_t  {kBeamTypeAA, kBeamTypepp, kNoBeamField};
-  enum PolarityConvention_t {kConvMap2005,kConvDCS2008,kConvLHC};
+  enum PolarityConvention_t {kConvLHC,kConvDCS2008,kConvMap2005};
   //
   AliMagF();
   AliMagF(const char *name, const char* title, Int_t integ, 
index 8896667171a97db253481c18b49feae391dc1346..19ddd855a8770f2af2b1f9bdd28af5602dfd1ff8 100644 (file)
@@ -907,15 +907,16 @@ void AliReconstruction::SetRecoParam(const char* detector, AliDetectorRecoParam
 
 //_____________________________________________________________________________
 Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Pol, 
-                                     Float_t diPol, Float_t beamenergy, 
-                                     const Char_t *beamtype, const Char_t *path) 
+                                 Float_t diPol, Int_t convention, Bool_t uniform,
+                                 Float_t beamenergy, const Char_t *beamtype, const Char_t *path) 
 {
   //------------------------------------------------
   // The magnetic field map, defined externally...
   // L3 current 30000 A  -> 0.5 T
   // L3 current 12000 A  -> 0.2 T
   // dipole current 6000 A
-  // The polarities must be the same
+  // The polarities must match the convention (LHC or DCS2008) 
+  // unless the special uniform map was used for MC
   //------------------------------------------------
   const Float_t l3NominalCurrent1=30000.; // (A)
   const Float_t l3NominalCurrent2=12000.; // (A)
@@ -924,55 +925,46 @@ Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Po
   const Float_t tolerance=0.03; // relative current tolerance
   const Float_t zero=77.;       // "zero" current (A)
   //
-  TString s=(l3Pol < 0) ? "L3: -" : "L3: +";
-  //
-  AliMagF::BMap_t map = AliMagF::k5kG;
-  //
-  double fcL3,fcDip;
+  AliMagF::BMap_t map;
+  double sclL3,sclDip;
   //
   l3Cur = TMath::Abs(l3Cur);
-  if (TMath::Abs(l3Cur-l3NominalCurrent1)/l3NominalCurrent1 < tolerance) {
-    fcL3 = l3Cur/l3NominalCurrent1;
-    map  = AliMagF::k5kG;
-    s   += "0.5 T;  ";
-  } else if (TMath::Abs(l3Cur-l3NominalCurrent2)/l3NominalCurrent2 < tolerance) {
-    fcL3 = l3Cur/l3NominalCurrent2;
-    map  = AliMagF::k2kG;
-    s   += "0.2 T;  ";
-  } else if (l3Cur <= zero) {
-    fcL3 = 0;
-    map  = AliMagF::k5kGUniform;
-    s   += "0.0 T;  ";
-  } else {
-    AliError(Form("Wrong L3 current (%f A)!",l3Cur));
-    return kFALSE;
-  }
-  //
   diCur = TMath::Abs(diCur);
-  if (TMath::Abs(diCur-diNominalCurrent)/diNominalCurrent < tolerance) {
-    // 3% current tolerance...
-    fcDip = diCur/diNominalCurrent;
-    s    += "Dipole ON";
-  } else if (diCur <= zero) { // some small current..
-    fcDip = 0.;
-    s    += "Dipole OFF";
-  } else {
-    AliError(Form("Wrong dipole current (%f A)!",diCur));
-    return kFALSE;
+  //
+  if (TMath::Abs((sclDip=diCur/diNominalCurrent)-1.) > tolerance && !uniform) {
+    if (diCur <= zero) sclDip = 0.; // some small current.. -> Dipole OFF
+    else {
+      AliError(Form("Wrong dipole current (%f A)!",diCur));
+      return kFALSE;
+    }
   }
   //
+  if (uniform) { 
+    // special treatment of special MC with uniform mag field (normalized to 0.5 T)
+    // no check for scaling/polarities are done
+    map   = AliMagF::k5kGUniform;
+    sclL3 = l3Cur/l3NominalCurrent1; 
+  }
+  else {
+    if      (TMath::Abs((sclL3=l3Cur/l3NominalCurrent1)-1.) < tolerance) map  = AliMagF::k5kG;
+    else if (TMath::Abs((sclL3=l3Cur/l3NominalCurrent2)-1.) < tolerance) map  = AliMagF::k2kG;
+    else if (l3Cur <= zero)                                { sclL3 = 0;  map  = AliMagF::k5kGUniform;}
+    else {
+      AliError(Form("Wrong L3 current (%f A)!",l3Cur));
+      return kFALSE;
+    }
+  }
   //
-  if (fcDip!=0 && (map==AliMagF::k5kG || map==AliMagF::k2kG) && 
-      ((AliMagF::GetPolarityConvention()==AliMagF::kConvMap2005 && l3Pol!=diPol) ||
-       (AliMagF::GetPolarityConvention()==AliMagF::kConvDCS2008 && l3Pol==diPol) ||
-       (AliMagF::GetPolarityConvention()==AliMagF::kConvLHC     && l3Pol!=diPol)) ) {
+  if (sclDip!=0 && (map==AliMagF::k5kG || map==AliMagF::k2kG) &&
+      ((convention==AliMagF::kConvLHC     && l3Pol!=diPol) ||
+       (convention==AliMagF::kConvDCS2008 && l3Pol==diPol)) ) { 
     AliError(Form("Wrong combination for L3/Dipole polarities (%c/%c) for convention %d",
                  l3Pol>0?'+':'-',diPol>0?'+':'-',AliMagF::GetPolarityConvention()));
     return kFALSE;
   }
   //
-  if (l3Pol<0) fcL3  = -fcL3;
-  if (diPol<0) fcDip = -fcDip;
+  if (l3Pol<0) sclL3  = -sclL3;
+  if (diPol<0) sclDip = -sclDip;
   //
   AliMagF::BeamType_t btype = AliMagF::kNoBeamField;
   TString btypestr = beamtype;
@@ -984,8 +976,10 @@ Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Po
   else {
     AliInfo(Form("Cannot determine the beam type from %s, assume no LHC magnet field",beamtype));
   }
-  
-  AliMagF* fld = new AliMagF("MagneticFieldMap", s.Data(), 2, fcL3, fcDip, 10., map, path, 
+  char ttl[50];
+  sprintf(ttl,"L3: %+5d Dip: %+4d kA; %s",(int)TMath::Sign(l3Cur,float(sclL3)),
+         (int)TMath::Sign(diCur,float(sclDip)),uniform ? " Constant":"");
+  AliMagF* fld = new AliMagF("MagneticFieldMap", ttl, 2, sclL3, sclDip, 10., map, path, 
                             btype,beamenergy);
   TGeoGlobalMagField::Instance()->SetField( fld );
   TGeoGlobalMagField::Instance()->Lock();
@@ -993,7 +987,6 @@ Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Po
   return kTRUE;
 }
 
-
 Bool_t AliReconstruction::InitGRP() {
   //------------------------------------
   // Initialization of the GRP entry 
@@ -1131,42 +1124,17 @@ Bool_t AliReconstruction::InitGRP() {
       ok = kFALSE;
     }
 
-    /*
-    TObjString *l3Current=
-       dynamic_cast<TObjString*>(fGRPData->GetValue("fL3Current"));
-    if (!l3Current) {
-      AliError("GRP/GRP/Data entry:  missing value for the L3 current !");
-      ok = kFALSE;
-    }
-    TObjString *l3Polarity=
-       dynamic_cast<TObjString*>(fGRPData->GetValue("fL3Polarity"));
-    if (!l3Polarity) {
-      AliError("GRP/GRP/Data entry:  missing value for the L3 polarity !");
-      ok = kFALSE;
-    }
-    
-    // Dipole
-    TObjString *diCurrent=
-       dynamic_cast<TObjString*>(fGRPData->GetValue("fDipoleCurrent"));
-    if (!diCurrent) {
-      AliError("GRP/GRP/Data entry:  missing value for the dipole current !");
-      ok = kFALSE;
-    }
-    TObjString *diPolarity=
-       dynamic_cast<TObjString*>(fGRPData->GetValue("fDipolePolarity"));
-    if (!diPolarity) {
-      AliError("GRP/GRP/Data entry:  missing value for the dipole polarity !");
-      ok = kFALSE;
-    }
-    */
+    // read special bits for the polarity convention and map type
+    Int_t  polConvention = fGRPData->IsPolarityConventionLHC() ? AliMagF::kConvLHC : AliMagF::kConvDCS2008;
+    Bool_t uniformB = fGRPData->IsUniformBMap();
 
     if (ok) { 
-      if ( !SetFieldMap(l3Current, diCurrent, l3Polarity ? -1:1, diPolarity ? -1:1) )
+      if ( !SetFieldMap(l3Current, diCurrent, l3Polarity ? -1:1, diPolarity ? -1:1, 
+                       polConvention,uniformB,beamEnergy, beamType.Data()))
        AliFatal("Failed to creat a B field map ! Exiting...");
       AliInfo("Running with the B field constructed out of GRP !");
     }
     else AliFatal("B field is neither set nor constructed from GRP ! Exitig...");
-    
   }
   
   //*** Get the diamond profiles from OCDB
index e8724ba5579bf43a964d76ee3e9fb0c6f261c841..308658cd1538fa614b7479c323d046d2069c6480 100644 (file)
@@ -83,8 +83,9 @@ public:
 
   //*** Magnetic field setters
   Bool_t SetFieldMap(Float_t l3Current=30000., Float_t diCurrent=6000., 
-                    Float_t l3Pol=1., Float_t dipPol=1., Float_t benergy=7000., 
-                    const Char_t* btype="pp",  
+                    Float_t l3Pol=-1., Float_t dipPol=-1.,
+                    Int_t convention=0, Bool_t uniform = kFALSE, 
+                    Float_t benergy=7000., const Char_t* btype="pp",
                     const Char_t* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
 
   //*** Global reconstruction flag setters
index 0181e1cd2e3f23091f1bae66d9bf8f35dd0a81e2..d017b446624b8782c6243314ad4d62f665226e32 100644 (file)
@@ -2262,27 +2262,24 @@ void AliSimulation::WriteGRPEntry()
   grpObj->SetLHCState("STABLE_BEAMS");
   grpObj->SetLHCLuminosity(0,(AliGRPObject::Stats)0);
   grpObj->SetBeamIntensity(0,(AliGRPObject::Stats)0);
-
+  //
   AliMagF *field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
   Float_t solenoidField = field ? TMath::Abs(field->SolenoidField()) : 0;
-  Float_t factor =        field ? field->Factor() : 0;
-  Float_t l3current = TMath::Abs(factor)*solenoidField*30000./5.;
-  grpObj->SetL3Current(l3current,(AliGRPObject::Stats)0);
-  
-  if (factor > 0) {
-    grpObj->SetL3Polarity(0);
-    grpObj->SetDipolePolarity(0);
-  }
-  else {
-    grpObj->SetL3Polarity(1);
-    grpObj->SetDipolePolarity(1);
-  }
-
-  if (TMath::Abs(factor) != 0)
-    grpObj->SetDipoleCurrent(6000,(AliGRPObject::Stats)0);
-  else 
-    grpObj->SetDipoleCurrent(0,(AliGRPObject::Stats)0);
 
+  Float_t factorSol     = field ? field->GetFactorSol() : 0;
+  Float_t currentSol    = TMath::Abs(factorSol)>1E-6 ? 
+    TMath::Nint(TMath::Abs(solenoidField/factorSol))/5.*30000.*TMath::Abs(factorSol) : 0;
+  //
+  Float_t factorDip     = field ? field->GetFactorDip() : 0;
+  Float_t currentDip    = 6000.*TMath::Abs(factorDip);
+  //
+  grpObj->SetL3Current(currentSol,(AliGRPObject::Stats)0);
+  grpObj->SetDipoleCurrent(currentDip,(AliGRPObject::Stats)0);  
+  grpObj->SetL3Polarity(factorSol>0 ? 0:1);  
+  grpObj->SetDipolePolarity(factorDip>0 ? 0:1);
+  grpObj->SetUniformBMap(field->IsUniform());            // for special MC with k5kGUniform map
+  grpObj->SetPolarityConventionLHC();                    // LHC convention +/+ current -> -/- field main components
+  //
   grpObj->SetCavernTemperature(0,(AliGRPObject::Stats)0);
   
   //grpMap->Add(new TObjString("fCavernPressure"),new TObjString("0")); ---> not inserted in simulation with the new object, since it is now an AliDCSSensor
index 95ad2a45be65fc2266e02c713d0adc7b8721518f..850a212761c29576fea0be4795cf034cc092c20b 100644 (file)
@@ -112,7 +112,7 @@ void Config()
   gener->Init(); // Initialization of the coctail generator
 
   // Field (the last parameter is 1 => L3 0.4 T)
-  TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
+  TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG));
 
   // Make sure the current ROOT directory is in galice.root 
   rl->CdGAFile();
index cd133ce572fcb3549e1b28178c53edef909ec3e2..455a674489dc8c6bd9b3070edc7351cf86c5990f 100644 (file)
@@ -190,7 +190,7 @@ void Config()
     //
     //gener->SetVertexSmear(perTrack); 
     // Field (L3 0.4 T)
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG));
 
     Int_t   iABSO   = 1;
     Int_t   iDIPO   = 1;
index 0cba2f78828f650722692a479a1f4e3fcbe5f6b1..165e9aaa998c8e80248a15de7d724e18c42ef37f 100644 (file)
@@ -19,7 +19,7 @@
 #include "STEER/AliConfig.h"
 #include "PYTHIA6/AliDecayerPythia.h"
 #include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagWrapCheb.h"
+#include "STEER/AliMagF.h"
 #include "STRUCT/AliBODY.h"
 #include "STRUCT/AliMAG.h"
 #include "STRUCT/AliABSOv3.h"
@@ -381,17 +381,17 @@ void Config()
 
   // FIELD
   //
-  AliMagWrapCheb* field = 0x0;
+  AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,
-                              kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
-
+  TGeoGlobalMagField::Instance()->SetField(field);
   rl->CdGAFile();
   gAlice->SetField(field);
 
index 0cba2f78828f650722692a479a1f4e3fcbe5f6b1..60fff7c8ec7e12553fdfc3abe6c42d6e011435b8 100644 (file)
@@ -19,7 +19,7 @@
 #include "STEER/AliConfig.h"
 #include "PYTHIA6/AliDecayerPythia.h"
 #include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagWrapCheb.h"
+#include "STEER/AliMagF.h"
 #include "STRUCT/AliBODY.h"
 #include "STRUCT/AliMAG.h"
 #include "STRUCT/AliABSOv3.h"
@@ -381,16 +381,16 @@ void Config()
 
   // FIELD
   //
-  AliMagWrapCheb* field = 0x0;
+  AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,
-                              kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
+  TGeoGlobalMagField::Instance()->SetField(field);
 
   rl->CdGAFile();
   gAlice->SetField(field);
index a49246d47c62ab0742983d2112fbdb79883d51ea..62d06c35bd0078780d711f6233fdb432e18da16f 100644 (file)
@@ -19,7 +19,7 @@
 #include "STEER/AliConfig.h"
 #include "PYTHIA6/AliDecayerPythia.h"
 #include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagWrapCheb.h"
+#include "STEER/AliMagF.h"
 #include "STRUCT/AliBODY.h"
 #include "STRUCT/AliMAG.h"
 #include "STRUCT/AliABSOv3.h"
@@ -383,17 +383,18 @@ void Config()
 
   // FIELD
   //
-  AliMagWrapCheb* field = 0x0;
+  
+  AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,
-                              kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
-
+  TGeoGlobalMagField::Instance()->SetField(field);
+    
    rl->CdGAFile();
    gAlice->SetField(field);
 
index a49246d47c62ab0742983d2112fbdb79883d51ea..62d06c35bd0078780d711f6233fdb432e18da16f 100644 (file)
@@ -19,7 +19,7 @@
 #include "STEER/AliConfig.h"
 #include "PYTHIA6/AliDecayerPythia.h"
 #include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagWrapCheb.h"
+#include "STEER/AliMagF.h"
 #include "STRUCT/AliBODY.h"
 #include "STRUCT/AliMAG.h"
 #include "STRUCT/AliABSOv3.h"
@@ -383,17 +383,18 @@ void Config()
 
   // FIELD
   //
-  AliMagWrapCheb* field = 0x0;
+  
+  AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,
-                              kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
-
+  TGeoGlobalMagField::Instance()->SetField(field);
+    
    rl->CdGAFile();
    gAlice->SetField(field);
 
index a49246d47c62ab0742983d2112fbdb79883d51ea..62d06c35bd0078780d711f6233fdb432e18da16f 100644 (file)
@@ -19,7 +19,7 @@
 #include "STEER/AliConfig.h"
 #include "PYTHIA6/AliDecayerPythia.h"
 #include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagWrapCheb.h"
+#include "STEER/AliMagF.h"
 #include "STRUCT/AliBODY.h"
 #include "STRUCT/AliMAG.h"
 #include "STRUCT/AliABSOv3.h"
@@ -383,17 +383,18 @@ void Config()
 
   // FIELD
   //
-  AliMagWrapCheb* field = 0x0;
+  
+  AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,
-                              kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
-
+  TGeoGlobalMagField::Instance()->SetField(field);
+    
    rl->CdGAFile();
    gAlice->SetField(field);
 
index a49246d47c62ab0742983d2112fbdb79883d51ea..52f4a59e123d0f8d0463e8c846525712a0d23763 100644 (file)
@@ -19,7 +19,7 @@
 #include "STEER/AliConfig.h"
 #include "PYTHIA6/AliDecayerPythia.h"
 #include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagWrapCheb.h"
+#include "STEER/AliMagF.h"
 #include "STRUCT/AliBODY.h"
 #include "STRUCT/AliMAG.h"
 #include "STRUCT/AliABSOv3.h"
@@ -383,17 +383,19 @@ void Config()
 
   // FIELD
   //
-  AliMagWrapCheb* field = 0x0;
+
+  AliMagWrapCheb* field = 0x0;  
+  AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,
-                              kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
-
+  TGeoGlobalMagField::Instance()->SetField(field);
+    
    rl->CdGAFile();
    gAlice->SetField(field);
 
index a49246d47c62ab0742983d2112fbdb79883d51ea..c81da8a59b704ecb62c3888842ff1ebcb31ea7e0 100644 (file)
@@ -19,7 +19,7 @@
 #include "STEER/AliConfig.h"
 #include "PYTHIA6/AliDecayerPythia.h"
 #include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagWrapCheb.h"
+#include "STEER/AliMagF.h"
 #include "STRUCT/AliBODY.h"
 #include "STRUCT/AliMAG.h"
 #include "STRUCT/AliABSOv3.h"
@@ -383,16 +383,17 @@ void Config()
 
   // FIELD
   //
-  AliMagWrapCheb* field = 0x0;
+  
+  AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,
-                              kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
+  TGeoGlobalMagField::Instance()->SetField(field);
 
    rl->CdGAFile();
    gAlice->SetField(field);
index a49246d47c62ab0742983d2112fbdb79883d51ea..fad5ca80486e5bc3600da5efd48466df04565918 100644 (file)
@@ -19,7 +19,7 @@
 #include "STEER/AliConfig.h"
 #include "PYTHIA6/AliDecayerPythia.h"
 #include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagWrapCheb.h"
+#include "STEER/AliMagF.h"
 #include "STRUCT/AliBODY.h"
 #include "STRUCT/AliMAG.h"
 #include "STRUCT/AliABSOv3.h"
@@ -383,19 +383,20 @@ void Config()
 
   // FIELD
   //
-  AliMagWrapCheb* field = 0x0;
-  if (mag == kNoField) {
-    comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);
-  } else if (mag == k5kG) {
-    comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,
-                              kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
-  }
-  printf("\n \n Comment: %s \n \n", comment.Data());
-
-   rl->CdGAFile();
-   gAlice->SetField(field);
+  
+       AliMagF* field = 0x0;
+       if (mag == kNoField) {
+         comment = comment.Append(" | L3 field 0.0 T");
+         field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
+       } else if (mag == k5kG) {
+         comment = comment.Append(" | L3 field 0.5 T");
+         field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
+       }
+       printf("\n \n Comment: %s \n \n", comment.Data());
+       TGeoGlobalMagField::Instance()->SetField(field);
+       
+       rl->CdGAFile();
+       gAlice->SetField(field);
 
        
        Int_t iABSO   = 1;
index a1d1be42a90688c12a1087a2f8817532ac65fa2e..92f9c909d5d1ccd3d88a2f2bc64e201a8c59ebd3 100644 (file)
@@ -357,7 +357,7 @@ void Config()
   // FIELD
   //
 
-  TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 10., mag));
+  TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., mag));
 
   printf("\n \n Comment: %s \n \n", comment.Data());
 
index 9997ff484e4e794c6ff9834000f405b6d961412b..17a14d2b43c56f7ae5b3c35d9fd2bd8603bd0e23 100644 (file)
@@ -260,7 +260,7 @@ void Config()
     gener->Init();
 
     // Field (L3 0.5 T)
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 10., mag));
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., mag));
 
     Int_t   iABSO   = 1;
     Int_t   iDIPO   = 1;
index 0cba2f78828f650722692a479a1f4e3fcbe5f6b1..fed5b871a7cff4fde01d6601d5f8790bf77704a7 100644 (file)
@@ -19,7 +19,7 @@
 #include "STEER/AliConfig.h"
 #include "PYTHIA6/AliDecayerPythia.h"
 #include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagWrapCheb.h"
+#include "STEER/AliMagF.h"
 #include "STRUCT/AliBODY.h"
 #include "STRUCT/AliMAG.h"
 #include "STRUCT/AliABSOv3.h"
@@ -381,16 +381,17 @@ void Config()
 
   // FIELD
   //
-  AliMagWrapCheb* field = 0x0;
+  AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,
-                              kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
+  TGeoGlobalMagField::Instance()->SetField(field);
+
 
   rl->CdGAFile();
   gAlice->SetField(field);
index 0cba2f78828f650722692a479a1f4e3fcbe5f6b1..60fff7c8ec7e12553fdfc3abe6c42d6e011435b8 100644 (file)
@@ -19,7 +19,7 @@
 #include "STEER/AliConfig.h"
 #include "PYTHIA6/AliDecayerPythia.h"
 #include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagWrapCheb.h"
+#include "STEER/AliMagF.h"
 #include "STRUCT/AliBODY.h"
 #include "STRUCT/AliMAG.h"
 #include "STRUCT/AliABSOv3.h"
@@ -381,16 +381,16 @@ void Config()
 
   // FIELD
   //
-  AliMagWrapCheb* field = 0x0;
+  AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,
-                              kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
+  TGeoGlobalMagField::Instance()->SetField(field);
 
   rl->CdGAFile();
   gAlice->SetField(field);
index 5e108b7503fd466077989bc3a87834a6d1e36e27..cdc355fbb3c3469f63203137309b830ee4659b6b 100644 (file)
@@ -45,7 +45,7 @@ class AliGenPythia;
 #include "STEER/AliConfig.h"\r
 #include "PYTHIA6/AliDecayerPythia.h"\r
 #include "PYTHIA6/AliGenPythia.h"\r
-#include "STEER/AliMagFMaps.h"\r
+#include "STEER/AliMagF.h"\r
 #include "STRUCT/AliBODY.h"\r
 #include "STRUCT/AliMAG.h"\r
 #include "STRUCT/AliABSOv3.h"\r
@@ -542,19 +542,19 @@ void Config()
   }\r
   // FIELD\r
   \r
-  printf("\n \n Comment: %s \n \n", comment.Data());\r
+  AliMagF* field = 0x0;\r
   if (mag == kNoField) {\r
     comment = comment.Append(" | L3 field 0.0 T");\r
-    field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);\r
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);\r
   } else if (mag == k5kG) {\r
     comment = comment.Append(" | L3 field 0.5 T");\r
     //    field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG);\r
-       field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");\r
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);\r
   }\r
 \r
   printf("\n \n Comment: %s \n \n", comment.Data());\r
+  TGeoGlobalMagField::Instance()->SetField(field);\r
   rl->CdGAFile();\r
-  gAlice->SetField(field);\r
 \r
 \r
 \r
index a211c6e3003399ae1db8dc26158487458c4a8123..a775f1a6f8d95fcfdd4aecbbb022fa788b538e5a 100644 (file)
@@ -193,7 +193,7 @@ void Config()
     \r
   //============================================================= \r
   // Field (L3 0.5 T) outside dimuon spectrometer\r
-  AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);\r
+  AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);\r
   TGeoGlobalMagField::Instance()->SetField(field);\r
 \r
   Int_t iITS = 1;\r
index a211c6e3003399ae1db8dc26158487458c4a8123..a775f1a6f8d95fcfdd4aecbbb022fa788b538e5a 100644 (file)
@@ -193,7 +193,7 @@ void Config()
     \r
   //============================================================= \r
   // Field (L3 0.5 T) outside dimuon spectrometer\r
-  AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);\r
+  AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);\r
   TGeoGlobalMagField::Instance()->SetField(field);\r
 \r
   Int_t iITS = 1;\r
index a211c6e3003399ae1db8dc26158487458c4a8123..a775f1a6f8d95fcfdd4aecbbb022fa788b538e5a 100644 (file)
@@ -193,7 +193,7 @@ void Config()
     \r
   //============================================================= \r
   // Field (L3 0.5 T) outside dimuon spectrometer\r
-  AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);\r
+  AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);\r
   TGeoGlobalMagField::Instance()->SetField(field);\r
 \r
   Int_t iITS = 1;\r
index a211c6e3003399ae1db8dc26158487458c4a8123..a775f1a6f8d95fcfdd4aecbbb022fa788b538e5a 100644 (file)
@@ -193,7 +193,7 @@ void Config()
     \r
   //============================================================= \r
   // Field (L3 0.5 T) outside dimuon spectrometer\r
-  AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);\r
+  AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);\r
   TGeoGlobalMagField::Instance()->SetField(field);\r
 \r
   Int_t iITS = 1;\r
index a211c6e3003399ae1db8dc26158487458c4a8123..a775f1a6f8d95fcfdd4aecbbb022fa788b538e5a 100644 (file)
@@ -193,7 +193,7 @@ void Config()
     \r
   //============================================================= \r
   // Field (L3 0.5 T) outside dimuon spectrometer\r
-  AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);\r
+  AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);\r
   TGeoGlobalMagField::Instance()->SetField(field);\r
 \r
   Int_t iITS = 1;\r
index a211c6e3003399ae1db8dc26158487458c4a8123..a775f1a6f8d95fcfdd4aecbbb022fa788b538e5a 100644 (file)
@@ -193,7 +193,7 @@ void Config()
     \r
   //============================================================= \r
   // Field (L3 0.5 T) outside dimuon spectrometer\r
-  AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);\r
+  AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);\r
   TGeoGlobalMagField::Instance()->SetField(field);\r
 \r
   Int_t iITS = 1;\r
index c7ef761611d65a809d71db4f1c1769d315cf6d95..b7244385605255100d64ff45b0106a5942148735 100644 (file)
@@ -267,7 +267,7 @@ void Config()
     
     
 // Field
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag));
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., smag));
     rl->CdGAFile();
 //
     Int_t   iABSO   = 1;
index efc14d635b48f849a5204a3af70914947e483351..85cff004ad55cc115c0cca5434f37d103c3926d1 100644 (file)
@@ -401,9 +401,9 @@ void Config()
     comment = comment.Append(" | L3 field 0.5 T");
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
-
-  AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., mag);
-  field->SetL3ConstField(0); //Using const. field in the barrel
+  // to use constant field in the barrel use:
+  //  AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kGUniform);
+  AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., mag);
   TGeoGlobalMagField::Instance()->SetField(field);
   rl->CdGAFile();
 
index e96e7813bfde53669adbb172a553c2eebaf59945..b192988fd094d31f322fde8ee27263d152db4d8a 100644 (file)
@@ -284,12 +284,10 @@ void Config()
     //  AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    //    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG);
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform));
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::kNoField));
-//     field = new AliMagFCheb("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG));
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
   //  TGeoGlobalMagField::Instance()->SetField(field);
index 692f6feba7605d7b80f35e46bcc4b4746d39f04c..328bbe421f1e359bf775f9f1e77dd586194ed743 100644 (file)
@@ -221,12 +221,12 @@ void Config()
   AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG,
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform,
                        "$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root",
                        AliMagF::kBeamTypepp, energy/2.0);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG,
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG,
                        "$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root",
                        AliMagF::kBeamTypepp, energy/2.0);
   }
index 5e0972e41ea5a55eb907ff6c1127c147d6edffa6..a9b99b8816c59b2fe821658ea93265971d2ce174 100644 (file)
@@ -224,7 +224,7 @@ void Config()
     
     
 // Field (L3 0.4 T)
-    AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., smag);
+    AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., smag);
     TGeoGlobalMagField::Instance()->SetField(field);
 
     rl->CdGAFile();
index 0a72ff20bc758f9f047076d1a20317a109217b3e..c9c8476deff6fd972bee3aa9faeb3fc76dc7b773 100644 (file)
@@ -314,7 +314,7 @@ void Config()
     //
     //gener->SetVertexSmear(perTrack); 
     // Field (L3 0.5 T)
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG));
 
     Int_t   iABSO  =  1;
     Int_t   iDIPO  =  1;
index 97603bbb62b145be0f378f22dd0900fbfc90a35f..f5a3e179f9d7d846d695d492ed0986354214c46a 100644 (file)
@@ -273,7 +273,7 @@ void Config()
     
     
 // Field (L3 0.4 T)
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag));
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., smag));
     rl->CdGAFile();
 //
     Int_t   iABSO   = 1;
index 0ceb5f42d28a84571c94f596f4fa677d9e00838b..f4d0609bf2485d4339ec6ce64042a8a041eb4113 100644 (file)
@@ -272,7 +272,7 @@ void Config()
     
     
 // Field (L3 0.4 T)
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag));
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., smag));
     rl->CdGAFile();
 //
     Int_t   iABSO   = 1;
index f729028a5528113d6738fc62f88227b0919fd3e9..0cf43e492e8cde83b11f37ed28117340344c0c00 100644 (file)
@@ -241,10 +241,10 @@ void Config()
   AliMagF* field = 0x0;
   if (mag == kNoField) {
     comment = comment.Append(" | L3 field 0.0 T");
-    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG);
+    field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform);
   } else if (mag == k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
-    field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);
+    field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG);
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
   TGeoGlobalMagField::Instance()->SetField(field);
index 47f2345030a66d8d152a9338cdc39eab95c1cf37..579bac6ee62b278b7fad56ca73943344005790ed 100644 (file)
@@ -267,7 +267,7 @@ void Config()
     
     
 // Field
-    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., smag));
 
     rl->CdGAFile();
 //
index 40ca712509ee70bfd18d182b8d2aa0c409a72b11..9971bce72059a232f548f577bab894191fca0ca8 100644 (file)
@@ -334,7 +334,7 @@ void Config()
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
     
-  AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., mag);
+  AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., mag);
   TGeoGlobalMagField::Instance()->SetField(field);
   
   rl->CdGAFile();