]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliCorrQADataMakerRec.cxx
Processing SPD Mean Vertex only in PHYSICS runs.
[u/mrichter/AliRoot.git] / 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] ;
a64b872d 69}
70
71//__________________________________________________________________
72AliCorrQADataMakerRec& AliCorrQADataMakerRec::operator = (const AliCorrQADataMakerRec& qadm )
73{
57acd2d2 74 // assign operator.
a64b872d 75 this->~AliCorrQADataMakerRec();
76 new(this) AliCorrQADataMakerRec(qadm);
77 return *this;
78}
57acd2d2 79
80//____________________________________________________________________________
81AliCorrQADataMakerRec::~AliCorrQADataMakerRec()
82{
83 // dtor only destroy the ntuple
84 if ( fCorrNt ) {
c6f66d2b 85// for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
86// if ( fCorrNt[specie] != NULL )
87// delete fCorrNt[specie] ;
88// }
57acd2d2 89 delete[] fCorrNt ;
96dd7d86 90 fCorrNt = 0x0;
57acd2d2 91 }
097485c2 92 if ( fMaxRawVar > 0 )
93 delete [] fVarvalue ;
57acd2d2 94}
95
a64b872d 96//____________________________________________________________________________
4e25ac79 97void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** /*list*/)
a64b872d 98{
99 //Detector specific actions at end of cycle
100 // do the QA checking
4e25ac79 101 if (task == AliQAv1::kRAWS) {
102 AliQAChecker::Instance()->Run(AliQAv1::kCORR, task, fCorrNt) ;
930e6e3e 103 }
a64b872d 104}
105
106//____________________________________________________________________________
107void AliCorrQADataMakerRec::InitESDs()
108{
109 //Create histograms to controll ESD
110
111 AliInfo("TO BE IMPLEMENTED") ;
112}
113
114//____________________________________________________________________________
115void AliCorrQADataMakerRec::InitRecPoints()
116{
117 // create Reconstructed Points histograms in RecPoints subdir
118
119 AliInfo("TO BE IMPLEMENTED") ;
120}
121
122//____________________________________________________________________________
123void AliCorrQADataMakerRec::InitRaws()
124{
125 // createa ntuple taking all the parameters declared by detectors
09a42975 126 if (fCorrNt[AliRecoParam::AConvert(fEventSpecie)])
a64b872d 127 return ;
3136db6f 128 if ( fRawsQAList )
129 {
130 delete[] fRawsQAList ; // not needed for the time being
131 fRawsQAList = NULL ;
132 }
a64b872d 133 TString varlist("") ;
4e25ac79 134 for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
a64b872d 135 AliQADataMaker * qadm = fqadm[detIndex] ;
136 if ( ! qadm )
137 continue ;
138 TList * list = qadm->GetParameterList() ;
139 if (list) {
140 TIter next(list) ;
141 TParameter<double> * p ;
eca4fa66 142 while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
a64b872d 143 varlist.Append(p->GetName()) ;
144 varlist.Append(":") ;
145 fMaxRawVar++ ;
146 }
147 }
148 }
149 varlist = varlist.Strip(TString::kTrailing, ':') ;
150 if (fMaxRawVar == 0) {
151 AliWarning("NTUPLE not created") ;
152 } else {
025edd2a 153 char * name = Form("%s_%s", AliQAv1::GetQACorrName(), AliRecoParam::GetEventSpecieName(fEventSpecie)) ;
154 fCorrNt[AliRecoParam::AConvert(fEventSpecie)] = new TNtupleD(name, "Raws data correlation among detectors", varlist.Data()) ;
097485c2 155 fVarvalue = new Double_t[fMaxRawVar] ;
a64b872d 156 }
157}
158
159//____________________________________________________________________________
160void AliCorrQADataMakerRec::MakeESDs(AliESDEvent * /*esd*/)
161{
162 // make QA data from ESDs
163
164 AliInfo("TO BE IMPLEMENTED") ;
165
166}
167
168//____________________________________________________________________________
930e6e3e 169void AliCorrQADataMakerRec::MakeRaws(AliRawReader *)
a64b872d 170{
171 //Fill prepared histograms with Raw digit properties
025edd2a 172
173 if ( ! fCorrNt[AliRecoParam::AConvert(fEventSpecie)])
174 InitRaws() ;
175
a64b872d 176 if ( fMaxRawVar > 0 ) {
a64b872d 177 Int_t index = 0 ;
4e25ac79 178 for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) {
a64b872d 179 AliQADataMaker * qadm = fqadm[detIndex] ;
180 if ( ! qadm )
181 continue ;
182 TList * list = qadm->GetParameterList() ;
183 TIter next(list) ;
184 TParameter<double> * p ;
eca4fa66 185 while ( (p = static_cast<TParameter<double>*>(next()) ) ) {
097485c2 186 fVarvalue[index] = p->GetVal() ;
187 index++ ;
a64b872d 188 }
189 }
097485c2 190 static_cast<TNtupleD*>(fCorrNt[AliRecoParam::AConvert(fEventSpecie)])->Fill(fVarvalue);
a64b872d 191 }
192}
193
194//____________________________________________________________________________
195void AliCorrQADataMakerRec::MakeRecPoints(TTree * /*clustersTree*/)
196{
197 AliInfo("TO BE IMPLEMENTED") ;
198}
199
200//____________________________________________________________________________
201void AliCorrQADataMakerRec::StartOfDetectorCycle()
202{
203 //Detector specific actions at start of cycle
930e6e3e 204
a64b872d 205}