]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSQADataMakerRec.cxx
91a7d2f6400cccc80264da3f6ec94a792741e620
[u/mrichter/AliRoot.git] / ITS / AliITSQADataMakerRec.cxx
1 /**************************************************************************
2  * Copyright(c) 2007-2009, 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 /* $Id$ */
17
18 //  *************************************************************
19 //  Checks the quality assurance 
20 //  by comparing with reference data
21 //  contained in a DB
22 //  -------------------------------------------------------------
23 //  W. Ferrarese + P. Cerello Feb 2008
24 //  INFN Torino
25
26 // --- ROOT system ---
27 #include <TTree.h>
28 // --- Standard library ---
29
30 // --- AliRoot header files ---
31 #include "AliITSQADataMakerRec.h"
32 #include "AliITSQASPDDataMakerRec.h"
33 #include "AliITSQASDDDataMakerRec.h"
34 #include "AliITSQASSDDataMakerRec.h"
35 #include "AliLog.h"
36 #include "AliQA.h"
37 #include "AliQAChecker.h"
38 #include "AliITSQAChecker.h"
39 #include "AliRawReader.h"
40
41 ClassImp(AliITSQADataMakerRec)
42
43 //____________________________________________________________________________ 
44 AliITSQADataMakerRec::AliITSQADataMakerRec(Bool_t kMode, Short_t subDet, Short_t ldc) :
45 AliQADataMakerRec(AliQA::GetDetName(AliQA::kITS), "ITS Quality Assurance Data Maker"),
46 fkOnline(kMode),
47 fSubDetector(subDet),
48 fLDC(ldc),
49 fSPDDataMaker(NULL),
50 fSDDDataMaker(NULL),
51 fSSDDataMaker(NULL)
52 {
53   //ctor used to discriminate OnLine-Offline analysis
54   if(fSubDetector < 0 || fSubDetector > 3) {
55         AliError("Error: fSubDetector number out of range; return\n");
56   }
57
58   // Initialization for RAW data 
59   if(fSubDetector == 0 || fSubDetector == 1) {
60     AliDebug(1,"AliITSQADM::Create SPD DataMakerRec\n");
61         fSPDDataMaker = new AliITSQASPDDataMakerRec(this,fkOnline);
62   }
63   if(fSubDetector == 0 || fSubDetector == 2) {
64         AliDebug(1,"AliITSQADM::Create SDD DataMakerRec\n");
65         fSDDDataMaker = new AliITSQASDDDataMakerRec(this,fkOnline);
66   }
67   if(fSubDetector == 0 || fSubDetector == 3) {
68         AliDebug(1,"AliITSQADM::Create SSD DataMakerRec\n");
69         fSSDDataMaker = new AliITSQASSDDataMakerRec(this,fkOnline);
70   }
71 }
72
73 //____________________________________________________________________________ 
74 AliITSQADataMakerRec::~AliITSQADataMakerRec(){
75   // destructor
76   if(fSPDDataMaker)delete fSPDDataMaker;
77   if(fSDDDataMaker)delete fSDDDataMaker;
78   if(fSSDDataMaker)delete fSSDDataMaker;
79 }
80
81 //____________________________________________________________________________ 
82 AliITSQADataMakerRec::AliITSQADataMakerRec(const AliITSQADataMakerRec& qadm) :
83 AliQADataMakerRec(),
84 fkOnline(qadm.fkOnline),
85 fSubDetector(qadm.fSubDetector),
86 fLDC(qadm.fLDC),
87 fSPDDataMaker(NULL),
88 fSDDDataMaker(NULL),
89 fSSDDataMaker(NULL)
90 {
91   //copy ctor 
92   SetName((const char*)qadm.GetName()) ; 
93   SetTitle((const char*)qadm.GetTitle());
94 }
95
96 //__________________________________________________________________
97 AliITSQADataMakerRec& AliITSQADataMakerRec::operator = (const AliITSQADataMakerRec& qac )
98 {
99   // Equal operator.
100   this->~AliITSQADataMakerRec();
101   new(this) AliITSQADataMakerRec(qac);
102   return *this;
103 }
104
105 //____________________________________________________________________________ 
106 void AliITSQADataMakerRec::StartOfDetectorCycle()
107 {
108   //Detector specific actions at start of cycle
109   AliDebug(1,"AliITSQADM::Start of ITS Cycle\n");
110   if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->StartOfDetectorCycle();
111   if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->StartOfDetectorCycle();
112   if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->StartOfDetectorCycle();
113 }
114
115 //____________________________________________________________________________ 
116 void AliITSQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list)
117 {
118   // launch the QA checking
119   AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n"); 
120   if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list);
121   if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list);
122   if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list);
123   
124   AliQAChecker *qac = AliQAChecker::Instance();
125   AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0);
126   qacb->SetTaskOffset(fSPDDataMaker->GetOffset(), fSDDDataMaker->GetOffset(), fSSDDataMaker->GetOffset()); //Setting the offset for the QAChecker list
127   qac->Run( AliQA::kITS , task, list);  //temporary skipping the checking
128 }
129
130 //____________________________________________________________________________ 
131 void AliITSQADataMakerRec::EndOfDetectorCycle(const char * /*fgDataName*/)
132 {
133   //eventually used for different  AliQAChecker::Instance()->Run
134 }
135
136 //____________________________________________________________________________ 
137 void AliITSQADataMakerRec::InitRaws()
138 {  
139   // Initialization for RAW data 
140         if(fSubDetector == 0 || fSubDetector == 1) {
141           AliDebug(1,"AliITSQADM:: SPD InitRaws\n");
142           fSPDDataMaker->InitRaws();
143         }
144         if(fSubDetector == 0 || fSubDetector == 2) {
145           AliDebug(1,"AliITSQADM:: SDD InitRaws\n");
146           fSDDDataMaker->InitRaws();
147         }
148         if(fSubDetector == 0 || fSubDetector == 3) {
149           AliDebug(1,"AliITSQADM:: SSD InitRaws\n");
150           fSSDDataMaker->InitRaws();
151         }
152 }
153
154 //____________________________________________________________________________
155 void AliITSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
156
157   // Fill QA for RAW   
158   if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeRaws(rawReader);
159   if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeRaws(rawReader);
160   if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRaws(rawReader);
161 }
162
163 //____________________________________________________________________________ 
164 void AliITSQADataMakerRec::InitRecPoints()
165 {
166   // Initialization for RECPOINTS
167   if(fSubDetector == 0 || fSubDetector == 1) {
168         AliDebug(1,"AliITSQADM:: SPD InitRecPoints\n");
169     fSPDDataMaker->InitRecPoints();
170   }
171   if(fSubDetector == 0 || fSubDetector == 2) {
172         AliDebug(1,"AliITSQADM:: SDD InitRecPoints\n");
173         fSDDDataMaker->InitRecPoints();
174   }
175   if(fSubDetector == 0 || fSubDetector == 3) {
176         AliDebug(1,"AliITSQADM:: SSD InitRecPoints\n");
177         fSSDDataMaker->InitRecPoints();
178   }
179 }
180
181 //____________________________________________________________________________ 
182 void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
183 {
184   // Fill QA for recpoints
185   if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeRecPoints(clustersTree);
186   if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeRecPoints(clustersTree);
187   if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRecPoints(clustersTree);
188 }
189
190