]>
Commit | Line | Data |
---|---|---|
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 | ||
42 | ClassImp(AliCorrQADataMakerRec) | |
43 | ||
44 | //____________________________________________________________________________ | |
45 | AliCorrQADataMakerRec::AliCorrQADataMakerRec(AliQADataMaker ** qadm ) : | |
4e25ac79 | 46 | AliQADataMakerRec(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 | //____________________________________________________________________________ | |
58 | AliCorrQADataMakerRec::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 | //__________________________________________________________________ | |
72 | AliCorrQADataMakerRec& 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 | //____________________________________________________________________________ | |
81 | AliCorrQADataMakerRec::~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 | 97 | void 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 | //____________________________________________________________________________ | |
107 | void AliCorrQADataMakerRec::InitESDs() | |
108 | { | |
109 | //Create histograms to controll ESD | |
110 | ||
111 | AliInfo("TO BE IMPLEMENTED") ; | |
112 | } | |
113 | ||
114 | //____________________________________________________________________________ | |
115 | void AliCorrQADataMakerRec::InitRecPoints() | |
116 | { | |
117 | // create Reconstructed Points histograms in RecPoints subdir | |
118 | ||
119 | AliInfo("TO BE IMPLEMENTED") ; | |
120 | } | |
121 | ||
122 | //____________________________________________________________________________ | |
123 | void AliCorrQADataMakerRec::InitRaws() | |
124 | { | |
125 | // createa ntuple taking all the parameters declared by detectors | |
09a42975 | 126 | if (fCorrNt[AliRecoParam::AConvert(fEventSpecie)]) |
a64b872d | 127 | return ; |
128 | delete fRawsQAList ; // not needed for the time being | |
129 | fRawsQAList = NULL ; | |
130 | TString varlist("") ; | |
4e25ac79 | 131 | for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) { |
a64b872d | 132 | AliQADataMaker * qadm = fqadm[detIndex] ; |
133 | if ( ! qadm ) | |
134 | continue ; | |
135 | TList * list = qadm->GetParameterList() ; | |
136 | if (list) { | |
137 | TIter next(list) ; | |
138 | TParameter<double> * p ; | |
eca4fa66 | 139 | while ( (p = static_cast<TParameter<double>*>(next()) ) ) { |
a64b872d | 140 | varlist.Append(p->GetName()) ; |
141 | varlist.Append(":") ; | |
142 | fMaxRawVar++ ; | |
143 | } | |
144 | } | |
145 | } | |
146 | varlist = varlist.Strip(TString::kTrailing, ':') ; | |
147 | if (fMaxRawVar == 0) { | |
148 | AliWarning("NTUPLE not created") ; | |
149 | } else { | |
025edd2a | 150 | char * name = Form("%s_%s", AliQAv1::GetQACorrName(), AliRecoParam::GetEventSpecieName(fEventSpecie)) ; |
151 | fCorrNt[AliRecoParam::AConvert(fEventSpecie)] = new TNtupleD(name, "Raws data correlation among detectors", varlist.Data()) ; | |
097485c2 | 152 | fVarvalue = new Double_t[fMaxRawVar] ; |
a64b872d | 153 | } |
154 | } | |
155 | ||
156 | //____________________________________________________________________________ | |
157 | void AliCorrQADataMakerRec::MakeESDs(AliESDEvent * /*esd*/) | |
158 | { | |
159 | // make QA data from ESDs | |
160 | ||
161 | AliInfo("TO BE IMPLEMENTED") ; | |
162 | ||
163 | } | |
164 | ||
165 | //____________________________________________________________________________ | |
930e6e3e | 166 | void AliCorrQADataMakerRec::MakeRaws(AliRawReader *) |
a64b872d | 167 | { |
168 | //Fill prepared histograms with Raw digit properties | |
025edd2a | 169 | |
170 | if ( ! fCorrNt[AliRecoParam::AConvert(fEventSpecie)]) | |
171 | InitRaws() ; | |
172 | ||
a64b872d | 173 | if ( fMaxRawVar > 0 ) { |
a64b872d | 174 | Int_t index = 0 ; |
4e25ac79 | 175 | for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) { |
a64b872d | 176 | AliQADataMaker * qadm = fqadm[detIndex] ; |
177 | if ( ! qadm ) | |
178 | continue ; | |
179 | TList * list = qadm->GetParameterList() ; | |
180 | TIter next(list) ; | |
181 | TParameter<double> * p ; | |
eca4fa66 | 182 | while ( (p = static_cast<TParameter<double>*>(next()) ) ) { |
097485c2 | 183 | fVarvalue[index] = p->GetVal() ; |
184 | index++ ; | |
a64b872d | 185 | } |
186 | } | |
097485c2 | 187 | static_cast<TNtupleD*>(fCorrNt[AliRecoParam::AConvert(fEventSpecie)])->Fill(fVarvalue); |
a64b872d | 188 | } |
189 | } | |
190 | ||
191 | //____________________________________________________________________________ | |
192 | void AliCorrQADataMakerRec::MakeRecPoints(TTree * /*clustersTree*/) | |
193 | { | |
194 | AliInfo("TO BE IMPLEMENTED") ; | |
195 | } | |
196 | ||
197 | //____________________________________________________________________________ | |
198 | void AliCorrQADataMakerRec::StartOfDetectorCycle() | |
199 | { | |
200 | //Detector specific actions at start of cycle | |
930e6e3e | 201 | |
a64b872d | 202 | } |