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 for Reconstruction
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 "AliQADataMakerRec.h"
38 #include "AliQAChecker.h"
39 #include "AliESDEvent.h"
40 #include "AliRawReader.h"
42 ClassImp(AliQADataMakerRec)
44 //____________________________________________________________________________
45 AliQADataMakerRec::AliQADataMakerRec(const char * name, const char * title) :
46 AliQADataMaker(name, title),
52 fDetectorDirName = GetName() ;
55 //____________________________________________________________________________
56 AliQADataMakerRec::AliQADataMakerRec(const AliQADataMakerRec& qadm) :
57 AliQADataMaker(qadm.GetName(), qadm.GetTitle()),
58 fESDsQAList(qadm.fESDsQAList),
59 fRawsQAList(qadm.fRawsQAList),
60 fRecPointsQAList(qadm.fRecPointsQAList)
64 SetName(qadm.GetName()) ;
65 SetTitle(qadm.GetTitle()) ;
66 fDetectorDirName = GetName() ;
69 //__________________________________________________________________
70 AliQADataMakerRec& AliQADataMakerRec::operator = (const AliQADataMakerRec& qadm )
72 // Assignment operator.
73 this->~AliQADataMakerRec();
74 new(this) AliQADataMakerRec(qadm);
78 //____________________________________________________________________________
79 void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX task)
81 // Finishes a cycle of QA data acquistion
83 TObjArray * list = 0x0 ;
85 if ( task == AliQA::kRAWS )
87 else if ( task == AliQA::kRECPOINTS )
88 list = fRecPointsQAList ;
89 else if ( task == AliQA::kESDS )
92 EndOfDetectorCycle(task, list) ;
93 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
100 //____________________________________________________________________________
101 void AliQADataMakerRec::Exec(AliQA::TASKINDEX task, TObject * data)
103 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
105 if ( task == AliQA::kRAWS ) {
106 AliDebug(1, "Processing Raws QA") ;
107 AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
109 MakeRaws(rawReader) ;
111 AliError("Wrong data type") ;
112 } else if ( task == AliQA::kRECPOINTS ) {
113 AliDebug(1, "Processing RecPoints QA") ;
114 TTree * tree = dynamic_cast<TTree *>(data) ;
116 MakeRecPoints(tree) ;
118 AliWarning("data are not a TTree") ;
120 } else if ( task == AliQA::kESDS ) {
121 AliDebug(1, "Processing ESDs QA") ;
122 AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
126 AliError("Wrong type of esd container") ;
130 //____________________________________________________________________________
131 TObjArray * AliQADataMakerRec::Init(AliQA::TASKINDEX task, Int_t run, Int_t cycles)
133 // general intialisation
135 TObjArray * rv = NULL ;
141 if ( task == AliQA::kRAWS ) {
142 fRawsQAList = new TObjArray(100) ;
145 } else if ( task == AliQA::kRECPOINTS ) {
146 fRecPointsQAList = new TObjArray(100) ;
148 rv = fRecPointsQAList ;
149 } else if ( task == AliQA::kESDS ) {
150 fESDsQAList = new TObjArray(100) ;
158 //____________________________________________________________________________
159 void AliQADataMakerRec::Init(AliQA::TASKINDEX task, TObjArray * list, Int_t run, Int_t cycles)
161 // Intialisation by passing the list of QA data booked elsewhere
167 if ( task == AliQA::kRAWS ) {
169 } else if ( task == AliQA::kRECPOINTS ) {
170 fRecPointsQAList = list ;
171 } else if ( task == AliQA::kESDS ) {
176 //____________________________________________________________________________
177 void AliQADataMakerRec::StartOfCycle(AliQA::TASKINDEX task, const Bool_t sameCycle)
179 // Finishes a cycle of QA data acquistion
181 if ( !sameCycle || fCurrentCycle == -1) {
185 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
187 AliInfo(Form(" Run %d Cycle %d task %s file %s",
188 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
190 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
192 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
194 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
196 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
199 TObjArray * list = 0x0 ;
201 if ( task == AliQA::kRAWS )
203 else if ( task == AliQA::kRECPOINTS)
204 list = fRecPointsQAList ;
205 else if ( task == AliQA::kESDS )
210 while ( (h = dynamic_cast<TH1 *>(next())) )
213 StartOfDetectorCycle() ;