X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliQADataMakerRec.cxx;h=3f6fc9f4c1ef80e9e8243634a2e6cf4302720bad;hb=69786dcc4796ff50a0ff055f2caad0c7af8f7048;hp=4b50678802bbe8e9ea52125f6ce8aa0e73c12fa0;hpb=eca4fa66e575b53a72c027046dc9ea60487c3240;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliQADataMakerRec.cxx b/STEER/AliQADataMakerRec.cxx index 4b50678802b..3f6fc9f4c1e 100644 --- a/STEER/AliQADataMakerRec.cxx +++ b/STEER/AliQADataMakerRec.cxx @@ -24,7 +24,6 @@ // // --- ROOT system --- -#include #include #include #include @@ -40,6 +39,7 @@ #include "AliLog.h" #include "AliQADataMakerRec.h" +#include "AliQAManager.h" #include "AliESDEvent.h" #include "AliRawReader.h" @@ -53,7 +53,8 @@ AliQADataMakerRec::AliQADataMakerRec(const char * name, const char * title) : fRawsQAList(NULL), fRecPointsQAList(NULL), fCorrNt(NULL), - fRecoParam(NULL) + fRecoParam(NULL), + fRecPointsArray(NULL) { // ctor fDetectorDirName = GetName() ; @@ -67,7 +68,8 @@ AliQADataMakerRec::AliQADataMakerRec(const AliQADataMakerRec& qadm) : fRawsQAList(qadm.fRawsQAList), fRecPointsQAList(qadm.fRecPointsQAList), fCorrNt(qadm.fCorrNt), - fRecoParam(qadm.fRecoParam) + fRecoParam(qadm.fRecoParam), + fRecPointsArray(NULL) { //copy ctor SetName(qadm.GetName()) ; @@ -82,7 +84,6 @@ AliQADataMakerRec::~AliQADataMakerRec() if ( fESDsQAList ) { for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { if ( fESDsQAList[specie] ) { - if ( fESDsQAList[specie]->IsOwner() ) fESDsQAList[specie]->Delete() ; } } @@ -91,8 +92,7 @@ AliQADataMakerRec::~AliQADataMakerRec() if ( fRawsQAList ) { for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { if ( fRawsQAList[specie] ) { - if ( fRawsQAList[specie]->IsOwner() ) - fRawsQAList[specie]->Delete() ; + fRawsQAList[specie]->Delete() ; } } delete[] fRawsQAList ; @@ -100,8 +100,7 @@ AliQADataMakerRec::~AliQADataMakerRec() if ( fDigitsQAList ) { for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { if ( fDigitsQAList[specie] ) { - if ( fDigitsQAList[specie]->IsOwner() ) - fDigitsQAList[specie]->Delete() ; + fDigitsQAList[specie]->Delete() ; } } delete[] fDigitsQAList ; @@ -109,12 +108,15 @@ AliQADataMakerRec::~AliQADataMakerRec() if ( fRecPointsQAList ) { for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { if ( fRecPointsQAList[specie] ) { - if ( fRecPointsQAList[specie]->IsOwner() ) - fRecPointsQAList[specie]->Delete() ; + fRecPointsQAList[specie]->Delete() ; } } delete[] fRecPointsQAList ; } + if (fRecPointsArray) { + fRecPointsArray->Clear() ; + delete fRecPointsArray ; + } } //__________________________________________________________________ @@ -142,7 +144,8 @@ void AliQADataMakerRec::EndOfCycle(AliQAv1::TASKINDEX_t task) { // Finishes a cycle of QA - TObjArray ** list = NULL ; + + TObjArray ** list = NULL ; if ( task == AliQAv1::kRAWS ) list = fRawsQAList ; @@ -158,6 +161,10 @@ void AliQADataMakerRec::EndOfCycle(AliQAv1::TASKINDEX_t task) return ; //DefaultEndOfDetectorCycle(task) ; EndOfDetectorCycle(task, list) ; + + if (! AliQAManager::QAManager(AliQAv1::kRECMODE)->IsSaveData()) + return ; + fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ; if (!fDetectorDir) fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ; @@ -165,82 +172,45 @@ void AliQADataMakerRec::EndOfCycle(AliQAv1::TASKINDEX_t task) if (!subDir) subDir = fDetectorDir->mkdir(AliQAv1::GetTaskName(task)) ; subDir->cd() ; - for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(specie)) ) + for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { // skip Default + if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(specie)) || AliRecoParam::ConvertIndex(specie) == AliRecoParam::kDefault) continue ; TDirectory * eventSpecieDir = subDir->GetDirectory(AliRecoParam::GetEventSpecieName(specie)) ; if (!eventSpecieDir) eventSpecieDir = subDir->mkdir(AliRecoParam::GetEventSpecieName(specie)) ; eventSpecieDir->cd() ; - if (list[specie]) { - TIter next(list[specie]) ; - TObject * obj ; - while( (obj = next()) ) { - if (!obj->TestBit(AliQAv1::GetExpertBit())) - obj->Write() ; - } - if (WriteExpert()) { - TDirectory * expertDir = eventSpecieDir->GetDirectory(AliQAv1::GetExpert()) ; - if (!expertDir) - expertDir = eventSpecieDir->mkdir(AliQAv1::GetExpert()) ; - expertDir->cd() ; - next.Reset() ; + if (list) { + if (list[specie]) { + TIter next(list[specie]) ; + TObject * obj ; while( (obj = next()) ) { if (!obj->TestBit(AliQAv1::GetExpertBit())) - continue ; - obj->Write() ; - } + obj->Write() ; + } + if (WriteExpert()) { + TDirectory * expertDir = eventSpecieDir->GetDirectory(AliQAv1::GetExpert()) ; + if (!expertDir) + expertDir = eventSpecieDir->mkdir(AliQAv1::GetExpert()) ; + expertDir->cd() ; + next.Reset() ; + while( (obj = next()) ) { + if (!obj->TestBit(AliQAv1::GetExpertBit())) + continue ; + obj->Write() ; + } + } } + } + else if ( fCorrNt ) { + if (fCorrNt[specie] && AliQAv1::GetDetIndex(GetName()) == AliQAv1::kCORR) { + if (fCorrNt[specie]->GetNvar() != 0) { + eventSpecieDir->cd() ; + fCorrNt[specie]->Write() ; + } + } + fOutput->Save() ; } - if ( !fCorrNt ) - continue ; - if (fCorrNt[specie] && AliQAv1::GetDetIndex(GetName()) == AliQAv1::kCORR) { - eventSpecieDir->cd() ; - fCorrNt[specie]->Write() ; - } - fOutput->Save() ; - } - MakeImage(task) ; -} - -//____________________________________________________________________________ -void AliQADataMakerRec::MakeImage(AliQAv1::TASKINDEX_t task) -{ - // create a drawing of detetor defined histograms - TObjArray ** list = NULL ; - switch (task) { - case AliQAv1::kRAWS: - list = fRawsQAList ; - break; - case AliQAv1::kHITS: - break; - case AliQAv1::kSDIGITS: - break; - case AliQAv1::kDIGITS: - break; - case AliQAv1::kDIGITSR: - list = fDigitsQAList ; - break; - case AliQAv1::kRECPOINTS: - list = fRecPointsQAList ; - break; - case AliQAv1::kTRACKSEGMENTS: - break; - case AliQAv1::kRECPARTICLES: - break; - case AliQAv1::kESDS: - list = fESDsQAList ; - break; - case AliQAv1::kNTASKINDEX: - break; - default: - break; - } - if ( !list) { - AliError("data not initialized, call AliQADataMaker::Init"); - return ; } - MakeTheImage(list, task, "Rec") ; } //____________________________________________________________________________ @@ -295,7 +265,7 @@ TObjArray ** AliQADataMakerRec::Init(AliQAv1::TASKINDEX_t task, Int_t cycles) if (! fRawsQAList ) { fRawsQAList = new TObjArray *[AliRecoParam::kNSpecies] ; for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - fRawsQAList[specie] = new TObjArray(1) ; + fRawsQAList[specie] = new TObjArray(AliQAv1::GetMaxQAObj()) ; fRawsQAList[specie]->SetName(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ; } } @@ -304,7 +274,7 @@ TObjArray ** AliQADataMakerRec::Init(AliQAv1::TASKINDEX_t task, Int_t cycles) if ( ! fDigitsQAList ) { fDigitsQAList = new TObjArray *[AliRecoParam::kNSpecies] ; for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - fDigitsQAList[specie] = new TObjArray(1) ; + fDigitsQAList[specie] = new TObjArray(AliQAv1::GetMaxQAObj()) ; fDigitsQAList[specie]->SetName(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ; } } @@ -313,7 +283,7 @@ TObjArray ** AliQADataMakerRec::Init(AliQAv1::TASKINDEX_t task, Int_t cycles) if ( ! fRecPointsQAList ) { fRecPointsQAList = new TObjArray *[AliRecoParam::kNSpecies] ; for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - fRecPointsQAList[specie] = new TObjArray(1) ; + fRecPointsQAList[specie] = new TObjArray(AliQAv1::GetMaxQAObj()) ; fRecPointsQAList[specie]->SetName(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ; } } @@ -322,8 +292,8 @@ TObjArray ** AliQADataMakerRec::Init(AliQAv1::TASKINDEX_t task, Int_t cycles) if ( ! fESDsQAList ) { fESDsQAList = new TObjArray *[AliRecoParam::kNSpecies] ; for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { - fESDsQAList[specie] = new TObjArray(1) ; - fESDsQAList[specie]->SetName(Form("%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ; + fESDsQAList[specie] = new TObjArray(AliQAv1::GetMaxQAObj()) ; + fESDsQAList[specie]->SetName(Form("%s_%s", GetName(), AliQAv1::GetTaskName(task).Data())); //, AliRecoParam::GetEventSpecieName(specie))) ; } } rv = fESDsQAList ; @@ -355,13 +325,14 @@ void AliQADataMakerRec::Init(AliQAv1::TASKINDEX_t task, TObjArray ** list, Int_t //____________________________________________________________________________ void AliQADataMakerRec::InitRecoParams() { + // Get the recoparam form the OCDB if (!fRecoParam) { AliDebug(AliQAv1::GetQADebugLevel(), Form("Loading reconstruction parameter objects for detector %s", GetName())); AliCDBPath path(GetName(),"Calib","RecoParam"); AliCDBEntry *entry=AliCDBManager::Instance()->Get(path.GetPath()); if(!entry) { fRecoParam = NULL ; - AliWarning(Form("Couldn't find RecoParam entry in OCDB for detector %s",GetName())); + AliDebug(AliQAv1::GetQADebugLevel(), Form("Couldn't find RecoParam entry in OCDB for detector %s",GetName())); } else { TObject * recoParamObj = entry->GetObject() ; @@ -387,7 +358,38 @@ void AliQADataMakerRec::InitRecoParams() AliError(Form("No valid RecoParam object found in the OCDB for detector %s",GetName())); } } - AliCDBManager::Instance()->UnloadFromCache(path.GetPath()); + } +} + +//____________________________________________________________________________ +void AliQADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task) +{ + // default reset that resets all the QA objects. + // to be overloaded by detectors, if necessary + + TObjArray ** list = NULL ; + if ( task == AliQAv1::kRAWS ) { + list = fRawsQAList ; + } else if ( task == AliQAv1::kDIGITSR ) { + list = fDigitsQAList ; + } else if ( task == AliQAv1::kRECPOINTS ) { + list = fRecPointsQAList ; + } else if ( task == AliQAv1::kESDS ) { + list = fESDsQAList ; + } + //list was not initialized, skip + if (!list) + return ; + + for (int spec = 0; spec < AliRecoParam::kNSpecies; spec++) { + if (!AliQAv1::Instance()->IsEventSpecieSet(AliRecoParam::ConvertIndex(spec))) + continue; + TIter next(list[spec]) ; + TH1 * histo = NULL ; + while ( (histo = dynamic_cast (next())) ) { + histo->Reset("ICE") ; + histo->ResetStats() ; + } } } @@ -413,7 +415,8 @@ void AliQADataMakerRec::StartOfCycle(AliQAv1::TASKINDEX_t task, Int_t run, const ResetCycle() ; if (fOutput) fOutput->Close() ; - fOutput = AliQAv1::GetQADataFile(GetName(), fRun) ; + if (AliQAManager::QAManager(AliQAv1::kRECMODE)->IsSaveData()) + fOutput = AliQAv1::GetQADataFile(GetName(), fRun) ; } AliDebug(AliQAv1::GetQADebugLevel(), Form(" Run %d Cycle %d task %s file %s", fRun, fCurrentCycle, AliQAv1::GetTaskName(task).Data(), fOutput->GetName() )) ;