]>
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), |
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 | //____________________________________________________________________________ | |
57 | AliCorrQADataMakerRec::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 | //__________________________________________________________________ | |
68 | AliCorrQADataMakerRec& 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 | //____________________________________________________________________________ | |
77 | AliCorrQADataMakerRec::~AliCorrQADataMakerRec() | |
78 | { | |
79 | // dtor only destroy the ntuple | |
80 | if ( fCorrNt ) { | |
81 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { | |
82 | if ( fCorrNt[specie] != NULL ) | |
83 | delete fCorrNt[specie] ; | |
84 | } | |
85 | delete[] fCorrNt ; | |
96dd7d86 | 86 | fCorrNt = 0x0; |
57acd2d2 | 87 | } |
88 | } | |
89 | ||
a64b872d | 90 | //____________________________________________________________________________ |
4e25ac79 | 91 | void 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 | //____________________________________________________________________________ | |
101 | void AliCorrQADataMakerRec::InitESDs() | |
102 | { | |
103 | //Create histograms to controll ESD | |
104 | ||
105 | AliInfo("TO BE IMPLEMENTED") ; | |
106 | } | |
107 | ||
108 | //____________________________________________________________________________ | |
109 | void AliCorrQADataMakerRec::InitRecPoints() | |
110 | { | |
111 | // create Reconstructed Points histograms in RecPoints subdir | |
112 | ||
113 | AliInfo("TO BE IMPLEMENTED") ; | |
114 | } | |
115 | ||
116 | //____________________________________________________________________________ | |
117 | void 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 | //____________________________________________________________________________ | |
150 | void AliCorrQADataMakerRec::MakeESDs(AliESDEvent * /*esd*/) | |
151 | { | |
152 | // make QA data from ESDs | |
153 | ||
154 | AliInfo("TO BE IMPLEMENTED") ; | |
155 | ||
156 | } | |
157 | ||
158 | //____________________________________________________________________________ | |
930e6e3e | 159 | void 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 ) { |
167 | const Int_t kSize = fMaxRawVar ; | |
31316597 | 168 | Double_t *varvalue = new Double_t[kSize] ; |
a64b872d | 169 | Int_t index = 0 ; |
4e25ac79 | 170 | for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++ ) { |
a64b872d | 171 | AliQADataMaker * qadm = fqadm[detIndex] ; |
172 | if ( ! qadm ) | |
173 | continue ; | |
174 | TList * list = qadm->GetParameterList() ; | |
175 | TIter next(list) ; | |
176 | TParameter<double> * p ; | |
eca4fa66 | 177 | while ( (p = static_cast<TParameter<double>*>(next()) ) ) { |
a64b872d | 178 | varvalue[index++] = p->GetVal() ; |
179 | } | |
180 | } | |
025edd2a | 181 | static_cast<TNtupleD*>(fCorrNt[AliRecoParam::AConvert(fEventSpecie)])->Fill(varvalue); |
31316597 | 182 | delete [] varvalue; |
a64b872d | 183 | } |
184 | } | |
185 | ||
186 | //____________________________________________________________________________ | |
187 | void AliCorrQADataMakerRec::MakeRecPoints(TTree * /*clustersTree*/) | |
188 | { | |
189 | AliInfo("TO BE IMPLEMENTED") ; | |
190 | } | |
191 | ||
192 | //____________________________________________________________________________ | |
193 | void AliCorrQADataMakerRec::StartOfDetectorCycle() | |
194 | { | |
195 | //Detector specific actions at start of cycle | |
930e6e3e | 196 | |
a64b872d | 197 | } |