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)) ;
94 //____________________________________________________________________________
95 void AliQADataMakerSim::Exec(AliQA::TASKINDEX task, TObject * data)
97 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
99 if ( task == AliQA::kHITS ) {
100 AliDebug(1, "Processing Hits QA") ;
101 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
105 TTree * tree = dynamic_cast<TTree *>(data) ;
109 AliWarning("data are neither a TClonesArray nor a TTree") ;
112 } else if ( task == AliQA::kSDIGITS ) {
113 AliDebug(1, "Processing SDigits QA") ;
114 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
118 TTree * tree = dynamic_cast<TTree *>(data) ;
122 AliWarning("data are neither a TClonesArray nor a TTree") ;
125 } else if ( task == AliQA::kDIGITS ) {
126 AliDebug(1, "Processing Digits QA") ;
127 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
131 TTree * tree = dynamic_cast<TTree *>(data) ;
135 AliWarning("data are neither a TClonesArray nor a TTree") ;
141 //____________________________________________________________________________
142 TObjArray * AliQADataMakerSim::Init(AliQA::TASKINDEX task, Int_t run, Int_t cycles)
144 // general intialisation
149 TObjArray * rv = NULL ;
150 if ( task == AliQA::kHITS ) {
151 fHitsQAList = new TObjArray(100) ;
154 } else if ( task == AliQA::kSDIGITS ) {
155 fSDigitsQAList = new TObjArray(100) ;
157 rv = fSDigitsQAList ;
158 } else if ( task == AliQA::kDIGITS ) {
159 fDigitsQAList = new TObjArray(100);
167 //____________________________________________________________________________
168 void AliQADataMakerSim::Init(AliQA::TASKINDEX task, TObjArray * list, Int_t run, Int_t cycles)
170 // Intialisation by passing the list of QA data booked elsewhere
176 if ( task == AliQA::kHITS ) {
178 } else if ( task == AliQA::kSDIGITS) {
179 fSDigitsQAList = list ;
180 } else if ( task == AliQA::kDIGITS ) {
181 fDigitsQAList = list ;
185 //____________________________________________________________________________
186 void AliQADataMakerSim::StartOfCycle(AliQA::TASKINDEX task, const Bool_t sameCycle)
188 // Finishes a cycle of QA data acquistion
189 if ( !sameCycle || fCurrentCycle == -1) {
193 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
196 AliInfo(Form(" Run %d Cycle %d task %s file %s",
197 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
199 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
201 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
203 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
205 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
208 TObjArray * list = 0x0 ;
210 if ( task == AliQA::kHITS )
212 else if ( task == AliQA::kSDIGITS )
213 list = fSDigitsQAList ;
214 else if ( task == AliQA::kDIGITS )
215 list = fDigitsQAList ;
219 while ( (h = dynamic_cast<TH1 *>(next())) )
222 StartOfDetectorCycle() ;