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>
32 #include <TParameter.h>
34 // --- Standard library ---
36 // --- AliRoot header files ---
38 #include "AliQADataMaker.h"
39 #include "AliQAChecker.h"
40 #include "AliESDEvent.h"
41 #include "AliRawReader.h"
43 ClassImp(AliQADataMaker)
45 //____________________________________________________________________________
46 AliQADataMaker::AliQADataMaker(const char * name, const char * title) :
59 fDetectorDirName = GetName() ;
62 //____________________________________________________________________________
63 AliQADataMaker::AliQADataMaker(const AliQADataMaker& qadm) :
64 TNamed(qadm.GetName(), qadm.GetTitle()),
65 fOutput(qadm.fOutput),
66 fDetectorDir(qadm.fDetectorDir),
67 fDetectorDirName(qadm.fDetectorDirName),
68 fCurrentCycle(qadm.fCurrentCycle),
70 fCycleCounter(qadm.fCycleCounter),
71 fWriteExpert(qadm.fWriteExpert),
72 fParameterList(qadm.fParameterList),
76 fDetectorDirName = GetName() ;
79 //____________________________________________________________________________
80 Int_t AliQADataMaker::Add2List(TH1 * hist, const Int_t index, TObjArray * list, const Bool_t expert, const Bool_t saveForCorr)
82 // Set histograms memory resident and add to the list
83 // Maximm allowed is 10000
84 TString className(hist->ClassName()) ;
85 if( ! className.BeginsWith("T") ) {
86 AliError(Form("QA data Object must be a generic ROOT object and not %s", className.Data())) ;
89 if ( index > 10000 ) {
90 AliError("Max number of authorized QA objects is 10000") ;
93 hist->SetDirectory(0) ;
96 hist->SetBit(AliQA::GetExpertBit()) ;
98 list->AddAtAndExpand(hist, index) ;
99 char * name = Form("%s_%s", list->GetName(), hist->GetName()) ;
100 TParameter<double> * p = new TParameter<double>(name, 9999.9999) ;
102 if ( ! fParameterList )
103 fParameterList = new TList() ;
104 fParameterList->Add(p) ;
106 return list->GetLast() ;
110 //____________________________________________________________________________
111 void AliQADataMaker::DefaultEndOfDetectorCycle(AliQA::TASKINDEX_t task)
113 // this method must be oveloaded by detectors
114 // sets the QA result to Fatal
115 AliQA::Instance(AliQA::GetDetIndex(GetName())) ;
116 AliQA * qa = AliQA::Instance(task) ;
117 qa->Set(AliQA::kFATAL) ;
118 AliQA::GetQAResultFile()->cd() ;
119 qa->Write(AliQA::GetQAName(), kWriteDelete) ;
120 AliQA::GetQAResultFile()->Close() ;
123 //____________________________________________________________________________
124 void AliQADataMaker::Finish() const
126 // write to the output File
131 //____________________________________________________________________________
132 TObject * AliQADataMaker::GetData(TObjArray * list, const Int_t index)
134 // Returns the QA object at index. Limit is 100.
136 if ( index > 10000 ) {
137 AliError("Max number of authorized QA objects is 10000") ;
140 return list->At(index) ;
143 AliError("Data list is NULL !!") ;