// - raw data DATE file: DATE file name, any other non-empty string //
// - MC root files : empty string, default //
// //
+// By default all events are reconstructed. The reconstruction can be //
+// limited to a range of events by giving the index of the first and the //
+// last event as an argument to the Run method or by calling //
+// //
+// rec.SetEventRange(..., ...); //
+// //
+// The index -1 (default) can be used for the last event to indicate no //
+// upper limit of the event range. //
+// //
// The name of the galice file can be changed from the default //
// "galice.root" by passing it as argument to the AliReconstruction //
// constructor or by //
#include "AliVertexer.h"
#include "AliHeader.h"
#include "AliGenEventHeader.h"
+#include "AliPID.h"
#include "AliESDpid.h"
#include "AliMagF.h"
fRunLocalReconstruction("ALL"),
fRunVertexFinder(kTRUE),
+ fRunHLTTracking(kFALSE),
fRunTracking("ALL"),
fFillESD("ALL"),
fGAliceFileName(gAliceFilename),
fInput(""),
+ fFirstEvent(0),
+ fLastEvent(-1),
fStopOnError(kFALSE),
fCheckPointLevel(0),
fOptions(),
fLoader[iDet] = NULL;
fTracker[iDet] = NULL;
}
+ AliPID pid;
}
//_____________________________________________________________________________
fRunLocalReconstruction(rec.fRunLocalReconstruction),
fRunVertexFinder(rec.fRunVertexFinder),
+ fRunHLTTracking(rec.fRunHLTTracking),
fRunTracking(rec.fRunTracking),
fFillESD(rec.fFillESD),
fGAliceFileName(rec.fGAliceFileName),
fInput(rec.fInput),
+ fFirstEvent(rec.fFirstEvent),
+ fLastEvent(rec.fLastEvent),
fStopOnError(rec.fStopOnError),
fCheckPointLevel(0),
fOptions(),
//_____________________________________________________________________________
-Bool_t AliReconstruction::Run(const char* input)
+Bool_t AliReconstruction::Run(const char* input,
+ Int_t firstEvent, Int_t lastEvent)
{
// run the reconstruction
fRawReader->SelectEvents(7);
}
- // open the run loader
- fRunLoader = AliRunLoader::Open(fGAliceFileName.Data());
- if (!fRunLoader) {
- AliError(Form("no run loader found in file %s", fGAliceFileName.Data()));
- CleanUp();
- return kFALSE;
- }
- fRunLoader->LoadgAlice();
- AliRun* aliRun = fRunLoader->GetAliRun();
- if (!aliRun) {
- AliError(Form("no gAlice object found in file %s",
- fGAliceFileName.Data()));
- CleanUp();
- return kFALSE;
- }
- gAlice = aliRun;
- AliTracker::SetFieldMap(gAlice->Field());
+ // get the run loader
+ if (!InitRunLoader()) return kFALSE;
// local reconstruction
if (!fRunLocalReconstruction.IsNull()) {
if (fStopOnError) {CleanUp(); return kFALSE;}
}
}
- if (!fRunVertexFinder && fRunTracking.IsNull() &&
- fFillESD.IsNull()) return kTRUE;
+// if (!fRunVertexFinder && fRunTracking.IsNull() &&
+// fFillESD.IsNull()) return kTRUE;
// get vertexer
if (fRunVertexFinder && !CreateVertexer()) {
}
}
- // get loaders and trackers
+ // get trackers
if (!fRunTracking.IsNull() && !CreateTrackers(fRunTracking)) {
if (fStopOnError) {
CleanUp();
}
}
+ // get the possibly already existing ESD file and tree
+ AliESD* esd = new AliESD; AliESD* hltesd = new AliESD;
+ TFile* fileOld = NULL;
+ TTree* treeOld = NULL; TTree *hlttreeOld = NULL;
+ if (!gSystem->AccessPathName("AliESDs.root")){
+ gSystem->CopyFile("AliESDs.root", "AliESDs.old.root", kTRUE);
+ fileOld = TFile::Open("AliESDs.old.root");
+ if (fileOld && fileOld->IsOpen()) {
+ treeOld = (TTree*) fileOld->Get("esdTree");
+ if (treeOld) treeOld->SetBranchAddress("ESD", &esd);
+ hlttreeOld = (TTree*) fileOld->Get("HLTesdTree");
+ if (hlttreeOld) hlttreeOld->SetBranchAddress("ESD", &hltesd);
+ }
+ }
+
// create the ESD output file and tree
TFile* file = TFile::Open("AliESDs.root", "RECREATE");
if (!file->IsOpen()) {
AliError("opening AliESDs.root failed");
- if (fStopOnError) {CleanUp(file); return kFALSE;}
+ if (fStopOnError) {CleanUp(file, fileOld); return kFALSE;}
}
- AliESD* esd = new AliESD;
TTree* tree = new TTree("esdTree", "Tree with ESD objects");
tree->Branch("ESD", "AliESD", &esd);
- delete esd;
+ TTree* hlttree = new TTree("HLTesdTree", "Tree with HLT ESD objects");
+ hlttree->Branch("ESD", "AliESD", &hltesd);
+ delete esd; delete hltesd;
+ esd = NULL; hltesd = NULL;
gROOT->cd();
// loop over events
if (fRawReader) fRawReader->RewindEvents();
+
for (Int_t iEvent = 0; iEvent < fRunLoader->GetNumberOfEvents(); iEvent++) {
+ if (fRawReader) fRawReader->NextEvent();
+ if ((iEvent < firstEvent) || ((lastEvent >= 0) && (iEvent > lastEvent))) {
+ // copy old ESD to the new one
+ if (treeOld) {
+ treeOld->SetBranchAddress("ESD", &esd);
+ treeOld->GetEntry(iEvent);
+ }
+ tree->Fill();
+ if (hlttreeOld) {
+ hlttreeOld->SetBranchAddress("ESD", &hltesd);
+ hlttreeOld->GetEntry(iEvent);
+ }
+ hlttree->Fill();
+ continue;
+ }
+
AliInfo(Form("processing event %d", iEvent));
fRunLoader->GetEvent(iEvent);
- if (fRawReader) fRawReader->NextEvent();
char fileName[256];
sprintf(fileName, "ESD_%d.%d_final.root",
- aliRun->GetRunNumber(), aliRun->GetEvNumber());
+ fRunLoader->GetHeader()->GetRun(),
+ fRunLoader->GetHeader()->GetEventNrInRun());
if (!gSystem->AccessPathName(fileName)) continue;
- esd = new AliESD;
- esd->SetRunNumber(aliRun->GetRunNumber());
- esd->SetEventNumber(aliRun->GetEvNumber());
- esd->SetMagneticField(aliRun->Field()->SolenoidField());
+ // local reconstruction
+ if (!fRunLocalReconstruction.IsNull()) {
+ if (!RunLocalEventReconstruction(fRunLocalReconstruction)) {
+ if (fStopOnError) {CleanUp(file, fileOld); return kFALSE;}
+ }
+ }
+
+ esd = new AliESD; hltesd = new AliESD;
+ esd->SetRunNumber(fRunLoader->GetHeader()->GetRun());
+ hltesd->SetRunNumber(fRunLoader->GetHeader()->GetRun());
+ esd->SetEventNumber(fRunLoader->GetHeader()->GetEventNrInRun());
+ hltesd->SetEventNumber(fRunLoader->GetHeader()->GetEventNrInRun());
+ if (gAlice) {
+ esd->SetMagneticField(gAlice->Field()->SolenoidField());
+ hltesd->SetMagneticField(gAlice->Field()->SolenoidField());
+ } else {
+ // ???
+ }
// vertex finder
if (fRunVertexFinder) {
if (!ReadESD(esd, "vertex")) {
if (!RunVertexFinder(esd)) {
- if (fStopOnError) {CleanUp(file); return kFALSE;}
+ if (fStopOnError) {CleanUp(file, fileOld); return kFALSE;}
}
if (fCheckPointLevel > 0) WriteESD(esd, "vertex");
}
}
+ // HLT tracking
+ if (!fRunTracking.IsNull()) {
+ if (fRunHLTTracking) {
+ hltesd->SetVertex(esd->GetVertex());
+ if (!RunHLTTracking(hltesd)) {
+ if (fStopOnError) {CleanUp(file, fileOld); return kFALSE;}
+ }
+ }
+ }
+
// barrel tracking
if (!fRunTracking.IsNull()) {
if (!ReadESD(esd, "tracking")) {
if (!RunTracking(esd)) {
- if (fStopOnError) {CleanUp(file); return kFALSE;}
+ if (fStopOnError) {CleanUp(file, fileOld); return kFALSE;}
}
if (fCheckPointLevel > 0) WriteESD(esd, "tracking");
}
// fill ESD
if (!fFillESD.IsNull()) {
if (!FillESD(esd, fFillESD)) {
- if (fStopOnError) {CleanUp(file); return kFALSE;}
+ if (fStopOnError) {CleanUp(file, fileOld); return kFALSE;}
}
}
// write ESD
tree->Fill();
+ // write HLT ESD
+ hlttree->Fill();
if (fCheckPointLevel > 0) WriteESD(esd, "final");
- delete esd;
+ delete esd; delete hltesd;
+ esd = NULL; hltesd = NULL;
}
file->cd();
tree->Write();
- CleanUp(file);
+ hlttree->Write();
+ CleanUp(file, fileOld);
return kTRUE;
}
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
AliReconstructor* reconstructor = GetReconstructor(iDet);
if (!reconstructor) continue;
+ if (reconstructor->HasLocalReconstruction()) continue;
AliInfo(Form("running reconstruction for %s", fgkDetectorName[iDet]));
TStopwatch stopwatchDet;
return kTRUE;
}
+//_____________________________________________________________________________
+Bool_t AliReconstruction::RunLocalEventReconstruction(const TString& detectors)
+{
+// run the local reconstruction
+
+ TStopwatch stopwatch;
+ stopwatch.Start();
+
+ TString detStr = detectors;
+ for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
+ AliReconstructor* reconstructor = GetReconstructor(iDet);
+ if (!reconstructor) continue;
+ AliLoader* loader = fLoader[iDet];
+
+ // conversion of digits
+ if (fRawReader && reconstructor->HasDigitConversion()) {
+ AliInfo(Form("converting raw data digits into root objects for %s",
+ fgkDetectorName[iDet]));
+ TStopwatch stopwatchDet;
+ stopwatchDet.Start();
+ loader->LoadDigits("update");
+ loader->CleanDigits();
+ loader->MakeDigitsContainer();
+ TTree* digitsTree = loader->TreeD();
+ reconstructor->ConvertDigits(fRawReader, digitsTree);
+ loader->WriteDigits("OVERWRITE");
+ loader->UnloadDigits();
+ AliDebug(1, Form("execution time for %s:", fgkDetectorName[iDet]));
+ ToAliDebug(1, stopwatchDet.Print());
+ }
+
+ // local reconstruction
+ if (!reconstructor->HasLocalReconstruction()) continue;
+ AliInfo(Form("running reconstruction for %s", fgkDetectorName[iDet]));
+ TStopwatch stopwatchDet;
+ stopwatchDet.Start();
+ loader->LoadRecPoints("update");
+ loader->CleanRecPoints();
+ loader->MakeRecPointsContainer();
+ TTree* clustersTree = loader->TreeR();
+ if (fRawReader && !reconstructor->HasDigitConversion()) {
+ reconstructor->Reconstruct(fRawReader, clustersTree);
+ } else {
+ loader->LoadDigits("read");
+ TTree* digitsTree = loader->TreeD();
+ if (!digitsTree) {
+ AliError(Form("Can't get the %s digits tree", fgkDetectorName[iDet]));
+ if (fStopOnError) return kFALSE;
+ } else {
+ reconstructor->Reconstruct(digitsTree, clustersTree);
+ }
+ loader->UnloadDigits();
+ }
+ loader->WriteRecPoints("OVERWRITE");
+ loader->UnloadRecPoints();
+ AliDebug(1, Form("execution time for %s:", fgkDetectorName[iDet]));
+ ToAliDebug(1, stopwatchDet.Print());
+ }
+
+ if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
+ AliError(Form("the following detectors were not found: %s",
+ detStr.Data()));
+ if (fStopOnError) return kFALSE;
+ }
+
+ AliInfo("execution time:");
+ ToAliInfo(stopwatch.Print());
+
+ return kTRUE;
+}
+
//_____________________________________________________________________________
Bool_t AliReconstruction::RunVertexFinder(AliESD*& esd)
{
if (fVertexer) {
AliInfo("running the ITS vertex finder");
+ if (fLoader[0]) fLoader[0]->LoadRecPoints();
vertex = fVertexer->FindVertexForCurrentEvent(fRunLoader->GetEventNumber());
+ if (fLoader[0]) fLoader[0]->UnloadRecPoints();
if(!vertex){
AliWarning("Vertex not found");
vertex = new AliESDVertex();
return kTRUE;
}
+//_____________________________________________________________________________
+Bool_t AliReconstruction::RunHLTTracking(AliESD*& esd)
+{
+// run the HLT barrel tracking
+
+ TStopwatch stopwatch;
+ stopwatch.Start();
+
+ if (!fRunLoader) {
+ AliError("Missing runLoader!");
+ return kFALSE;
+ }
+
+ AliInfo("running HLT tracking");
+
+ // Get a pointer to the HLT reconstructor
+ AliReconstructor *reconstructor = GetReconstructor(fgkNDetectors-1);
+ if (!reconstructor) return kFALSE;
+
+ // TPC + ITS
+ for (Int_t iDet = 1; iDet >= 0; iDet--) {
+ TString detName = fgkDetectorName[iDet];
+ AliDebug(1, Form("%s HLT tracking", detName.Data()));
+ reconstructor->SetOption(detName.Data());
+ AliTracker *tracker = reconstructor->CreateTracker(fRunLoader);
+ if (!tracker) {
+ AliWarning(Form("couldn't create a HLT tracker for %s", detName.Data()));
+ if (fStopOnError) return kFALSE;
+ }
+ Double_t vtxPos[3];
+ Double_t vtxErr[3]={0.005,0.005,0.010};
+ const AliESDVertex *vertex = esd->GetVertex();
+ vertex->GetXYZ(vtxPos);
+ tracker->SetVertex(vtxPos,vtxErr);
+ if(iDet != 1) {
+ fLoader[iDet]->LoadRecPoints("read");
+ TTree* tree = fLoader[iDet]->TreeR();
+ if (!tree) {
+ AliError(Form("Can't get the %s cluster tree", detName.Data()));
+ return kFALSE;
+ }
+ tracker->LoadClusters(tree);
+ }
+ if (tracker->Clusters2Tracks(esd) != 0) {
+ AliError(Form("HLT %s Clusters2Tracks failed", fgkDetectorName[iDet]));
+ return kFALSE;
+ }
+ if(iDet != 1) {
+ tracker->UnloadClusters();
+ }
+ delete tracker;
+ }
+
+ AliInfo("execution time:");
+ ToAliInfo(stopwatch.Print());
+
+ return kTRUE;
+}
+
//_____________________________________________________________________________
Bool_t AliReconstruction::RunTracking(AliESD*& esd)
{
if (fCheckPointLevel > 1) {
WriteESD(esd, Form("%s.tracking", fgkDetectorName[iDet]));
}
+ // preliminary PID in TPC needed by the ITS tracker
+ if (iDet == 1) {
+ GetReconstructor(1)->FillESD(fRunLoader, esd);
+ GetReconstructor(1)->FillESD((TTree*)NULL, (TTree*)NULL, esd);
+ AliESDpid::MakePID(esd);
+ }
}
// pass 2: ALL backwards
if (!ReadESD(esd, fgkDetectorName[iDet])) {
AliDebug(1, Form("filling ESD for %s", fgkDetectorName[iDet]));
+ TTree* clustersTree = NULL;
+ if (reconstructor->HasLocalReconstruction() && fLoader[iDet]) {
+ fLoader[iDet]->LoadRecPoints("read");
+ clustersTree = fLoader[iDet]->TreeR();
+ if (!clustersTree) {
+ AliError(Form("Can't get the %s clusters tree",
+ fgkDetectorName[iDet]));
+ if (fStopOnError) return kFALSE;
+ }
+ }
+ if (fRawReader && !reconstructor->HasDigitConversion()) {
+ reconstructor->FillESD(fRawReader, clustersTree, esd);
+ } else {
+ TTree* digitsTree = NULL;
+ if (fLoader[iDet]) {
+ fLoader[iDet]->LoadDigits("read");
+ digitsTree = fLoader[iDet]->TreeD();
+ if (!digitsTree) {
+ AliError(Form("Can't get the %s digits tree",
+ fgkDetectorName[iDet]));
+ if (fStopOnError) return kFALSE;
+ }
+ }
+ reconstructor->FillESD(digitsTree, clustersTree, esd);
+ if (fLoader[iDet]) fLoader[iDet]->UnloadDigits();
+ }
+ if (reconstructor->HasLocalReconstruction() && fLoader[iDet]) {
+ fLoader[iDet]->UnloadRecPoints();
+ }
+
if (fRawReader) {
reconstructor->FillESD(fRunLoader, fRawReader, esd);
} else {
return result;
}
+//_____________________________________________________________________________
+Bool_t AliReconstruction::InitRunLoader()
+{
+// get or create the run loader
+
+ if (gAlice) delete gAlice;
+ gAlice = NULL;
+
+ if (!gSystem->AccessPathName(fGAliceFileName.Data())) { // galice.root exists
+ // load all base libraries to get the loader classes
+ TString libs = gSystem->GetLibraries();
+ for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ TString detName = fgkDetectorName[iDet];
+ if (detName == "HLT") continue;
+ if (libs.Contains("lib" + detName + "base.so")) continue;
+ gSystem->Load("lib" + detName + "base.so");
+ }
+ fRunLoader = AliRunLoader::Open(fGAliceFileName.Data());
+ if (!fRunLoader) {
+ AliError(Form("no run loader found in file %s", fGAliceFileName.Data()));
+ CleanUp();
+ return kFALSE;
+ }
+ fRunLoader->CdGAFile();
+ if (gFile->GetKey(AliRunLoader::GetGAliceName())) {
+ if (fRunLoader->LoadgAlice() == 0) {
+ gAlice = fRunLoader->GetAliRun();
+ AliTracker::SetFieldMap(gAlice->Field());
+ }
+ }
+ if (!gAlice && !fRawReader) {
+ AliError(Form("no gAlice object found in file %s",
+ fGAliceFileName.Data()));
+ CleanUp();
+ return kFALSE;
+ }
+
+ } else { // galice.root does not exist
+ if (!fRawReader) {
+ AliError(Form("the file %s does not exist", fGAliceFileName.Data()));
+ CleanUp();
+ return kFALSE;
+ }
+ fRunLoader = AliRunLoader::Open(fGAliceFileName.Data(),
+ AliConfig::GetDefaultEventFolderName(),
+ "recreate");
+ if (!fRunLoader) {
+ AliError(Form("could not create run loader in file %s",
+ fGAliceFileName.Data()));
+ CleanUp();
+ return kFALSE;
+ }
+ fRunLoader->MakeTree("E");
+ Int_t iEvent = 0;
+ while (fRawReader->NextEvent()) {
+ fRunLoader->SetEventNumber(iEvent);
+ fRunLoader->GetHeader()->Reset(fRawReader->GetRunNumber(),
+ iEvent, iEvent);
+ fRunLoader->MakeTree("H");
+ fRunLoader->TreeE()->Fill();
+ iEvent++;
+ }
+ fRawReader->RewindEvents();
+ fRunLoader->WriteHeader("OVERWRITE");
+ fRunLoader->CdGAFile();
+ fRunLoader->Write(0, TObject::kOverwrite);
+// AliTracker::SetFieldMap(???);
+ }
+
+ return kTRUE;
+}
+
//_____________________________________________________________________________
AliReconstructor* AliReconstruction::GetReconstructor(Int_t iDet)
{
-// get the reconstructor object for a detector
+// get the reconstructor object and the loader for a detector
if (fReconstructor[iDet]) return fReconstructor[iDet];
TPluginManager* pluginManager = gROOT->GetPluginManager();
TString detName = fgkDetectorName[iDet];
TString recName = "Ali" + detName + "Reconstructor";
- if (!gAlice->GetDetector(detName) && (detName != "HLT")) return NULL;
+ if (gAlice && !gAlice->GetDetector(detName) && (detName != "HLT")) return NULL;
if (detName == "HLT") {
if (!gROOT->GetClass("AliLevel3")) {
// first check if a plugin is defined for the reconstructor
TPluginHandler* pluginHandler =
pluginManager->FindHandler("AliReconstructor", detName);
- // if not, but the reconstructor class is implemented, add a plugin for it
- if (!pluginHandler && gROOT->GetClass(recName.Data())) {
+ // if not, add a plugin for it
+ if (!pluginHandler) {
AliDebug(1, Form("defining plugin for %s", recName.Data()));
- if (gSystem->Load("lib" + detName + "base.so") == 0) {
+ TString libs = gSystem->GetLibraries();
+ if (libs.Contains("lib" + detName + "base.so") ||
+ (gSystem->Load("lib" + detName + "base.so") >= 0)) {
pluginManager->AddHandler("AliReconstructor", detName,
recName, detName + "rec", recName + "()");
} else {
if (reconstructor) {
TObject* obj = fOptions.FindObject(detName.Data());
if (obj) reconstructor->SetOption(obj->GetTitle());
+ reconstructor->Init(fRunLoader);
fReconstructor[iDet] = reconstructor;
}
+ // get or create the loader
+ if (detName != "HLT") {
+ fLoader[iDet] = fRunLoader->GetLoader(detName + "Loader");
+ if (!fLoader[iDet]) {
+ AliConfig::Instance()
+ ->CreateDetectorFolders(fRunLoader->GetEventFolder(),
+ detName, detName);
+ // first check if a plugin is defined for the loader
+ TPluginHandler* pluginHandler =
+ pluginManager->FindHandler("AliLoader", detName);
+ // if not, add a plugin for it
+ if (!pluginHandler) {
+ TString loaderName = "Ali" + detName + "Loader";
+ AliDebug(1, Form("defining plugin for %s", loaderName.Data()));
+ pluginManager->AddHandler("AliLoader", detName,
+ loaderName, detName + "base",
+ loaderName + "(const char*, TFolder*)");
+ pluginHandler = pluginManager->FindHandler("AliLoader", detName);
+ }
+ if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
+ fLoader[iDet] =
+ (AliLoader*) pluginHandler->ExecPlugin(2, detName.Data(),
+ fRunLoader->GetEventFolder());
+ }
+ if (!fLoader[iDet]) { // use default loader
+ fLoader[iDet] = new AliLoader(detName, fRunLoader->GetEventFolder());
+ }
+ if (!fLoader[iDet]) {
+ AliWarning(Form("couldn't get loader for %s", detName.Data()));
+ if (fStopOnError) return NULL;
+ } else {
+ fRunLoader->AddLoader(fLoader[iDet]);
+ fRunLoader->CdGAFile();
+ if (gFile && !gFile->IsWritable()) gFile->ReOpen("UPDATE");
+ fRunLoader->Write(0, TObject::kOverwrite);
+ }
+ }
+ }
+
return reconstructor;
}
//_____________________________________________________________________________
Bool_t AliReconstruction::CreateTrackers(const TString& detectors)
{
-// get the loaders and create the trackers
+// create the trackers
TString detStr = detectors;
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
AliReconstructor* reconstructor = GetReconstructor(iDet);
if (!reconstructor) continue;
TString detName = fgkDetectorName[iDet];
- if (detName == "HLT") continue;
- fLoader[iDet] = fRunLoader->GetLoader(detName + "Loader");
- if (!fLoader[iDet]) {
- AliWarning(Form("no %s loader found", detName.Data()));
+ if (detName == "HLT") {
+ fRunHLTTracking = kTRUE;
+ continue;
+ }
+
+ fTracker[iDet] = reconstructor->CreateTracker(fRunLoader);
+ if (!fTracker[iDet] && (iDet < 7)) {
+ AliWarning(Form("couldn't create a tracker for %s", detName.Data()));
if (fStopOnError) return kFALSE;
- } else {
- fTracker[iDet] = reconstructor->CreateTracker(fRunLoader);
- if (!fTracker[iDet] && (iDet < 7)) {
- AliWarning(Form("couldn't create a tracker for %s", detName.Data()));
- if (fStopOnError) return kFALSE;
- }
}
}
}
//_____________________________________________________________________________
-void AliReconstruction::CleanUp(TFile* file)
+void AliReconstruction::CleanUp(TFile* file, TFile* fileOld)
{
// delete trackers and the run loader and close and delete the file
file->Close();
delete file;
}
+
+ if (fileOld) {
+ fileOld->Close();
+ delete fileOld;
+ gSystem->Unlink("AliESDs.old.root");
+ }
}