]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONReAlignTask.cxx
Adding missing include
[u/mrichter/AliRoot.git] / MUON / AliMUONReAlignTask.cxx
index fb13dfd74d2986a9f09c8aa29bdcd0732355b6d0..8dad37cfcb4f8747066bb55e7c9040a5b85862bd 100644 (file)
@@ -1,3 +1,20 @@
+/**************************************************************************
+* 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.
@@ -28,6 +45,7 @@
 #include "AliESDMuonTrack.h"
 #include "AliMagF.h"
 #include "AliCDBManager.h"
+#include "AliGRPManager.h"
 #include "AliGeomManager.h"
 
 #include "AliMpConstants.h"
@@ -375,7 +393,7 @@ void AliMUONReAlignTask::Exec(Option_t *)
        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);
       }
@@ -413,13 +431,7 @@ void AliMUONReAlignTask::Prepare(const char* geoFilename, const char* defaultOCD
       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);
@@ -430,6 +442,17 @@ void AliMUONReAlignTask::Prepare(const char* geoFilename, const char* defaultOCD
     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