]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQADataMakerRec.cxx
removing obsolete component from libAliHLTTrigger
[u/mrichter/AliRoot.git] / STEER / AliQADataMakerRec.cxx
index 8989c6fe178e740f3e602d01016bafa25797274a..3f6fc9f4c1ef80e9e8243634a2e6cf4302720bad 100644 (file)
@@ -24,7 +24,6 @@
 //
 
 // --- ROOT system ---
-#include <TCanvas.h>
 #include <TFile.h>
 #include <TTree.h>
 #include <TNtupleD.h>
@@ -40,6 +39,7 @@
 
 #include "AliLog.h"
 #include "AliQADataMakerRec.h"
+#include "AliQAManager.h"
 #include "AliESDEvent.h"
 #include "AliRawReader.h"
 
@@ -84,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() ;     
       }
     }
@@ -93,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 ;
@@ -102,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 ; 
@@ -111,8 +108,7 @@ 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 ; 
@@ -148,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 ; 
@@ -164,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()) ; 
@@ -178,75 +179,38 @@ void AliQADataMakerRec::EndOfCycle(AliQAv1::TASKINDEX_t task)
     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") ; 
 }
 
 //____________________________________________________________________________
@@ -329,7 +293,7 @@ TObjArray **  AliQADataMakerRec::Init(AliQAv1::TASKINDEX_t task, Int_t cycles)
       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 ;
@@ -361,6 +325,7 @@ 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");
@@ -393,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<TH1*> (next())) ) {
+      histo->Reset("ICE") ;
+      histo->ResetStats() ;
+    }
   }
 }
 
@@ -419,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() )) ;