/// \author Laurent Aphecetche, Nicole Bastid, Bogdan Vulpescu, ...
#if !defined(__CINT__) || defined(__MAKECINT__)
-#include "AliMUONReconstructor.h"
-#include "AliMUONRecoParam.h"
-#include "AliRecoParam.h"
#include "AliCDBManager.h"
-#include "AliMagF.h"
-#include "AliTracker.h"
#include "AliReconstruction.h"
-#include <TRandom.h>
#include <TGrid.h>
-//#include <TObjectTable.h>
+#include <TSystem.h>
#endif
-// Data file, OCDB on Grid
-TString input="alien:///alice/data/2008/LHC08b/000037057/raw/08000037057021.10.root";
-TString ocdbPath = "alien://folder=/alice/data/2008/LHC08b/OCDB";
-
-// Data file, OCDB locally
-//TString input="$ALICE_ROOT/MUON/test_out.100/raw.root";
-//TString ocdbPath = "local://$ALICE_ROOT";
-
-TString caliboption1 = "NOGAIN";
-TString caliboption2 = "GAINCONSTANTCAPA";
-TString recoptions = "SAVEDIGITS";
-Int_t seed = 1234567;
-
-void runDataReconstruction(Int_t calib = 1)
+void runDataReconstruction(const char* input = "raw://run124360",
+ const char* ocdbPath = "raw://",
+ const char* recoptions="SAVEDIGITS",
+ Int_t numberOfEvents=1000)
{
- TGrid::Connect("alien://");
-
AliCDBManager* man = AliCDBManager::Instance();
- man->SetDefaultStorage(ocdbPath.Data());
+ man->SetDefaultStorage(ocdbPath);
- man->SetSpecificStorage("MUON/Calib/Mapping","local://$ALICE_ROOT");
- man->SetSpecificStorage("MUON/Calib/DDLStore","local://$ALICE_ROOT");
-
- gRandom->SetSeed(seed);
+ AliReconstruction rec;
- // no magnetic field --> factor (4th parameter) = 0
- TGeoGlobalMagField::Instance()->GetField()->SetFactorSol(0);
- TGeoGlobalMagField::Instance()->GetField()->SetFactorDip(0);
+ rec.SetRunReconstruction("MUON");
- AliReconstruction *MuonRec = new AliReconstruction();
-
- MuonRec->SetInput(input.Data());
- MuonRec->SetRunVertexFinder(kFALSE);
- MuonRec->SetRunLocalReconstruction("MUON");
- MuonRec->SetRunTracking("MUON");
- MuonRec->SetFillESD(" ");
- MuonRec->SetLoadAlignData("MUON");
- MuonRec->SetNumberOfEventsPerFile(0);
- MuonRec->SetOption("MUON",recoptions.Data());
- AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetCosmicParam();
- muonRecoParam->BypassSt45(kTRUE,kFALSE);
- muonRecoParam->RequestStation(2,kFALSE);
- muonRecoParam->SetPadGoodnessMask(0x400BE80);
- TString caliboption = caliboption1;
- if ( calib == 2 ) caliboption = caliboption2;
- muonRecoParam->SetCalibrationMode(caliboption.Data());
- muonRecoParam->Print("FULL");
-
- AliMUONReconstructor::SetRecoParam(muonRecoParam);
-
- MuonRec->SetRunQA("MUON:ALL");
-
- MuonRec->Run();
-
- delete MuonRec;
+ rec.SetRunQA("MUON:ALL");
+
+ rec.SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ;
+
+ rec.SetWriteESDfriend(kTRUE);
+ rec.SetWriteAlignmentData();
+
+ rec.SetInput(gSystem->ExpandPathName(input));
+
+ rec.SetUseTrackingErrorsForAlignment("ITS");
+
+ rec.SetCleanESD(kFALSE);
+
+ rec.SetStopOnError(kFALSE);
+
+ rec.SetNumberOfEventsPerFile(500); // must set a limit otherwise time per event increases with event number (this is a "bug" of the loaders)
+
+ rec.SetOption("MUON",recoptions);
+
+ rec.SetQAWriteExpert(AliQAv1::kMUON);
+
+ if ( numberOfEvents > 0 )
+ {
+ rec.SetEventRange(0,numberOfEvents);
+ }
+
+ AliLog::Flush();
+ rec.Run();
- //gObjectTable->Print();
}