// --- 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 ;
+ }
}
//____________________________________________________________________________
TString className(classType->GetName()) ;
if( ! className.BeginsWith("T") && ! classType->InheritsFrom("TH1") ) {
AliError(Form("QA data Object must be a generic ROOT object and derive fom TH1 and not %s", className.Data())) ;
- } else if ( index > 10000 ) {
- AliError("Max number of authorized QA objects is 10000") ;
+ } else if ( index > AliQAv1::GetMaxQAObj() ) {
+ AliError(Form("Max number of authorized QA objects is %d", AliQAv1::GetMaxQAObj())) ;
} else {
hist->SetDirectory(0) ;
if (expert)
//____________________________________________________________________________
TObject * AliQADataMaker::GetData(TObjArray ** list, const Int_t index)
{
- // Returns the QA object at index. Limit is 100.
+ // Returns the QA object at index. Limit is AliQAv1::GetMaxQAObj()
if ( ! list ) {
AliError("Data list is NULL !!") ;
return NULL ;
SetEventSpecie(fEventSpecie) ;
Int_t esindex = AliRecoParam::AConvert(fEventSpecie) ;
TH1 * histClone = NULL ;
- if (list[esindex]) {
- if ( index > 10000 ) {
- AliError("Max number of authorized QA objects is 10000") ;
+ 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 {
- if ( list[esindex]->At(index) ) {
- histClone = static_cast<TH1*>(list[esindex]->At(index)) ;
+ if ( arr->At(index) ) {
+ histClone = static_cast<TH1*>(arr->At(index)) ;
}
}
}
}
//____________________________________________________________________________
-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 ;
}
+