#include "AliAODVertex.h"
#include "AliAODCluster.h"
-#include "AliQualAssDataMaker.h"
+#include "AliQADataMaker.h"
-//#include "TMemStatManager.h" // memory snapshots
#include "AliSysInfo.h" // memory snapshots
+
ClassImp(AliReconstruction)
fReconstructor[iDet] = NULL;
fLoader[iDet] = NULL;
fTracker[iDet] = NULL;
- fQualAssDataMaker[iDet] = NULL;
+ fQADataMaker[iDet] = NULL;
fQACycles[iDet] = 999999;
}
AliPID pid;
fReconstructor[iDet] = NULL;
fLoader[iDet] = NULL;
fTracker[iDet] = NULL;
- fQualAssDataMaker[iDet] = NULL;
+ fQADataMaker[iDet] = NULL;
fQACycles[iDet] = rec.fQACycles[iDet];
}
for (Int_t i = 0; i < rec.fSpecCDBUri.GetEntriesFast(); i++) {
ProcInfo_t ProcInfo;
gSystem->GetProcInfo(&ProcInfo);
AliInfo(Form("Current memory usage %d %d", ProcInfo.fMemResident, ProcInfo.fMemVirtual));
+
+ // checking the QA of previous steps
+ CheckQA() ;
+
for (Int_t iEvent = 0; iEvent < fRunLoader->GetNumberOfEvents(); iEvent++) {
if (fRawReader) fRawReader->NextEvent();
if ((iEvent < fFirstEvent) || ((fLastEvent >= 0) && (iEvent > fLastEvent))) {
}
if (!fFillESD.IsNull())
- RunQualAss(fFillESD.Data(), esd);
+ RunQA(fFillESD.Data(), esd);
// fill Event header information from the RawEventHeader
if (fRawReader){FillRawEventHeaderESD(esd);}
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr))
continue;
- AliQualAssDataMaker * qadm = GetQualAssDataMaker(iDet);
+ AliQADataMaker * qadm = GetQADataMaker(iDet);
if (!qadm) continue;
- qadm->EndOfCycle(AliQualAss::kRECPOINTS);
- qadm->EndOfCycle(AliQualAss::kESDS);
- qadm->Finish(AliQualAss::kRECPOINTS);
- qadm->Finish(AliQualAss::kESDS) ;
+ qadm->EndOfCycle(AliQA::kRECPOINTS);
+ qadm->EndOfCycle(AliQA::kESDS);
+ qadm->Finish(AliQA::kRECPOINTS);
+ qadm->Finish(AliQA::kESDS) ;
}
tree->GetUserInfo()->Add(esd);
file->cd();
if (fWriteESDfriend)
tree->SetBranchStatus("ESDfriend*",0);
- tree->Write();
+ // we want to have only one tree version number
+ tree->Write(tree->GetName(),TObject::kOverwrite);
hlttree->Write();
if (fWriteAOD) {
loader->UnloadDigits();
}
- AliQualAssDataMaker * qadm = GetQualAssDataMaker(iDet);
+ AliQADataMaker * qadm = GetQADataMaker(iDet);
if (qadm) {
AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
- if (qadm->IsCycleDone() ) {
- qadm->EndOfCycle(AliQualAss::kRECPOINTS) ;
- qadm->EndOfCycle(AliQualAss::kESDS) ;
- qadm->StartOfCycle(AliQualAss::kRECPOINTS) ;
- qadm->StartOfCycle(AliQualAss::kESDS, "same") ;
- }
- qadm->Exec(AliQualAss::kRECPOINTS, clustersTree) ;
+ if (qadm->IsCycleDone() ) {
+ qadm->EndOfCycle(AliQA::kRECPOINTS) ;
+ qadm->EndOfCycle(AliQA::kESDS) ;
+ qadm->StartOfCycle(AliQA::kRECPOINTS) ;
+ qadm->StartOfCycle(AliQA::kESDS, "same") ;
+ }
+ qadm->Exec(AliQA::kRECPOINTS, clustersTree) ;
AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
}
loader->WriteRecPoints("OVERWRITE");
loader->UnloadRecPoints();
- AliSysInfo::AddStamp(Form("LRec%s_%d",fgkDetectorName[iDet],eventNr));
+ AliSysInfo::AddStamp(Form("LRec%s_%d",fgkDetectorName[iDet],eventNr), iDet,1,eventNr);
}
if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
// load clusters
fLoader[iDet]->LoadRecPoints("read");
+ AliSysInfo::AddStamp(Form("RLoadCluster%s_%d",fgkDetectorName[iDet],eventNr),iDet,1, eventNr);
TTree* tree = fLoader[iDet]->TreeR();
if (!tree) {
AliError(Form("Can't get the %s cluster tree", fgkDetectorName[iDet]));
return kFALSE;
}
fTracker[iDet]->LoadClusters(tree);
-
+ AliSysInfo::AddStamp(Form("TLoadCluster%s_%d",fgkDetectorName[iDet],eventNr), iDet,2, eventNr);
// run tracking
if (fTracker[iDet]->Clusters2Tracks(esd) != 0) {
AliError(Form("%s Clusters2Tracks failed", fgkDetectorName[iDet]));
GetReconstructor(1)->FillESD((TTree*)NULL, (TTree*)NULL, esd);
AliESDpid::MakePID(esd);
}
- AliSysInfo::AddStamp(Form("Tracking0%s_%d",fgkDetectorName[iDet],eventNr));
+ AliSysInfo::AddStamp(Form("Tracking0%s_%d",fgkDetectorName[iDet],eventNr), iDet,3,eventNr);
}
// pass 2: ALL backwards
if (iDet > 1) { // all except ITS, TPC
TTree* tree = NULL;
fLoader[iDet]->LoadRecPoints("read");
+ AliSysInfo::AddStamp(Form("RLoadCluster0%s_%d",fgkDetectorName[iDet],eventNr), iDet,1, eventNr);
tree = fLoader[iDet]->TreeR();
if (!tree) {
AliError(Form("Can't get the %s cluster tree", fgkDetectorName[iDet]));
return kFALSE;
}
fTracker[iDet]->LoadClusters(tree);
- AliSysInfo::AddStamp(Form("LoadCluster0%s_%d",fgkDetectorName[iDet],eventNr));
+ AliSysInfo::AddStamp(Form("TLoadCluster0%s_%d",fgkDetectorName[iDet],eventNr), iDet,2, eventNr);
}
// run tracking
GetReconstructor(1)->FillESD((TTree*)NULL, (TTree*)NULL, esd);
AliESDpid::MakePID(esd);
}
- AliSysInfo::AddStamp(Form("Tracking1%s_%d",fgkDetectorName[iDet],eventNr));
+ AliSysInfo::AddStamp(Form("Tracking1%s_%d",fgkDetectorName[iDet],eventNr), iDet,3, eventNr);
}
// write space-points to the ESD in case alignment data output
if (fCheckPointLevel > 1) {
WriteESD(esd, Form("%s.refit", fgkDetectorName[iDet]));
}
-
+ AliSysInfo::AddStamp(Form("Tracking2%s_%d",fgkDetectorName[iDet],eventNr), iDet,3, eventNr);
// unload clusters
fTracker[iDet]->UnloadClusters();
+ AliSysInfo::AddStamp(Form("TUnloadCluster%s_%d",fgkDetectorName[iDet],eventNr), iDet,4, eventNr);
fLoader[iDet]->UnloadRecPoints();
- AliSysInfo::AddStamp(Form("Tracking2%s_%d",fgkDetectorName[iDet],eventNr));
+ AliSysInfo::AddStamp(Form("RUnloadCluster%s_%d",fgkDetectorName[iDet],eventNr), iDet,5, eventNr);
}
//
// Propagate track to the vertex - if not done by ITS
detStr.Data()));
if (fStopOnError) return kFALSE;
}
- AliSysInfo::AddStamp(Form("FillESD%d",eventNr));
+ AliSysInfo::AddStamp(Form("FillESD%d",eventNr), 0,1, eventNr);
eventNr++;
return kTRUE;
}
AliWarning(Form("couldn't create a tracker for %s", detName.Data()));
if (fStopOnError) return kFALSE;
}
+ AliSysInfo::AddStamp(Form("LTracker%s",fgkDetectorName[iDet]), iDet,0);
}
return kTRUE;
fLoader[iDet] = NULL;
delete fTracker[iDet];
fTracker[iDet] = NULL;
- delete fQualAssDataMaker[iDet];
- fQualAssDataMaker[iDet] = NULL;
+ delete fQADataMaker[iDet];
+ fQADataMaker[iDet] = NULL;
}
delete fVertexer;
fVertexer = NULL;
AliAODTrack *primTrack = NULL;
Char_t ttype=AliAODCluster::kUndef;
- if (cluster->IsPHOS()) ttype=AliAODCluster::kPHOSNeutral;
- else if (cluster->IsEMCAL()) {
-
- if (cluster->GetClusterType() == AliESDCaloCluster::kPseudoCluster)
- ttype = AliAODCluster::kEMCALPseudoCluster;
- else
- ttype = AliAODCluster::kEMCALClusterv1;
-
+ if (cluster->GetClusterType() == AliESDCaloCluster::kPHOSCluster){
+ ttype = AliAODCluster::kPHOSNeutral;
}
+ else if (cluster->GetClusterType() == AliESDCaloCluster::kEMCALClusterv1){
+ ttype = AliAODCluster::kEMCALClusterv1;
+ }
+ else if (cluster->GetClusterType() == AliESDCaloCluster::kEMCALPseudoCluster){
+ ttype = AliAODCluster::kEMCALPseudoCluster;
+ }
new(clusters[jClusters++]) AliAODCluster(id,
label,
out.close();
}
+
+
//_____________________________________________________________________________
-AliQualAssDataMaker * AliReconstruction::GetQualAssDataMaker(Int_t iDet)
+AliQADataMaker * AliReconstruction::GetQADataMaker(Int_t iDet)
{
// get the quality assurance data maker object and the loader for a detector
- if (fQualAssDataMaker[iDet])
- return fQualAssDataMaker[iDet];
+ if (fQADataMaker[iDet])
+ return fQADataMaker[iDet];
// load the QA data maker object
TPluginManager* pluginManager = gROOT->GetPluginManager();
TString detName = fgkDetectorName[iDet];
- TString qadmName = "Ali" + detName + "QualAssDataMaker";
+ TString qadmName = "Ali" + detName + "QADataMaker";
if (gAlice && !gAlice->GetDetector(detName) && (detName != "HLT"))
return NULL;
- AliQualAssDataMaker * qadm = NULL;
+ AliQADataMaker * qadm = NULL;
// first check if a plugin is defined for the quality assurance data maker
- TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQualAssDataMaker", detName);
+ TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMaker", 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("AliQualAssDataMaker", detName,
+ pluginManager->AddHandler("AliQADataMaker", detName,
qadmName, detName + "qadm", qadmName + "()");
} else {
- pluginManager->AddHandler("AliQualAssDataMaker", detName,
+ pluginManager->AddHandler("AliQADataMaker", detName,
qadmName, detName, qadmName + "()");
}
- pluginHandler = pluginManager->FindHandler("AliQualAssDataMaker", detName);
+ pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName);
}
if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
- qadm = (AliQualAssDataMaker *) pluginHandler->ExecPlugin(0);
+ qadm = (AliQADataMaker *) pluginHandler->ExecPlugin(0);
}
if (qadm) {
AliInfo(Form("Initializing quality assurance data maker for %s", fgkDetectorName[iDet]));
- qadm->Init(AliQualAss::kRECPOINTS, fRunLoader->GetHeader()->GetRun(), GetQACycles(fgkDetectorName[iDet]));
- qadm->Init(AliQualAss::kESDS, fRunLoader->GetHeader()->GetRun(), GetQACycles(fgkDetectorName[iDet]));
- qadm->StartOfCycle(AliQualAss::kRECPOINTS);
- qadm->StartOfCycle(AliQualAss::kESDS, "same") ;
- fQualAssDataMaker[iDet] = qadm;
+ qadm->Init(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun(), GetQACycles(fgkDetectorName[iDet]));
+ qadm->StartOfCycle(AliQA::kRECPOINTS);
+ qadm->Init(AliQA::kESDS, AliCDBManager::Instance()->GetRun());
+ qadm->StartOfCycle(AliQA::kESDS, "same") ;
+ fQADataMaker[iDet] = qadm;
}
return qadm;
}
//_____________________________________________________________________________
-Bool_t AliReconstruction::RunQualAss(const char* detectors, AliESDEvent *& esd)
+Bool_t AliReconstruction::RunQA(const char* detectors, AliESDEvent *& esd)
{
// run the Quality Assurance data producer
for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr))
continue;
- AliQualAssDataMaker * qadm = GetQualAssDataMaker(iDet);
+ AliQADataMaker * qadm = GetQADataMaker(iDet);
if (!qadm)
continue;
AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
- qadm->Exec(AliQualAss::kESDS, esd) ;
+ qadm->Exec(AliQA::kESDS, esd) ;
qadm->Increment() ;
AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
return kTRUE;
+}
+
+//_____________________________________________________________________________
+void AliReconstruction::CheckQA()
+{
+// check the QA of SIM for this run and remove the detectors
+// with status Fatal
+
+ TString newDetList ;
+ for (Int_t iDet = 0; iDet < AliQA::kNDET; iDet++) {
+ TString detName(AliQA::GetDetName(iDet)) ;
+ if ( fRunLocalReconstruction.Contains(AliQA::GetDetName(iDet)) ||
+ fRunLocalReconstruction.Contains("ALL") ) {
+ AliQA * qa = AliQA::Instance(AliQA::DETECTORINDEX(iDet)) ;
+ if ( qa->IsSet(AliQA::DETECTORINDEX(iDet), AliQA::kSIM, AliQA::kFATAL)) {
+ AliInfo(Form("QA status for %s in Hits and/or SDIGITS and/or Digits was Fatal; No reconstruction performed", detName.Data())) ;
+ } else if ( qa->IsSet(AliQA::DETECTORINDEX(iDet), AliQA::kSIM, AliQA::kERROR)) {
+ AliError(Form("QA status for %s in Hits and/or SDIGITS and/or Digits was ERROR", detName.Data())) ;
+ newDetList += detName ;
+ newDetList += " " ;
+ } else if ( qa->IsSet(AliQA::DETECTORINDEX(iDet), AliQA::kSIM, AliQA::kWARNING) ) {
+ AliWarning(Form("QA status for %s in Hits and/or SDIGITS and/or Digits was WARNING", detName.Data())) ;
+ newDetList += detName ;
+ newDetList += " " ;
+ } else if ( qa->IsSet(AliQA::DETECTORINDEX(iDet), AliQA::kSIM, AliQA::kINFO) ) {
+ AliInfo(Form("QA status for %s in Hits and/or SDIGITS and/or Digits was INFO", detName.Data())) ;
+ newDetList += detName ;
+ newDetList += " " ;
+ }
+ }
+ }
+ fRunLocalReconstruction = newDetList ;
}
//_____________________________________________________________________________