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.
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 "AliQADataMaker.h"
38 #include "AliQAChecker.h"
39 #include "AliESDEvent.h"
40 #include "AliRawReader.h"
42 ClassImp(AliQADataMaker)
44 //____________________________________________________________________________
45 AliQADataMaker::AliQADataMaker(const char * name, const char * title) :
54 fRecPointsQAList(0x0),
62 fDetectorDirName = GetName() ;
65 //____________________________________________________________________________
66 AliQADataMaker::AliQADataMaker(const AliQADataMaker& qadm) :
67 TNamed(qadm.GetName(), qadm.GetTitle()),
68 fOutput(qadm.fOutput),
69 fDetectorDir(qadm.fDetectorDir),
70 fDetectorDirName(qadm.fDetectorDirName),
71 fDigitsQAList(qadm.fDigitsQAList),
72 fESDsQAList(qadm.fESDsQAList),
73 fHitsQAList(qadm.fHitsQAList),
74 fRawsQAList(qadm.fRecPointsQAList),
75 fRecPointsQAList(qadm.fRecPointsQAList),
76 fSDigitsQAList(qadm.fSDigitsQAList),
77 fCurrentCycle(qadm.fCurrentCycle),
79 fCycleCounter(qadm.fCycleCounter),
83 fDetectorDirName = GetName() ;
86 //__________________________________________________________________
87 AliQADataMaker& AliQADataMaker::operator = (const AliQADataMaker& qadm )
89 // Assignment operator.
90 this->~AliQADataMaker();
91 new(this) AliQADataMaker(qadm);
95 //____________________________________________________________________________
96 void AliQADataMaker::EndOfCycle(AliQA::TASKINDEX task)
98 // Finishes a cycle of QA data acquistion
112 case AliQA::kSDIGITS:
113 list = fSDigitsQAList ;
117 list = fDigitsQAList ;
120 case AliQA::kRECPOINTS:
121 list = fRecPointsQAList ;
124 case AliQA::kTRACKSEGMENTS:
127 case AliQA::kRECPARTICLES:
135 EndOfDetectorCycle(task, list) ;
136 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
141 //____________________________________________________________________________
142 void AliQADataMaker::Exec(AliQA::TASKINDEX task, TObject * data)
144 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
150 AliInfo("Processing Raws QA") ;
151 AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
153 MakeRaws(rawReader) ;
155 AliError("Wrong data type") ;
160 AliInfo("Processing Hits QA") ;
161 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
165 TTree * tree = dynamic_cast<TTree *>(data) ;
169 AliWarning("data are neither a TClonesArray nor a TTree") ;
174 case AliQA::kSDIGITS:
176 AliInfo("Processing SDigits QA") ;
177 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
181 TTree * tree = dynamic_cast<TTree *>(data) ;
185 AliWarning("data are neither a TClonesArray nor a TTree") ;
192 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
196 TTree * tree = dynamic_cast<TTree *>(data) ;
200 AliWarning("data are neither a TClonesArray nor a TTree") ;
205 case AliQA::kRECPOINTS:
207 AliInfo("Processing RecPoints QA") ;
208 TTree * tree = dynamic_cast<TTree *>(data) ;
210 MakeRecPoints(tree) ;
212 AliWarning("data are not a TTree") ;
216 case AliQA::kTRACKSEGMENTS:
217 AliInfo("Processing Track Segments QA: not existing anymore") ;
218 // MakeTrackSegments(ts) ;
221 case AliQA::kRECPARTICLES:
222 AliInfo("Processing RecParticles QA: not existing anymore") ;
223 // MakeRecParticles(recpar) ;
227 AliInfo("Processing ESDs QA") ;
228 AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
232 AliError("Wrong type of esd container") ;
238 //____________________________________________________________________________
239 void AliQADataMaker::Finish() const
241 // write to the output File
245 //____________________________________________________________________________
246 TList * AliQADataMaker::Init(AliQA::TASKINDEX task, Int_t run, Int_t cycles)
248 // general intialisation
257 fRawsQAList = new TList() ;
264 fHitsQAList = new TList() ;
269 case AliQA::kSDIGITS:
271 fSDigitsQAList = new TList() ;
273 return fSDigitsQAList ;
278 fDigitsQAList = new TList();
280 return fDigitsQAList ;
283 case AliQA::kRECPOINTS:
285 fRecPointsQAList = new TList() ;
287 return fRecPointsQAList ;
290 case AliQA::kTRACKSEGMENTS:
291 // InitTrackSegments() ;
294 case AliQA::kRECPARTICLES:
295 // InitRecParticles() ;
300 fESDsQAList = new TList() ;
302 return fRecPointsQAList ;
309 //____________________________________________________________________________
310 void AliQADataMaker::Init(AliQA::TASKINDEX task, TList * list, Int_t run, Int_t cycles)
312 // Intialisation by passing the list of QA data booked elsewhere
329 case AliQA::kSDIGITS:
331 fSDigitsQAList = list ;
336 fDigitsQAList = list ;
339 case AliQA::kRECPOINTS:
341 fRecPointsQAList = list ;
344 case AliQA::kTRACKSEGMENTS:
347 case AliQA::kRECPARTICLES:
358 //____________________________________________________________________________
359 void AliQADataMaker::Reset()
361 // Resets defaut value of data members
366 //____________________________________________________________________________
367 void AliQADataMaker::StartOfCycle(AliQA::TASKINDEX task, const Bool_t sameCycle)
369 // Finishes a cycle of QA data acquistion
375 fOutput = AliQA::GetQADMOutFile(GetName(), fRun, fCurrentCycle) ;
377 AliInfo(Form(" Run %d Cycle %d task %s file %s",
378 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
380 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
382 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
384 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
386 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
400 case AliQA::kSDIGITS:
401 list = fSDigitsQAList ;
405 list = fDigitsQAList ;
408 case AliQA::kRECPOINTS:
409 list = fRecPointsQAList ;
412 case AliQA::kTRACKSEGMENTS:
415 case AliQA::kRECPARTICLES:
425 while ( (h = dynamic_cast<TH1 *>(next())) )
428 StartOfDetectorCycle() ;