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 ---
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),
48 fDetectorDirName = GetName() ;
51 //____________________________________________________________________________
52 AliQADataMakerRec::AliQADataMakerRec(const AliQADataMakerRec& qadm) :
53 AliQADataMaker(qadm.GetName(), qadm.GetTitle()),
54 fESDsQAList(qadm.fESDsQAList),
55 fRawsQAList(qadm.fRawsQAList),
56 fRecPointsQAList(qadm.fRecPointsQAList)
60 SetName(qadm.GetName()) ;
61 SetTitle(qadm.GetTitle()) ;
62 fDetectorDirName = GetName() ;
65 //____________________________________________________________________________
66 AliQADataMakerRec::~AliQADataMakerRec()
68 //dtor: delete the TObjArray and thei content
70 fESDsQAList->Delete() ;
74 fRawsQAList->Delete() ;
77 if ( fRecPointsQAList ) {
78 fRecPointsQAList->Delete() ;
79 delete fRecPointsQAList ;
83 //__________________________________________________________________
84 AliQADataMakerRec& AliQADataMakerRec::operator = (const AliQADataMakerRec& qadm )
86 // Assignment operator.
87 this->~AliQADataMakerRec();
88 new(this) AliQADataMakerRec(qadm);
92 //____________________________________________________________________________
93 void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task)
95 // Finishes a cycle of QA data acquistion
97 TObjArray * list = 0x0 ;
99 if ( task == AliQA::kRAWS )
101 else if ( task == AliQA::kRECPOINTS )
102 list = fRecPointsQAList ;
103 else if ( task == AliQA::kESDS )
106 DefaultEndOfDetectorCycle(task) ;
107 EndOfDetectorCycle(task, list) ;
108 TDirectory * subDir = 0x0 ;
110 subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
119 //____________________________________________________________________________
120 void AliQADataMakerRec::Exec(AliQA::TASKINDEX_t task, TObject * data)
122 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
124 if ( task == AliQA::kRAWS ) {
125 AliDebug(1, "Processing Raws QA") ;
126 AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
128 MakeRaws(rawReader) ;
130 AliError("Wrong data type") ;
131 } else if ( task == AliQA::kRECPOINTS ) {
132 AliDebug(1, "Processing RecPoints QA") ;
133 TTree * tree = dynamic_cast<TTree *>(data) ;
135 MakeRecPoints(tree) ;
137 AliWarning("data are not a TTree") ;
139 } else if ( task == AliQA::kESDS ) {
140 AliDebug(1, "Processing ESDs QA") ;
141 AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
145 AliError("Wrong type of esd container") ;
149 //____________________________________________________________________________
150 TObjArray * AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, Int_t run, Int_t cycles)
152 // general intialisation
154 TObjArray * rv = NULL ;
160 if ( task == AliQA::kRAWS ) {
161 if (! fRawsQAList ) {
162 fRawsQAList = new TObjArray(100) ;
166 } else if ( task == AliQA::kRECPOINTS ) {
167 if ( ! fRecPointsQAList ) {
168 fRecPointsQAList = new TObjArray(100) ;
171 rv = fRecPointsQAList ;
172 } else if ( task == AliQA::kESDS ) {
173 if ( ! fESDsQAList ) {
174 fESDsQAList = new TObjArray(100) ;
183 //____________________________________________________________________________
184 void AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, TObjArray * list, Int_t run, Int_t cycles)
186 // Intialisation by passing the list of QA data booked elsewhere
192 if ( task == AliQA::kRAWS ) {
194 } else if ( task == AliQA::kRECPOINTS ) {
195 fRecPointsQAList = list ;
196 } else if ( task == AliQA::kESDS ) {
201 //____________________________________________________________________________
202 void AliQADataMakerRec::StartOfCycle(AliQA::TASKINDEX_t task, const Bool_t sameCycle)
204 // Finishes a cycle of QA data acquistion
205 if ( !sameCycle || fCurrentCycle == -1) {
209 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
211 AliInfo(Form(" Run %d Cycle %d task %s file %s",
212 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
214 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
216 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
218 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
220 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
223 TObjArray * list = 0x0 ;
225 if ( task == AliQA::kRAWS )
227 else if ( task == AliQA::kRECPOINTS)
228 list = fRecPointsQAList ;
229 else if ( task == AliQA::kESDS )
232 // Should be the choice of detectors
233 // TIter next(list) ;
235 // while ( (h = dynamic_cast<TH1 *>(next())) )
238 StartOfDetectorCycle() ;