]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/STEER/AliCorrQADataMakerRec.cxx
Removing the tasks from the digitization (Ruben)
[u/mrichter/AliRoot.git] / STEER / STEER / AliCorrQADataMakerRec.cxx
CommitLineData
a64b872d 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16
17/* $Id: AliCorrQADataMakerRec.cxx 27570 2008-07-24 21:49:27Z cvetan $ */
18
19/*
20 Produces the data needed to calculate the quality assurance.
21 All data must be mergeable objects.
22 Y. Schutz CERN July 2007
23*/
24
25// --- ROOT system ---
26#include <TClonesArray.h>
27#include <TFile.h>
28#include <TH1F.h>
29#include <TH1I.h>
30#include <TH2F.h>
31#include <TNtupleD.h>
32#include <TParameter.h>
57acd2d2 33#include <TMath.h>
a64b872d 34
35// --- Standard library ---
36
37// --- AliRoot header files ---
38#include "AliLog.h"
39#include "AliCorrQADataMakerRec.h"
40#include "AliQAChecker.h"
41
42ClassImp(AliCorrQADataMakerRec)
43
44//____________________________________________________________________________
45AliCorrQADataMakerRec::AliCorrQADataMakerRec(AliQADataMaker ** qadm ) :
4e25ac79 46AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kCORR), "Corr Quality Assurance Data Maker"),
a64b872d 47 fMaxRawVar(0),
097485c2 48 fqadm(qadm),
49 fVarvalue(NULL)
a64b872d 50{
51 // ctor
57acd2d2 52 fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ;
53 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
54 fCorrNt[specie] = NULL ;
a64b872d 55}
56
57//____________________________________________________________________________
58AliCorrQADataMakerRec::AliCorrQADataMakerRec(const AliCorrQADataMakerRec& qadm) :
59 AliQADataMakerRec(),
60 fMaxRawVar(qadm.fMaxRawVar),
097485c2 61 fqadm(qadm.fqadm),
62 fVarvalue(NULL)
a64b872d 63{
64 //copy ctor
65 SetName((const char*)qadm.GetName()) ;
66 SetTitle((const char*)qadm.GetTitle());
097485c2 67 if ( fMaxRawVar > 0 )
68 fVarvalue = new Double_t[fMaxRawVar] ;
4bb9542a 69
70 fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ;
71 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
72 fCorrNt[specie] = qadm.fCorrNt[specie] ;
73
a64b872d 74}
75
76//__________________________________________________________________
77AliCorrQADataMakerRec& AliCorrQADataMakerRec::operator = (const AliCorrQADataMakerRec& qadm )
78{
57acd2d2 79 // assign operator.
a64b872d 80 this->~AliCorrQADataMakerRec();
81 new(this) AliCorrQADataMakerRec(qadm);
82 return *this;
83}
57acd2d2 84
85//____________________________________________________________________________
86AliCorrQADataMakerRec::~AliCorrQADataMakerRec()
87{
88 // dtor only destroy the ntuple
89 if ( fCorrNt ) {
c6f66d2b 90// for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
91// if ( fCorrNt[specie] != NULL )
92// delete fCorrNt[specie] ;
93// }
57acd2d2 94 delete[] fCorrNt ;
96dd7d86 95 fCorrNt = 0x0;
57acd2d2 96 }
097485c2 97 if ( fMaxRawVar > 0 )
98 delete [] fVarvalue ;
57acd2d2 99}
100
a64b872d 101//____________________________________________________________________________
4e25ac79 102void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** /*list*/)
a64b872d 103{
104 //Detector specific actions at end of cycle
105 // do the QA checking
4e25ac79 106 if (task == AliQAv1::kRAWS) {
107 AliQAChecker::Instance()->Run(AliQAv1::kCORR, task, fCorrNt) ;
930e6e3e 108 }
a64b872d 109}
110
111//____________________________________________________________________________
112void AliCorrQADataMakerRec::InitESDs()
113{
114 //Create histograms to controll ESD
115
116 AliInfo("TO BE IMPLEMENTED") ;
92664bc8 117 //
118 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
a64b872d 119}
120
a64b872d 121
122//____________________________________________________________________________
123void AliCorrQADataMakerRec::InitRaws()
124{
125 // createa ntuple taking all the parameters declared by detectors
4bb9542a 126 if (fCorrNt && fCorrNt[AliRecoParam::AConvert(fEventSpecie)])
a64b872d 127 return ;
4bb9542a 128
129 if (!fCorrNt) {
130 fCorrNt = new TNtupleD *[AliRecoParam::kNSpecies] ; ;
131 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
132 fCorrNt[specie] = NULL ;
133 }
134
3136db6f 135 if ( fRawsQAList )
136 {
137 delete[] fRawsQAList ; // not needed for the time being
138 fRawsQAList = NULL ;
139 }
a64b872d 140 TString varlist("") ;
4e25ac79 141 for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
a64b872d 142 AliQADataMaker * qadm = fqadm[detIndex] ;
143 if ( ! qadm )
144 continue ;
145 TList * list = qadm->GetParameterList() ;
146 if (list) {
147 TIter next(list) ;
148 TParameter<double> * p ;
eca4fa66 149 while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
a64b872d 150 varlist.Append(p->GetName()) ;
151 varlist.Append(":") ;
152 fMaxRawVar++ ;
153 }
154 }
155 }
156 varlist = varlist.Strip(TString::kTrailing, ':') ;
157 if (fMaxRawVar == 0) {
158 AliWarning("NTUPLE not created") ;
159 } else {
025edd2a 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()) ;
097485c2 162 fVarvalue = new Double_t[fMaxRawVar] ;
a64b872d 163 }
92664bc8 164 //
165 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
a64b872d 166}
167
f14c8c46 168//____________________________________________________________________________
169void AliCorrQADataMakerRec::InitRecPoints()
170{
171 // create Reconstructed Points histograms in RecPoints subdir
172
173 AliInfo("TO BE IMPLEMENTED") ;
92664bc8 174 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
f14c8c46 175}
176
177//____________________________________________________________________________
178void AliCorrQADataMakerRec::InitRecoParams()
179{
180 // Get the recoparam form the OCDB for every detector involved in CORR
181
182 AliInfo("TO BE IMPLEMENTED") ;
183}
184
a64b872d 185//____________________________________________________________________________
186void AliCorrQADataMakerRec::MakeESDs(AliESDEvent * /*esd*/)
187{
188 // make QA data from ESDs
189
190 AliInfo("TO BE IMPLEMENTED") ;
92664bc8 191 IncEvCountCycleESDs();
192 IncEvCountTotalESDs();
193 //
a64b872d 194}
195
196//____________________________________________________________________________
930e6e3e 197void AliCorrQADataMakerRec::MakeRaws(AliRawReader *)
a64b872d 198{
199 //Fill prepared histograms with Raw digit properties
025edd2a 200
4bb9542a 201 if ( !fCorrNt || ! fCorrNt[AliRecoParam::AConvert(fEventSpecie)])
025edd2a 202 InitRaws() ;
203
a64b872d 204 if ( fMaxRawVar > 0 ) {
a64b872d 205 Int_t index = 0 ;
4e25ac79 206 for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
a64b872d 207 AliQADataMaker * qadm = fqadm[detIndex] ;
208 if ( ! qadm )
209 continue ;
210 TList * list = qadm->GetParameterList() ;
4bb9542a 211 if (list) {
212 TIter next(list) ;
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));
217 break;
218 }
219 fVarvalue[index] = p->GetVal() ;
220 index++ ;
221 }
a64b872d 222 }
223 }
097485c2 224 static_cast<TNtupleD*>(fCorrNt[AliRecoParam::AConvert(fEventSpecie)])->Fill(fVarvalue);
a64b872d 225 }
92664bc8 226 //
227 IncEvCountCycleRaws();
228 IncEvCountTotalRaws();
229 //
a64b872d 230}
231
232//____________________________________________________________________________
233void AliCorrQADataMakerRec::MakeRecPoints(TTree * /*clustersTree*/)
234{
235 AliInfo("TO BE IMPLEMENTED") ;
92664bc8 236 IncEvCountCycleRecPoints();
237 IncEvCountTotalRecPoints();
238 //
a64b872d 239}
240
241//____________________________________________________________________________
242void AliCorrQADataMakerRec::StartOfDetectorCycle()
243{
244 //Detector specific actions at start of cycle
930e6e3e 245
a64b872d 246}