]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQADataMakerRec.cxx
The description of changes:
[u/mrichter/AliRoot.git] / STEER / AliQADataMakerRec.cxx
index 3fef9e5ab9cfa75ae50f464204eb3362b6bf39e9..f400185483a3a4c248e6ddc55c3f94e0be11c4df 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "AliLog.h"
 #include "AliQADataMakerRec.h"
+#include "AliQAManager.h"
 #include "AliESDEvent.h"
 #include "AliRawReader.h"
 
@@ -147,7 +148,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 ; 
@@ -163,6 +165,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()) ; 
@@ -356,6 +362,37 @@ void AliQADataMakerRec::InitRecoParams()
   }
 }
 
+//____________________________________________________________________________ 
+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() ;
+    }
+  }
+}
+
 //____________________________________________________________________________
 void AliQADataMakerRec::StartOfCycle(Int_t run) 
 {
@@ -378,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() )) ;