1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
21 // Produces the data needed to calculate the quality assurance.
22 // All data must be mergeable objects.
23 // Y. Schutz CERN July 2007
26 // --- ROOT system ---
31 #include <TClonesArray.h>
33 // --- Standard library ---
35 // --- AliRoot header files ---
37 #include "AliQADataMaker.h"
38 #include "AliQAChecker.h"
39 #include "AliESDEvent.h"
40 #include "AliRawReader.h"
42 ClassImp(AliQADataMaker)
44 //____________________________________________________________________________
45 AliQADataMaker::AliQADataMaker(const char * name, const char * title) :
56 fDetectorDirName = GetName() ;
59 //____________________________________________________________________________
60 AliQADataMaker::AliQADataMaker(const AliQADataMaker& qadm) :
61 TNamed(qadm.GetName(), qadm.GetTitle()),
62 fOutput(qadm.fOutput),
63 fDetectorDir(qadm.fDetectorDir),
64 fDetectorDirName(qadm.fDetectorDirName),
65 fCurrentCycle(qadm.fCurrentCycle),
67 fCycleCounter(qadm.fCycleCounter),
71 fDetectorDirName = GetName() ;
74 //____________________________________________________________________________
75 Int_t AliQADataMaker::Add2List(TH1 * hist, const Int_t index, TObjArray * list)
77 // Set histograms memory resident and add to the list
78 // Maximm allowed is 10000
79 TString className(hist->ClassName()) ;
80 if( ! className.BeginsWith("T") ) {
81 AliError(Form("QA data Object must be a generic ROOT object and not %s", className.Data())) ;
84 if ( index > 10000 ) {
85 AliError("Max number of authorized QA objects is 10000") ;
88 hist->SetDirectory(0) ;
89 list->AddAtAndExpand(hist, index) ;
90 return list->GetLast() ;
94 //____________________________________________________________________________
95 void AliQADataMaker::DefaultEndOfDetectorCycle(AliQA::TASKINDEX_t task)
97 // this method must be oveloaded by detectors
98 // sets the QA result to Fatal
99 AliQA::Instance(AliQA::GetDetIndex(GetName())) ;
100 AliQA * qa = AliQA::Instance(task) ;
101 qa->Set(AliQA::kFATAL) ;
102 AliQA::GetQAResultFile()->cd() ;
103 qa->Write(AliQA::GetQAName(), kWriteDelete) ;
104 AliQA::GetQAResultFile()->Close() ;
107 //____________________________________________________________________________
108 void AliQADataMaker::Finish() const
110 // write to the output File
115 //____________________________________________________________________________
116 TObject * AliQADataMaker::GetData(TObjArray * list, const Int_t index)
118 // Returns the QA object at index. Limit is 100.
120 if ( index > 10000 ) {
121 AliError("Max number of authorized QA objects is 10000") ;
124 return list->At(index) ;
127 AliError("Data list is NULL !!") ;
132 //____________________________________________________________________________
133 void AliQADataMaker::Reset(const Bool_t sameCycle)
135 // Resets defaut value of data members