3 // This class contains a number of histograms for diagnostics of a TPC
4 // read out chamber from the reconstructed clusters.
11 #include "AliTPCClusterHistograms.h"
17 #include <TProfile2D.h>
18 #include <TObjArray.h>
20 #include <TTimeStamp.h>
23 #include <AliTPCclusterMI.h>
24 #include <AliTPCseed.h>
28 // uncomment if working with version after release that has new cluster scheme
31 //____________________________________________________________________
32 ClassImp(AliTPCClusterHistograms)
34 //____________________________________________________________________
35 AliTPCClusterHistograms::AliTPCClusterHistograms()
41 fhQtotProfileVsRow(0),
42 fhQmaxProfileVsRow(0),
43 fhQtotVsDistanceToEdge(0),
44 fhQtotProfileVsDistanceToEdge(0),
49 fhQmaxProfileYVsRow(0),
50 fhQtotProfileYVsRow(0),
51 fhSigmaYProfileYVsRow(0),
52 fhSigmaZProfileYVsRow(0),
53 fhQmaxProfileZVsRow(0),
54 fhQtotProfileZVsRow(0),
55 fhSigmaYProfileZVsRow(0),
56 fhSigmaZProfileZVsRow(0),
59 fhMeanNClustersVsTime(0),
61 fhTrackQtotPerCluster(0),
62 fhTrackQtotPerClusterVsPhi(0),
63 fhTrackQtotPerClusterVsTheta(0),
64 fhTrackMeanQtotPerClusterVsPhi(0),
65 fhTrackMeanQtotPerClusterVsTheta(0),
66 fhMeanNTracksVsTime(),
70 fEdgeSuppression(kFALSE),
76 fCommentToHistograms()
78 // default constructor
81 //____________________________________________________________________
82 AliTPCClusterHistograms::AliTPCClusterHistograms(Int_t detector, const Char_t* comment, Int_t timeStart, Int_t timeStop, Bool_t edgeSuppression)
88 fhQtotProfileVsRow(0),
89 fhQmaxProfileVsRow(0),
90 fhQtotVsDistanceToEdge(0),
91 fhQtotProfileVsDistanceToEdge(0),
96 fhQmaxProfileYVsRow(0),
97 fhQtotProfileYVsRow(0),
98 fhSigmaYProfileYVsRow(0),
99 fhSigmaZProfileYVsRow(0),
100 fhQmaxProfileZVsRow(0),
101 fhQtotProfileZVsRow(0),
102 fhSigmaYProfileZVsRow(0),
103 fhSigmaZProfileZVsRow(0),
106 fhMeanNClustersVsTime(0),
107 fhNClustersVsTime(0),
108 fhTrackQtotPerCluster(0),
109 fhTrackQtotPerClusterVsPhi(0),
110 fhTrackQtotPerClusterVsTheta(0),
111 fhTrackMeanQtotPerClusterVsPhi(0),
112 fhTrackMeanQtotPerClusterVsTheta(0),
113 fhMeanNTracksVsTime(),
117 fEdgeSuppression(edgeSuppression),
118 fNClustersInEvent(0),
123 fCommentToHistograms()
127 // make name and title
128 if (detector < 0 || detector >= 72) {
129 AliDebug(AliLog::kError, Form("Detector %d does not exist", detector));
133 TString name(FormDetectorName(detector, edgeSuppression, comment));
135 fNClustersInEvent = 0;
140 fWhyKeepEvent = TString("hi");
142 fDetector = detector;
147 SetTitle(Form("%s (detector %d)",name.Data(), detector));
149 // rounding down to the closest hour and starting 10 hours before
150 fTimeStart = 3600*UInt_t(timeStart/3600) - 36000;
151 // rounding up to the closest hour
152 fTimeStop = 3600*UInt_t((3600 + timeStop)/3600);
153 // each time bin covers 5 min
154 Int_t nTimeBins = (fTimeStop-fTimeStart)/300;
156 // printf(Form(" start time: %d, stop time: %d \n",fTimeStart, fTimeStop));
158 #define BINNING_Z 250, 0, 250
169 // 1 bin for each 0.5 cm
170 Int_t nBinsY = Int_t(4*yRange);
172 // do not add this hists to the directory
173 Bool_t oldStatus = TH1::AddDirectoryStatus();
174 TH1::AddDirectory(kFALSE);
176 //defining histograms and profile plots
177 fhQmaxVsRow = new TH2F("QmaxVsPadRow", "Qmax vs. pad row;Pad row;Qmax", nPadRows+2, -1.5, nPadRows+0.5, 500, 0, 500);
178 fhQtotVsRow = new TH2F("QtotVsPadRow", "Qtot vs. pad row;Pad row;Qtot", nPadRows+2, -1.5, nPadRows+0.5, 400, 0, 4000);
180 fhQmaxProfileVsRow = new TProfile("MeanQmaxVsPadRow","Mean Qmax vs. pad row;Pad row;Mean Qmax",nPadRows+2, -1.5, nPadRows+0.5);
181 fhQtotProfileVsRow = new TProfile("MeanQtotVsPadRow","Mean Qtot vs. pad row;Pad row;Mean Qtot",nPadRows+2, -1.5, nPadRows+0.5);
183 fhNClustersYVsRow = new TH2F("NClusters y vs pad row","N clusters y vs pad;Pad row;y",nPadRows+2, -1.5, nPadRows+0.5, nBinsY, -yRange, yRange);
184 fhNClustersZVsRow = new TH2F("NClusters z vs pad row","N clusters z vs pad;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
186 fhSigmaYVsRow = new TH2F("SigmaYVsPadRow", "Sigma Y vs. pad row;Pad row;#sigma_{Y}", nPadRows+2, -1.5, nPadRows+0.5, 100, 0, 0.5);
187 fhSigmaZVsRow = new TH2F("SigmaZVsPadRow", "Sigma Z vs. pad row;Pad row;#sigma_{Z}", nPadRows+2, -1.5, nPadRows+0.5, 100, 0, 0.5);
189 fhQmaxProfileYVsRow = new TProfile2D("MeanQmaxYVsPadRow","Mean Qmax, y vs pad row;Pad row;y",nPadRows+2, -1.5, nPadRows+0.5, nBinsY, -yRange, yRange);
190 fhQtotProfileYVsRow = new TProfile2D("MeanQtotYVsPadRow","Mean Qtot, y vs pad row;Pad row;y",nPadRows+2, -1.5, nPadRows+0.5, nBinsY, -yRange, yRange);
191 fhSigmaYProfileYVsRow = new TProfile2D("MeanSigmaYYVsPadRow","Mean Sigma y, y vs pad row;Pad row;y",nPadRows+2, -1.5, nPadRows+0.5, nBinsY, -yRange, yRange);
192 fhSigmaZProfileYVsRow = new TProfile2D("MeanSigmaZYVsPadRow","Mean Sigma z, y vs pad row;Pad row;y",nPadRows+2, -1.5, nPadRows+0.5, nBinsY, -yRange, yRange);
194 fhQmaxProfileZVsRow = new TProfile2D("MeanQmaxZVsPadRow","Mean Qmax, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
195 fhQtotProfileZVsRow = new TProfile2D("MeanQtotZVsPadRow","Mean Qtot, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
196 fhSigmaYProfileZVsRow = new TProfile2D("MeanSigmaYZVsPadRow","Mean Sigma y, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
197 fhSigmaZProfileZVsRow = new TProfile2D("MeanSigmaZZVsPadRow","Mean Sigma z, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
200 TString start(TTimeStamp(fTimeStart).AsString());
201 // TString stop(TTimeStamp(fTimeStart).AsString());
204 fhMeanQtotVsTime = new TProfile("MeanQtotVsTime",Form("Mean Qtot vs. time (start %s , 1 min bins); time; Qtot",start.Data()),5*nTimeBins, fTimeStart, fTimeStop);
205 fhQtotVsTime = new TH2F("QtotVsTime",Form("Qtot vs. time (start %s , 1 min bins); time; Qtot",start.Data()),5*nTimeBins, fTimeStart, fTimeStop,400,0,2000);
207 fhMeanNClustersVsTime = new TProfile("MeanNClustersVsTime",Form("Mean N Cluster vs. time (start %s , 5 min bins); time; NClusters",start.Data()),nTimeBins, fTimeStart, fTimeStop);
208 fhNClustersVsTime = new TH2F("NClustersVsTime",Form("N Clusters vs. time (start %s , 5 min bins); time; NClusters",start.Data()),nTimeBins, fTimeStart, fTimeStop,400,-0.5,3999.5);
210 fhQmaxProfileVsRow->SetLineWidth(2);
211 fhQtotProfileVsRow->SetLineWidth(2);
213 fhMeanQtotVsTime->SetLineWidth(2);
215 // histograms related to tracks
217 fhTrackQtotPerCluster = new TH1F("QtotPerCluster","Qtot per cluster; (Sum Qtot)/clusters",200,0,2000);
218 fhTrackQtotPerCluster->SetMarkerStyle(22);
219 fhTrackQtotPerCluster->SetMarkerSize(1);
221 fhTrackQtotPerClusterVsPhi = new TH2F("QtotPerClusterVsPhi","QtotPerCluster vs Phi; Phi; (Sum Qtot)/clusters",40,-2,2,200,0,2000);
222 fhTrackQtotPerClusterVsTheta = new TH2F("QtotPerClusterVsTheta","QtotPerCluster vs Theta; Theta; (Sum Qtot)/clusters",40,-2,2,200,0,2000);
224 fhTrackMeanQtotPerClusterVsPhi = new TProfile("MeanQtotPerClusterVsPhi", "QtotPerCluster vs Phi; Phi; Mean (Sum Qtot)/clusters",40,-2,2);
225 fhTrackMeanQtotPerClusterVsTheta = new TProfile("MeanQtotPerClusterVsTheta", "QtotPerCluster vs Theta; Theta; Mean (Sum Qtot)/clusters",40,-2,2);
227 fhTrackMeanQtotPerClusterVsPhi->SetLineWidth(2);
228 fhTrackMeanQtotPerClusterVsTheta->SetLineWidth(2);
230 fhMeanNTracksVsTime = new TProfile("MeanNTracksVsTime",Form("Mean n tracks vs. time (start %s , 5 min bins); time; N tracks",start.Data()),nTimeBins, fTimeStart, fTimeStop);
232 fhNEventsVsTime = new TH1F("NEventsVsTime",Form("N events vs. time (start %s , 5 min bins); time; N events",start.Data()),nTimeBins, fTimeStart, fTimeStop);
234 TH1::AddDirectory(oldStatus);
237 //____________________________________________________________________
238 AliTPCClusterHistograms::AliTPCClusterHistograms(const AliTPCClusterHistograms& c) : TNamed(c),
243 fhQtotProfileVsRow(0),
244 fhQmaxProfileVsRow(0),
245 fhQtotVsDistanceToEdge(0),
246 fhQtotProfileVsDistanceToEdge(0),
247 fhNClustersYVsRow(0),
248 fhNClustersZVsRow(0),
251 fhQmaxProfileYVsRow(0),
252 fhQtotProfileYVsRow(0),
253 fhSigmaYProfileYVsRow(0),
254 fhSigmaZProfileYVsRow(0),
255 fhQmaxProfileZVsRow(0),
256 fhQtotProfileZVsRow(0),
257 fhSigmaYProfileZVsRow(0),
258 fhSigmaZProfileZVsRow(0),
261 fhMeanNClustersVsTime(0),
262 fhNClustersVsTime(0),
263 fhTrackQtotPerCluster(0),
264 fhTrackQtotPerClusterVsPhi(0),
265 fhTrackQtotPerClusterVsTheta(0),
266 fhTrackMeanQtotPerClusterVsPhi(0),
267 fhTrackMeanQtotPerClusterVsTheta(0),
268 fhMeanNTracksVsTime(),
272 fEdgeSuppression(kFALSE),
273 fNClustersInEvent(0),
278 fCommentToHistograms()
281 ((AliTPCClusterHistograms &)c).Copy(*this);
284 //____________________________________________________________________
285 AliTPCClusterHistograms::~AliTPCClusterHistograms()
299 if (fhQmaxProfileVsRow) {
300 delete fhQmaxProfileVsRow;
301 fhQmaxProfileVsRow = 0;
303 if (fhQtotProfileVsRow) {
304 delete fhQtotProfileVsRow;
305 fhQtotProfileVsRow = 0;
307 if (fhNClustersYVsRow) {
308 delete fhNClustersYVsRow;
309 fhNClustersYVsRow = 0;
311 if (fhNClustersZVsRow) {
312 delete fhNClustersZVsRow;
313 fhNClustersZVsRow = 0;
316 delete fhSigmaYVsRow;
320 delete fhSigmaZVsRow;
323 if (fhQmaxProfileYVsRow) {
324 delete fhQmaxProfileYVsRow;
325 fhQmaxProfileYVsRow = 0;
327 if (fhQtotProfileYVsRow) {
328 delete fhQtotProfileYVsRow;
329 fhQtotProfileYVsRow = 0;
331 if (fhSigmaYProfileYVsRow) {
332 delete fhSigmaYProfileYVsRow;
333 fhSigmaYProfileYVsRow = 0;
335 if (fhSigmaZProfileYVsRow) {
336 delete fhSigmaZProfileYVsRow;
337 fhSigmaZProfileYVsRow = 0;
339 if (fhQmaxProfileZVsRow) {
340 delete fhQmaxProfileZVsRow;
341 fhQmaxProfileZVsRow = 0;
343 if (fhQtotProfileZVsRow) {
344 delete fhQtotProfileZVsRow;
345 fhQtotProfileZVsRow = 0;
347 if (fhSigmaYProfileZVsRow) {
348 delete fhSigmaYProfileZVsRow;
349 fhSigmaYProfileZVsRow = 0;
351 if (fhSigmaZProfileZVsRow) {
352 delete fhSigmaZProfileZVsRow;
353 fhSigmaZProfileZVsRow = 0;
355 if (fhMeanQtotVsTime) {
356 delete fhMeanQtotVsTime;
357 fhMeanQtotVsTime = 0;
363 if (fhMeanNClustersVsTime) {
364 delete fhMeanNClustersVsTime;
365 fhMeanNClustersVsTime = 0;
367 if (fhNClustersVsTime) {
368 delete fhNClustersVsTime;
369 fhNClustersVsTime = 0;
371 if (fhTrackQtotPerCluster) {
372 delete fhTrackQtotPerCluster;
373 fhTrackQtotPerCluster = 0;
375 if (fhTrackQtotPerClusterVsPhi) {
376 delete fhTrackQtotPerClusterVsPhi;
377 fhTrackQtotPerClusterVsPhi = 0;
379 if (fhTrackQtotPerClusterVsTheta) {
380 delete fhTrackQtotPerClusterVsTheta;
381 fhTrackQtotPerClusterVsTheta = 0;
383 if (fhTrackMeanQtotPerClusterVsPhi) {
384 delete fhTrackMeanQtotPerClusterVsPhi;
385 fhTrackMeanQtotPerClusterVsPhi = 0;
387 if (fhTrackMeanQtotPerClusterVsTheta) {
388 delete fhTrackMeanQtotPerClusterVsTheta;
389 fhTrackMeanQtotPerClusterVsTheta = 0;
391 if (fhMeanNTracksVsTime) {
392 delete fhMeanNTracksVsTime;
393 fhMeanNTracksVsTime = 0;
395 if (fhNEventsVsTime) {
396 delete fhNEventsVsTime;
401 //____________________________________________________________________
402 AliTPCClusterHistograms &AliTPCClusterHistograms::operator=(const AliTPCClusterHistograms &c)
404 // assigment operator
407 ((AliTPCClusterHistograms &) c).Copy(*this);
412 //____________________________________________________________________
413 TString AliTPCClusterHistograms::FormDetectorName(Int_t detector, Bool_t edgeSuppression, const char* comment)
416 // creates a readable name from the detector number
419 Int_t sector = detector%18;
423 if (detector<18 || ( detector>=36 && detector<54))
434 name.Form("sector_%s%d_%s", side.Data(), sector, inout.Data());
445 //____________________________________________________________________
446 Long64_t AliTPCClusterHistograms::Merge(TCollection* list)
448 // Merge a list of AliTPCClusterHistograms objects with this (needed for
450 // Returns the number of merged objects (including this).
458 TIterator* iter = list->MakeIterator();
461 // collections of measured and generated histograms
462 TList* collectionQmaxVsRow = new TList;
463 TList* collectionQtotVsRow = new TList;
465 TList* collectionQmaxProfileVsRow = new TList;
466 TList* collectionQtotProfileVsRow = new TList;
468 TList* collectionNClustersYVsRow = new TList;
469 TList* collectionNClustersZVsRow = new TList;
471 TList* collectionSigmaYVsRow = new TList;
472 TList* collectionSigmaZVsRow = new TList;
474 TList* collectionQmaxProfileYVsRow = new TList;
475 TList* collectionQtotProfileYVsRow = new TList;
476 TList* collectionSigmaYProfileYVsRow = new TList;
477 TList* collectionSigmaZProfileYVsRow = new TList;
479 TList* collectionQmaxProfileZVsRow = new TList;
480 TList* collectionQtotProfileZVsRow = new TList;
481 TList* collectionSigmaYProfileZVsRow = new TList;
482 TList* collectionSigmaZProfileZVsRow = new TList;
484 TList* collectionMeanQtotVsTime = new TList;
485 TList* collectionQtotVsTime = new TList;
487 TList* collectionMeanNClustersVsTime = new TList;
488 TList* collectionNClustersVsTime = new TList;
490 TList* collectionTrackQtotPerCluster = new TList;
492 TList* collectionTrackQtotPerClusterVsPhi = new TList;
493 TList* collectionTrackQtotPerClusterVsTheta = new TList;
495 TList* collectionTrackMeanQtotPerClusterVsPhi = new TList;
496 TList* collectionTrackMeanQtotPerClusterVsTheta = new TList;
498 TList* collectionMeanNTracksVsTime = new TList;
499 TList* collectionNEventsVsTime = new TList;
502 while ((obj = iter->Next())) {
504 AliTPCClusterHistograms* entry = dynamic_cast<AliTPCClusterHistograms*> (obj);
508 collectionQmaxVsRow ->Add(entry->fhQmaxVsRow );
509 collectionQtotVsRow ->Add(entry->fhQtotVsRow );
511 collectionQmaxProfileVsRow ->Add(entry->fhQmaxProfileVsRow );
512 collectionQtotProfileVsRow ->Add(entry->fhQtotProfileVsRow );
514 collectionNClustersYVsRow ->Add(entry->fhNClustersYVsRow);
515 collectionNClustersZVsRow ->Add(entry->fhNClustersZVsRow);
517 collectionSigmaYVsRow ->Add(entry->fhSigmaYVsRow );
518 collectionSigmaZVsRow ->Add(entry->fhSigmaZVsRow );
520 collectionQmaxProfileYVsRow ->Add(entry->fhQmaxProfileYVsRow );
521 collectionQtotProfileYVsRow ->Add(entry->fhQtotProfileYVsRow );
522 collectionSigmaYProfileYVsRow->Add(entry->fhSigmaYProfileYVsRow);
523 collectionSigmaZProfileYVsRow->Add(entry->fhSigmaZProfileYVsRow);
525 collectionQmaxProfileZVsRow ->Add(entry->fhQmaxProfileZVsRow );
526 collectionQtotProfileZVsRow ->Add(entry->fhQtotProfileZVsRow );
527 collectionSigmaYProfileZVsRow->Add(entry->fhSigmaYProfileZVsRow);
528 collectionSigmaZProfileZVsRow->Add(entry->fhSigmaZProfileZVsRow);
530 collectionMeanQtotVsTime ->Add(entry->fhMeanQtotVsTime);
531 collectionQtotVsTime ->Add(entry->fhQtotVsTime);
533 collectionMeanNClustersVsTime->Add(entry->fhMeanNClustersVsTime);
534 collectionNClustersVsTime ->Add(entry->fhNClustersVsTime);
536 collectionTrackQtotPerCluster->Add(entry->fhTrackQtotPerCluster);
538 collectionTrackQtotPerClusterVsPhi->Add(entry->fhTrackQtotPerClusterVsPhi);
539 collectionTrackQtotPerClusterVsTheta->Add(entry->fhTrackQtotPerClusterVsTheta);
541 collectionTrackMeanQtotPerClusterVsPhi->Add(entry->fhTrackMeanQtotPerClusterVsPhi);
542 collectionTrackMeanQtotPerClusterVsTheta->Add(entry->fhTrackMeanQtotPerClusterVsTheta);
544 collectionMeanNTracksVsTime->Add(entry->fhMeanNTracksVsTime);
545 collectionNEventsVsTime->Add(entry->fhNEventsVsTime);
550 fhQmaxVsRow ->Merge(collectionQmaxVsRow );
551 fhQtotVsRow ->Merge(collectionQtotVsRow );
553 fhQmaxProfileVsRow ->Merge(collectionQtotProfileVsRow);
554 fhQtotProfileVsRow ->Merge(collectionQtotProfileVsRow);
556 fhNClustersYVsRow ->Merge(collectionNClustersYVsRow);
557 fhNClustersZVsRow ->Merge(collectionNClustersZVsRow);
559 fhSigmaYVsRow ->Merge(collectionSigmaYVsRow );
560 fhSigmaZVsRow ->Merge(collectionSigmaZVsRow );
562 fhQmaxProfileYVsRow ->Merge(collectionQmaxProfileYVsRow );
563 fhQtotProfileYVsRow ->Merge(collectionQtotProfileYVsRow );
564 fhSigmaYProfileYVsRow->Merge(collectionSigmaYProfileYVsRow);
565 fhSigmaZProfileYVsRow->Merge(collectionSigmaZProfileYVsRow);
567 fhQmaxProfileZVsRow ->Merge(collectionQmaxProfileZVsRow );
568 fhQtotProfileZVsRow ->Merge(collectionQtotProfileZVsRow );
569 fhSigmaYProfileZVsRow->Merge(collectionSigmaYProfileZVsRow);
570 fhSigmaZProfileZVsRow->Merge(collectionSigmaZProfileZVsRow);
572 fhMeanQtotVsTime ->Merge(collectionMeanQtotVsTime);
573 fhQtotVsTime ->Merge(collectionQtotVsTime);
575 fhMeanNClustersVsTime->Merge(collectionMeanNClustersVsTime );
576 fhNClustersVsTime ->Merge(collectionNClustersVsTime);
578 fhTrackQtotPerCluster->Merge(collectionTrackQtotPerCluster);
580 fhTrackQtotPerClusterVsPhi->Merge(collectionTrackQtotPerClusterVsPhi);
581 fhTrackQtotPerClusterVsTheta->Merge(collectionTrackQtotPerClusterVsTheta);
583 fhTrackMeanQtotPerClusterVsPhi->Merge(collectionTrackMeanQtotPerClusterVsPhi);
584 fhTrackMeanQtotPerClusterVsTheta->Merge(collectionTrackMeanQtotPerClusterVsTheta);
586 fhMeanNTracksVsTime->Merge(collectionMeanNTracksVsTime);
587 fhNEventsVsTime->Merge(collectionNEventsVsTime);
589 delete collectionQmaxVsRow;
590 delete collectionQtotVsRow;
592 delete collectionQmaxProfileVsRow;
593 delete collectionQtotProfileVsRow;
595 delete collectionNClustersYVsRow;
596 delete collectionNClustersZVsRow;
598 delete collectionSigmaYVsRow;
599 delete collectionSigmaZVsRow;
601 delete collectionQmaxProfileYVsRow;
602 delete collectionQtotProfileYVsRow;
603 delete collectionSigmaYProfileYVsRow;
604 delete collectionSigmaZProfileYVsRow;
606 delete collectionQmaxProfileZVsRow;
607 delete collectionQtotProfileZVsRow;
608 delete collectionSigmaYProfileZVsRow;
609 delete collectionSigmaZProfileZVsRow;
611 delete collectionMeanQtotVsTime;
612 delete collectionQtotVsTime;
614 delete collectionMeanNClustersVsTime;
615 delete collectionNClustersVsTime;
617 delete collectionTrackQtotPerCluster;
619 delete collectionTrackQtotPerClusterVsPhi;
620 delete collectionTrackQtotPerClusterVsTheta;
622 delete collectionTrackMeanQtotPerClusterVsPhi;
623 delete collectionTrackMeanQtotPerClusterVsTheta;
625 delete collectionMeanNTracksVsTime;
626 delete collectionNEventsVsTime;
632 //____________________________________________________________________
633 void AliTPCClusterHistograms::FillCluster(AliTPCclusterMI* cluster, Int_t time) {
635 // Fills the different histograms with the information from the cluster.
638 Int_t padRow = cluster->GetRow();
639 Float_t qMax = cluster->GetMax();
640 Float_t qTot = cluster->GetQ();
641 Float_t sigmaY = cluster->GetSigmaY2();
642 Float_t sigmaZ = cluster->GetSigmaZ2();
643 Float_t y = cluster->GetY();
644 Float_t z = cluster->GetZ();
646 // check if this is ok!!!
650 printf(Form("\n WARNING: Hi Marian! How can we have Qmax = %f ??? \n \n", qMax));
653 printf(Form("\n WARNING: Hi Marian! How can we have Qtot = %f ??? \n \n ", qTot));
656 // check if the cluster is accepted
657 if (fEdgeSuppression)
658 if (IsClusterOnEdge(cluster))
662 fQtotInEvent = fQtotInEvent + qTot;
663 if (qTot > fMaxQtotInEvent)
664 fMaxQtotInEvent = qTot;
666 fhQmaxVsRow ->Fill(padRow, qMax);
667 fhQtotVsRow ->Fill(padRow, qTot);
669 fhQmaxProfileVsRow ->Fill(padRow, qMax);
670 fhQtotProfileVsRow ->Fill(padRow, qTot);
672 fhNClustersYVsRow ->Fill(padRow, y, 1);
673 fhNClustersZVsRow ->Fill(padRow, z, 1);
675 fhSigmaYVsRow ->Fill(padRow, sigmaY);
676 fhSigmaZVsRow ->Fill(padRow, sigmaZ);
678 fhQmaxProfileYVsRow ->Fill(padRow, y, qMax);
679 fhQtotProfileYVsRow ->Fill(padRow, y, qTot);
680 fhSigmaYProfileYVsRow ->Fill(padRow, y, sigmaY);
681 fhSigmaZProfileYVsRow ->Fill(padRow, y, sigmaZ);
683 fhQmaxProfileZVsRow ->Fill(padRow, z, qMax);
684 fhQtotProfileZVsRow ->Fill(padRow, z, qTot);
685 fhSigmaYProfileZVsRow ->Fill(padRow, z, sigmaY);
686 fhSigmaZProfileZVsRow ->Fill(padRow, z, sigmaZ);
688 if (time>0 && fTimeStart>0 && fTimeStop>0 && time>fTimeStart) {
689 //Float_t timeFraction = (time - fTimeStart)/(fTimeStop-fTimeStart);
691 fhMeanQtotVsTime->Fill(time,qTot);
692 fhQtotVsTime->Fill(time,qTot);
696 //____________________________________________________________________
697 void AliTPCClusterHistograms::FillTrack(const AliTPCseed* seed) {
699 // fill histograms related to tracks
702 Float_t totalQtot = 0;
704 for (Int_t clusterID = 0; clusterID < 160; clusterID++) {
705 AliTPCclusterMI* cluster = 0;
707 cluster = seed->GetClusterPointer(clusterID);
712 // only use clusters within this detector
713 if (cluster->GetDetector()!=fDetector)
716 // check if the cluster is accepted
717 if (fEdgeSuppression)
718 if (IsClusterOnEdge(cluster))
721 // Int_t padRow = cluster->GetRow();
722 //Float_t qMax = cluster->GetMax();
723 Float_t qTot = cluster->GetQ();
732 Float_t meanQtot = totalQtot/nClusters;
735 Float_t phi = TMath::ASin(seed->GetSnp() + seed->GetAlpha());
736 // angle with respect to the central membrane
737 Float_t theta = TMath::ATan(seed->GetTgl());
739 fhTrackQtotPerCluster->Fill(meanQtot);
741 fhTrackMeanQtotPerClusterVsPhi->Fill(phi, meanQtot);
742 fhTrackMeanQtotPerClusterVsTheta->Fill(theta, meanQtot);
744 fhTrackQtotPerClusterVsPhi->Fill(phi, meanQtot);
745 fhTrackQtotPerClusterVsTheta->Fill(theta, meanQtot);
748 //____________________________________________________________________
749 void AliTPCClusterHistograms::FillEvent(Int_t time, Int_t nTracks) {
754 fhMeanNTracksVsTime->Fill(time, nTracks);
756 // fhNEventsVsTime->Fill(time);
760 //____________________________________________________________________
761 Bool_t AliTPCClusterHistograms::IsClusterOnEdge(AliTPCclusterMI* clusterMI) {
763 // check if the cluster is on the edge
766 Int_t padRow = clusterMI->GetRow();
767 Float_t y = clusterMI->GetY();
772 limit = 12 + padRow * (20.0 - 12.0) / 63;
775 limit = 16 + padRow * (36.0 - 16.0) / 96;
777 if (TMath::Abs(y) > limit)
783 //____________________________________________________________________
784 Float_t AliTPCClusterHistograms::DistanceToEdge(AliTPCclusterMI* clusterMI) {
786 // get the y-distance to closest edge
789 Int_t detector = clusterMI->GetDetector();
790 Int_t padRow = clusterMI->GetRow();
791 Float_t y = clusterMI->GetY();
793 Float_t yEdge = -9999;
798 yEdge = 14 + padRow * 0.1333;
802 if (padRow<64) // small pads
803 yEdge = 22.5 + padRow * 0.1746;
805 yEdge = 34.0 + (padRow-64) * 0.2581;
807 if (y<=0) yEdge = -yEdge;
815 //____________________________________________________________________
816 Bool_t AliTPCClusterHistograms::KeepThisEvent(TString& why) {
818 // is this event interesting?
820 // the criteria are ...
824 why = TString(fWhyKeepEvent);
828 if (fNClustersInEvent>20000) {
829 why.Append("_moreThan20000clusters");
830 fWhyKeepEvent = TString(why);
835 if (fMaxQtotInEvent>10000) {
836 why.Append("_clusterWithQtot20000plus");
837 fWhyKeepEvent = TString(why);
842 if (gRandom->Uniform()<0.001) {
843 why.Append("_random");
844 fWhyKeepEvent = TString(why);
852 //____________________________________________________________________
853 void AliTPCClusterHistograms::StartEvent() {
858 fNClustersInEvent = 0;
862 fWhyKeepEvent = TString("");
867 //____________________________________________________________________
868 void AliTPCClusterHistograms::FinishEvent(Int_t timeStamp) {
870 // fill histograms related to the event
873 fhMeanNClustersVsTime->Fill(timeStamp, fNClustersInEvent);
874 fhNClustersVsTime ->Fill(timeStamp, fNClustersInEvent);
876 fhNEventsVsTime->Fill(timeStamp);
881 //____________________________________________________________________
882 void AliTPCClusterHistograms::SaveHistograms()
885 // saves the histograms
888 gDirectory->mkdir(fName.Data());
889 gDirectory->cd(fName.Data());
891 fhQmaxVsRow ->Write();
892 fhQtotVsRow ->Write();
894 fhQmaxProfileVsRow ->Write();
895 fhQtotProfileVsRow ->Write();
897 fhNClustersYVsRow ->Write();
898 fhNClustersZVsRow ->Write();
900 fhSigmaYVsRow ->Write();
901 fhSigmaZVsRow ->Write();
903 fhQmaxProfileYVsRow ->Write();
904 fhQtotProfileYVsRow ->Write();
905 fhSigmaYProfileYVsRow ->Write();
906 fhSigmaZProfileYVsRow ->Write();
908 fhQmaxProfileZVsRow ->Write();
909 fhQtotProfileZVsRow ->Write();
910 fhSigmaYProfileZVsRow ->Write();
911 fhSigmaZProfileZVsRow ->Write();
913 TNamed* comment = new TNamed("comment", fCommentToHistograms.Data());
916 if (fhMeanQtotVsTime->GetEntries()>0)
917 fhMeanQtotVsTime->Write();
919 if (fhQtotVsTime->GetEntries()>0)
920 fhQtotVsTime->Write();
922 if (fhMeanNClustersVsTime->GetEntries()>0)
923 fhMeanNClustersVsTime->Write();
925 if (fhNClustersVsTime->GetEntries()>0)
926 fhNClustersVsTime->Write();
928 if (fhNEventsVsTime->GetEntries()>0)
929 fhNEventsVsTime->Write();
931 gDirectory->mkdir("track_hists");
932 gDirectory->cd("track_hists");
934 fhTrackQtotPerCluster->Write();
936 fhTrackQtotPerClusterVsPhi->Write();
937 fhTrackQtotPerClusterVsTheta->Write();
939 fhTrackMeanQtotPerClusterVsPhi->Write();
940 fhTrackMeanQtotPerClusterVsTheta->Write();
942 fhMeanNTracksVsTime->Write();
944 gDirectory->cd("../");
946 gDirectory->cd("../");
951 //____________________________________________________________________
952 TCanvas* AliTPCClusterHistograms::DrawHistograms(const Char_t* opt) {
954 // Draws some histograms and save the canvas as eps and gif file.
957 TCanvas* c = new TCanvas(fName.Data(), fName.Data(), 1200, 800);
959 gStyle->SetOptStat(0);
960 gStyle->SetOptFit(0);
962 gStyle->SetPadLeftMargin(0.1);
970 // this is not really a nice way to do it...
971 c->GetPad(1)->Delete();
973 TLatex* tName = new TLatex(0.05,0.9,fName.Data());
974 tName->SetTextSize(0.02);
978 if (fEdgeSuppression)
979 tEdge = new TLatex(0.05,0.85,"(edges cut)");
981 tEdge = new TLatex(0.05,0.85,"(no edge cut)");
983 tEdge->SetTextSize(0.015);
986 tName = new TLatex(0.05,0.7, Form("Run: %s", opt));
987 tName->SetTextSize(0.02);
991 fhNClustersYVsRow->Draw("colz");
994 fhQtotVsRow->Draw("colz");
995 fhQtotProfileVsRow->SetMarkerStyle(3);
996 fhQtotProfileVsRow->Draw("same");
999 fhQtotProfileYVsRow ->Draw("colz");
1002 fhQtotProfileZVsRow ->Draw("colz");
1005 fhQtotVsTime->Draw("COLZ");
1006 fhMeanQtotVsTime->SetMarkerStyle(3);
1007 fhMeanQtotVsTime->Draw("SAME");