//
// --- ROOT system ---
-#include <TCanvas.h>
#include <TFile.h>
#include <TTree.h>
#include <TNtupleD.h>
#include "AliLog.h"
#include "AliQADataMakerRec.h"
+#include "AliQAManager.h"
#include "AliESDEvent.h"
#include "AliRawReader.h"
if ( fESDsQAList ) {
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
if ( fESDsQAList[specie] ) {
- if ( fESDsQAList[specie]->IsOwner() )
fESDsQAList[specie]->Delete() ;
}
}
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 ;
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 ;
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 ;
{
// Finishes a cycle of QA
- TObjArray ** list = NULL ;
+
+ TObjArray ** list = NULL ;
if ( task == AliQAv1::kRAWS )
list = fRawsQAList ;
return ;
//DefaultEndOfDetectorCycle(task) ;
EndOfDetectorCycle(task, list) ;
+
+ if (! AliQAManager::QAManager(AliQAv1::kRECMODE)->IsSaveData())
+ return ;
+
fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
if (!fDetectorDir)
fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
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") ;
}
//____________________________________________________________________________
fESDsQAList = new TObjArray *[AliRecoParam::kNSpecies] ;
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
fESDsQAList[specie] = new TObjArray(AliQAv1::GetMaxQAObj()) ;
- fESDsQAList[specie]->SetName(Form("%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(specie))) ;
+ fESDsQAList[specie]->SetName(Form("%s_%s", GetName(), AliQAv1::GetTaskName(task).Data())); //, AliRecoParam::GetEventSpecieName(specie))) ;
}
}
rv = fESDsQAList ;
//____________________________________________________________________________
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");
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<TH1*> (next())) ) {
+ histo->Reset("ICE") ;
+ histo->ResetStats() ;
+ }
}
}
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() )) ;