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 if ( fESDsQAList->IsOwner() )
71 fESDsQAList->Delete() ;
75 if ( fRawsQAList->IsOwner() )
76 fRawsQAList->Delete() ;
79 if ( fRecPointsQAList ) {
80 if ( fRecPointsQAList->IsOwner() )
81 fRecPointsQAList->Delete() ;
82 delete fRecPointsQAList ;
86 //__________________________________________________________________
87 AliQADataMakerRec& AliQADataMakerRec::operator = (const AliQADataMakerRec& qadm )
89 // Assignment operator.
90 this->~AliQADataMakerRec();
91 new(this) AliQADataMakerRec(qadm);
95 //____________________________________________________________________________
96 void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task)
98 // Finishes a cycle of QA data acquistion
100 TObjArray * list = 0x0 ;
102 if ( task == AliQA::kRAWS )
104 else if ( task == AliQA::kRECPOINTS )
105 list = fRecPointsQAList ;
106 else if ( task == AliQA::kESDS )
109 DefaultEndOfDetectorCycle(task) ;
110 EndOfDetectorCycle(task, list) ;
111 TDirectory * subDir = 0x0 ;
113 subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
122 //____________________________________________________________________________
123 void AliQADataMakerRec::Exec(AliQA::TASKINDEX_t task, TObject * data)
125 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
127 if ( task == AliQA::kRAWS ) {
128 AliDebug(1, "Processing Raws QA") ;
129 AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
131 MakeRaws(rawReader) ;
133 AliError("Wrong data type") ;
134 } else if ( task == AliQA::kRECPOINTS ) {
135 AliDebug(1, "Processing RecPoints QA") ;
136 TTree * tree = dynamic_cast<TTree *>(data) ;
138 MakeRecPoints(tree) ;
140 AliWarning("data are not a TTree") ;
142 } else if ( task == AliQA::kESDS ) {
143 AliDebug(1, "Processing ESDs QA") ;
144 AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
148 AliError("Wrong type of esd container") ;
152 //____________________________________________________________________________
153 TObjArray * AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, Int_t run, Int_t cycles)
155 // general intialisation
157 TObjArray * rv = NULL ;
163 if ( task == AliQA::kRAWS ) {
164 if (! fRawsQAList ) {
165 fRawsQAList = new TObjArray(100) ;
169 } else if ( task == AliQA::kRECPOINTS ) {
170 if ( ! fRecPointsQAList ) {
171 fRecPointsQAList = new TObjArray(100) ;
174 rv = fRecPointsQAList ;
175 } else if ( task == AliQA::kESDS ) {
176 if ( ! fESDsQAList ) {
177 fESDsQAList = new TObjArray(100) ;
186 //____________________________________________________________________________
187 void AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, TObjArray * list, Int_t run, Int_t cycles)
189 // Intialisation by passing the list of QA data booked elsewhere
195 if ( task == AliQA::kRAWS ) {
197 } else if ( task == AliQA::kRECPOINTS ) {
198 fRecPointsQAList = list ;
199 } else if ( task == AliQA::kESDS ) {
204 //____________________________________________________________________________
205 void AliQADataMakerRec::StartOfCycle(AliQA::TASKINDEX_t task, const Bool_t sameCycle)
207 // Finishes a cycle of QA data acquistion
208 if ( !sameCycle || fCurrentCycle == -1) {
212 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
214 AliInfo(Form(" Run %d Cycle %d task %s file %s",
215 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
217 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
219 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
221 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
223 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
226 TObjArray * list = 0x0 ;
228 if ( task == AliQA::kRAWS )
230 else if ( task == AliQA::kRECPOINTS)
231 list = fRecPointsQAList ;
232 else if ( task == AliQA::kESDS )
235 // Should be the choice of detectors
236 // TIter next(list) ;
238 // while ( (h = dynamic_cast<TH1 *>(next())) )
241 StartOfDetectorCycle() ;