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.fRawsQAList),
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 AliDebug(1, "Processing Raws QA") ;
151 AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
153 MakeRaws(rawReader) ;
155 AliError("Wrong data type") ;
160 AliDebug(1, "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 AliDebug(1, "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 AliDebug(1, "Processing Digits QA") ;
193 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
197 TTree * tree = dynamic_cast<TTree *>(data) ;
201 AliWarning("data are neither a TClonesArray nor a TTree") ;
206 case AliQA::kRECPOINTS:
208 AliDebug(1, "Processing RecPoints QA") ;
209 TTree * tree = dynamic_cast<TTree *>(data) ;
211 MakeRecPoints(tree) ;
213 AliWarning("data are not a TTree") ;
217 case AliQA::kTRACKSEGMENTS:
218 AliInfo("Processing Track Segments QA: not existing anymore") ;
219 // MakeTrackSegments(ts) ;
222 case AliQA::kRECPARTICLES:
223 AliInfo("Processing RecParticles QA: not existing anymore") ;
224 // MakeRecParticles(recpar) ;
228 AliDebug(1, "Processing ESDs QA") ;
229 AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
233 AliError("Wrong type of esd container") ;
239 //____________________________________________________________________________
240 void AliQADataMaker::Finish() const
242 // write to the output File
246 //____________________________________________________________________________
247 TList * AliQADataMaker::Init(AliQA::TASKINDEX task, Int_t run, Int_t cycles)
249 // general intialisation
258 fRawsQAList = new TList() ;
265 fHitsQAList = new TList() ;
270 case AliQA::kSDIGITS:
272 fSDigitsQAList = new TList() ;
274 return fSDigitsQAList ;
279 fDigitsQAList = new TList();
281 return fDigitsQAList ;
284 case AliQA::kRECPOINTS:
286 fRecPointsQAList = new TList() ;
288 return fRecPointsQAList ;
291 case AliQA::kTRACKSEGMENTS:
292 // InitTrackSegments() ;
295 case AliQA::kRECPARTICLES:
296 // InitRecParticles() ;
301 fESDsQAList = new TList() ;
303 return fRecPointsQAList ;
310 //____________________________________________________________________________
311 void AliQADataMaker::Init(AliQA::TASKINDEX task, TList * list, Int_t run, Int_t cycles)
313 // Intialisation by passing the list of QA data booked elsewhere
330 case AliQA::kSDIGITS:
332 fSDigitsQAList = list ;
337 fDigitsQAList = list ;
340 case AliQA::kRECPOINTS:
342 fRecPointsQAList = list ;
345 case AliQA::kTRACKSEGMENTS:
348 case AliQA::kRECPARTICLES:
359 //____________________________________________________________________________
360 void AliQADataMaker::Reset()
362 // Resets defaut value of data members
367 //____________________________________________________________________________
368 void AliQADataMaker::StartOfCycle(AliQA::TASKINDEX task, const Bool_t sameCycle)
370 // Finishes a cycle of QA data acquistion
372 if ( !sameCycle || fCurrentCycle == -1) {
376 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
378 AliInfo(Form(" Run %d Cycle %d task %s file %s",
379 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
381 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
383 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
385 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
387 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
401 case AliQA::kSDIGITS:
402 list = fSDigitsQAList ;
406 list = fDigitsQAList ;
409 case AliQA::kRECPOINTS:
410 list = fRecPointsQAList ;
413 case AliQA::kTRACKSEGMENTS:
416 case AliQA::kRECPARTICLES:
426 while ( (h = dynamic_cast<TH1 *>(next())) )
429 StartOfDetectorCycle() ;