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 TString AliQADataMaker::fDetectorDirName("") ;
47 //____________________________________________________________________________
48 AliQADataMaker::AliQADataMaker(const char * name, const char * title) :
56 fRecPointsQAList(0x0),
64 fDetectorDirName = GetName() ;
67 //____________________________________________________________________________
68 AliQADataMaker::AliQADataMaker(const AliQADataMaker& qadm) :
69 TNamed(qadm.GetName(), qadm.GetTitle()),
70 fOutput(qadm.fOutput),
71 fDetectorDir(qadm.fDetectorDir),
72 fDigitsQAList(qadm.fDigitsQAList),
73 fESDsQAList(qadm.fESDsQAList),
74 fHitsQAList(qadm.fHitsQAList),
75 fRawsQAList(qadm.fRecPointsQAList),
76 fRecPointsQAList(qadm.fRecPointsQAList),
77 fSDigitsQAList(qadm.fSDigitsQAList),
78 fCurrentCycle(qadm.fCurrentCycle),
80 fCycleCounter(qadm.fCycleCounter),
84 fDetectorDirName = GetName() ;
87 //____________________________________________________________________________
88 AliQADataMaker::~AliQADataMaker()
93 //__________________________________________________________________
94 AliQADataMaker& AliQADataMaker::operator = (const AliQADataMaker& qadm )
97 this->~AliQADataMaker();
98 new(this) AliQADataMaker(qadm);
102 //____________________________________________________________________________
103 void AliQADataMaker::EndOfCycle(AliQA::TASKINDEX task)
105 // Finishes a cycle of QA data acquistion
119 case AliQA::kSDIGITS:
120 list = fSDigitsQAList ;
124 list = fDigitsQAList ;
127 case AliQA::kRECPOINTS:
128 list = fRecPointsQAList ;
131 case AliQA::kTRACKSEGMENTS:
134 case AliQA::kRECPARTICLES:
142 EndOfDetectorCycle(task, list) ;
143 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
148 //____________________________________________________________________________
149 void AliQADataMaker::Exec(AliQA::TASKINDEX task, TObject * data)
151 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
157 AliInfo("Processing Raws QA") ;
158 AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
160 MakeRaws(rawReader) ;
162 AliError("Wrong data type") ;
167 AliInfo("Processing Hits QA") ;
168 TClonesArray * hits = dynamic_cast<TClonesArray *>(data) ;
172 AliError("Wrong type of hits container") ;
175 case AliQA::kSDIGITS:
177 AliInfo("Processing SDigits QA") ;
178 TClonesArray * sdigits = dynamic_cast<TClonesArray *>(data) ;
180 MakeSDigits(sdigits) ;
182 AliError("Wrong type of sdigits container") ;
187 TClonesArray * digits = dynamic_cast<TClonesArray *>(data) ;
191 AliError("Wrong type of digits container") ;
194 case AliQA::kRECPOINTS:
196 AliInfo("Processing RecPoints QA") ;
197 TTree * recpoints = dynamic_cast<TTree *>(data) ;
199 MakeRecPoints(recpoints) ;
201 AliError("Wrong type of recpoints container") ;
204 case AliQA::kTRACKSEGMENTS:
205 AliInfo("Processing Track Segments QA: not existing anymore") ;
206 // TTree * ts = dynamic_cast<TTree *>(data) ;
208 // MakeTrackSegments(ts) ;
210 // AliError("Wrong type of track segments container") ;
213 case AliQA::kRECPARTICLES:
214 AliInfo("Processing RecParticles QA: not existing anymore") ;
215 // TTree * recpar = dynamic_cast<TTree *>(data) ;
217 // MakeRecParticles(recpar) ;
219 // AliError("Wrong type of recparticles container") ;
224 AliInfo("Processing ESDs QA") ;
225 AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
229 AliError("Wrong type of esd container") ;
235 //____________________________________________________________________________
236 void AliQADataMaker::Finish(AliQA::TASKINDEX) const
238 // write to the output File
242 //____________________________________________________________________________
243 TList * AliQADataMaker::Init(AliQA::TASKINDEX task, Int_t run, Int_t cycles)
245 // general intialisation
254 fRawsQAList = new TList() ;
261 fHitsQAList = new TList() ;
266 case AliQA::kSDIGITS:
268 fSDigitsQAList = new TList() ;
270 return fSDigitsQAList ;
275 fDigitsQAList = new TList();
277 return fDigitsQAList ;
280 case AliQA::kRECPOINTS:
282 fRecPointsQAList = new TList ;
284 return fRecPointsQAList ;
287 case AliQA::kTRACKSEGMENTS:
288 // InitTrackSegments() ;
291 case AliQA::kRECPARTICLES:
292 // InitRecParticles() ;
297 fESDsQAList = new TList() ;
299 return fRecPointsQAList ;
306 //____________________________________________________________________________
307 void AliQADataMaker::StartOfCycle(AliQA::TASKINDEX task, Option_t * sameCycle)
309 // Finishes a cycle of QA data acquistion
311 if ( (strcmp(sameCycle, "new") == 0) ) {
315 fOutput = AliQA::GetQADMOutFile(GetName(), fRun, fCurrentCycle) ;
318 AliInfo(Form(" Run %d Cycle %d task %s file %s",
319 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
321 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
323 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
325 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
327 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
341 case AliQA::kSDIGITS:
342 list = fSDigitsQAList ;
346 list = fDigitsQAList ;
349 case AliQA::kRECPOINTS:
350 list = fRecPointsQAList ;
353 case AliQA::kTRACKSEGMENTS:
356 case AliQA::kRECPARTICLES:
366 while ( (h = dynamic_cast<TH1 *>(next())) )
369 StartOfDetectorCycle() ;