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 "AliQADataMakerSim.h"
38 #include "AliQAChecker.h"
40 ClassImp(AliQADataMakerSim)
42 //____________________________________________________________________________
43 AliQADataMakerSim::AliQADataMakerSim(const char * name, const char * title) :
44 AliQADataMaker(name, title),
50 fDetectorDirName = GetName() ;
53 //____________________________________________________________________________
54 AliQADataMakerSim::AliQADataMakerSim(const AliQADataMakerSim& qadm) :
55 AliQADataMaker(qadm.GetName(), qadm.GetTitle()),
56 fDigitsQAList(qadm.fDigitsQAList),
57 fHitsQAList(qadm.fHitsQAList),
58 fSDigitsQAList(qadm.fSDigitsQAList)
61 fDetectorDirName = GetName() ;
64 //__________________________________________________________________
65 AliQADataMakerSim& AliQADataMakerSim::operator = (const AliQADataMakerSim& qadm )
67 // Assignment operator.
68 this->~AliQADataMakerSim();
69 new(this) AliQADataMakerSim(qadm);
73 //____________________________________________________________________________
74 void AliQADataMakerSim::EndOfCycle(AliQA::TASKINDEX task)
76 // Finishes a cycle of QA data acquistion
77 TObjArray * list = 0x0 ;
79 if ( task == AliQA::kHITS )
81 else if ( task == AliQA::kSDIGITS )
82 list = fSDigitsQAList ;
83 else if ( task == AliQA::kDIGITS )
84 list = fDigitsQAList ;
86 EndOfDetectorCycle(task, list) ;
87 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
92 //____________________________________________________________________________
93 void AliQADataMakerSim::Exec(AliQA::TASKINDEX task, TObject * data)
95 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
97 if ( task == AliQA::kHITS ) {
98 AliDebug(1, "Processing Hits QA") ;
99 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
103 TTree * tree = dynamic_cast<TTree *>(data) ;
107 AliWarning("data are neither a TClonesArray nor a TTree") ;
110 } else if ( task == AliQA::kSDIGITS ) {
111 AliDebug(1, "Processing SDigits QA") ;
112 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
116 TTree * tree = dynamic_cast<TTree *>(data) ;
120 AliWarning("data are neither a TClonesArray nor a TTree") ;
123 } else if ( task == AliQA::kDIGITS ) {
124 AliDebug(1, "Processing Digits QA") ;
125 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
129 TTree * tree = dynamic_cast<TTree *>(data) ;
133 AliWarning("data are neither a TClonesArray nor a TTree") ;
139 //____________________________________________________________________________
140 TObjArray * AliQADataMakerSim::Init(AliQA::TASKINDEX task, Int_t run, Int_t cycles)
142 // general intialisation
147 TObjArray * rv = NULL ;
148 if ( task == AliQA::kHITS ) {
149 fHitsQAList = new TObjArray(100) ;
152 } else if ( task == AliQA::kSDIGITS ) {
153 fSDigitsQAList = new TObjArray(100) ;
155 rv = fSDigitsQAList ;
156 } else if ( task == AliQA::kDIGITS ) {
157 fDigitsQAList = new TObjArray(100);
165 //____________________________________________________________________________
166 void AliQADataMakerSim::Init(AliQA::TASKINDEX task, TObjArray * list, Int_t run, Int_t cycles)
168 // Intialisation by passing the list of QA data booked elsewhere
174 if ( task == AliQA::kHITS ) {
176 } else if ( task == AliQA::kSDIGITS) {
177 fSDigitsQAList = list ;
178 } else if ( task == AliQA::kDIGITS ) {
179 fDigitsQAList = list ;
183 //____________________________________________________________________________
184 void AliQADataMakerSim::StartOfCycle(AliQA::TASKINDEX task, const Bool_t sameCycle)
186 // Finishes a cycle of QA data acquistion
187 if ( !sameCycle || fCurrentCycle == -1) {
191 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
194 AliInfo(Form(" Run %d Cycle %d task %s file %s",
195 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
197 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
199 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
201 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
203 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
206 TObjArray * list = 0x0 ;
208 if ( task == AliQA::kHITS )
210 else if ( task == AliQA::kSDIGITS )
211 list = fSDigitsQAList ;
212 else if ( task == AliQA::kDIGITS )
213 list = fDigitsQAList ;
217 while ( (h = dynamic_cast<TH1 *>(next())) )
220 StartOfDetectorCycle() ;