// The index -1 (default) can be used for the last event to indicate no //
// upper limit of the event range. //
// //
+// In case of raw-data reconstruction the user can modify the default //
+// number of events per digits/clusters/tracks file. In case the option //
+// is not used the number is set 1. In case the user provides 0, than //
+// the number of events is equal to the number of events inside the //
+// raw-data file (i.e. one digits/clusters/tracks file): //
+// //
+// rec.SetNumberOfEventsPerFile(...); //
+// //
+// //
// 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 "AliTracker.h"
#include "AliVertexer.h"
#include "AliVertexerTracks.h"
+#include "AliV0vertexer.h"
+#include "AliCascadeVertexer.h"
#include "AliHeader.h"
#include "AliGenEventHeader.h"
#include "AliPID.h"
//_____________________________________________________________________________
-const char* AliReconstruction::fgkDetectorName[AliReconstruction::fgkNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "RICH", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "START", "VZERO", "CRT", "HLT"};
+const char* AliReconstruction::fgkDetectorName[AliReconstruction::fgkNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE", "HLT"};
//_____________________________________________________________________________
AliReconstruction::AliReconstruction(const char* gAliceFilename, const char* cdbUri,
fStopOnError(kFALSE),
fWriteAlignmentData(kFALSE),
fWriteESDfriend(kFALSE),
+ fWriteAOD(kFALSE),
fFillTriggerESD(kTRUE),
fRunLocalReconstruction("ALL"),
fEquipIdMap(""),
fFirstEvent(0),
fLastEvent(-1),
+ fNumberOfEventsPerFile(1),
fCheckPointLevel(0),
fOptions(),
fLoadAlignFromCDB(kTRUE),
fStopOnError(rec.fStopOnError),
fWriteAlignmentData(rec.fWriteAlignmentData),
fWriteESDfriend(rec.fWriteESDfriend),
+ fWriteAOD(rec.fWriteAOD),
fFillTriggerESD(rec.fFillTriggerESD),
fRunLocalReconstruction(rec.fRunLocalReconstruction),
fEquipIdMap(rec.fEquipIdMap),
fFirstEvent(rec.fFirstEvent),
fLastEvent(rec.fLastEvent),
+ fNumberOfEventsPerFile(rec.fNumberOfEventsPerFile),
fCheckPointLevel(0),
fOptions(),
fLoadAlignFromCDB(rec.fLoadAlignFromCDB),
}
}
+ delete fAlignObjArray; fAlignObjArray=0;
return kTRUE;
}
TGeoManager::Import(geom.Data());
if (!gGeoManager) if (fStopOnError) return kFALSE;
}
+
+ AliCDBManager* man = AliCDBManager::Instance();
if (!MisalignGeometry(fLoadAlignData)) if (fStopOnError) return kFALSE;
// local reconstruction
AliInfo(Form("processing event %d", iEvent));
fRunLoader->GetEvent(iEvent);
- char fileName[256];
- sprintf(fileName, "ESD_%d.%d_final.root",
+ char aFileName[256];
+ sprintf(aFileName, "ESD_%d.%d_final.root",
fRunLoader->GetHeader()->GetRun(),
fRunLoader->GetHeader()->GetEventNrInRun());
- if (!gSystem->AccessPathName(fileName)) continue;
+ if (!gSystem->AccessPathName(aFileName)) continue;
// local reconstruction
if (!fRunLocalReconstruction.IsNull()) {
}
}
- esd->SetPrimaryVertex(tVertexer.FindPrimaryVertex(esd));
+ //Try to improve the reconstructed primary vertex position using the tracks
+ AliESDVertex *pvtx=tVertexer.FindPrimaryVertex(esd);
+ if (pvtx)
+ if (pvtx->GetStatus()) {
+ // Store the improved primary vertex
+ esd->SetPrimaryVertex(pvtx);
+ // Propagate the tracks to the DCA to the improved primary vertex
+ Double_t somethingbig = 777.;
+ Double_t bz = esd->GetMagneticField();
+ Int_t nt=esd->GetNumberOfTracks();
+ while (nt--) {
+ AliESDtrack *t = esd->GetTrack(nt);
+ t->RelateToVertex(pvtx, bz, somethingbig);
+ }
+ }
+ {
+ // V0 finding
+ AliV0vertexer vtxer;
+ vtxer.Tracks2V0vertices(esd);
+
+ // Cascade finding
+ AliCascadeVertexer cvtxer;
+ cvtxer.V0sTracks2CascadeVertices(esd);
+ }
+
// write ESD
if (fWriteESDfriend) {
esdf=new AliESDfriend();
tree->Write();
hlttree->Write();
+ if (fWriteAOD) {
+ CreateAOD(file);
+ }
+
// Create tags for the events in the ESD tree (the ESD tree is always present)
// In case of empty events the tags will contain dummy values
CreateTag(file);
TStopwatch stopwatch;
stopwatch.Start();
+ AliCDBManager* man = AliCDBManager::Instance();
+ Bool_t origCache = man->GetCacheFlag();
+
TString detStr = detectors;
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
AliInfo(Form("running reconstruction for %s", fgkDetectorName[iDet]));
TStopwatch stopwatchDet;
stopwatchDet.Start();
+
+ AliInfo(Form("Loading calibration data from OCDB for %s", fgkDetectorName[iDet]));
+
+ man->SetCacheFlag(kTRUE);
+ TString calibPath = Form("%s/Calib/*", fgkDetectorName[iDet]);
+ man->GetAll(calibPath); // entries are cached!
+
if (fRawReader) {
fRawReader->RewindEvents();
reconstructor->Reconstruct(fRunLoader, fRawReader);
AliInfo(Form("Execution time for %s: R:%.2fs C:%.2fs",
fgkDetectorName[iDet],
stopwatchDet.RealTime(),stopwatchDet.CpuTime()));
+
+ // unload calibration data
+ man->ClearCache();
}
+ man->SetCacheFlag(origCache);
+
if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
AliError(Form("the following detectors were not found: %s",
detStr.Data()));
iEvent++;
}
fRawReader->RewindEvents();
+ if (fNumberOfEventsPerFile > 0)
+ fRunLoader->SetNumberOfEventsPerFile(fNumberOfEventsPerFile);
+ else
+ fRunLoader->SetNumberOfEventsPerFile(iEvent);
fRunLoader->WriteHeader("OVERWRITE");
fRunLoader->CdGAFile();
fRunLoader->Write(0, TObject::kOverwrite);
if (detName == "HLT") {
if (!gROOT->GetClass("AliLevel3")) {
- gSystem->Load("libAliL3Src.so");
- gSystem->Load("libAliL3Misc.so");
- gSystem->Load("libAliL3Hough.so");
- gSystem->Load("libAliL3Comp.so");
+ gSystem->Load("libAliHLTSrc.so");
+ gSystem->Load("libAliHLTMisc.so");
+ gSystem->Load("libAliHLTHough.so");
+ gSystem->Load("libAliHLTComp.so");
}
}
->CreateDetectorFolders(fRunLoader->GetEventFolder(),
detName, detName);
// first check if a plugin is defined for the loader
- TPluginHandler* pluginHandler =
+ pluginHandler =
pluginManager->FindHandler("AliLoader", detName);
// if not, add a plugin for it
if (!pluginHandler) {
b->GetEntry(fFirstEvent);
Int_t iInitRunNumber = esd->GetRunNumber();
- Int_t iNumberOfEvents = b->GetEntries();
+ Int_t iNumberOfEvents = (Int_t)b->GetEntries();
if(fLastEvent != -1) iNumberOfEvents = fLastEvent + 1;
for (Int_t iEventNumber = fFirstEvent; iEventNumber < iNumberOfEvents; iEventNumber++) {
ntrack = 0;
tag->SetRunId(iInitRunNumber);
tag->AddEventTag(*evTag);
}
- if(fLastEvent == -1) lastEvent = b->GetEntries();
+ if(fLastEvent == -1) lastEvent = (Int_t)b->GetEntries();
else lastEvent = fLastEvent;
ttag.Fill();
delete evTag;
}
+//_____________________________________________________________________________
+void AliReconstruction::CreateAOD(TFile* esdFile)
+{
+ // do nothing for now
+
+ return;
+}
+
+
void AliReconstruction::WriteAlignmentData(AliESD* esd)
{
// Write space-points which are then used in the alignment procedures