]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliCorrQADataMakerRec.cxx
Compilation errors fixed.
[u/mrichter/AliRoot.git] / STEER / AliCorrQADataMakerRec.cxx
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>
33
34 // --- Standard library ---
35
36 // --- AliRoot header files ---
37 #include "AliLog.h"
38 #include "AliCorrQADataMakerRec.h"
39 #include "AliQAChecker.h"
40
41 ClassImp(AliCorrQADataMakerRec)
42            
43 //____________________________________________________________________________ 
44 AliCorrQADataMakerRec::AliCorrQADataMakerRec(AliQADataMaker ** qadm ) : 
45   AliQADataMakerRec("Corr", "Corr Quality Assurance Data Maker"),
46   fMaxRawVar(0),  
47   fqadm(qadm)
48 {
49   // ctor
50
51 }
52
53 //____________________________________________________________________________ 
54 AliCorrQADataMakerRec::AliCorrQADataMakerRec(const AliCorrQADataMakerRec& qadm) :
55   AliQADataMakerRec(),
56   fMaxRawVar(qadm.fMaxRawVar), 
57   fqadm(qadm.fqadm)
58 {
59   //copy ctor 
60   SetName((const char*)qadm.GetName()) ; 
61   SetTitle((const char*)qadm.GetTitle()); 
62 }
63
64 //__________________________________________________________________
65 AliCorrQADataMakerRec& AliCorrQADataMakerRec::operator = (const AliCorrQADataMakerRec& qadm )
66 {
67   // Equal operator.
68   this->~AliCorrQADataMakerRec();
69   new(this) AliCorrQADataMakerRec(qadm);
70   return *this;
71 }
72  
73 //____________________________________________________________________________ 
74 void AliCorrQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * /*list*/)
75 {
76   //Detector specific actions at end of cycle
77   // do the QA checking
78   if (task == AliQA::kRAWS) 
79     AliQAChecker::Instance()->Run(AliQA::kCORR, task, fObject) ; 
80 }
81
82 //____________________________________________________________________________ 
83 void AliCorrQADataMakerRec::InitESDs()
84 {
85   //Create histograms to controll ESD
86
87   AliInfo("TO BE IMPLEMENTED") ; 
88 }
89
90 //____________________________________________________________________________ 
91 void AliCorrQADataMakerRec::InitRecPoints()
92 {
93   // create Reconstructed Points histograms in RecPoints subdir
94
95   AliInfo("TO BE IMPLEMENTED") ; 
96 }
97
98 //____________________________________________________________________________ 
99 void AliCorrQADataMakerRec::InitRaws()
100 {
101   // createa ntuple taking all the parameters declared by detectors
102   if (fObject) 
103     return ; 
104   delete fRawsQAList ; // not needed for the time being 
105   fRawsQAList = NULL ; 
106   TString varlist("") ;
107   for ( Int_t detIndex = 0 ; detIndex < AliQA::kNDET ; detIndex++ ) {
108     AliQADataMaker * qadm = fqadm[detIndex] ; 
109     if ( ! qadm ) 
110       continue ;
111     TList * list = qadm->GetParameterList() ; 
112     if (list) {
113       TIter next(list) ; 
114       TParameter<double> * p ; 
115       while ( (p = dynamic_cast<TParameter<double>*>(next()) ) ) {
116         varlist.Append(p->GetName()) ; 
117         varlist.Append(":") ; 
118         fMaxRawVar++ ; 
119       }
120     }
121   }
122   varlist = varlist.Strip(TString::kTrailing, ':') ; 
123   if (fMaxRawVar == 0) { 
124     AliWarning("NTUPLE not created") ; 
125   } else {
126     fObject = new TNtupleD(AliQA::GetQACorrName(), "Raws data correlation among detectors", varlist.Data()) ;  
127   }  
128 }
129
130 //____________________________________________________________________________
131 void AliCorrQADataMakerRec::MakeESDs(AliESDEvent * /*esd*/)
132 {
133   // make QA data from ESDs
134
135   AliInfo("TO BE IMPLEMENTED") ; 
136
137 }
138
139 //____________________________________________________________________________
140 void AliCorrQADataMakerRec::MakeRaws()
141 {
142   //Fill prepared histograms with Raw digit properties
143   if ( fMaxRawVar > 0 ) {
144     const Int_t kSize = fMaxRawVar ; 
145     Double_t  *varvalue = new Double_t[kSize] ;
146     Int_t index = 0 ;
147     for ( Int_t detIndex = 0 ; detIndex < AliQA::kNDET ; detIndex++ ) {
148       AliQADataMaker * qadm = fqadm[detIndex] ; 
149       if ( ! qadm ) 
150         continue ;
151       TList * list = qadm->GetParameterList() ; 
152       TIter next(list) ; 
153       TParameter<double> * p ; 
154       while ( (p = dynamic_cast<TParameter<double>*>(next()) ) ) {
155         varvalue[index++] = p->GetVal() ; 
156       }
157     }
158     (dynamic_cast<TNtupleD*>(fObject))->Fill(varvalue);
159     delete [] varvalue;
160   }
161 }
162
163 //____________________________________________________________________________
164 void AliCorrQADataMakerRec::MakeRecPoints(TTree * /*clustersTree*/)
165 {
166   AliInfo("TO BE IMPLEMENTED") ; 
167 }
168
169 //____________________________________________________________________________ 
170 void AliCorrQADataMakerRec::StartOfDetectorCycle()
171 {
172   //Detector specific actions at start of cycle  
173 }