From b03591abb5137fef7e83b911f1fdd16441444755 Mon Sep 17 00:00:00 2001 From: schutz Date: Sat, 21 Feb 2009 22:04:32 +0000 Subject: [PATCH] Replace QADataMakerSteer by QAManager deriving from CDBManager --- STEER/AliCDBManager.cxx | 2 +- STEER/AliCDBManager.h | 11 +++++--- STEER/AliQAChecker.cxx | 14 ++++++---- STEER/AliReconstruction.cxx | 56 ++++++++++++++++++------------------- STEER/AliReconstruction.h | 4 +-- STEER/AliSimulation.cxx | 22 +++++++-------- STEER/AliSimulation.h | 8 +++--- STEER/CMake_libSTEER.txt | 2 +- STEER/STEERLinkDef.h | 2 +- STEER/libSTEER.pkg | 2 +- 10 files changed, 64 insertions(+), 59 deletions(-) diff --git a/STEER/AliCDBManager.cxx b/STEER/AliCDBManager.cxx index 0bcc8530e52..49ee4f37ea0 100644 --- a/STEER/AliCDBManager.cxx +++ b/STEER/AliCDBManager.cxx @@ -185,7 +185,6 @@ AliCDBParam* AliCDBManager::CreateParameter(const char* dbString) const { // create AliCDBParam object from URI string TIter iter(&fFactories); - AliCDBStorageFactory* factory=0; while ((factory = (AliCDBStorageFactory*) iter.Next())) { AliCDBParam* param = factory->CreateParameter(dbString); @@ -330,6 +329,7 @@ void AliCDBManager::SetDefaultStorage(const char* dbString) { if (fStorageMap->Contains("default")) { delete fStorageMap->Remove(fStorageMap->GetValue("default")); } + fStorageMap->Add(new TObjString("default"), new TObjString(fDefaultStorage->GetURI())); } diff --git a/STEER/AliCDBManager.h b/STEER/AliCDBManager.h index bfa1ce230ac..c3d9a8bcbe1 100644 --- a/STEER/AliCDBManager.h +++ b/STEER/AliCDBManager.h @@ -119,12 +119,15 @@ class AliCDBManager: public TObject { static AliCDBManager* Instance(TMap *entryCache = NULL, Int_t run = -1); - private: + void Init(); + void InitFromCache(TMap *entryCache, Int_t run); + +protected: static TString fgkCondUri; // URI of the Conditions data base folder static TString fgkRefUri; // URI of the Reference data base folder - AliCDBManager(); + AliCDBManager() ; AliCDBManager(const AliCDBManager & source); AliCDBManager & operator=(const AliCDBManager & source); @@ -138,9 +141,9 @@ class AliCDBManager: public TObject { AliCDBParam* SelectSpecificStorage(const TString& path); - void Init(); +// void Init(); void InitShortLived(); - void InitFromCache(TMap *entryCache, Int_t run); +// void InitFromCache(TMap *entryCache, Int_t run); TList fFactories; //! list of registered storage factories diff --git a/STEER/AliQAChecker.cxx b/STEER/AliQAChecker.cxx index 64361548404..9c7256ab997 100644 --- a/STEER/AliQAChecker.cxx +++ b/STEER/AliQAChecker.cxx @@ -22,7 +22,7 @@ /////////////////////////////////////////////////////////////////////////////// #include "AliCDBEntry.h" -#include "AliCDBManager.h" +#include "AliQAManager.h" #include "AliCDBStorage.h" #include "AliRunInfo.h" #include "AliLog.h" @@ -175,7 +175,7 @@ void AliQAChecker::GetRefSubDir(const char * det, const char * task, TDirectory AliError(Form("%s is not a valid location for reference data", refStorage.Data())) ; return ; } else { - AliCDBManager* man = AliCDBManager::Instance() ; + AliQAManager* manQA = AliQAManager::QAManager() ; for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { if ( !AliQA::Instance()->IsEventSpecieSet(specie) ) continue ; @@ -185,12 +185,14 @@ void AliQAChecker::GetRefSubDir(const char * det, const char * task, TDirectory // LoadRunInfoFromGRP() ; AliQA::SetQARefDataDirName(specie) ; //} - if ( ! man->GetLock() ) { - man->SetDefaultStorage(AliQA::GetQARefStorage()) ; - man->SetSpecificStorage("*", AliQA::GetQARefStorage()) ; + if ( ! manQA->GetLock() ) { + manQA->SetDefaultStorage(AliQA::GetQARefStorage()) ; + manQA->SetSpecificStorage("*", AliQA::GetQARefStorage()) ; + manQA->SetRun(AliCDBManager::Instance()->GetRun()) ; + manQA->SetLock() ; } char * detOCDBDir = Form("%s/%s/%s", det, AliQA::GetRefOCDBDirName(), AliQA::GetRefDataDirName()) ; - AliCDBEntry * entry = man->Get(detOCDBDir, man->GetRun()) ; + AliCDBEntry * entry = manQA->Get(detOCDBDir, manQA->GetRun()) ; if (entry) { dirOCDB = new TObjArray*[AliRecoParam::kNSpecies] ; TList * listDetQAD = dynamic_cast(entry->GetObject()) ; diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index eba15b41554..1e3c1e6262f 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -164,7 +164,7 @@ #include "AliPlaneEff.h" #include "AliQA.h" #include "AliQADataMakerRec.h" -#include "AliQADataMakerSteer.h" +#include "AliQAManager.h" #include "AliRawEvent.h" #include "AliRawEventHeaderBase.h" #include "AliRawHLTManager.h" @@ -248,7 +248,7 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename) : fInitCDBCalled(kFALSE), fSetRunNumberFromDataCalled(kFALSE), fQADetectors("ALL"), - fQASteer(NULL), + fQAManager(NULL), fQATasks("ALL"), fRunQA(kTRUE), fRunGlobalQA(kTRUE), @@ -340,7 +340,7 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) : fInitCDBCalled(rec.fInitCDBCalled), fSetRunNumberFromDataCalled(rec.fSetRunNumberFromDataCalled), fQADetectors(rec.fQADetectors), - fQASteer(NULL), + fQAManager(NULL), fQATasks(rec.fQATasks), fRunQA(rec.fRunQA), fRunGlobalQA(rec.fRunGlobalQA), @@ -469,7 +469,7 @@ AliReconstruction& AliReconstruction::operator = (const AliReconstruction& rec) fInitCDBCalled = rec.fInitCDBCalled; fSetRunNumberFromDataCalled = rec.fSetRunNumberFromDataCalled; fQADetectors = rec.fQADetectors; - fQASteer = NULL; + fQAManager = NULL; fQATasks = rec.fQATasks; fRunQA = rec.fRunQA; fRunGlobalQA = rec.fRunGlobalQA; @@ -503,7 +503,7 @@ AliReconstruction::~AliReconstruction() delete fAlignObjArray; } fSpecCDBUri.Delete(); - delete fQASteer; + delete fQAManager; AliCodeTimer::Instance()->Print(); } @@ -934,7 +934,6 @@ Bool_t AliReconstruction::InitGRP() { } fRunInfo = new AliRunInfo(lhcState, beamType, beamEnergy, runType, activeDetectors); - printf("qqqqqqqqqqqqqqqqqqqqqqq %s %s %f %s %d\n", lhcState.Data(), beamType.Data(), beamEnergy, runType.Data(), activeDetectors); fRunInfo->Dump(); @@ -1394,22 +1393,23 @@ void AliReconstruction::SlaveBegin(TTree*) //QA //Initialize the QA and start of cycle if (fRunQA) { - fQASteer = new AliQADataMakerSteer("rec") ; - fQASteer->SetActiveDetectors(fQADetectors) ; + fQAManager = AliQAManager::QAManager("rec") ; + fQAManager->SetActiveDetectors(fQADetectors) ; for (Int_t det = 0 ; det < AliQA::kNDET ; det++) { - fQASteer->SetCycleLength(AliQA::DETECTORINDEX_t(det), fQACycles[det]) ; - fQASteer->SetWriteExpert(AliQA::DETECTORINDEX_t(det)) ; + fQAManager->SetCycleLength(AliQA::DETECTORINDEX_t(det), fQACycles[det]) ; + fQAManager->SetWriteExpert(AliQA::DETECTORINDEX_t(det)) ; } if (!fRawReader && fQATasks.Contains(AliQA::kRAWS)) fQATasks.ReplaceAll(Form("%d",AliQA::kRAWS), "") ; - fQASteer->SetTasks(fQATasks) ; - fQASteer->InitQADataMaker(AliCDBManager::Instance()->GetRun()) ; + fQAManager->SetTasks(fQATasks) ; + fQAManager->InitQADataMaker(AliCDBManager::Instance()->GetRun()) ; } if (fRunGlobalQA) { Bool_t sameCycle = kFALSE ; - if (!fQASteer) fQASteer = new AliQADataMakerSteer("rec") ; - AliQADataMaker *qadm = fQASteer->GetQADataMaker(AliQA::kGLOBAL); + if (!fQAManager) + fQAManager = AliQAManager::QAManager("rec") ; + AliQADataMaker *qadm = fQAManager->GetQADataMaker(AliQA::kGLOBAL); AliInfo(Form("Initializing the global QA data maker")); if (fQATasks.Contains(Form("%d", AliQA::kRECPOINTS))) { qadm->StartOfCycle(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun(), sameCycle) ; @@ -1505,7 +1505,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet); reconstructor->SetRecoParam(par); if (fRunQA) { - fQASteer->SetRecoParam(iDet, par) ; + fQAManager->SetRecoParam(iDet, par) ; } } } @@ -1513,8 +1513,8 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) // QA on single raw if (fRunQA) { - fQASteer->SetEventSpecie(fRecoParam.GetEventSpecie()) ; - fQASteer->RunOneEvent(fRawReader) ; + fQAManager->SetEventSpecie(fRecoParam.GetEventSpecie()) ; + fQAManager->RunOneEvent(fRawReader) ; } // local single event reconstruction if (!fRunLocalReconstruction.IsNull()) { @@ -1731,15 +1731,15 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) if (fCleanESD) CleanESD(fesd); if (fRunQA) { - fQASteer->SetEventSpecie(fRecoParam.GetEventSpecie()) ; - fQASteer->RunOneEvent(fesd) ; + fQAManager->SetEventSpecie(fRecoParam.GetEventSpecie()) ; + fQAManager->RunOneEvent(fesd) ; } if (fRunGlobalQA) { - AliQADataMaker *qadm = fQASteer->GetQADataMaker(AliQA::kGLOBAL); + AliQADataMaker *qadm = fQAManager->GetQADataMaker(AliQA::kGLOBAL); qadm->SetEventSpecie(fRecoParam.GetEventSpecie()) ; - if (qadm && fQATasks.Contains(Form("%d", AliQA::kESDS))) - qadm->Exec(AliQA::kESDS, fesd); - } + if (qadm && fQATasks.Contains(Form("%d", AliQA::kESDS))) + qadm->Exec(AliQA::kESDS, fesd); + } if (fWriteESDfriend) { // fesdf->~AliESDfriend(); @@ -1779,7 +1779,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) } if (fRunQA || fRunGlobalQA) - fQASteer->Increment() ; + fQAManager->Increment() ; return kTRUE; } @@ -1843,10 +1843,10 @@ void AliReconstruction::SlaveTerminate() // End of cycle for the in-loop if (fRunQA) - fQASteer->EndOfCycle() ; + fQAManager->EndOfCycle() ; if (fRunGlobalQA) { - AliQADataMaker *qadm = fQASteer->GetQADataMaker(AliQA::kGLOBAL); + AliQADataMaker *qadm = fQAManager->GetQADataMaker(AliQA::kGLOBAL); if (qadm) { if (fQATasks.Contains(Form("%d", AliQA::kRECPOINTS))) qadm->EndOfCycle(AliQA::kRECPOINTS); @@ -1939,8 +1939,8 @@ Bool_t AliReconstruction::RunLocalEventReconstruction(const TString& detectors) TString detQAStr(fQADetectors) ; if (fRunQA) { - fQASteer->SetEventSpecie(fRecoParam.GetEventSpecie()) ; - fQASteer->RunOneEventInOneDetector(iDet, clustersTree) ; + fQAManager->SetEventSpecie(fRecoParam.GetEventSpecie()) ; + fQAManager->RunOneEventInOneDetector(iDet, clustersTree) ; } loader->WriteRecPoints("OVERWRITE"); loader->UnloadRecPoints(); diff --git a/STEER/AliReconstruction.h b/STEER/AliReconstruction.h index 3b3ea784b8b..4b71cdc1db8 100644 --- a/STEER/AliReconstruction.h +++ b/STEER/AliReconstruction.h @@ -35,7 +35,7 @@ class AliVertexerTracks; class TFile; class TTree; class TList; -class AliQADataMakerSteer; +class AliQAManager; class TMap; class AliRecoParam; class AliDetectorRecoParam; @@ -264,7 +264,7 @@ private: Int_t fQACycles[ AliQA::kNDET]; // # events over which QA data are accumulated Bool_t fQAWriteExpert[AliQA::kNDET]; // Flag to save or not expert QA data TString fQADetectors ; // list of detectors to be QA'ed - AliQADataMakerSteer * fQASteer ; //! steering class to run QA + AliQAManager * fQAManager ; //! steering class to run QA TString fQATasks ; // list of QA tasks to be performed Bool_t fRunQA ; // Run QA flag Bool_t fRunGlobalQA; // Run global QA flag diff --git a/STEER/AliSimulation.cxx b/STEER/AliSimulation.cxx index 77ff6f9eff8..07e0fb4af2f 100644 --- a/STEER/AliSimulation.cxx +++ b/STEER/AliSimulation.cxx @@ -191,7 +191,7 @@ AliSimulation::AliSimulation(const char* configFileName, fLego(NULL), fQADetectors("ALL"), fQATasks("ALL"), - fQASteer(NULL), + fQAManager(NULL), fRunQA(kTRUE), fEventSpecie(AliRecoParam::kDefault), fRunHLT("default"), @@ -202,10 +202,10 @@ AliSimulation::AliSimulation(const char* configFileName, SetGAliceFile("galice.root"); // for QA - fQASteer = new AliQADataMakerSteer("sim") ; - fQASteer->SetActiveDetectors(fQADetectors) ; + fQAManager = AliQAManager::QAManager("sim") ; + fQAManager->SetActiveDetectors(fQADetectors) ; fQATasks = Form("%d %d %d", AliQA::kHITS, AliQA::kSDIGITS, AliQA::kDIGITS) ; - fQASteer->SetTasks(fQATasks) ; + fQAManager->SetTasks(fQATasks) ; } //_____________________________________________________________________________ @@ -225,7 +225,7 @@ AliSimulation::~AliSimulation() fSpecCDBUri.Delete(); if (fgInstance==this) fgInstance = 0; - delete fQASteer ; + delete fQAManager ; AliCodeTimer::Instance()->Print(); } @@ -1983,12 +1983,12 @@ Bool_t AliSimulation::RunQA() // run the QA on summable hits, digits or digits if(!gAlice) return kFALSE; - fQASteer->SetRunLoader(AliRunLoader::Instance()) ; + fQAManager->SetRunLoader(AliRunLoader::Instance()) ; TString detectorsw("") ; Bool_t rv = kTRUE ; - fQASteer->SetEventSpecie(fEventSpecie) ; - detectorsw = fQASteer->Run(fQADetectors.Data()) ; + fQAManager->SetEventSpecie(fEventSpecie) ; + detectorsw = fQAManager->Run(fQADetectors.Data()) ; if ( detectorsw.IsNull() ) rv = kFALSE ; return rv ; @@ -2035,10 +2035,10 @@ Bool_t AliSimulation::SetRunQA(TString detAndAction) tempo.ReplaceAll(Form("%d", AliQA::kDIGITS), AliQA::GetTaskName(AliQA::kDIGITS)) ; AliInfo( Form("QA will be done on \"%s\" for \"%s\"\n", fQADetectors.Data(), tempo.Data()) ) ; fRunQA = kTRUE ; - fQASteer->SetActiveDetectors(fQADetectors) ; - fQASteer->SetTasks(fQATasks) ; + fQAManager->SetActiveDetectors(fQADetectors) ; + fQAManager->SetTasks(fQATasks) ; for (Int_t det = 0 ; det < AliQA::kNDET ; det++) - fQASteer->SetWriteExpert(AliQA::DETECTORINDEX_t(det)) ; + fQAManager->SetWriteExpert(AliQA::DETECTORINDEX_t(det)) ; return kTRUE; } diff --git a/STEER/AliSimulation.h b/STEER/AliSimulation.h index 8349af1b149..f7121d15de0 100644 --- a/STEER/AliSimulation.h +++ b/STEER/AliSimulation.h @@ -16,7 +16,7 @@ #include #include #include "AliQA.h" -#include "AliQADataMakerSteer.h" +#include "AliQAManager.h" class AliCDBId; class AliCDBParam; @@ -112,10 +112,10 @@ public: //Quality Assurance Int_t GetDetIndex(const char * detector); - void SetQACycles(AliQA::DETECTORINDEX_t det, const Int_t cycles) { fQASteer->SetCycleLength(det, cycles) ; } + void SetQACycles(AliQA::DETECTORINDEX_t det, const Int_t cycles) { fQAManager->SetCycleLength(det, cycles) ; } Bool_t RunQA() ; Bool_t SetRunQA(TString detAndAction="ALL:ALL") ; - void SetQAWriteExpert(AliQA::DETECTORINDEX_t det) { fQASteer->SetWriteExpert(det) ; } + void SetQAWriteExpert(AliQA::DETECTORINDEX_t det) { fQAManager->SetWriteExpert(det) ; } void SetWriteGRPEntry(Bool_t flag = kTRUE) { fWriteGRPEntry = flag; } void WriteGRPEntry(); @@ -175,7 +175,7 @@ private: static const char * fgkDetectorName[fgkNDetectors] ; // names of detectors TString fQADetectors ; // list of detectors to be QA'ed TString fQATasks ; // list of QA tasks to be performed - AliQADataMakerSteer * fQASteer ; // steering object to run QA + AliQAManager * fQAManager ; // steering object to run QA Bool_t fRunQA ; // Runs the QA at the end of simulation AliRecoParam::EventSpecie_t fEventSpecie ; // type of event (see AliRecoParam::EventSpecie_t) diff --git a/STEER/CMake_libSTEER.txt b/STEER/CMake_libSTEER.txt index 59e235e5659..1d29319e88d 100644 --- a/STEER/CMake_libSTEER.txt +++ b/STEER/CMake_libSTEER.txt @@ -53,7 +53,7 @@ AliGlobalQADataMaker.cxx AliQADataMakerSim.cxx AliQADataMakerRec.cxx AliCorrQADataMakerRec.cxx -AliQADataMakerSteer.cxx +AliQAManager.cxx AliQAChecker.cxx AliCorrQAChecker.cxx AliGlobalQAChecker.cxx diff --git a/STEER/STEERLinkDef.h b/STEER/STEERLinkDef.h index 31fa36fe7c7..4621ca3116b 100644 --- a/STEER/STEERLinkDef.h +++ b/STEER/STEERLinkDef.h @@ -123,7 +123,7 @@ #pragma link C++ class AliQADataMakerRec+; #pragma link C++ class AliCorrQADataMakerRec+; #pragma link C++ class AliGlobalQADataMaker+; -#pragma link C++ class AliQADataMakerSteer+; +#pragma link C++ class AliQAManager+; #pragma link C++ class AliQAChecker+; #pragma link C++ class AliCorrQAChecker+; #pragma link C++ class AliGlobalQAChecker+; diff --git a/STEER/libSTEER.pkg b/STEER/libSTEER.pkg index 8cea5825814..f54f4818ba2 100644 --- a/STEER/libSTEER.pkg +++ b/STEER/libSTEER.pkg @@ -53,7 +53,7 @@ AliGlobalQADataMaker.cxx \ AliQADataMakerSim.cxx \ AliQADataMakerRec.cxx \ AliCorrQADataMakerRec.cxx \ -AliQADataMakerSteer.cxx \ +AliQAManager.cxx \ AliQAChecker.cxx \ AliCorrQAChecker.cxx \ AliGlobalQAChecker.cxx \ -- 2.43.0