]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQADataMakerSim.cxx
Put the QA images into a compac format
[u/mrichter/AliRoot.git] / STEER / AliQADataMakerSim.cxx
index 8499afaa34ea82321e0f1886fb616af628b76100..56693089addc8b2cc97fa5ab18c0b092689c0d4f 100644 (file)
@@ -152,7 +152,8 @@ void AliQADataMakerSim::EndOfCycle(AliQAv1::TASKINDEX_t task)
     }
     fOutput->Save() ; 
   }
-  MakeImage(task) ; 
+  if (fPrintImage) 
+    MakeImage(task) ; 
 }
  
 //____________________________________________________________________________
@@ -238,52 +239,7 @@ void AliQADataMakerSim::MakeImage(AliQAv1::TASKINDEX_t task)
     AliFatal("data not initialized, call AliQADataMaker::Init"); 
   return ; 
   }
-  TIter next(list[0]) ;  
-  TH1 * hdata = NULL ; 
-  Int_t nImages = 0 ;
-  while ( (hdata=dynamic_cast<TH1 *>(next())) ) {
-    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())) ;  
-    Double_t w  = 1000 ;
-    Double_t h  = 1000 ;
-    for (Int_t esIndex = 0 ; esIndex < AliRecoParam::kNSpecies ; esIndex++) {
-      if ( !fImage[esIndex] ) {
-        fImage[esIndex] = new TCanvas(Form("QA_%s_%s_%s", 
-                                           GetName(), 
-                                           AliQAv1::GetTaskName(task).Data(), 
-                                           AliRecoParam::GetEventSpecieName(esIndex)), 
-                                      Form("QA control plots for det=%s task=%s eventspecie=%s", 
-                                           GetName(), 
-                                           AliQAv1::GetTaskName(task).Data(), 
-                                           AliRecoParam::GetEventSpecieName(esIndex)), 
-                                      w, h) ;
-        fImage[esIndex]->SetWindowSize(w + (w - fImage[esIndex]->GetWw()), h + (h - fImage[esIndex]->GetWh())) ;
-        Int_t nx = TMath::Sqrt(nImages) ; 
-        Int_t ny = nx  ; 
-        if ( nx < TMath::Sqrt(nImages)) 
-          ny++ ; 
-        fImage[esIndex]->Divide(nx, ny) ; 
-      }
-      fImage[esIndex]->Clear() ; 
-      TIter nexthist(list[esIndex]) ; 
-      TH1* hist = NULL ;
-      Int_t npad = 1 ; 
-      fImage[esIndex]->cd(npad) ; 
-      while ( (hist=dynamic_cast<TH1*>(nexthist())) ) {
-        if(hist->TestBit(AliQAv1::GetImageBit())) {
-          hist->Draw() ; 
-          fImage[esIndex]->cd(++npad) ; 
-        }
-      }
-      if (fPrintImage) 
-        fImage[esIndex]->Print() ; 
-    }
-  }
+  MakeTheImage(list, task, "Sim") ; 
 }
 
 //____________________________________________________________________________