]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQADataMaker.cxx
added a protection
[u/mrichter/AliRoot.git] / STEER / AliQADataMaker.cxx
index 87ba4741ebbc07400a9f86fc07c0779832173417..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,24 +86,42 @@ 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(const Bool_t sameCycle) 
@@ -112,4 +130,4 @@ void AliQADataMaker::Reset(const Bool_t sameCycle)
        if (!sameCycle) {
                fCycleCounter = 0 ; 
        }
-}
\ No newline at end of file
+}