+ /// Load magnetic field (existing field will be deleted).
+ /// OCDB path and run number are supposed to be set.
+
+ AliInfoGeneral("AliMUONCDB","Loading field map from GRP...");
+
+ if (!AliMUONCDB::CheckOCDB()) return kFALSE;
+
+ AliGRPManager grpMan;
+
+ // make sure the old field is deleted even if it is locked
+ if(TGeoGlobalMagField::Instance()->IsLocked()) delete TGeoGlobalMagField::Instance();
+
+ if (!grpMan.ReadGRPEntry() || !grpMan.SetMagField()) {
+ AliErrorGeneral("AliMUONCDB", "failed to load magnetic field from OCDB");
+ return kFALSE;
+ }
+
+ return kTRUE;
+
+}
+
+//_____________________________________________________________________________
+Bool_t AliMUONCDB::LoadMapping(Bool_t segmentationOnly)
+{
+ /// Load mapping (existing mapping will be unloaded).
+ /// OCDB path and run number are supposed to be set.
+
+ AliInfoGeneral("AliMUONCDB", "Loading mapping from OCDB...");
+
+ if (!AliMUONCDB::CheckOCDB()) return kFALSE;
+
+ // in case it has already been set
+ AliMpCDB::UnloadAll();
+
+ if (segmentationOnly) {
+
+ if (!AliMpCDB::LoadMpSegmentation(kTRUE)){
+ AliErrorGeneral("AliMUONCDB", "failed to load segmentation from OCDB");
+ return kFALSE;
+ }
+
+ } else {
+
+ if (!AliMpCDB::LoadAll(kTRUE)) {
+ AliErrorGeneral("AliMUONCDB", "failed to load mapping from OCDB");
+ return kFALSE;
+ }
+
+ }
+
+ return kTRUE;
+
+}
+
+//_____________________________________________________________________________
+AliMUONRecoParam* AliMUONCDB::LoadRecoParam()
+{
+ /// Load and return reconstruction parameters.
+ /// OCDB path is supposed to be set.
+
+ AliInfoGeneral("AliMUONCDB", "Loading RecoParam from OCDB...");
+
+ if (!AliMUONCDB::CheckOCDB()) return kFALSE;
+
+ AliMUONRecoParam* recoParam = 0x0;
+ AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam");
+
+ if(entry) {
+
+ // load recoParam according OCDB content (single or array)
+ if (!(recoParam = dynamic_cast<AliMUONRecoParam*>(entry->GetObject()))) {
+
+ TObjArray* recoParamArray = static_cast<TObjArray*>(entry->GetObject());
+
+ for(Int_t i = 0; i < recoParamArray->GetEntriesFast(); i++) {
+ recoParam = static_cast<AliMUONRecoParam*>(recoParamArray->UncheckedAt(i));
+ if (recoParam->IsDefault()) break;
+ recoParam = 0x0;
+ }
+
+ }
+