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::operator = (const AliQADataMakerRec& qadm )
68 // Assignment operator.
69 this->~AliQADataMakerRec();
70 new(this) AliQADataMakerRec(qadm);
74 //____________________________________________________________________________
75 void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX task)
77 // Finishes a cycle of QA data acquistion
79 TObjArray * list = 0x0 ;
81 if ( task == AliQA::kRAWS )
83 else if ( task == AliQA::kRECPOINTS )
84 list = fRecPointsQAList ;
85 else if ( task == AliQA::kESDS )
88 EndOfDetectorCycle(task, list) ;
89 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
96 //____________________________________________________________________________
97 void AliQADataMakerRec::Exec(AliQA::TASKINDEX task, TObject * data)
99 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
101 if ( task == AliQA::kRAWS ) {
102 AliDebug(1, "Processing Raws QA") ;
103 AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
105 MakeRaws(rawReader) ;
107 AliError("Wrong data type") ;
108 } else if ( task == AliQA::kRECPOINTS ) {
109 AliDebug(1, "Processing RecPoints QA") ;
110 TTree * tree = dynamic_cast<TTree *>(data) ;
112 MakeRecPoints(tree) ;
114 AliWarning("data are not a TTree") ;
116 } else if ( task == AliQA::kESDS ) {
117 AliDebug(1, "Processing ESDs QA") ;
118 AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
122 AliError("Wrong type of esd container") ;
126 //____________________________________________________________________________
127 TObjArray * AliQADataMakerRec::Init(AliQA::TASKINDEX task, Int_t run, Int_t cycles)
129 // general intialisation
131 TObjArray * rv = NULL ;
137 if ( task == AliQA::kRAWS ) {
138 fRawsQAList = new TObjArray(100) ;
141 } else if ( task == AliQA::kRECPOINTS ) {
142 fRecPointsQAList = new TObjArray(100) ;
144 rv = fRecPointsQAList ;
145 } else if ( task == AliQA::kESDS ) {
146 fESDsQAList = new TObjArray(100) ;
154 //____________________________________________________________________________
155 void AliQADataMakerRec::Init(AliQA::TASKINDEX task, TObjArray * list, Int_t run, Int_t cycles)
157 // Intialisation by passing the list of QA data booked elsewhere
163 if ( task == AliQA::kRAWS ) {
165 } else if ( task == AliQA::kRECPOINTS ) {
166 fRecPointsQAList = list ;
167 } else if ( task == AliQA::kESDS ) {
172 //____________________________________________________________________________
173 void AliQADataMakerRec::StartOfCycle(AliQA::TASKINDEX task, const Bool_t sameCycle)
175 // Finishes a cycle of QA data acquistion
176 if ( !sameCycle || fCurrentCycle == -1) {
180 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
182 AliDebug(1, Form(" Run %d Cycle %d task %s file %s",
183 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
185 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
187 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
189 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
191 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
194 TObjArray * list = 0x0 ;
196 if ( task == AliQA::kRAWS )
198 else if ( task == AliQA::kRECPOINTS)
199 list = fRecPointsQAList ;
200 else if ( task == AliQA::kESDS )
205 while ( (h = dynamic_cast<TH1 *>(next())) )
208 StartOfDetectorCycle() ;