7 #include <TProfile2D.h>
9 #include <../TPC/AliTPCclusterMI.h>
13 #include "AliTPCClusterHistograms.h"
15 //____________________________________________________________________
16 ClassImp(AliTPCClusterHistograms)
18 //____________________________________________________________________
19 AliTPCClusterHistograms::AliTPCClusterHistograms()
25 fhQmaxProfileYVsRow(0),
26 fhQtotProfileYVsRow(0),
27 fhSigmaYProfileYVsRow(0),
28 fhSigmaZProfileYVsRow(0)
30 // default constructor
33 //____________________________________________________________________
34 AliTPCClusterHistograms::AliTPCClusterHistograms(const Char_t* name, const Char_t* title)
35 : TNamed(name, title),
40 fhQmaxProfileYVsRow(0),
41 fhQtotProfileYVsRow(0),
42 fhSigmaYProfileYVsRow(0),
43 fhSigmaZProfileYVsRow(0)
45 // constructor initializing tnamed
47 fhQmaxVsRow = new TH2F("QmaxVsPadRow", "Qmax vs. pad row;Pad row;Qmax", 91, -0.5, 90.5, 301, -0.5, 300.5);
48 fhQtotVsRow = new TH2F("QtotVsPadRow", "Qtot vs. pad row;Pad row;Qtot", 91, -0.5, 90.5, 100, 0, 1000);
50 fhSigmaYVsRow = new TH2F("SigmaYVsPadRow", "Sigma Y vs. pad row;Pad row;#sigma_{Y}", 91, -0.5, 90.5, 100, 0, 0.5);
51 fhSigmaZVsRow = new TH2F("SigmaZVsPadRow", "Sigma Z vs. pad row;Pad row;#sigma_{Z}", 91, -0.5, 90.5, 100, 0, 0.5);
53 fhQmaxProfileYVsRow = new TProfile2D("QmaxMeanYVsPadRow","Mean Qmax, y vs pad row;Pad row;y",91,-0.5,90.5,100,-30,30);
54 fhQtotProfileYVsRow = new TProfile2D("QtotMeanYVsPadRow","Mean Qtot, y vs pad row;Pad row;y",91,-0.5,90.5,100,-30,30);
55 fhSigmaYProfileYVsRow = new TProfile2D("SigmaYMeanYVsPadRow","Mean Sigma y, x vs pad row;Pad row;y",91,-0.5,90.5,100,-30,30);
56 fhSigmaZProfileYVsRow = new TProfile2D("SigmaZMeanYVsPadRow","Mean Sigma y, x vs pad row;Pad row;y",91,-0.5,90.5,100,-30,30);
60 //____________________________________________________________________
61 AliTPCClusterHistograms::AliTPCClusterHistograms(const AliTPCClusterHistograms& c) : TNamed(c)
64 ((AliTPCClusterHistograms &)c).Copy(*this);
67 //____________________________________________________________________
68 AliTPCClusterHistograms::~AliTPCClusterHistograms()
90 if (fhQmaxProfileYVsRow) {
91 delete fhQmaxProfileYVsRow;
92 fhQmaxProfileYVsRow = 0;
94 if (fhQtotProfileYVsRow) {
95 delete fhQtotProfileYVsRow;
96 fhQtotProfileYVsRow = 0;
98 if (fhSigmaYProfileYVsRow) {
99 delete fhSigmaYProfileYVsRow;
100 fhSigmaYProfileYVsRow = 0;
102 if (fhSigmaZProfileYVsRow) {
103 delete fhSigmaZProfileYVsRow;
104 fhSigmaZProfileYVsRow = 0;
109 //____________________________________________________________________
110 AliTPCClusterHistograms &AliTPCClusterHistograms::operator=(const AliTPCClusterHistograms &c)
112 // assigment operator
115 ((AliTPCClusterHistograms &) c).Copy(*this);
121 //____________________________________________________________________
122 Long64_t AliTPCClusterHistograms::Merge(TCollection* list)
124 // Merge a list of AliTPCClusterHistograms objects with this (needed for
126 // Returns the number of merged objects (including this).
134 TIterator* iter = list->MakeIterator();
137 // collections of measured and generated histograms
138 TList* collectionQmaxVsRow = new TList;
139 TList* collectionQtotVsRow = new TList;
140 TList* collectionSigmaYVsRow = new TList;
141 TList* collectionSigmaZVsRow = new TList;
143 TList* collectionQmaxProfileYVsRow = new TList;
144 TList* collectionQtotProfileYVsRow = new TList;
145 TList* collectionSigmaYProfileYVsRow = new TList;
146 TList* collectionSigmaZProfileYVsRow = new TList;
149 while ((obj = iter->Next())) {
151 AliTPCClusterHistograms* entry = dynamic_cast<AliTPCClusterHistograms*> (obj);
156 collectionQmaxVsRow ->Add(entry->fhQmaxVsRow );
157 collectionQtotVsRow ->Add(entry->fhQtotVsRow );
158 collectionSigmaYVsRow ->Add(entry->fhSigmaYVsRow );
159 collectionSigmaZVsRow ->Add(entry->fhSigmaZVsRow );
161 collectionQmaxProfileYVsRow ->Add(entry->fhQmaxProfileYVsRow );
162 collectionQtotProfileYVsRow ->Add(entry->fhQtotProfileYVsRow );
163 collectionSigmaYProfileYVsRow->Add(entry->fhSigmaYProfileYVsRow);
164 collectionSigmaZProfileYVsRow->Add(entry->fhSigmaZProfileYVsRow);
169 fhQmaxVsRow ->Merge(collectionQmaxVsRow );
170 fhQtotVsRow ->Merge(collectionQtotVsRow );
171 fhSigmaYVsRow ->Merge(collectionSigmaYVsRow );
172 fhSigmaZVsRow ->Merge(collectionSigmaZVsRow );
174 fhQmaxProfileYVsRow ->Merge(collectionQmaxProfileYVsRow );
175 fhQtotProfileYVsRow ->Merge(collectionQtotProfileYVsRow );
176 fhSigmaYProfileYVsRow->Merge(collectionSigmaYProfileYVsRow);
177 fhSigmaZProfileYVsRow->Merge(collectionSigmaZProfileYVsRow);
179 delete collectionQmaxVsRow;
180 delete collectionQtotVsRow;
181 delete collectionSigmaYVsRow;
182 delete collectionSigmaZVsRow;
184 delete collectionQmaxProfileYVsRow;
185 delete collectionQtotProfileYVsRow;
186 delete collectionSigmaYProfileYVsRow;
187 delete collectionSigmaZProfileYVsRow;
192 //____________________________________________________________________
193 void AliTPCClusterHistograms::FillCluster(AliTPCclusterMI* cluster) {
198 Int_t padRow = cluster->GetRow();
199 Float_t qMax = cluster->GetMax();
200 Float_t qTot = cluster->GetQ();
201 Float_t sigmaY = cluster->GetSigmaY2();
202 Float_t sigmaZ = cluster->GetSigmaZ2();
203 Float_t y = cluster->GetY();
205 fhQmaxVsRow ->Fill(padRow, qMax);
206 fhQtotVsRow ->Fill(padRow, qTot);
208 fhSigmaYVsRow ->Fill(padRow, sigmaY);
209 fhSigmaZVsRow ->Fill(padRow, sigmaZ);
211 fhQmaxProfileYVsRow ->Fill(padRow, y, qMax);
212 fhQtotProfileYVsRow ->Fill(padRow, y, qTot);
213 fhSigmaYProfileYVsRow ->Fill(padRow, y, sigmaY);
214 fhSigmaZProfileYVsRow ->Fill(padRow, y, sigmaZ);
218 //____________________________________________________________________
219 void AliTPCClusterHistograms::SaveHistograms()
222 // saves the histograms
225 gDirectory->mkdir(fName.Data());
226 gDirectory->cd(fName.Data());
228 fhQmaxVsRow ->Write();
229 fhQtotVsRow ->Write();
231 fhSigmaYVsRow ->Write();
232 fhSigmaZVsRow ->Write();
234 fhQmaxProfileYVsRow ->Write();
235 fhQtotProfileYVsRow ->Write();
236 fhSigmaYProfileYVsRow ->Write();
237 fhSigmaZProfileYVsRow ->Write();
239 gDirectory->cd("../");