]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQADataMaker.cxx
added a protection
[u/mrichter/AliRoot.git] / STEER / AliQADataMaker.cxx
index d094866c309dcab12a69040b209a74ed66a97a08..38c880ef8af0f5079dea3875158b4d1c20d86a22 100644 (file)
 
 /* $Id$ */
 
-/*
-  Base Class
-  Produces the data needed to calculate the quality assurance. 
-  All data must be mergeable objects.
-  Y. Schutz CERN July 2007
-*/
+//
+//  Base Class
+//  Produces the data needed to calculate the quality assurance. 
+//  All data must be mergeable objects.
+//  Y. Schutz CERN July 2007
+//
 
 // --- ROOT system ---
 #include <TSystem.h> 
@@ -86,29 +86,48 @@ Int_t AliQADataMaker::Add2List(TH1 * hist, const Int_t index, TObjArray * list)
        }
 }
 
+//____________________________________________________________________________
+void AliQADataMaker::DefaultEndOfDetectorCycle(AliQA::TASKINDEX_t task) 
+{
+       // this method must be oveloaded by detectors
+       // sets the QA result to Fatal
+       AliQA::Instance(AliQA::GetDetIndex(GetName())) ;
+       AliQA * qa = AliQA::Instance(task) ;
+       qa->Set(AliQA::kFATAL) ; 
+       AliQA::GetQAResultFile()->cd() ; 
+       qa->Write(AliQA::GetQAName(), kWriteDelete) ;   
+       AliQA::GetQAResultFile()->Close() ; 
+}
+
 //____________________________________________________________________________ 
 void AliQADataMaker::Finish() const 
 { 
-  // write to the output File
-  fOutput->Close() ; 
+       // write to the output File
+       fOutput->Close() ; 
 } 
 
 //____________________________________________________________________________ 
 TObject * AliQADataMaker::GetData(TObjArray * list, const Int_t index)  
 { 
        // Returns the QA object at index. Limit is 100. 
-       if ( index > 10000 ) {
-               AliError("Max number of authorized QA objects is 10000") ; 
-               return NULL; 
+       if (list) {
+               if ( index > 10000 ) {
+                       AliError("Max number of authorized QA objects is 10000") ; 
+                       return NULL ; 
+               } else {
+                       return list->At(index) ; 
+               }       
        } else {
-               return list->At(index) ; 
+               AliError("Data list is NULL !!") ; 
+               return NULL ;           
        }
-} 
+}
 
 //____________________________________________________________________________
-void AliQADataMaker::Reset() 
+void AliQADataMaker::Reset(const Bool_t sameCycle
 { 
   // Resets defaut value of data members 
-  fCurrentCycle = -1 ;  
-  fCycleCounter = 0 ; 
+       if (!sameCycle) {
+               fCycleCounter = 0 ; 
+       }
 }