// --- ROOT system ---
#include <TROOT.h>
-#include <TCanvas.h>
-#include <TPaveText.h>
#include <TSystem.h>
#include <TFile.h>
#include <TList.h>
fParameterList(new TList*[AliRecoParam::kNSpecies]),
fRun(0),
fEventSpecie(AliRecoParam::kDefault),
- fImage(new TCanvas*[AliRecoParam::kNSpecies]),
- fPrintImage(kTRUE)
+ fDigitsArray(NULL)
{
// ctor
fDetectorDirName = GetName() ;
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
fParameterList[specie] = NULL ;
- fImage[specie] = NULL ;
}
}
fWriteExpert(qadm.fWriteExpert),
fParameterList(qadm.fParameterList),
fRun(qadm.fRun),
- fEventSpecie(qadm.fEventSpecie),
- fImage(qadm.fImage),
- fPrintImage(kTRUE)
-
+ fEventSpecie(qadm.fEventSpecie),
+ fDigitsArray(NULL)
{
//copy ctor
fDetectorDirName = GetName() ;
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
fParameterList[specie] = qadm.fParameterList[specie] ;
- fImage[specie] = qadm.fImage[specie] ;
+ // fImage[specie] = qadm.fImage[specie] ;
}
}
AliQADataMaker::~AliQADataMaker()
{
for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
- if ( fImage[esIndex] )
- delete fImage[esIndex] ;
if (fParameterList[esIndex] )
delete fParameterList[esIndex] ;
}
- delete[] fImage ;
delete[] fParameterList ;
+
+ if (fDigitsArray) {
+ fDigitsArray->Clear() ;
+ delete fDigitsArray ;
+ }
}
//____________________________________________________________________________
fParameterList[AliRecoParam::AConvert(fEventSpecie)] = new TList() ;
fParameterList[AliRecoParam::AConvert(fEventSpecie)]->Add(p) ;
}
+ TObject* old = list[AliRecoParam::AConvert(fEventSpecie)]->At(index);
+ if (old) {
+ AliError(Form("%s - OUPS ! Already got an object (%p,%s) for index=%d => will most probably get a memory leak by replacing it with (%p,%s) !",
+ GetName(),old,old->GetName(),index,hist,hist->GetName()));
+ }
list[AliRecoParam::AConvert(fEventSpecie)]->AddAtAndExpand(hist, index) ;
rv = list[AliRecoParam::AConvert(fEventSpecie)]->GetLast() ;
}
TH1 * histClone = NULL ;
TObjArray * arr = list[esindex] ;
if (arr) {
+ if ( ! arr->GetEntriesFast() ) {
+ // Initializes the histograms
+ TString arrName(arr->GetName()) ;
+ if (arrName.Contains(AliQAv1::GetTaskName(AliQAv1::kRAWS)))
+ InitRaws() ;
+ else if (arrName.Contains(AliQAv1::GetTaskName(AliQAv1::kHITS)))
+ InitHits() ;
+ else if (arrName.Contains(AliQAv1::GetTaskName(AliQAv1::kSDIGITS)))
+ InitSDigits() ;
+ else if (arrName.Contains(AliQAv1::GetTaskName(AliQAv1::kDIGITS)))
+ InitDigits() ;
+ else if (arrName.Contains(AliQAv1::GetTaskName(AliQAv1::kDIGITSR)))
+ InitDigits() ;
+ else if (arrName.Contains(AliQAv1::GetTaskName(AliQAv1::kRECPOINTS)))
+ InitRecPoints() ;
+ else if (arrName.Contains(AliQAv1::GetTaskName(AliQAv1::kESDS)))
+ InitESDs() ;
+ }
if ( index > AliQAv1::GetMaxQAObj() ) {
AliError(Form("Max number of authorized QA objects is %d", AliQAv1::GetMaxQAObj())) ;
} else {
}
//____________________________________________________________________________
-void AliQADataMaker::MakeTheImage( TObjArray ** list, AliQAv1::TASKINDEX_t task, const Char_t * mode)
+Bool_t AliQADataMaker::IsValidEventSpecie(Int_t eventSpecieIndex, TObjArray ** list)
{
- // makes the QA image for sim and rec
- TIter next(list[AliRecoParam::AConvert(fEventSpecie)]) ;
- TH1 * hdata = NULL ;
- Int_t nImages = 0 ;
- while ( (hdata=static_cast<TH1 *>(next())) ) {
- TString cln(hdata->ClassName()) ;
- if ( ! cln.Contains("TH1") )
- continue ;
- if ( hdata->TestBit(AliQAv1::GetImageBit()) )
- nImages++;
- }
- if ( nImages == 0 ) {
- AliWarning(Form("No histogram will be plotted for %s %s\n", GetName(), AliQAv1::GetTaskName(task).Data())) ;
- } else {
- AliDebug(AliQAv1::GetQADebugLevel(), Form("%d histograms will be plotted for %s %s\n", nImages, GetName(), AliQAv1::GetTaskName(task).Data())) ;
- for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
- if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(esIndex)) )
- continue ;
- const Char_t * title = Form("QA_%s_%s_%s", GetName(), AliQAv1::GetTaskName(task).Data(), AliRecoParam::GetEventSpecieName(esIndex)) ;
- if ( !fImage[esIndex] ) {
- fImage[esIndex] = new TCanvas(title, title) ;
- }
- fImage[esIndex]->Clear() ;
- fImage[esIndex]->SetTitle(title) ;
- fImage[esIndex]->cd() ;
- TPaveText someText(0.015, 0.015, 0.98, 0.98) ;
- someText.AddText(title) ;
- someText.Draw() ;
- fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), mode, fRun, AliQAv1::GetImageFileFormat())) ;
- fImage[esIndex]->Clear() ;
- Int_t nx = TMath::Sqrt(nImages) ;
- Int_t ny = nx ;
- if ( nx < TMath::Sqrt(nImages))
- ny++ ;
- fImage[esIndex]->Divide(nx, ny) ;
- TIter nexthist(list[esIndex]) ;
- TH1* hist = NULL ;
- Int_t npad = 1 ;
- fImage[esIndex]->cd(npad) ;
- while ( (hist=static_cast<TH1*>(nexthist())) ) {
- TString cln(hist->ClassName()) ;
- if ( ! cln.Contains("TH1") )
- continue ;
- if(hist->TestBit(AliQAv1::GetImageBit())) {
- hist->Draw() ;
- fImage[esIndex]->cd(++npad) ;
- }
- }
- fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), mode, fRun, AliQAv1::GetImageFileFormat())) ;
- }
- }
+ // check if event specie was present in current run or
+ // if histograms of this event specie have been created
+ if (! AliQAv1::Instance(AliQAv1::GetDetIndex(GetName()))->IsEventSpecieSet(AliRecoParam::ConvertIndex(eventSpecieIndex)) || ! list[eventSpecieIndex]->GetEntriesFast() )
+ return kFALSE ;
+ else
+ return kTRUE ;
}
+