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) :
59 AliQADataMakerRec(qadm),
60 fMaxRawVar(qadm.fMaxRawVar),
65 if ( fMaxRawVar > 0 ) {
66 fVarvalue = new Double_t[fMaxRawVar] ;
67 memcpy(fVarvalue, qadm.fVarvalue, fMaxRawVar*sizeof(Double_t));
70 // Replace shallow copy done by AliQADataMakerRec by a semi-deep
71 // copy where the pointer container is recreated but the Ntuples pointed
72 // to are simply copied
73 fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ;
74 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
75 fCorrNt[specie] = qadm.fCorrNt[specie] ;
79 //__________________________________________________________________
80 AliCorrQADataMakerRec& AliCorrQADataMakerRec::operator = (const AliCorrQADataMakerRec& qadm )
84 AliQADataMakerRec::operator=(qadm);
85 fMaxRawVar = qadm.fMaxRawVar;
88 if ( fMaxRawVar > 0 ) {
89 fVarvalue = new Double_t[fMaxRawVar] ;
90 memcpy(fVarvalue, qadm.fVarvalue, fMaxRawVar*sizeof(Double_t));
93 // Replace shallow copy done by AliQADataMakerRec by a semi-deep
94 // copy where the pointer container is recreated but the Ntuples pointed
95 // to are simply copied
96 fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ;
97 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
98 fCorrNt[specie] = qadm.fCorrNt[specie] ;
102 //____________________________________________________________________________
103 AliCorrQADataMakerRec::~AliCorrQADataMakerRec()
106 // dtor only destroy the ntuple otherwise it would violate ownership...
107 // however when the last AliCorrQADataMakerRec is deleted there is
111 // for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; ++specie)
112 // delete fCorrNt[specie] ;
115 delete [] fVarvalue ;
118 //____________________________________________________________________________
119 void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** /*list*/)
121 //Detector specific actions at end of cycle
122 // do the QA checking
123 if (task == AliQAv1::kRAWS) {
124 AliQAChecker::Instance()->Run(AliQAv1::kCORR, task, fCorrNt) ;
128 //____________________________________________________________________________
129 void AliCorrQADataMakerRec::InitESDs()
131 //Create histograms to controll ESD
133 AliInfo("TO BE IMPLEMENTED") ;
135 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
139 //____________________________________________________________________________
140 void AliCorrQADataMakerRec::InitRaws()
142 // createa ntuple taking all the parameters declared by detectors
143 if (fCorrNt && fCorrNt[AliRecoParam::AConvert(fEventSpecie)])
147 fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ; ;
148 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
149 fCorrNt[specie] = NULL ;
154 delete[] fRawsQAList ; // not needed for the time being
157 TString varlist("") ;
158 for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
159 AliQADataMaker * qadm = fqadm[detIndex] ;
162 TList * list = qadm->GetParameterList() ;
165 TParameter<double> * p ;
166 while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
167 varlist.Append(p->GetName()) ;
168 varlist.Append(":") ;
173 varlist = varlist.Strip(TString::kTrailing, ':') ;
174 if (fMaxRawVar == 0) {
175 AliWarning("NTUPLE not created") ;
177 char * name = Form("%s_%s", AliQAv1::GetQACorrName(), AliRecoParam::GetEventSpecieName(fEventSpecie)) ;
178 fCorrNt[AliRecoParam::AConvert(fEventSpecie)] = new TNtupleD(name, "Raws data correlation among detectors", varlist.Data()) ;
179 fVarvalue = new Double_t[fMaxRawVar] ;
182 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
185 //____________________________________________________________________________
186 void AliCorrQADataMakerRec::InitRecPoints()
188 // create Reconstructed Points histograms in RecPoints subdir
190 AliInfo("TO BE IMPLEMENTED") ;
191 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
194 //____________________________________________________________________________
195 void AliCorrQADataMakerRec::InitRecoParams()
197 // Get the recoparam form the OCDB for every detector involved in CORR
199 AliInfo("TO BE IMPLEMENTED") ;
202 //____________________________________________________________________________
203 void AliCorrQADataMakerRec::MakeESDs(AliESDEvent * /*esd*/)
205 // make QA data from ESDs
207 AliInfo("TO BE IMPLEMENTED") ;
208 IncEvCountCycleESDs();
209 IncEvCountTotalESDs();
213 //____________________________________________________________________________
214 void AliCorrQADataMakerRec::MakeRaws(AliRawReader *)
216 //Fill prepared histograms with Raw digit properties
218 if ( !fCorrNt || ! fCorrNt[AliRecoParam::AConvert(fEventSpecie)])
221 if ( fMaxRawVar > 0 ) {
223 for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
224 AliQADataMaker * qadm = fqadm[detIndex] ;
227 TList * list = qadm->GetParameterList() ;
230 TParameter<double> * p ;
231 while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
232 if (index >= fMaxRawVar) {
233 AliError(Form("Variables list size exceeded (%d) !",index));
236 fVarvalue[index] = p->GetVal() ;
241 static_cast<TNtupleD*>(fCorrNt[AliRecoParam::AConvert(fEventSpecie)])->Fill(fVarvalue);
244 IncEvCountCycleRaws();
245 IncEvCountTotalRaws();
249 //____________________________________________________________________________
250 void AliCorrQADataMakerRec::MakeRecPoints(TTree * /*clustersTree*/)
252 AliInfo("TO BE IMPLEMENTED") ;
253 IncEvCountCycleRecPoints();
254 IncEvCountTotalRecPoints();
258 //____________________________________________________________________________
259 void AliCorrQADataMakerRec::StartOfDetectorCycle()
261 //Detector specific actions at start of cycle