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
69 fESDsQAList->Delete() ;
70 fRawsQAList->Delete() ;
71 fRecPointsQAList->Delete() ;
74 delete fRecPointsQAList ;
77 //__________________________________________________________________
78 AliQADataMakerRec& AliQADataMakerRec::operator = (const AliQADataMakerRec& qadm )
80 // Assignment operator.
81 this->~AliQADataMakerRec();
82 new(this) AliQADataMakerRec(qadm);
86 //____________________________________________________________________________
87 void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task)
89 // Finishes a cycle of QA data acquistion
91 TObjArray * list = 0x0 ;
93 if ( task == AliQA::kRAWS )
95 else if ( task == AliQA::kRECPOINTS )
96 list = fRecPointsQAList ;
97 else if ( task == AliQA::kESDS )
100 DefaultEndOfDetectorCycle(task) ;
101 EndOfDetectorCycle(task, list) ;
102 TDirectory * subDir = 0x0 ;
104 subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
113 //____________________________________________________________________________
114 void AliQADataMakerRec::Exec(AliQA::TASKINDEX_t task, TObject * data)
116 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
118 if ( task == AliQA::kRAWS ) {
119 AliDebug(1, "Processing Raws QA") ;
120 AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
122 MakeRaws(rawReader) ;
124 AliError("Wrong data type") ;
125 } else if ( task == AliQA::kRECPOINTS ) {
126 AliDebug(1, "Processing RecPoints QA") ;
127 TTree * tree = dynamic_cast<TTree *>(data) ;
129 MakeRecPoints(tree) ;
131 AliWarning("data are not a TTree") ;
133 } else if ( task == AliQA::kESDS ) {
134 AliDebug(1, "Processing ESDs QA") ;
135 AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
139 AliError("Wrong type of esd container") ;
143 //____________________________________________________________________________
144 TObjArray * AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, Int_t run, Int_t cycles)
146 // general intialisation
148 TObjArray * rv = NULL ;
154 if ( task == AliQA::kRAWS ) {
155 if (! fRawsQAList ) {
156 fRawsQAList = new TObjArray(100) ;
160 } else if ( task == AliQA::kRECPOINTS ) {
161 if ( ! fRecPointsQAList ) {
162 fRecPointsQAList = new TObjArray(100) ;
165 rv = fRecPointsQAList ;
166 } else if ( task == AliQA::kESDS ) {
167 if ( ! fESDsQAList ) {
168 fESDsQAList = new TObjArray(100) ;
177 //____________________________________________________________________________
178 void AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, TObjArray * list, Int_t run, Int_t cycles)
180 // Intialisation by passing the list of QA data booked elsewhere
186 if ( task == AliQA::kRAWS ) {
188 } else if ( task == AliQA::kRECPOINTS ) {
189 fRecPointsQAList = list ;
190 } else if ( task == AliQA::kESDS ) {
195 //____________________________________________________________________________
196 void AliQADataMakerRec::StartOfCycle(AliQA::TASKINDEX_t task, const Bool_t sameCycle)
198 // Finishes a cycle of QA data acquistion
199 if ( !sameCycle || fCurrentCycle == -1) {
203 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
205 AliInfo(Form(" Run %d Cycle %d task %s file %s",
206 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
208 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
210 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
212 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
214 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
217 TObjArray * list = 0x0 ;
219 if ( task == AliQA::kRAWS )
221 else if ( task == AliQA::kRECPOINTS)
222 list = fRecPointsQAList ;
223 else if ( task == AliQA::kESDS )
226 // Should be the choice of detectors
227 // TIter next(list) ;
229 // while ( (h = dynamic_cast<TH1 *>(next())) )
232 StartOfDetectorCycle() ;