+/**************************************************************************
+* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* *
+* Author: The ALICE Off-line Project. *
+* Contributors are mentioned in the code where appropriate. *
+* *
+* Permission to use, copy, modify and distribute this software and its *
+* documentation strictly for non-commercial purposes is hereby granted *
+* without fee, provided that the above copyright notice appears in all *
+* copies and that both the copyright notice and this permission notice *
+* appear in the supporting documentation. The authors make no claims *
+* about the suitability of this software for any purpose. It is *
+* provided "as is" without express or implied warranty. *
+**************************************************************************/
+
+// $Id$
+
//-----------------------------------------------------------------------------
/// \class AliMUONReAlignTask
/// AliAnalysisTask to realign the MUON spectrometer.
#include "AliESDMuonTrack.h"
#include "AliMagF.h"
#include "AliCDBManager.h"
+#include "AliGRPManager.h"
#include "AliGeomManager.h"
#include "AliMpConstants.h"
padInfo.SetCalibrated(digit->IsCalibrated());
padInfo.SetPedestal(ped->ValueAsFloatFast(manuChannel,0), ped->ValueAsFloatFast(manuChannel,1));
padInfo.SetGain(gain->ValueAsFloatFast(manuChannel,0), gain->ValueAsFloatFast(manuChannel,1),
- gain->ValueAsFloatFast(manuChannel,2), gain->ValueAsFloatFast(manuChannel,3));
+ gain->ValueAsIntFast(manuChannel,2), gain->ValueAsIntFast(manuChannel,3));
fClusterInfo->AddPad(padInfo);
}
return;
}
}
-
- // set mag field
- printf("Loading field map...\n");
- AliMagF* field = new AliMagF("Maps","Maps",2,0.,0., 10.,AliMagF::k5kG);
- TGeoGlobalMagField::Instance()->SetField(field);
- TGeoGlobalMagField::Instance()->Lock();
-
+
// Load mapping
AliCDBManager* man = AliCDBManager::Instance();
man->SetDefaultStorage(defaultOCDB);
Error("MUONRefit","Could not access mapping from OCDB !");
exit(-1);
}
+
+ // set mag field
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
+ printf("Loading field map...\n");
+ AliGRPManager *grpMan = new AliGRPManager();
+ grpMan->ReadGRPEntry();
+ grpMan->SetMagField();
+ delete grpMan;
+ }
+ // set the magnetic field for track extrapolations
+ AliMUONTrackExtrap::SetField();
// Load initial reconstruction parameters from OCDB
// reconstruction parameters