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] ;
103 //____________________________________________________________________________
104 AliCorrQADataMakerRec::~AliCorrQADataMakerRec()
107 // dtor only destroy the ntuple otherwise it would violate ownership...
108 // however when the last AliCorrQADataMakerRec is deleted there is
112 // for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; ++specie)
113 // delete fCorrNt[specie] ;
116 delete [] fVarvalue ;
119 //____________________________________________________________________________
120 void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** /*list*/)
122 //Detector specific actions at end of cycle
123 // do the QA checking
124 if (task == AliQAv1::kRAWS) {
125 AliQAChecker::Instance()->Run(AliQAv1::kCORR, task, fCorrNt) ;
129 //____________________________________________________________________________
130 void AliCorrQADataMakerRec::InitESDs()
132 //Create histograms to controll ESD
134 AliInfo("TO BE IMPLEMENTED") ;
136 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
140 //____________________________________________________________________________
141 void AliCorrQADataMakerRec::InitRaws()
143 // createa ntuple taking all the parameters declared by detectors
144 if (fCorrNt && fCorrNt[AliRecoParam::AConvert(fEventSpecie)])
148 fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ; ;
149 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
150 fCorrNt[specie] = NULL ;
155 delete[] fRawsQAList ; // not needed for the time being
158 TString varlist("") ;
159 for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
160 AliQADataMaker * qadm = fqadm[detIndex] ;
163 TList * list = qadm->GetParameterList() ;
166 TParameter<double> * p ;
167 while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
168 varlist.Append(p->GetName()) ;
169 varlist.Append(":") ;
174 varlist = varlist.Strip(TString::kTrailing, ':') ;
175 if (fMaxRawVar == 0) {
176 AliWarning("NTUPLE not created") ;
178 char * name = Form("%s_%s", AliQAv1::GetQACorrName(), AliRecoParam::GetEventSpecieName(fEventSpecie)) ;
179 fCorrNt[AliRecoParam::AConvert(fEventSpecie)] = new TNtupleD(name, "Raws data correlation among detectors", varlist.Data()) ;
180 fVarvalue = new Double_t[fMaxRawVar] ;
183 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
186 //____________________________________________________________________________
187 void AliCorrQADataMakerRec::InitRecPoints()
189 // create Reconstructed Points histograms in RecPoints subdir
191 AliInfo("TO BE IMPLEMENTED") ;
192 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
195 //____________________________________________________________________________
196 void AliCorrQADataMakerRec::InitRecoParams()
198 // Get the recoparam form the OCDB for every detector involved in CORR
200 AliInfo("TO BE IMPLEMENTED") ;
203 //____________________________________________________________________________
204 void AliCorrQADataMakerRec::MakeESDs(AliESDEvent * /*esd*/)
206 // make QA data from ESDs
208 AliInfo("TO BE IMPLEMENTED") ;
209 IncEvCountCycleESDs();
210 IncEvCountTotalESDs();
214 //____________________________________________________________________________
215 void AliCorrQADataMakerRec::MakeRaws(AliRawReader *)
217 //Fill prepared histograms with Raw digit properties
219 if ( !fCorrNt || ! fCorrNt[AliRecoParam::AConvert(fEventSpecie)])
222 if ( fMaxRawVar > 0 ) {
224 for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
225 AliQADataMaker * qadm = fqadm[detIndex] ;
228 TList * list = qadm->GetParameterList() ;
231 TParameter<double> * p ;
232 while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
233 if (index >= fMaxRawVar) {
234 AliError(Form("Variables list size exceeded (%d) !",index));
237 fVarvalue[index] = p->GetVal() ;
242 static_cast<TNtupleD*>(fCorrNt[AliRecoParam::AConvert(fEventSpecie)])->Fill(fVarvalue);
245 IncEvCountCycleRaws();
246 IncEvCountTotalRaws();
250 //____________________________________________________________________________
251 void AliCorrQADataMakerRec::MakeRecPoints(TTree * /*clustersTree*/)
253 AliInfo("TO BE IMPLEMENTED") ;
254 IncEvCountCycleRecPoints();
255 IncEvCountTotalRecPoints();
259 //____________________________________________________________________________
260 void AliCorrQADataMakerRec::StartOfDetectorCycle()
262 //Detector specific actions at start of cycle