Removing obsolete option
[u/mrichter/AliRoot.git] / ITS / AliITSQADataMakerSim.cxx
CommitLineData
04236e67 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// -------------------------------------------------------------
8dc34e37 23// W. Ferrarese + P. Cerello Feb 2008
04236e67 24// INFN Torino
25
26// --- ROOT system ---
04236e67 27#include <TTree.h>
04236e67 28// --- Standard library ---
29
30// --- AliRoot header files ---
31#include "AliITSQADataMakerSim.h"
8dc34e37 32#include "AliITSQASPDDataMakerSim.h"
33#include "AliITSQASDDDataMakerSim.h"
34#include "AliITSQASSDDataMakerSim.h"
04236e67 35#include "AliLog.h"
8dc34e37 36#include "AliQA.h"
04236e67 37#include "AliQAChecker.h"
5dfa9b71 38#include "AliITSQAChecker.h"
8dc34e37 39#include "AliRawReader.h"
04236e67 40
41ClassImp(AliITSQADataMakerSim)
42
43//____________________________________________________________________________
8dc34e37 44AliITSQADataMakerSim::AliITSQADataMakerSim(Short_t subDet) :
45AliQADataMakerSim(AliQA::GetDetName(AliQA::kITS), "ITS Quality Assurance Data Maker"),
46fSubDetector(subDet),
47fSPDDataMaker(NULL),
48fSDDDataMaker(NULL),
49fSSDDataMaker(NULL)
50{
51 //ctor used to discriminate OnLine-Offline analysis
52 if(fSubDetector < 0 || fSubDetector > 3) {
53 AliError("Error: fSubDetector number out of range; return\n");
54 }
55
56 // Initialization for RAW data
57 if(fSubDetector == 0 || fSubDetector == 1) {
58 AliDebug(1,"AliITSQADM::Create SPD DataMakerSim\n");
59 fSPDDataMaker = new AliITSQASPDDataMakerSim(this);
60 }
61 if(fSubDetector == 0 || fSubDetector == 2) {
62 AliDebug(1,"AliITSQADM::Create SDD DataMakerSim\n");
63 //printf("AliITSQADM::Create SDD DataMakerSim\n");
64 fSDDDataMaker = new AliITSQASDDDataMakerSim(this);
65 }
66 if(fSubDetector == 0 || fSubDetector == 3) {
67 AliDebug(1,"AliITSQADM::Create SSD DataMakerSim\n");
68 fSSDDataMaker = new AliITSQASSDDataMakerSim(this);
69 }
04236e67 70}
71
72//____________________________________________________________________________
8dc34e37 73AliITSQADataMakerSim::~AliITSQADataMakerSim(){
74 // destructor
75 if(fSPDDataMaker)delete fSPDDataMaker;
76 if(fSDDDataMaker)delete fSDDDataMaker;
77 if(fSSDDataMaker)delete fSSDDataMaker;
04236e67 78}
79
80//____________________________________________________________________________
81AliITSQADataMakerSim::AliITSQADataMakerSim(const AliITSQADataMakerSim& qadm) :
8dc34e37 82AliQADataMakerSim(),
83fSubDetector(qadm.fSubDetector),
84fSPDDataMaker(NULL),
85fSDDDataMaker(NULL),
86fSSDDataMaker(NULL)
04236e67 87{
88 //copy ctor
89 SetName((const char*)qadm.GetName()) ;
8dc34e37 90 SetTitle((const char*)qadm.GetTitle());
04236e67 91}
92
93//__________________________________________________________________
94AliITSQADataMakerSim& AliITSQADataMakerSim::operator = (const AliITSQADataMakerSim& qac )
95{
96 // Equal operator.
97 this->~AliITSQADataMakerSim();
98 new(this) AliITSQADataMakerSim(qac);
99 return *this;
100}
101
102//____________________________________________________________________________
85f5e9c2 103void AliITSQADataMakerSim::StartOfDetectorCycle()
04236e67 104{
105 //Detector specific actions at start of cycle
106 AliDebug(1,"AliITSQADM::Start of ITS Cycle\n");
8dc34e37 107
108 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->StartOfDetectorCycle();
8dc34e37 109 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->StartOfDetectorCycle();
110 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->StartOfDetectorCycle();
04236e67 111}
112
113//____________________________________________________________________________
8dc34e37 114void AliITSQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list)
04236e67 115{
116 // launch the QA checking
117 AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n");
c71529b0 118 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list);
8dc34e37 119 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list);
120 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list);
04236e67 121
5dfa9b71 122 AliQAChecker *qac = AliQAChecker::Instance();
123 AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0);
614c7e17 124 Int_t subdet=GetSubDet();
125 qacb->SetSubDet(subdet);
126
127 if(subdet== 0 ){
128 qacb->SetTaskOffset(fSPDDataMaker->GetOffset(task),fSDDDataMaker->GetOffset(task),fSSDDataMaker->GetOffset(task)); //Setting the offset for the QAChecker list
129 }
130 else
131 if(subdet!=0){
132 Int_t offset=GetDetTaskOffset(subdet, task);
133 qacb->SetDetTaskOffset(subdet,offset);
134 }
3f905799 135 qac->Run( AliQA::kITS , task, list); //temporary skipping the checking
04236e67 136}
137
8dc34e37 138//____________________________________________________________________________
139void AliITSQADataMakerSim::InitDigits()
140{
141 // Initialization for RAW data
142 if(fSubDetector == 0 || fSubDetector == 1) {
143 AliDebug(1,"AliITSQADM:: SPD InitDigits\n");
144 fSPDDataMaker->InitDigits();
145 }
146 if(fSubDetector == 0 || fSubDetector == 2) {
147 AliDebug(1,"AliITSQADM:: SDD InitDigits\n");
8dc34e37 148 fSDDDataMaker->InitDigits();
149 }
150 if(fSubDetector == 0 || fSubDetector == 3) {
151 AliDebug(1,"AliITSQADM:: SSD InitDigits\n");
152 fSSDDataMaker->InitDigits();
153 }
154}
155
156//____________________________________________________________________________
157void AliITSQADataMakerSim::MakeDigits(TClonesArray * digits)
158{
159 // Fill QA for RAW
160 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeDigits(digits);
8dc34e37 161 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeDigits(digits);
162 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(digits);
163}
164
165//____________________________________________________________________________
166void AliITSQADataMakerSim::MakeDigits(TTree * digits)
167{
168 // Fill QA for RAW
169 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeDigits(digits);
8dc34e37 170 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeDigits(digits);
171 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(digits);
172}
173
174//____________________________________________________________________________
175void AliITSQADataMakerSim::InitSDigits()
176{
177 // Initialization for RECPOINTS
178 if(fSubDetector == 0 || fSubDetector == 1) {
179 AliDebug(1,"AliITSQADM:: SPD InitSDigits\n");
180 fSPDDataMaker->InitSDigits();
181 }
182 if(fSubDetector == 0 || fSubDetector == 2) {
183 AliDebug(1,"AliITSQADM:: SDD InitSDigits\n");
8dc34e37 184 fSDDDataMaker->InitSDigits();
185 }
186 if(fSubDetector == 0 || fSubDetector == 3) {
187 AliDebug(1,"AliITSQADM:: SSD InitSDigits\n");
188 fSSDDataMaker->InitSDigits();
189 }
190}
191
192//____________________________________________________________________________
193void AliITSQADataMakerSim::MakeSDigits(TClonesArray * sdigits)
194{
195 // Fill QA for recpoints
c71529b0 196 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeSDigits(sdigits);
8dc34e37 197 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeSDigits(sdigits);
198 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeSDigits(sdigits);
199}
200
201//____________________________________________________________________________
202void AliITSQADataMakerSim::MakeSDigits(TTree * sdigits)
203{
204 // Fill QA for recpoints
c71529b0 205 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeSDigits(sdigits);
8dc34e37 206 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeSDigits(sdigits);
207 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeSDigits(sdigits);
208}
209
210//____________________________________________________________________________
211void AliITSQADataMakerSim::InitHits()
212{
213 // Initialization for RECPOINTS
214 if(fSubDetector == 0 || fSubDetector == 1) {
215 AliDebug(1,"AliITSQADM:: SPD InitHits\n");
216 fSPDDataMaker->InitHits();
217 }
218 if(fSubDetector == 0 || fSubDetector == 2) {
219 AliDebug(1,"AliITSQADM:: SDD InitHits\n");
8dc34e37 220 fSDDDataMaker->InitHits();
221 }
222 if(fSubDetector == 0 || fSubDetector == 3) {
223 AliDebug(1,"AliITSQADM:: SSD InitHits\n");
224 fSSDDataMaker->InitHits();
225 }
226}
227
228//____________________________________________________________________________
229void AliITSQADataMakerSim::MakeHits(TClonesArray * hits)
230{
231 // Fill QA for recpoints
232 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeHits(hits);
8dc34e37 233 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeHits(hits);
234 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeHits(hits);
235}
236
237//____________________________________________________________________________
238void AliITSQADataMakerSim::MakeHits(TTree * hits)
239{
240 // Fill QA for recpoints
241 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeHits(hits);
8dc34e37 242 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeHits(hits);
243 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeHits(hits);
244}
614c7e17 245
246//_________________________________________________________________
247
248Int_t AliITSQADataMakerSim::GetDetTaskOffset(Int_t subdet,AliQA::TASKINDEX_t task)
249{
250 switch(subdet)
251 {
252
253 Int_t offset;
254 case 1:
255 offset=fSPDDataMaker->GetOffset(task);
256 return offset;
257 break;
258 case 2:
259 offset=fSDDDataMaker->GetOffset(task);
260 return offset;
261 break;
262 case 3:
263 offset=fSSDDataMaker->GetOffset(task);
264 return offset;
265 break;
266 default:
267 AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n");
268 offset=0;
269 return offset;
270 break;
271 }
272 //return offset;
273}