]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG0/TPC/AliTPCClusterHistograms.cxx
Corrected description of data members
[u/mrichter/AliRoot.git] / PWG0 / TPC / AliTPCClusterHistograms.cxx
CommitLineData
2d9e89d4 1/* $Id$ */
2
3
4#include <TFile.h>
5#include <TCanvas.h>
6#include <TH2F.h>
7#include <TProfile2D.h>
8
9#include <../TPC/AliTPCclusterMI.h>
10
11#include <AliLog.h>
12
13#include "AliTPCClusterHistograms.h"
14
15//____________________________________________________________________
16ClassImp(AliTPCClusterHistograms)
17
18//____________________________________________________________________
19AliTPCClusterHistograms::AliTPCClusterHistograms()
20 : TNamed(),
21 fhQmaxVsRow(0),
22 fhQtotVsRow(0),
23 fhSigmaYVsRow(0),
24 fhSigmaZVsRow(0),
25 fhQmaxProfileYVsRow(0),
26 fhQtotProfileYVsRow(0),
27 fhSigmaYProfileYVsRow(0),
28 fhSigmaZProfileYVsRow(0)
29{
30 // default constructor
31}
32
33//____________________________________________________________________
34AliTPCClusterHistograms::AliTPCClusterHistograms(const Char_t* name, const Char_t* title)
35 : TNamed(name, title),
36 fhQmaxVsRow(0),
37 fhQtotVsRow(0),
38 fhSigmaYVsRow(0),
39 fhSigmaZVsRow(0),
40 fhQmaxProfileYVsRow(0),
41 fhQtotProfileYVsRow(0),
42 fhSigmaYProfileYVsRow(0),
43 fhSigmaZProfileYVsRow(0)
44{
45 // constructor initializing tnamed
46
9cc7192c 47 #define BINNING_Y 100, -50, 50
48
2d9e89d4 49 fhQmaxVsRow = new TH2F("QmaxVsPadRow", "Qmax vs. pad row;Pad row;Qmax", 91, -0.5, 90.5, 301, -0.5, 300.5);
50 fhQtotVsRow = new TH2F("QtotVsPadRow", "Qtot vs. pad row;Pad row;Qtot", 91, -0.5, 90.5, 100, 0, 1000);
51
52 fhSigmaYVsRow = new TH2F("SigmaYVsPadRow", "Sigma Y vs. pad row;Pad row;#sigma_{Y}", 91, -0.5, 90.5, 100, 0, 0.5);
53 fhSigmaZVsRow = new TH2F("SigmaZVsPadRow", "Sigma Z vs. pad row;Pad row;#sigma_{Z}", 91, -0.5, 90.5, 100, 0, 0.5);
54
9cc7192c 55 fhQmaxProfileYVsRow = new TProfile2D("QmaxMeanYVsPadRow","Mean Qmax, y vs pad row;Pad row;y",91,-0.5,90.5, BINNING_Y);
56 fhQtotProfileYVsRow = new TProfile2D("QtotMeanYVsPadRow","Mean Qtot, y vs pad row;Pad row;y",91,-0.5,90.5, BINNING_Y);
57 fhSigmaYProfileYVsRow = new TProfile2D("SigmaYMeanYVsPadRow","Mean Sigma y, x vs pad row;Pad row;y",91,-0.5,90.5, BINNING_Y);
58 fhSigmaZProfileYVsRow = new TProfile2D("SigmaZMeanYVsPadRow","Mean Sigma y, x vs pad row;Pad row;y",91,-0.5,90.5, BINNING_Y);
2d9e89d4 59
60}
61
62//____________________________________________________________________
63AliTPCClusterHistograms::AliTPCClusterHistograms(const AliTPCClusterHistograms& c) : TNamed(c)
64{
65 // copy constructor
66 ((AliTPCClusterHistograms &)c).Copy(*this);
67}
68
69//____________________________________________________________________
70AliTPCClusterHistograms::~AliTPCClusterHistograms()
71{
72 //
73 // destructor
74 //
75
76 if (fhQmaxVsRow) {
77 delete fhQmaxVsRow;
78 fhQmaxVsRow = 0;
79 }
80 if (fhQtotVsRow) {
81 delete fhQtotVsRow;
82 fhQtotVsRow = 0;
83 }
84 if (fhSigmaYVsRow) {
85 delete fhSigmaYVsRow;
86 fhSigmaYVsRow = 0;
87 }
88 if (fhSigmaZVsRow) {
89 delete fhSigmaZVsRow;
90 fhSigmaZVsRow = 0;
91 }
92 if (fhQmaxProfileYVsRow) {
93 delete fhQmaxProfileYVsRow;
94 fhQmaxProfileYVsRow = 0;
95 }
96 if (fhQtotProfileYVsRow) {
97 delete fhQtotProfileYVsRow;
98 fhQtotProfileYVsRow = 0;
99 }
100 if (fhSigmaYProfileYVsRow) {
101 delete fhSigmaYProfileYVsRow;
102 fhSigmaYProfileYVsRow = 0;
103 }
104 if (fhSigmaZProfileYVsRow) {
105 delete fhSigmaZProfileYVsRow;
106 fhSigmaZProfileYVsRow = 0;
107 }
108
109}
110
111//____________________________________________________________________
112AliTPCClusterHistograms &AliTPCClusterHistograms::operator=(const AliTPCClusterHistograms &c)
113{
114 // assigment operator
115
116 if (this != &c)
117 ((AliTPCClusterHistograms &) c).Copy(*this);
118
119 return *this;
120}
121
122
123//____________________________________________________________________
124Long64_t AliTPCClusterHistograms::Merge(TCollection* list)
125{
126 // Merge a list of AliTPCClusterHistograms objects with this (needed for
127 // PROOF).
128 // Returns the number of merged objects (including this).
129
130 if (!list)
131 return 0;
132
133 if (list->IsEmpty())
134 return 1;
135
136 TIterator* iter = list->MakeIterator();
137 TObject* obj;
138
139 // collections of measured and generated histograms
140 TList* collectionQmaxVsRow = new TList;
141 TList* collectionQtotVsRow = new TList;
142 TList* collectionSigmaYVsRow = new TList;
143 TList* collectionSigmaZVsRow = new TList;
144
145 TList* collectionQmaxProfileYVsRow = new TList;
146 TList* collectionQtotProfileYVsRow = new TList;
147 TList* collectionSigmaYProfileYVsRow = new TList;
148 TList* collectionSigmaZProfileYVsRow = new TList;
149
150 Int_t count = 0;
151 while ((obj = iter->Next())) {
152
153 AliTPCClusterHistograms* entry = dynamic_cast<AliTPCClusterHistograms*> (obj);
154 if (entry == 0)
155 continue;
156
157
158 collectionQmaxVsRow ->Add(entry->fhQmaxVsRow );
159 collectionQtotVsRow ->Add(entry->fhQtotVsRow );
160 collectionSigmaYVsRow ->Add(entry->fhSigmaYVsRow );
161 collectionSigmaZVsRow ->Add(entry->fhSigmaZVsRow );
162
163 collectionQmaxProfileYVsRow ->Add(entry->fhQmaxProfileYVsRow );
164 collectionQtotProfileYVsRow ->Add(entry->fhQtotProfileYVsRow );
165 collectionSigmaYProfileYVsRow->Add(entry->fhSigmaYProfileYVsRow);
166 collectionSigmaZProfileYVsRow->Add(entry->fhSigmaZProfileYVsRow);
167
168 count++;
169 }
170
171 fhQmaxVsRow ->Merge(collectionQmaxVsRow );
172 fhQtotVsRow ->Merge(collectionQtotVsRow );
173 fhSigmaYVsRow ->Merge(collectionSigmaYVsRow );
174 fhSigmaZVsRow ->Merge(collectionSigmaZVsRow );
175
176 fhQmaxProfileYVsRow ->Merge(collectionQmaxProfileYVsRow );
177 fhQtotProfileYVsRow ->Merge(collectionQtotProfileYVsRow );
178 fhSigmaYProfileYVsRow->Merge(collectionSigmaYProfileYVsRow);
179 fhSigmaZProfileYVsRow->Merge(collectionSigmaZProfileYVsRow);
180
181 delete collectionQmaxVsRow;
182 delete collectionQtotVsRow;
183 delete collectionSigmaYVsRow;
184 delete collectionSigmaZVsRow;
185
186 delete collectionQmaxProfileYVsRow;
187 delete collectionQtotProfileYVsRow;
188 delete collectionSigmaYProfileYVsRow;
189 delete collectionSigmaZProfileYVsRow;
190
191 return count+1;
192}
193
194//____________________________________________________________________
195void AliTPCClusterHistograms::FillCluster(AliTPCclusterMI* cluster) {
196 //
197 //
198 //
199
200 Int_t padRow = cluster->GetRow();
201 Float_t qMax = cluster->GetMax();
202 Float_t qTot = cluster->GetQ();
203 Float_t sigmaY = cluster->GetSigmaY2();
204 Float_t sigmaZ = cluster->GetSigmaZ2();
205 Float_t y = cluster->GetY();
206
207 fhQmaxVsRow ->Fill(padRow, qMax);
208 fhQtotVsRow ->Fill(padRow, qTot);
209
210 fhSigmaYVsRow ->Fill(padRow, sigmaY);
211 fhSigmaZVsRow ->Fill(padRow, sigmaZ);
212
213 fhQmaxProfileYVsRow ->Fill(padRow, y, qMax);
214 fhQtotProfileYVsRow ->Fill(padRow, y, qTot);
215 fhSigmaYProfileYVsRow ->Fill(padRow, y, sigmaY);
216 fhSigmaZProfileYVsRow ->Fill(padRow, y, sigmaZ);
217}
218
219
220//____________________________________________________________________
221void AliTPCClusterHistograms::SaveHistograms()
222{
223 //
224 // saves the histograms
225 //
226
227 gDirectory->mkdir(fName.Data());
228 gDirectory->cd(fName.Data());
229
230 fhQmaxVsRow ->Write();
231 fhQtotVsRow ->Write();
232
233 fhSigmaYVsRow ->Write();
234 fhSigmaZVsRow ->Write();
235
236 fhQmaxProfileYVsRow ->Write();
237 fhQtotProfileYVsRow ->Write();
238 fhSigmaYProfileYVsRow ->Write();
239 fhSigmaZProfileYVsRow ->Write();
240
241 gDirectory->cd("../");
242
243}
244