]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliGRPManager.cxx
Do not reset a zero pointer to MC info
[u/mrichter/AliRoot.git] / STEER / AliGRPManager.cxx
index dfaaff0ed595c27b532fc23a09c8e16465c8d010..7f6d6cdaa2e0aaff2e3fe427946f183aadb991b3 100644 (file)
@@ -117,6 +117,11 @@ Bool_t AliGRPManager::SetMagField()
     }
   }
   //
+  if (!fGRPData) {
+    AliError("GRP Data is not loaded");
+    return kFALSE;
+  }
+  //
   // Construct the field map out of the information retrieved from GRP.
   Bool_t ok = kTRUE;
   // L3
@@ -158,8 +163,6 @@ Bool_t AliGRPManager::SetMagField()
     beamEnergy = 0;
     //ok = kFALSE;  // temprorary suppressed to make read cosmics data
   }
-  // LHC: "multiply by 120 to get the energy in MeV"
-  beamEnergy *= 0.120;
   
   // read special bits for the polarity convention and map type
   Int_t  polConvention = fGRPData->IsPolarityConventionLHC() ? AliMagF::kConvLHC : AliMagF::kConvDCS2008;
@@ -227,3 +230,16 @@ AliRunInfo* AliGRPManager::GetRunInfo()
 
   return new AliRunInfo(lhcState, beamType, beamEnergy, runType, activeDetectors);
 }
+
+//_____________________________________________________________________________
+void AliGRPManager::SetGRPEntry(AliGRPObject* source)
+{
+  // Create a GRP entry from the extrnaly provide GRP object
+  // To be used by HLT to create an online GRP instance
+  if (!source) return;
+  if (fGRPData) delete fGRPData;
+  fGRPData = new AliGRPObject(*source);
+  AliInfo("Created GRP Data from external object");
+  //
+}