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 ---
29 #include <TClonesArray.h>
31 // --- Standard library ---
33 // --- AliRoot header files ---
35 #include "AliQADataMakerSim.h"
37 ClassImp(AliQADataMakerSim)
39 //____________________________________________________________________________
40 AliQADataMakerSim::AliQADataMakerSim(const char * name, const char * title) :
41 AliQADataMaker(name, title),
47 fDetectorDirName = GetName() ;
50 //____________________________________________________________________________
51 AliQADataMakerSim::AliQADataMakerSim(const AliQADataMakerSim& qadm) :
52 AliQADataMaker(qadm.GetName(), qadm.GetTitle()),
53 fDigitsQAList(qadm.fDigitsQAList),
54 fHitsQAList(qadm.fHitsQAList),
55 fSDigitsQAList(qadm.fSDigitsQAList)
58 fDetectorDirName = GetName() ;
61 //__________________________________________________________________
62 AliQADataMakerSim& AliQADataMakerSim::operator = (const AliQADataMakerSim& qadm )
64 // Assignment operator.
65 this->~AliQADataMakerSim();
66 new(this) AliQADataMakerSim(qadm);
70 //____________________________________________________________________________
71 void AliQADataMakerSim::EndOfCycle(AliQA::TASKINDEX_t task)
73 // Finishes a cycle of QA data acquistion
74 TObjArray * list = 0x0 ;
76 if ( task == AliQA::kHITS )
78 else if ( task == AliQA::kSDIGITS )
79 list = fSDigitsQAList ;
80 else if ( task == AliQA::kDIGITS )
81 list = fDigitsQAList ;
83 EndOfDetectorCycle(task, list) ;
84 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
91 //____________________________________________________________________________
92 void AliQADataMakerSim::Exec(AliQA::TASKINDEX_t task, TObject * data)
94 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
96 if ( task == AliQA::kHITS ) {
97 AliDebug(1, "Processing Hits QA") ;
98 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
102 TTree * tree = dynamic_cast<TTree *>(data) ;
106 AliWarning("data are neither a TClonesArray nor a TTree") ;
109 } else if ( task == AliQA::kSDIGITS ) {
110 AliDebug(1, "Processing SDigits QA") ;
111 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
115 TTree * tree = dynamic_cast<TTree *>(data) ;
119 AliWarning("data are neither a TClonesArray nor a TTree") ;
122 } else if ( task == AliQA::kDIGITS ) {
123 AliDebug(1, "Processing Digits QA") ;
124 TClonesArray * arr = dynamic_cast<TClonesArray *>(data) ;
128 TTree * tree = dynamic_cast<TTree *>(data) ;
132 AliWarning("data are neither a TClonesArray nor a TTree") ;
138 //____________________________________________________________________________
139 TObjArray * AliQADataMakerSim::Init(AliQA::TASKINDEX_t task, Int_t run, Int_t cycles)
141 // general intialisation
146 TObjArray * rv = NULL ;
147 if ( task == AliQA::kHITS ) {
148 fHitsQAList = new TObjArray(100) ;
151 } else if ( task == AliQA::kSDIGITS ) {
152 fSDigitsQAList = new TObjArray(100) ;
154 rv = fSDigitsQAList ;
155 } else if ( task == AliQA::kDIGITS ) {
156 fDigitsQAList = new TObjArray(100);
164 //____________________________________________________________________________
165 void AliQADataMakerSim::Init(AliQA::TASKINDEX_t task, TObjArray * list, Int_t run, Int_t cycles)
167 // Intialisation by passing the list of QA data booked elsewhere
173 if ( task == AliQA::kHITS ) {
175 } else if ( task == AliQA::kSDIGITS) {
176 fSDigitsQAList = list ;
177 } else if ( task == AliQA::kDIGITS ) {
178 fDigitsQAList = list ;
182 //____________________________________________________________________________
183 void AliQADataMakerSim::StartOfCycle(AliQA::TASKINDEX_t task, const Bool_t sameCycle)
185 // Finishes a cycle of QA data acquistion
186 if ( !sameCycle || fCurrentCycle == -1) {
190 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
193 AliInfo(Form(" Run %d Cycle %d task %s file %s",
194 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
196 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
198 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
200 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
202 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
205 TObjArray * list = 0x0 ;
207 if ( task == AliQA::kHITS )
209 else if ( task == AliQA::kSDIGITS )
210 list = fSDigitsQAList ;
211 else if ( task == AliQA::kDIGITS )
212 list = fDigitsQAList ;
216 while ( (h = dynamic_cast<TH1 *>(next())) )
219 StartOfDetectorCycle() ;