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 notifce *
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 for Reconstruction
22 // All data must be mergeable objects.
23 // Y. Schutz CERN July 2007
26 // --- ROOT system ---
30 // --- Standard library ---
32 // --- AliRoot header files ---
34 #include "AliQADataMakerRec.h"
35 #include "AliESDEvent.h"
36 #include "AliRawReader.h"
38 ClassImp(AliQADataMakerRec)
40 //____________________________________________________________________________
41 AliQADataMakerRec::AliQADataMakerRec(const char * name, const char * title) :
42 AliQADataMaker(name, title),
45 fRecPointsQAList(NULL),
50 fDetectorDirName = GetName() ;
53 //____________________________________________________________________________
54 AliQADataMakerRec::AliQADataMakerRec(const AliQADataMakerRec& qadm) :
55 AliQADataMaker(qadm.GetName(), qadm.GetTitle()),
56 fESDsQAList(qadm.fESDsQAList),
57 fRawsQAList(qadm.fRawsQAList),
58 fRecPointsQAList(qadm.fRecPointsQAList),
59 fObject(qadm.fObject),
60 fRecoParam(qadm.fRecoParam)
63 SetName(qadm.GetName()) ;
64 SetTitle(qadm.GetTitle()) ;
65 fDetectorDirName = GetName() ;
68 //____________________________________________________________________________
69 AliQADataMakerRec::~AliQADataMakerRec()
71 //dtor: delete the TObjArray and thei content
73 if ( fESDsQAList->IsOwner() )
74 fESDsQAList->Delete() ;
78 if ( fRawsQAList->IsOwner() )
79 fRawsQAList->Delete() ;
82 if ( fRecPointsQAList ) {
83 if ( fRecPointsQAList->IsOwner() )
84 fRecPointsQAList->Delete() ;
85 delete fRecPointsQAList ;
89 //__________________________________________________________________
90 AliQADataMakerRec& AliQADataMakerRec::operator = (const AliQADataMakerRec& qadm )
92 // Assignment operator.
93 this->~AliQADataMakerRec();
94 new(this) AliQADataMakerRec(qadm);
98 //____________________________________________________________________________
99 void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task)
101 // Finishes a cycle of QA data acquistion
103 TObjArray * list = NULL ;
105 if ( task == AliQA::kRAWS )
107 else if ( task == AliQA::kRECPOINTS )
108 list = fRecPointsQAList ;
109 else if ( task == AliQA::kESDS )
112 //DefaultEndOfDetectorCycle(task) ;
113 EndOfDetectorCycle(task, list) ;
114 TDirectory * subDir = NULL ;
116 subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
127 //____________________________________________________________________________
128 void AliQADataMakerRec::Exec(AliQA::TASKINDEX_t task, TObject * data)
130 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
132 if ( task == AliQA::kRAWS ) {
133 AliDebug(1, "Processing Raws QA") ;
134 AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
136 MakeRaws(rawReader) ;
138 AliError("Wrong data type") ;
139 } else if ( task == AliQA::kRECPOINTS ) {
140 AliDebug(1, "Processing RecPoints QA") ;
141 TTree * tree = dynamic_cast<TTree *>(data) ;
143 MakeRecPoints(tree) ;
145 AliWarning("data are not a TTree") ;
147 } else if ( task == AliQA::kESDS ) {
148 AliDebug(1, "Processing ESDs QA") ;
149 AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
153 AliError("Wrong type of esd container") ;
157 //____________________________________________________________________________
158 TObjArray * AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, Int_t run, Int_t cycles)
160 // general intialisation
162 TObjArray * rv = NULL ;
168 if ( task == AliQA::kRAWS ) {
169 if (! fRawsQAList ) {
170 fRawsQAList = new TObjArray(100) ;
171 fRawsQAList->SetName(Form("%s_%s", GetName(), AliQA::GetTaskName(task).Data())) ;
175 } else if ( task == AliQA::kRECPOINTS ) {
176 if ( ! fRecPointsQAList ) {
177 fRecPointsQAList = new TObjArray(100) ;
178 fRecPointsQAList->SetName(Form("%s_%s", GetName(), AliQA::GetTaskName(task).Data())) ;
181 rv = fRecPointsQAList ;
182 } else if ( task == AliQA::kESDS ) {
183 if ( ! fESDsQAList ) {
184 fESDsQAList = new TObjArray(100) ;
185 fESDsQAList->SetName(Form("%s_%s", GetName(), AliQA::GetTaskName(task).Data())) ;
194 //____________________________________________________________________________
195 void AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, TObjArray * list, Int_t run, Int_t cycles)
197 // Intialisation by passing the list of QA data booked elsewhere
203 if ( task == AliQA::kRAWS ) {
205 } else if ( task == AliQA::kRECPOINTS ) {
206 fRecPointsQAList = list ;
207 } else if ( task == AliQA::kESDS ) {
212 //____________________________________________________________________________
213 void AliQADataMakerRec::StartOfCycle(AliQA::TASKINDEX_t task, const Bool_t sameCycle)
215 // Finishes a cycle of QA data acquistion
216 if ( !sameCycle || fCurrentCycle == -1) {
220 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
222 AliInfo(Form(" Run %d Cycle %d task %s file %s",
223 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
225 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
227 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
229 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
231 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
234 TObjArray * list = NULL ;
236 if ( task == AliQA::kRAWS )
238 else if ( task == AliQA::kRECPOINTS)
239 list = fRecPointsQAList ;
240 else if ( task == AliQA::kESDS )
243 // Should be the choice of detectors
244 // TIter next(list) ;
246 // while ( (h = dynamic_cast<TH1 *>(next())) )
249 StartOfDetectorCycle() ;