Obsolete.
[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);
3f905799 124 if(fSubDetector == 0 ) {
ad300de9 125 Int_t offsetSPD = fSPDDataMaker->GetOffsetH() + fSPDDataMaker->GetOffsetS() + fSPDDataMaker->GetOffsetD() ;
126 Int_t offsetSDD = fSDDDataMaker->GetOffset(task);
3f905799 127 Int_t offsetSSD = fSSDDataMaker->GetOffsetH() + fSSDDataMaker->GetOffsetS() + fSSDDataMaker->GetOffsetD() ;
128 qacb->SetTaskOffset(offsetSPD, offsetSDD, offsetSSD); //Setting the offset for the QAChecker list
129 }
130 qac->Run( AliQA::kITS , task, list); //temporary skipping the checking
04236e67 131}
132
8dc34e37 133//____________________________________________________________________________
134void AliITSQADataMakerSim::InitDigits()
135{
136 // Initialization for RAW data
137 if(fSubDetector == 0 || fSubDetector == 1) {
138 AliDebug(1,"AliITSQADM:: SPD InitDigits\n");
139 fSPDDataMaker->InitDigits();
140 }
141 if(fSubDetector == 0 || fSubDetector == 2) {
142 AliDebug(1,"AliITSQADM:: SDD InitDigits\n");
8dc34e37 143 fSDDDataMaker->InitDigits();
144 }
145 if(fSubDetector == 0 || fSubDetector == 3) {
146 AliDebug(1,"AliITSQADM:: SSD InitDigits\n");
147 fSSDDataMaker->InitDigits();
148 }
149}
150
151//____________________________________________________________________________
152void AliITSQADataMakerSim::MakeDigits(TClonesArray * digits)
153{
154 // Fill QA for RAW
155 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeDigits(digits);
8dc34e37 156 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeDigits(digits);
157 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(digits);
158}
159
160//____________________________________________________________________________
161void AliITSQADataMakerSim::MakeDigits(TTree * digits)
162{
163 // Fill QA for RAW
164 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeDigits(digits);
8dc34e37 165 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeDigits(digits);
166 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(digits);
167}
168
169//____________________________________________________________________________
170void AliITSQADataMakerSim::InitSDigits()
171{
172 // Initialization for RECPOINTS
173 if(fSubDetector == 0 || fSubDetector == 1) {
174 AliDebug(1,"AliITSQADM:: SPD InitSDigits\n");
175 fSPDDataMaker->InitSDigits();
176 }
177 if(fSubDetector == 0 || fSubDetector == 2) {
178 AliDebug(1,"AliITSQADM:: SDD InitSDigits\n");
8dc34e37 179 fSDDDataMaker->InitSDigits();
180 }
181 if(fSubDetector == 0 || fSubDetector == 3) {
182 AliDebug(1,"AliITSQADM:: SSD InitSDigits\n");
183 fSSDDataMaker->InitSDigits();
184 }
185}
186
187//____________________________________________________________________________
188void AliITSQADataMakerSim::MakeSDigits(TClonesArray * sdigits)
189{
190 // Fill QA for recpoints
c71529b0 191 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeSDigits(sdigits);
8dc34e37 192 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeSDigits(sdigits);
193 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeSDigits(sdigits);
194}
195
196//____________________________________________________________________________
197void AliITSQADataMakerSim::MakeSDigits(TTree * sdigits)
198{
199 // Fill QA for recpoints
c71529b0 200 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeSDigits(sdigits);
8dc34e37 201 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeSDigits(sdigits);
202 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeSDigits(sdigits);
203}
204
205//____________________________________________________________________________
206void AliITSQADataMakerSim::InitHits()
207{
208 // Initialization for RECPOINTS
209 if(fSubDetector == 0 || fSubDetector == 1) {
210 AliDebug(1,"AliITSQADM:: SPD InitHits\n");
211 fSPDDataMaker->InitHits();
212 }
213 if(fSubDetector == 0 || fSubDetector == 2) {
214 AliDebug(1,"AliITSQADM:: SDD InitHits\n");
8dc34e37 215 fSDDDataMaker->InitHits();
216 }
217 if(fSubDetector == 0 || fSubDetector == 3) {
218 AliDebug(1,"AliITSQADM:: SSD InitHits\n");
219 fSSDDataMaker->InitHits();
220 }
221}
222
223//____________________________________________________________________________
224void AliITSQADataMakerSim::MakeHits(TClonesArray * hits)
225{
226 // Fill QA for recpoints
227 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeHits(hits);
8dc34e37 228 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeHits(hits);
229 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeHits(hits);
230}
231
232//____________________________________________________________________________
233void AliITSQADataMakerSim::MakeHits(TTree * hits)
234{
235 // Fill QA for recpoints
236 if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeHits(hits);
8dc34e37 237 if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeHits(hits);
238 if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeHits(hits);
239}