-//-----------------------------------------------------------------------
-void Prepare()
-{
- /// Set the geometry, the magnetic field, the mapping and the reconstruction parameters
-
- // Import TGeo geometry (needed by AliMUONTrackExtrap::ExtrapToVertex)
- if (!gGeoManager) {
- AliGeomManager::LoadGeometry("geometry.root");
- if (!gGeoManager) {
- Error("MUONRefit", "getting geometry from file %s failed", "generated/galice.root");
- return;
- }
- }
-
- // set mag field
- // waiting for mag field in CDB
- if (!TGeoGlobalMagField::Instance()->GetField()) {
- printf("Loading field map...\n");
- AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
- TGeoGlobalMagField::Instance()->SetField(field);
- }
- // set the magnetic field for track extrapolations
- AliMUONTrackExtrap::SetField();
-
- // Load mapping
- AliCDBManager* man = AliCDBManager::Instance();
- man->SetDefaultStorage("local://$ALICE_ROOT");
- man->SetRun(0);
- if ( ! AliMpCDB::LoadDDLStore() ) {
- Error("MUONRefit","Could not access mapping from OCDB !");
- exit(-1);
- }
-
- // Load initial reconstruction parameters from OCDB
- AliMUONRecoParam* recoParam = 0x0;
- AliCDBPath path("MUON","Calib","RecoParam");
- AliCDBEntry *entry=man->Get(path.GetPath());
- if(entry) {
- recoParam = dynamic_cast<AliMUONRecoParam*>(entry->GetObject());
- entry->SetOwner(0);
- AliCDBManager::Instance()->UnloadFromCache(path.GetPath());
- }
- if (!recoParam) {
- printf("Couldn't find RecoParam object in OCDB: create default one");
- recoParam = AliMUONRecoParam::GetLowFluxParam();
- }
- Info("MUONRefit", "\n initial recontruction parameters:");
- recoParam->Print("FULL");
- AliMUONESDInterface::ResetTracker(recoParam);
-
-}
-