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 **************************************************************************/
17 /* $Id: AliCorrQADataMakerRec.cxx 27570 2008-07-24 21:49:27Z cvetan $ */
20 Produces the data needed to calculate the quality assurance.
21 All data must be mergeable objects.
22 Y. Schutz CERN July 2007
25 // --- ROOT system ---
26 #include <TClonesArray.h>
32 #include <TParameter.h>
35 // --- Standard library ---
37 // --- AliRoot header files ---
39 #include "AliCorrQADataMakerRec.h"
40 #include "AliQAChecker.h"
42 ClassImp(AliCorrQADataMakerRec)
44 //____________________________________________________________________________
45 AliCorrQADataMakerRec::AliCorrQADataMakerRec(AliQADataMaker ** qadm ) :
46 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kCORR), "Corr Quality Assurance Data Maker"),
52 fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ;
53 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
54 fCorrNt[specie] = NULL ;
57 //____________________________________________________________________________
58 AliCorrQADataMakerRec::AliCorrQADataMakerRec(const AliCorrQADataMakerRec& qadm) :
60 fMaxRawVar(qadm.fMaxRawVar),
65 SetName((const char*)qadm.GetName()) ;
66 SetTitle((const char*)qadm.GetTitle());
68 fVarvalue = new Double_t[fMaxRawVar] ;
70 fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ;
71 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
72 fCorrNt[specie] = qadm.fCorrNt[specie] ;
76 //__________________________________________________________________
77 AliCorrQADataMakerRec& AliCorrQADataMakerRec::operator = (const AliCorrQADataMakerRec& qadm )
80 this->~AliCorrQADataMakerRec();
81 new(this) AliCorrQADataMakerRec(qadm);
85 //____________________________________________________________________________
86 AliCorrQADataMakerRec::~AliCorrQADataMakerRec()
88 // dtor only destroy the ntuple
90 // for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
91 // if ( fCorrNt[specie] != NULL )
92 // delete fCorrNt[specie] ;
101 //____________________________________________________________________________
102 void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** /*list*/)
104 //Detector specific actions at end of cycle
105 // do the QA checking
106 if (task == AliQAv1::kRAWS) {
107 AliQAChecker::Instance()->Run(AliQAv1::kCORR, task, fCorrNt) ;
111 //____________________________________________________________________________
112 void AliCorrQADataMakerRec::InitESDs()
114 //Create histograms to controll ESD
116 AliInfo("TO BE IMPLEMENTED") ;
118 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
122 //____________________________________________________________________________
123 void AliCorrQADataMakerRec::InitRaws()
125 // createa ntuple taking all the parameters declared by detectors
126 if (fCorrNt && fCorrNt[AliRecoParam::AConvert(fEventSpecie)])
130 fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ; ;
131 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
132 fCorrNt[specie] = NULL ;
137 delete[] fRawsQAList ; // not needed for the time being
140 TString varlist("") ;
141 for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
142 AliQADataMaker * qadm = fqadm[detIndex] ;
145 TList * list = qadm->GetParameterList() ;
148 TParameter<double> * p ;
149 while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
150 varlist.Append(p->GetName()) ;
151 varlist.Append(":") ;
156 varlist = varlist.Strip(TString::kTrailing, ':') ;
157 if (fMaxRawVar == 0) {
158 AliWarning("NTUPLE not created") ;
160 char * name = Form("%s_%s", AliQAv1::GetQACorrName(), AliRecoParam::GetEventSpecieName(fEventSpecie)) ;
161 fCorrNt[AliRecoParam::AConvert(fEventSpecie)] = new TNtupleD(name, "Raws data correlation among detectors", varlist.Data()) ;
162 fVarvalue = new Double_t[fMaxRawVar] ;
165 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
168 //____________________________________________________________________________
169 void AliCorrQADataMakerRec::InitRecPoints()
171 // create Reconstructed Points histograms in RecPoints subdir
173 AliInfo("TO BE IMPLEMENTED") ;
174 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
177 //____________________________________________________________________________
178 void AliCorrQADataMakerRec::InitRecoParams()
180 // Get the recoparam form the OCDB for every detector involved in CORR
182 AliInfo("TO BE IMPLEMENTED") ;
185 //____________________________________________________________________________
186 void AliCorrQADataMakerRec::MakeESDs(AliESDEvent * /*esd*/)
188 // make QA data from ESDs
190 AliInfo("TO BE IMPLEMENTED") ;
191 IncEvCountCycleESDs();
192 IncEvCountTotalESDs();
196 //____________________________________________________________________________
197 void AliCorrQADataMakerRec::MakeRaws(AliRawReader *)
199 //Fill prepared histograms with Raw digit properties
201 if ( !fCorrNt || ! fCorrNt[AliRecoParam::AConvert(fEventSpecie)])
204 if ( fMaxRawVar > 0 ) {
206 for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
207 AliQADataMaker * qadm = fqadm[detIndex] ;
210 TList * list = qadm->GetParameterList() ;
213 TParameter<double> * p ;
214 while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
215 if (index >= fMaxRawVar) {
216 AliError(Form("Variables list size exceeded (%d) !",index));
219 fVarvalue[index] = p->GetVal() ;
224 static_cast<TNtupleD*>(fCorrNt[AliRecoParam::AConvert(fEventSpecie)])->Fill(fVarvalue);
227 IncEvCountCycleRaws();
228 IncEvCountTotalRaws();
232 //____________________________________________________________________________
233 void AliCorrQADataMakerRec::MakeRecPoints(TTree * /*clustersTree*/)
235 AliInfo("TO BE IMPLEMENTED") ;
236 IncEvCountCycleRecPoints();
237 IncEvCountTotalRecPoints();
241 //____________________________________________________________________________
242 void AliCorrQADataMakerRec::StartOfDetectorCycle()
244 //Detector specific actions at start of cycle