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 notifce *
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 for Reconstruction
22 // All data must be mergeable objects.
23 // Y. Schutz CERN July 2007
26 // --- ROOT system ---
30 // --- Standard library ---
32 // --- AliRoot header files ---
34 #include "AliQADataMakerRec.h"
35 #include "AliESDEvent.h"
36 #include "AliRawReader.h"
38 ClassImp(AliQADataMakerRec)
40 //____________________________________________________________________________
41 AliQADataMakerRec::AliQADataMakerRec(const char * name, const char * title) :
42 AliQADataMaker(name, title),
45 fRecPointsQAList(0x0),
49 fDetectorDirName = GetName() ;
52 //____________________________________________________________________________
53 AliQADataMakerRec::AliQADataMakerRec(const AliQADataMakerRec& qadm) :
54 AliQADataMaker(qadm.GetName(), qadm.GetTitle()),
55 fESDsQAList(qadm.fESDsQAList),
56 fRawsQAList(qadm.fRawsQAList),
57 fRecPointsQAList(qadm.fRecPointsQAList),
58 fRecoParam(qadm.fRecoParam)
62 SetName(qadm.GetName()) ;
63 SetTitle(qadm.GetTitle()) ;
64 fDetectorDirName = GetName() ;
67 //____________________________________________________________________________
68 AliQADataMakerRec::~AliQADataMakerRec()
70 //dtor: delete the TObjArray and thei content
72 if ( fESDsQAList->IsOwner() )
73 fESDsQAList->Delete() ;
77 if ( fRawsQAList->IsOwner() )
78 fRawsQAList->Delete() ;
81 if ( fRecPointsQAList ) {
82 if ( fRecPointsQAList->IsOwner() )
83 fRecPointsQAList->Delete() ;
84 delete fRecPointsQAList ;
88 //__________________________________________________________________
89 AliQADataMakerRec& AliQADataMakerRec::operator = (const AliQADataMakerRec& qadm )
91 // Assignment operator.
92 this->~AliQADataMakerRec();
93 new(this) AliQADataMakerRec(qadm);
97 //____________________________________________________________________________
98 void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task)
100 // Finishes a cycle of QA data acquistion
102 TObjArray * list = 0x0 ;
104 if ( task == AliQA::kRAWS )
106 else if ( task == AliQA::kRECPOINTS )
107 list = fRecPointsQAList ;
108 else if ( task == AliQA::kESDS )
111 //DefaultEndOfDetectorCycle(task) ;
112 EndOfDetectorCycle(task, list) ;
113 TDirectory * subDir = 0x0 ;
115 subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
124 //____________________________________________________________________________
125 void AliQADataMakerRec::Exec(AliQA::TASKINDEX_t task, TObject * data)
127 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
129 if ( task == AliQA::kRAWS ) {
130 AliDebug(1, "Processing Raws QA") ;
131 AliRawReader * rawReader = dynamic_cast<AliRawReader *>(data) ;
133 MakeRaws(rawReader) ;
135 AliError("Wrong data type") ;
136 } else if ( task == AliQA::kRECPOINTS ) {
137 AliDebug(1, "Processing RecPoints QA") ;
138 TTree * tree = dynamic_cast<TTree *>(data) ;
140 MakeRecPoints(tree) ;
142 AliWarning("data are not a TTree") ;
144 } else if ( task == AliQA::kESDS ) {
145 AliDebug(1, "Processing ESDs QA") ;
146 AliESDEvent * esd = dynamic_cast<AliESDEvent *>(data) ;
150 AliError("Wrong type of esd container") ;
154 //____________________________________________________________________________
155 TObjArray * AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, Int_t run, Int_t cycles)
157 // general intialisation
159 TObjArray * rv = NULL ;
165 if ( task == AliQA::kRAWS ) {
166 if (! fRawsQAList ) {
167 fRawsQAList = new TObjArray(100) ;
171 } else if ( task == AliQA::kRECPOINTS ) {
172 if ( ! fRecPointsQAList ) {
173 fRecPointsQAList = new TObjArray(100) ;
176 rv = fRecPointsQAList ;
177 } else if ( task == AliQA::kESDS ) {
178 if ( ! fESDsQAList ) {
179 fESDsQAList = new TObjArray(100) ;
188 //____________________________________________________________________________
189 void AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, TObjArray * list, Int_t run, Int_t cycles)
191 // Intialisation by passing the list of QA data booked elsewhere
197 if ( task == AliQA::kRAWS ) {
199 } else if ( task == AliQA::kRECPOINTS ) {
200 fRecPointsQAList = list ;
201 } else if ( task == AliQA::kESDS ) {
206 //____________________________________________________________________________
207 void AliQADataMakerRec::StartOfCycle(AliQA::TASKINDEX_t task, const Bool_t sameCycle)
209 // Finishes a cycle of QA data acquistion
210 if ( !sameCycle || fCurrentCycle == -1) {
214 fOutput = AliQA::GetQADataFile(GetName(), fRun, fCurrentCycle) ;
216 AliInfo(Form(" Run %d Cycle %d task %s file %s",
217 fRun, fCurrentCycle, AliQA::GetTaskName(task).Data(), fOutput->GetName() )) ;
219 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
221 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
223 TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ;
225 subDir = fDetectorDir->mkdir(AliQA::GetTaskName(task)) ;
228 TObjArray * list = 0x0 ;
230 if ( task == AliQA::kRAWS )
232 else if ( task == AliQA::kRECPOINTS)
233 list = fRecPointsQAList ;
234 else if ( task == AliQA::kESDS )
237 // Should be the choice of detectors
238 // TIter next(list) ;
240 // while ( (h = dynamic_cast<TH1 *>(next())) )
243 StartOfDetectorCycle() ;