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