+/**************************************************************************
+* 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"
#include "AliMUONReAlignTask.h"
+using std::cout;
+using std::endl;
///\cond CLASSIMP
ClassImp(AliMUONReAlignTask)
///\endcond
AliMUONReAlignTask& AliMUONReAlignTask::operator=(const AliMUONReAlignTask& other)
{
/// Assignment
+ if(&other == this) return *this;
AliAnalysisTask::operator=(other);
fESD = other.fESD;
fClusterInfoTree = other.fClusterInfoTree;
// Find the corresponding re-fitted MUON track
AliMUONTrack* newTrack = (AliMUONTrack*) newTrackStore->FindObject(esdTrack->GetUniqueID());
-// // replace the content of the current ESD track or remove it if the refitting has failed
-// if (newTrack) {
-// Double_t vertex[3] = {esdTrack->GetNonBendingCoor(), esdTrack->GetBendingCoor(), esdTrack->GetZ()};
-// AliMUONESDInterface::MUONToESD(*newTrack, *esdTrack, vertex, esdInterface.GetDigits());
-// } else {
-// esdTracks->Remove(esdTrack);
-// }
-
// print initial and re-fitted track parameters at first cluster if any
if (fPrintLevel>0) {
cout<<" ----------------track #"<<iTrack+1<<"----------------"<<endl;
padInfo.SetPadADC(digit->ADC());
padInfo.SetSaturated(digit->IsSaturated());
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));
-
+ if (ped) {
+ padInfo.SetPedestal(ped->ValueAsFloatFast(manuChannel,0), ped->ValueAsFloatFast(manuChannel,1));
+ } else {
+ padInfo.SetPedestal(-250.,-5.);
+ }
+ if (gain) {
+ padInfo.SetGain(gain->ValueAsFloatFast(manuChannel,0), gain->ValueAsFloatFast(manuChannel,1),
+ gain->ValueAsIntFast(manuChannel,2), gain->ValueAsIntFast(manuChannel,3));
+ } else {
+ padInfo.SetGain(-1.,-0.1,-4095,-1);
+ }
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