#include "AliAODFmdCluster.h"
#include "AliAODTracklets.h"
-#include "AliQADataMaker.h"
+#include "AliQADataMakerRec.h"
#include "AliGlobalQADataMaker.h"
#include "AliQA.h"
#include "AliQADataMakerSteer.h"
+#include "AliPlaneEff.h"
+
#include "AliSysInfo.h" // memory snapshots
fSetRunNumberFromDataCalled(kFALSE),
fRunQA(kTRUE),
fRunGlobalQA(kFALSE),
- fInLoopQA(kFALSE)
+ fInLoopQA(kFALSE),
+
+ fRunPlaneEff(kFALSE)
{
// create reconstruction object with default parameters
fSetRunNumberFromDataCalled(rec.fSetRunNumberFromDataCalled),
fRunQA(rec.fRunQA),
fRunGlobalQA(rec.fRunGlobalQA),
- fInLoopQA(rec.fInLoopQA)
+ fInLoopQA(rec.fInLoopQA),
+ fRunPlaneEff(rec.fRunPlaneEff)
{
// copy constructor
//_____________________________________________________________________________
-Bool_t AliReconstruction::Run(const char* input)
+Bool_t AliReconstruction::Run(const char* input, Bool_t IsOnline)
{
// run the reconstruction
AliCodeTimerAuto("")
// set the input
- if (!input) input = fInput.Data();
- TString fileName(input);
- if (fileName.EndsWith("/")) {
- fRawReader = new AliRawReaderFile(fileName);
- } else if (fileName.EndsWith(".root")) {
- fRawReader = new AliRawReaderRoot(fileName);
- } else if (!fileName.IsNull()) {
- fRawReader = new AliRawReaderDate(fileName);
- fRawReader->SelectEvents(7);
+ if (!IsOnline) {
+ if (!input) input = fInput.Data();
+ TString fileName(input);
+ if (fileName.EndsWith("/")) {
+ fRawReader = new AliRawReaderFile(fileName);
+ } else if (fileName.EndsWith(".root")) {
+ fRawReader = new AliRawReaderRoot(fileName);
+ } else if (!fileName.IsNull()) {
+ fRawReader = new AliRawReaderDate(fileName);
+ }
+ }
+ else {
+ if (!input) {
+ AliError("Null pointer to the event structure!");
+ return kFALSE;
+ }
+ fRawReader = new AliRawReaderDate((void *)input);
}
+
if (!fEquipIdMap.IsNull() && fRawReader)
fRawReader->LoadEquipmentIdsMap(fEquipIdMap);
//QA
AliQADataMakerSteer qas ;
if (fRunQA && fRawReader) qas.Run(fRunLocalReconstruction, fRawReader) ;
-
// checking the QA of previous steps
- CheckQA() ;
+ //CheckQA() ;
/*
// local reconstruction
TString detStr(fFillESD);
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
- AliQADataMaker *qadm = GetQADataMaker(iDet);
+ AliQADataMakerRec *qadm = GetQADataMaker(iDet);
if (!qadm) continue;
AliInfo(Form("Initializing the QA data maker for %s",
fgkDetectorName[iDet]));
}
}
if (fRunGlobalQA) {
- AliQADataMaker *qadm = GetQADataMaker(fgkNDetectors);
+ AliQADataMakerRec *qadm = GetQADataMaker(fgkNDetectors);
AliInfo(Form("Initializing the global QA data maker"));
TObjArray *arr=
qadm->Init(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun());
}
}
+ //Initialize the Plane Efficiency framework
+ if (fRunPlaneEff && !InitPlaneEff()) {
+ if(fStopOnError) {CleanUp(file, fileOld); return kFALSE;}
+ }
//******* The loop over events
for (Int_t iEvent = 0; iEvent < fRunLoader->GetNumberOfEvents(); iEvent++) {
TString detStr(fFillESD);
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
- AliQADataMaker *qadm = GetQADataMaker(iDet);
+ AliQADataMakerRec *qadm = GetQADataMaker(iDet);
if (!qadm) continue;
qadm->StartOfCycle(AliQA::kRECPOINTS);
qadm->StartOfCycle(AliQA::kESDS, "same") ;
}
if (fRunGlobalQA) {
- AliQADataMaker *qadm = GetQADataMaker(fgkNDetectors);
+ AliQADataMakerRec *qadm = GetQADataMaker(fgkNDetectors);
qadm->StartOfCycle(AliQA::kRECPOINTS);
}
}
TString detStr(fFillESD);
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
- AliQADataMaker * qadm = GetQADataMaker(iDet);
+ AliQADataMakerRec * qadm = GetQADataMaker(iDet);
if (!qadm) continue;
qadm->EndOfCycle(AliQA::kRECPOINTS);
qadm->EndOfCycle(AliQA::kESDS);
qadm->Finish();
}
if (fRunGlobalQA) {
- AliQADataMaker *qadm = GetQADataMaker(fgkNDetectors);
+ AliQADataMakerRec *qadm = GetQADataMaker(fgkNDetectors);
if (qadm) {
qadm->EndOfCycle(AliQA::kRECPOINTS);
qadm->Finish();
tree->Write(tree->GetName(),TObject::kOverwrite);
hlttree->Write();
+ gROOT->cd();
+ CleanUp(file, fileOld);
+
if (fWriteAOD) {
+ TFile *esdFile = TFile::Open("AliESDs.root", "READONLY");
TFile *aodFile = TFile::Open("AliAOD.root", "RECREATE");
- ESDFile2AODFile(file, aodFile);
+ ESDFile2AODFile(esdFile, aodFile);
aodFile->Close();
+ esdFile->Close();
+ }
+
+// Finish with Plane Efficiency evaluation
+ if (fRunPlaneEff && !FinishPlaneEff()) {
+ AliWarning("Finish PlaneEff evaluation failed");
}
gROOT->cd();
qas.Run(fRunTracking.Data(), AliQA::kESDS);
if (fRunGlobalQA) {
- AliQADataMaker *qadm = GetQADataMaker(fgkNDetectors);
+ AliQADataMakerRec *qadm = GetQADataMaker(fgkNDetectors);
if (qadm) {
qadm->EndOfCycle(AliQA::kRECPOINTS);
qadm->Finish();
//_____________________________________________________________________________
-Bool_t AliReconstruction::RunLocalReconstruction(const TString& detectors)
+Bool_t AliReconstruction::RunLocalReconstruction(const TString& /*detectors*/)
{
// run the local reconstruction
static Int_t eventNr=0;
// In-loop QA for local reconstrucion
if (fRunQA && fInLoopQA) {
- AliQADataMaker * qadm = GetQADataMaker(iDet);
+ AliQADataMakerRec * qadm = GetQADataMaker(iDet);
if (qadm) {
//AliCodeTimerStart
//(Form("Running QA data maker for %s", fgkDetectorName[iDet]));
AliError(Form("%s inward refit failed", fgkDetectorName[iDet]));
// return kFALSE;
}
+ // run postprocessing
+ if (fTracker[iDet]->PostProcess(esd) != 0) {
+ AliError(Form("%s postprocessing failed", fgkDetectorName[iDet]));
+ // return kFALSE;
+ }
if (fCheckPointLevel > 1) {
WriteESD(esd, Form("%s.refit", fgkDetectorName[iDet]));
}
AliTrackPoint p;
Int_t isp = 0;
Int_t isp2 = 0;
- while (isp < nspdet) {
+ while (isp2 < nspdet) {
Bool_t isvalid;
TString dets = fgkDetectorName[iDet];
if ((fUseTrackingErrorsForAlignment.CompareTo(dets) == 0) ||
}
//_____________________________________________________________________________
-AliQADataMaker * AliReconstruction::GetQADataMaker(Int_t iDet)
+AliQADataMakerRec * AliReconstruction::GetQADataMaker(Int_t iDet)
{
// get the quality assurance data maker object and the loader for a detector
if (fQADataMaker[iDet])
return fQADataMaker[iDet];
- AliQADataMaker * qadm = NULL;
- if (iDet==fgkNDetectors) { //Global QA
- qadm=new AliGlobalQADataMaker();
+ AliQADataMakerRec * qadm = NULL;
+ if (iDet == fgkNDetectors) { //Global QA
+ qadm = new AliGlobalQADataMaker();
fQADataMaker[iDet] = qadm;
return qadm;
}
// load the QA data maker object
TPluginManager* pluginManager = gROOT->GetPluginManager();
TString detName = fgkDetectorName[iDet];
- TString qadmName = "Ali" + detName + "QADataMaker";
+ TString qadmName = "Ali" + detName + "QADataMakerRec";
if (gAlice && !gAlice->GetDetector(detName) && (detName != "HLT"))
return NULL;
// first check if a plugin is defined for the quality assurance data maker
- TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName);
+ TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMakerRec", detName);
// if not, add a plugin for it
if (!pluginHandler) {
AliDebug(1, Form("defining plugin for %s", qadmName.Data()));
TString libs = gSystem->GetLibraries();
if (libs.Contains("lib" + detName + "base.so") ||
(gSystem->Load("lib" + detName + "base.so") >= 0)) {
- pluginManager->AddHandler("AliQADataMaker", detName,
+ pluginManager->AddHandler("AliQADataMakerRec", detName,
qadmName, detName + "qadm", qadmName + "()");
} else {
- pluginManager->AddHandler("AliQADataMaker", detName,
+ pluginManager->AddHandler("AliQADataMakerRec", detName,
qadmName, detName, qadmName + "()");
}
- pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName);
+ pluginHandler = pluginManager->FindHandler("AliQADataMakerRec", detName);
}
if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
- qadm = (AliQADataMaker *) pluginHandler->ExecPlugin(0);
+ qadm = (AliQADataMakerRec *) pluginHandler->ExecPlugin(0);
}
fQADataMaker[iDet] = qadm;
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr))
continue;
- AliQADataMaker * qadm = GetQADataMaker(iDet);
+ AliQADataMakerRec * qadm = GetQADataMaker(iDet);
if (!qadm)
continue;
AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
}
return index ;
}
+//_____________________________________________________________________________
+Bool_t AliReconstruction::FinishPlaneEff() {
+ //
+ // Here execute all the necessary operationis, at the end of the tracking phase,
+ // in case that evaluation of PlaneEfficiencies was required for some detector.
+ // E.g., write into a DataBase file the PlaneEfficiency which have been evaluated.
+ //
+ // This Preliminary version works only FOR ITS !!!!!
+ // other detectors (TOF,TRD, etc. have to develop their specific codes)
+ //
+ // Input: none
+ // Return: kTRUE if all operations have been done properly, kFALSE otherwise
+ //
+ Bool_t ret=kFALSE;
+ //for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < 1; iDet++) { // for the time being only ITS
+ //if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
+ //if(fReconstructor[iDet]->GetRecoParam()->GetComputePlaneEff()) continue;
+ ret=fTracker[iDet]->GetPlaneEff()->WriteIntoCDB();
+ }
+ return ret;
+}
+//_____________________________________________________________________________
+Bool_t AliReconstruction::InitPlaneEff() {
+//
+ // Here execute all the necessary operations, before of the tracking phase,
+ // for the evaluation of PlaneEfficiencies, in case required for some detectors.
+ // E.g., read from a DataBase file a first evaluation of the PlaneEfficiency
+ // which should be updated/recalculated.
+ //
+ // This Preliminary version will work only FOR ITS !!!!!
+ // other detectors (TOF,TRD, etc. have to develop their specific codes)
+ //
+ // Input: none
+ // Return: kTRUE if all operations have been done properly, kFALSE otherwise
+ //
+ AliWarning(Form("Implementation of this method not yet done !! Method return kTRUE"));
+ return kTRUE;
+}