First implementation of neural network PID
[u/mrichter/AliRoot.git] / STEER / AliQualAssDataMaker.cxx
CommitLineData
421ab0fb 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$ */
18
19/*
20 Base Class
21 Produces the data needed to calculate the quality assurance.
22 All data must be mergeable objects.
23 Y. Schutz CERN July 2007
24*/
25
26// --- ROOT system ---
27#include <TSystem.h>
28#include <TFile.h>
29
30// --- Standard library ---
31
32// --- AliRoot header files ---
33#include "AliLog.h"
34#include "AliQualAssDataMaker.h"
35
36ClassImp(AliQualAssDataMaker)
37
38TString AliQualAssDataMaker::fDetectorDirName("") ;
39
40
41//____________________________________________________________________________
42AliQualAssDataMaker::AliQualAssDataMaker(const char * name, const char * title) :
43 TNamed(name, title),
44 fOutput(0x0),
45 fDetectorDir(0x0),
46 fData(0x0)
47{
48 // ctor
a5fa6165 49 TString tmp(GetName()) ;
50 tmp.Append("QA") ;
51 SetName(tmp.Data()) ;
421ab0fb 52 fOutput = AliQualAss::GetQADMOutFile() ;
53 fDetectorDirName = GetName() ;
54}
55
56//____________________________________________________________________________
57AliQualAssDataMaker::AliQualAssDataMaker(const AliQualAssDataMaker& qadm) :
58 TNamed(qadm.GetName(), qadm.GetTitle()),
59 fOutput(qadm.fOutput),
60 fDetectorDir(qadm.fDetectorDir),
61 fData(qadm.fData)
62{
63 //copy ctor
64 fDetectorDirName = GetName() ;
65}
66
67//__________________________________________________________________
68AliQualAssDataMaker& AliQualAssDataMaker::operator = (const AliQualAssDataMaker& qadm )
69{
70 // Equal operator.
71 this->~AliQualAssDataMaker();
72 new(this) AliQualAssDataMaker(qadm);
73 return *this;
74}
75
76//____________________________________________________________________________
77void AliQualAssDataMaker::Exec(AliQualAss::TASKINDEX task)
78{
79 // creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
80
81 fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
82 if (!fDetectorDir)
83 fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
84
85 switch (task) {
86 case AliQualAss::kHITS:
87 AliInfo("Processing Hits QA") ;
88 MakeHits() ;
89 break ;
90
91 case AliQualAss::kSDIGITS:
92 AliInfo("Processing SDigits QA") ;
93 MakeSDigits() ;
94 break ;
95
96 case AliQualAss::kDIGITS:
97 AliInfo("Processing Digits QA") ;
98 MakeDigits() ;
99 break ;
100
101 case AliQualAss::kRECPOINTS:
102 AliInfo("Processing RecPoints QA") ;
103 MakeRecPoints() ;
104 break ;
105
106 case AliQualAss::kTRACKSEGMENTS:
107 AliInfo("Processing Track Segments QA") ;
108 MakeTrackSegments() ;
109 break ;
110
111 case AliQualAss::kRECPARTICLES:
112 AliInfo("Processing RecParticles QA") ;
113 MakeRecParticles() ;
114 break ;
115
116 case AliQualAss::kESDS:
117 AliInfo("Processing ESDs QA") ;
118 MakeESDs() ;
119 break ;
120 }
121}
122
123//____________________________________________________________________________
124void AliQualAssDataMaker::Finish(AliQualAss::TASKINDEX task) const
125{
126 // write to the output File
127
128 fDetectorDir->cd() ;
129 TDirectory * subDir = 0x0 ;
130
a5fa6165 131// switch (task) {
132// case AliQualAss::kHITS:
133 subDir = fDetectorDir->GetDirectory(AliQualAss::GetTaskName(task)) ;
134// break ;
135
136// case AliQualAss::kSDIGITS:
137// subDir = fDetectorDir->GetDirectory("SDigits") ;
138// break ;
139
140// case AliQualAss::kDIGITS:
141// subDir = fDetectorDir->GetDirectory("Digits") ;
142// break ;
421ab0fb 143
a5fa6165 144// case AliQualAss::kRECPOINTS:
145// subDir = fDetectorDir->GetDirectory("RecPoints") ;
146// break ;
421ab0fb 147
a5fa6165 148// case AliQualAss::kTRACKSEGMENTS:
149// subDir = fDetectorDir->GetDirectory("TrackSegments") ;
150// break ;
421ab0fb 151
a5fa6165 152// case AliQualAss::kRECPARTICLES:
153// subDir = fDetectorDir->GetDirectory("RecParticles") ;
154// break ;
421ab0fb 155
a5fa6165 156// case AliQualAss::kESDS:
157// subDir = fDetectorDir->GetDirectory("ESDs") ;
158// break ;
159// }
421ab0fb 160 subDir->Write() ;
161}
162
163//____________________________________________________________________________
164void AliQualAssDataMaker::Init(AliQualAss::TASKINDEX task)
165{
166 // general intialisation
167
168 TDirectory * subDir = 0x0 ;
169
170 switch (task) {
171 case AliQualAss::kHITS:
172 subDir = fDetectorDir->GetDirectory("Hits") ;
173 if (!subDir)
174 subDir = fDetectorDir->mkdir("Hits") ;
175 subDir->cd() ;
176 InitHits() ;
177 break ;
178
179 case AliQualAss::kSDIGITS:
180 subDir = fDetectorDir->GetDirectory("SDigits") ;
181 if (!subDir)
182 subDir = fDetectorDir->mkdir("SDigits") ;
183 subDir->cd() ;
184 InitSDigits() ;
185 break ;
186
187 case AliQualAss::kDIGITS:
188 subDir = fDetectorDir->GetDirectory("Digits") ;
189 if (!subDir)
190 subDir = fDetectorDir->mkdir("Digits") ;
191 subDir->cd() ;
192 InitDigits() ;
193 break ;
194
195 case AliQualAss::kRECPOINTS:
196 subDir = fDetectorDir->GetDirectory("RecPoints") ;
197 if(!subDir)
198 subDir = fDetectorDir->mkdir("RecPoints") ;
199 subDir->cd() ;
200 InitRecPoints() ;
201 break ;
202
203 case AliQualAss::kTRACKSEGMENTS:
204 subDir = fDetectorDir->GetDirectory("TrackSegments") ;
205 if (!subDir)
206 subDir = fDetectorDir->mkdir("TrackSegments") ;
207 subDir->cd() ;
208 InitTrackSegments() ;
209 break ;
210
211 case AliQualAss::kRECPARTICLES:
212 subDir = fDetectorDir->GetDirectory("RecParticles") ;
213 if (!subDir)
214 subDir = fDetectorDir->mkdir("RecParticles") ;
215 subDir->cd() ;
216 InitRecParticles() ;
217 break ;
218
219 case AliQualAss::kESDS:
220 subDir = fDetectorDir->GetDirectory("ESDs") ;
221 if (!subDir)
222 subDir = fDetectorDir->mkdir("ESDs") ;
223 subDir->cd() ;
224 InitESDs() ;
225 break ;
226 }
227}