Added to AliMagF the definition (const) of the polarities conventions.
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.cxx
index e8b444612569873c431705053055ef4c9cbb4851..ba6a391289d026c4f9086531b2b3fdfd6f9a2bf0 100644 (file)
@@ -961,8 +961,13 @@ Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Po
     return kFALSE;
   }
   //
-  if (l3Pol!=diPol && (map==AliMagF::k5kG || map==AliMagF::k2kG) && fcDip!=0) {
-    AliError("L3 and Dipole polarities must be the same");
+  //
+  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)) ) {
+    AliError(Form("Wrong combination for L3/Dipole polarities (%c/%c) for convention %d",
+                 l3Pol>0?'+':'-',diPol>0?'+':'-',AliMagF::GetPolarityConvention()));
     return kFALSE;
   }
   //