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()
39 fhQtotProfileVsRow(0),
40 fhQmaxProfileVsRow(0),
45 fhQmaxProfileYVsRow(0),
46 fhQtotProfileYVsRow(0),
47 fhSigmaYProfileYVsRow(0),
48 fhSigmaZProfileYVsRow(0),
49 fhQmaxProfileZVsRow(0),
50 fhQtotProfileZVsRow(0),
51 fhSigmaYProfileZVsRow(0),
52 fhSigmaZProfileZVsRow(0),
55 fhMeanNClustersVsTime(0),
57 fhTrackQtotPerCluster(0),
58 fhTrackQtotPerClusterVsPhi(0),
59 fhTrackQtotPerClusterVsTheta(0),
60 fhTrackMeanQtotPerClusterVsPhi(0),
61 fhTrackMeanQtotPerClusterVsTheta(0),
62 fhMeanNTracksVsTime(),
65 fEdgeSuppression(kFALSE)
67 // default constructor
70 //____________________________________________________________________
71 AliTPCClusterHistograms::AliTPCClusterHistograms(Int_t detector, const Char_t* comment, Int_t timeStart, Int_t timeStop, Bool_t edgeSuppression)
75 fhQtotProfileVsRow(0),
76 fhQmaxProfileVsRow(0),
81 fhQmaxProfileYVsRow(0),
82 fhQtotProfileYVsRow(0),
83 fhSigmaYProfileYVsRow(0),
84 fhSigmaZProfileYVsRow(0),
85 fhQmaxProfileZVsRow(0),
86 fhQtotProfileZVsRow(0),
87 fhSigmaYProfileZVsRow(0),
88 fhSigmaZProfileZVsRow(0),
91 fhMeanNClustersVsTime(0),
93 fhTrackQtotPerCluster(0),
94 fhTrackQtotPerClusterVsPhi(0),
95 fhTrackQtotPerClusterVsTheta(0),
96 fhTrackMeanQtotPerClusterVsPhi(0),
97 fhTrackMeanQtotPerClusterVsTheta(0),
98 fhMeanNTracksVsTime(0),
101 fEdgeSuppression(edgeSuppression)
105 // make name and title
106 if (detector < 0 || detector >= 72) {
107 AliDebug(AliLog::kError, Form("Detector %d does not exist", detector));
111 TString name(FormDetectorName(detector, edgeSuppression, comment));
113 fNClustersInEvent = 0;
118 fWhyKeepEvent = TString("hi");
120 fDetector = detector;
125 SetTitle(Form("%s (detector %d)",name.Data(), detector));
127 // rounding down to the closest hour and starting 10 hours before
128 fTimeStart = 3600*UInt_t(timeStart/3600) - 36000;
129 // rounding up to the closest hour
130 fTimeStop = 3600*UInt_t((3600 + timeStop)/3600);
131 // each time bin covers 5 min
132 Int_t nTimeBins = (fTimeStop-fTimeStart)/300;
134 // printf(Form(" start time: %d, stop time: %d \n",fTimeStart, fTimeStop));
136 #define BINNING_Z 250, 0, 250
147 // 1 bin for each 0.5 cm
148 Int_t nBinsY = Int_t(4*yRange);
150 // do not add this hists to the directory
151 Bool_t oldStatus = TH1::AddDirectoryStatus();
152 TH1::AddDirectory(kFALSE);
154 //defining histograms and profile plots
155 fhQmaxVsRow = new TH2F("QmaxVsPadRow", "Qmax vs. pad row;Pad row;Qmax", nPadRows+2, -1.5, nPadRows+0.5, 500, 0, 500);
156 fhQtotVsRow = new TH2F("QtotVsPadRow", "Qtot vs. pad row;Pad row;Qtot", nPadRows+2, -1.5, nPadRows+0.5, 400, 0, 4000);
158 fhQmaxProfileVsRow = new TProfile("MeanQmaxVsPadRow","Mean Qmax vs. pad row;Pad row;Mean Qmax",nPadRows+2, -1.5, nPadRows+0.5);
159 fhQtotProfileVsRow = new TProfile("MeanQtotVsPadRow","Mean Qtot vs. pad row;Pad row;Mean Qtot",nPadRows+2, -1.5, nPadRows+0.5);
161 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);
162 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);
164 fhSigmaYVsRow = new TH2F("SigmaYVsPadRow", "Sigma Y vs. pad row;Pad row;#sigma_{Y}", nPadRows+2, -1.5, nPadRows+0.5, 100, 0, 0.5);
165 fhSigmaZVsRow = new TH2F("SigmaZVsPadRow", "Sigma Z vs. pad row;Pad row;#sigma_{Z}", nPadRows+2, -1.5, nPadRows+0.5, 100, 0, 0.5);
167 fhQmaxProfileYVsRow = new TProfile2D("MeanQmaxYVsPadRow","Mean Qmax, y vs pad row;Pad row;y",nPadRows+2, -1.5, nPadRows+0.5, nBinsY, -yRange, yRange);
168 fhQtotProfileYVsRow = new TProfile2D("MeanQtotYVsPadRow","Mean Qtot, y vs pad row;Pad row;y",nPadRows+2, -1.5, nPadRows+0.5, nBinsY, -yRange, yRange);
169 fhSigmaYProfileYVsRow = new TProfile2D("MeanSigmaYYVsPadRow","Mean Sigma y, y vs pad row;Pad row;y",nPadRows+2, -1.5, nPadRows+0.5, nBinsY, -yRange, yRange);
170 fhSigmaZProfileYVsRow = new TProfile2D("MeanSigmaZYVsPadRow","Mean Sigma z, y vs pad row;Pad row;y",nPadRows+2, -1.5, nPadRows+0.5, nBinsY, -yRange, yRange);
172 fhQmaxProfileZVsRow = new TProfile2D("MeanQmaxZVsPadRow","Mean Qmax, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
173 fhQtotProfileZVsRow = new TProfile2D("MeanQtotZVsPadRow","Mean Qtot, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
174 fhSigmaYProfileZVsRow = new TProfile2D("MeanSigmaYZVsPadRow","Mean Sigma y, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
175 fhSigmaZProfileZVsRow = new TProfile2D("MeanSigmaZZVsPadRow","Mean Sigma z, z vs pad row;Pad row;z",nPadRows+2, -1.5, nPadRows+0.5, BINNING_Z);
178 TString start(TTimeStamp(fTimeStart).AsString());
179 // TString stop(TTimeStamp(fTimeStart).AsString());
182 fhMeanQtotVsTime = new TProfile("MeanQtotVsTime",Form("Mean Qtot vs. time (start %s , 1 min bins); time; Qtot",start.Data()),5*nTimeBins, fTimeStart, fTimeStop);
183 fhQtotVsTime = new TH2F("QtotVsTime",Form("Qtot vs. time (start %s , 1 min bins); time; Qtot",start.Data()),5*nTimeBins, fTimeStart, fTimeStop,400,0,2000);
185 fhMeanNClustersVsTime = new TProfile("MeanNClustersVsTime",Form("Mean N Cluster vs. time (start %s , 5 min bins); time; NClusters",start.Data()),nTimeBins, fTimeStart, fTimeStop);
186 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);
188 fhQmaxProfileVsRow->SetLineWidth(2);
189 fhQtotProfileVsRow->SetLineWidth(2);
191 fhMeanQtotVsTime->SetLineWidth(2);
193 // histograms related to tracks
195 fhTrackQtotPerCluster = new TH1F("QtotPerCluster","Qtot per cluster; (Sum Qtot)/clusters",200,0,2000);
196 fhTrackQtotPerCluster->SetMarkerStyle(22);
197 fhTrackQtotPerCluster->SetMarkerSize(1);
199 fhTrackQtotPerClusterVsPhi = new TH2F("QtotPerClusterVsPhi","QtotPerCluster vs Phi; Phi; (Sum Qtot)/clusters",40,-2,2,200,0,2000);
200 fhTrackQtotPerClusterVsTheta = new TH2F("QtotPerClusterVsTheta","QtotPerCluster vs Theta; Theta; (Sum Qtot)/clusters",40,-2,2,200,0,2000);
202 fhTrackMeanQtotPerClusterVsPhi = new TProfile("MeanQtotPerClusterVsPhi", "QtotPerCluster vs Phi; Phi; Mean (Sum Qtot)/clusters",40,-2,2);
203 fhTrackMeanQtotPerClusterVsTheta = new TProfile("MeanQtotPerClusterVsTheta", "QtotPerCluster vs Theta; Theta; Mean (Sum Qtot)/clusters",40,-2,2);
205 fhTrackMeanQtotPerClusterVsPhi->SetLineWidth(2);
206 fhTrackMeanQtotPerClusterVsTheta->SetLineWidth(2);
208 fhMeanNTracksVsTime = new TProfile("MeanNTracksVsTime",Form("Mean n tracks vs. time (start %s , 5 min bins); time; N tracks",start.Data()),nTimeBins, fTimeStart, fTimeStop);
210 fhNEventsVsTime = new TH1F("NEventsVsTime",Form("N events vs. time (start %s , 5 min bins); time; N events",start.Data()),nTimeBins, fTimeStart, fTimeStop);
212 TH1::AddDirectory(oldStatus);
215 //____________________________________________________________________
216 AliTPCClusterHistograms::AliTPCClusterHistograms(const AliTPCClusterHistograms& c) : TNamed(c)
219 ((AliTPCClusterHistograms &)c).Copy(*this);
222 //____________________________________________________________________
223 AliTPCClusterHistograms::~AliTPCClusterHistograms()
237 if (fhQmaxProfileVsRow) {
238 delete fhQmaxProfileVsRow;
239 fhQmaxProfileVsRow = 0;
241 if (fhQtotProfileVsRow) {
242 delete fhQtotProfileVsRow;
243 fhQtotProfileVsRow = 0;
245 if (fhNClustersYVsRow) {
246 delete fhNClustersYVsRow;
247 fhNClustersYVsRow = 0;
249 if (fhNClustersZVsRow) {
250 delete fhNClustersZVsRow;
251 fhNClustersZVsRow = 0;
254 delete fhSigmaYVsRow;
258 delete fhSigmaZVsRow;
261 if (fhQmaxProfileYVsRow) {
262 delete fhQmaxProfileYVsRow;
263 fhQmaxProfileYVsRow = 0;
265 if (fhQtotProfileYVsRow) {
266 delete fhQtotProfileYVsRow;
267 fhQtotProfileYVsRow = 0;
269 if (fhSigmaYProfileYVsRow) {
270 delete fhSigmaYProfileYVsRow;
271 fhSigmaYProfileYVsRow = 0;
273 if (fhSigmaZProfileYVsRow) {
274 delete fhSigmaZProfileYVsRow;
275 fhSigmaZProfileYVsRow = 0;
277 if (fhQmaxProfileZVsRow) {
278 delete fhQmaxProfileZVsRow;
279 fhQmaxProfileZVsRow = 0;
281 if (fhQtotProfileZVsRow) {
282 delete fhQtotProfileZVsRow;
283 fhQtotProfileZVsRow = 0;
285 if (fhSigmaYProfileZVsRow) {
286 delete fhSigmaYProfileZVsRow;
287 fhSigmaYProfileZVsRow = 0;
289 if (fhSigmaZProfileZVsRow) {
290 delete fhSigmaZProfileZVsRow;
291 fhSigmaZProfileZVsRow = 0;
293 if (fhMeanQtotVsTime) {
294 delete fhMeanQtotVsTime;
295 fhMeanQtotVsTime = 0;
301 if (fhMeanNClustersVsTime) {
302 delete fhMeanNClustersVsTime;
303 fhMeanNClustersVsTime = 0;
305 if (fhNClustersVsTime) {
306 delete fhNClustersVsTime;
307 fhNClustersVsTime = 0;
309 if (fhTrackQtotPerCluster) {
310 delete fhTrackQtotPerCluster;
311 fhTrackQtotPerCluster = 0;
313 if (fhTrackQtotPerClusterVsPhi) {
314 delete fhTrackQtotPerClusterVsPhi;
315 fhTrackQtotPerClusterVsPhi = 0;
317 if (fhTrackQtotPerClusterVsTheta) {
318 delete fhTrackQtotPerClusterVsTheta;
319 fhTrackQtotPerClusterVsTheta = 0;
321 if (fhTrackMeanQtotPerClusterVsPhi) {
322 delete fhTrackMeanQtotPerClusterVsPhi;
323 fhTrackMeanQtotPerClusterVsPhi = 0;
325 if (fhTrackMeanQtotPerClusterVsTheta) {
326 delete fhTrackMeanQtotPerClusterVsTheta;
327 fhTrackMeanQtotPerClusterVsTheta = 0;
329 if (fhMeanNTracksVsTime) {
330 delete fhMeanNTracksVsTime;
331 fhMeanNTracksVsTime = 0;
333 if (fhNEventsVsTime) {
334 delete fhNEventsVsTime;
339 //____________________________________________________________________
340 AliTPCClusterHistograms &AliTPCClusterHistograms::operator=(const AliTPCClusterHistograms &c)
342 // assigment operator
345 ((AliTPCClusterHistograms &) c).Copy(*this);
350 //____________________________________________________________________
351 TString AliTPCClusterHistograms::FormDetectorName(Int_t detector, Bool_t edgeSuppression, const char* comment)
354 // creates a readable name from the detector number
357 Int_t sector = detector%18;
361 if (detector<18 || ( detector>=36 && detector<54))
372 name.Form("sector_%s%d_%s", side.Data(), sector, inout.Data());
383 //____________________________________________________________________
384 Long64_t AliTPCClusterHistograms::Merge(TCollection* list)
386 // Merge a list of AliTPCClusterHistograms objects with this (needed for
388 // Returns the number of merged objects (including this).
396 TIterator* iter = list->MakeIterator();
399 // collections of measured and generated histograms
400 TList* collectionQmaxVsRow = new TList;
401 TList* collectionQtotVsRow = new TList;
403 TList* collectionQmaxProfileVsRow = new TList;
404 TList* collectionQtotProfileVsRow = new TList;
406 TList* collectionNClustersYVsRow = new TList;
407 TList* collectionNClustersZVsRow = new TList;
409 TList* collectionSigmaYVsRow = new TList;
410 TList* collectionSigmaZVsRow = new TList;
412 TList* collectionQmaxProfileYVsRow = new TList;
413 TList* collectionQtotProfileYVsRow = new TList;
414 TList* collectionSigmaYProfileYVsRow = new TList;
415 TList* collectionSigmaZProfileYVsRow = new TList;
417 TList* collectionQmaxProfileZVsRow = new TList;
418 TList* collectionQtotProfileZVsRow = new TList;
419 TList* collectionSigmaYProfileZVsRow = new TList;
420 TList* collectionSigmaZProfileZVsRow = new TList;
422 TList* collectionMeanQtotVsTime = new TList;
423 TList* collectionQtotVsTime = new TList;
425 TList* collectionMeanNClustersVsTime = new TList;
426 TList* collectionNClustersVsTime = new TList;
428 TList* collectionTrackQtotPerCluster = new TList;
430 TList* collectionTrackQtotPerClusterVsPhi = new TList;
431 TList* collectionTrackQtotPerClusterVsTheta = new TList;
433 TList* collectionTrackMeanQtotPerClusterVsPhi = new TList;
434 TList* collectionTrackMeanQtotPerClusterVsTheta = new TList;
436 TList* collectionMeanNTracksVsTime = new TList;
437 TList* collectionNEventsVsTime = new TList;
440 while ((obj = iter->Next())) {
442 AliTPCClusterHistograms* entry = dynamic_cast<AliTPCClusterHistograms*> (obj);
446 collectionQmaxVsRow ->Add(entry->fhQmaxVsRow );
447 collectionQtotVsRow ->Add(entry->fhQtotVsRow );
449 collectionQmaxProfileVsRow ->Add(entry->fhQmaxProfileVsRow );
450 collectionQtotProfileVsRow ->Add(entry->fhQtotProfileVsRow );
452 collectionNClustersYVsRow ->Add(entry->fhNClustersYVsRow);
453 collectionNClustersZVsRow ->Add(entry->fhNClustersZVsRow);
455 collectionSigmaYVsRow ->Add(entry->fhSigmaYVsRow );
456 collectionSigmaZVsRow ->Add(entry->fhSigmaZVsRow );
458 collectionQmaxProfileYVsRow ->Add(entry->fhQmaxProfileYVsRow );
459 collectionQtotProfileYVsRow ->Add(entry->fhQtotProfileYVsRow );
460 collectionSigmaYProfileYVsRow->Add(entry->fhSigmaYProfileYVsRow);
461 collectionSigmaZProfileYVsRow->Add(entry->fhSigmaZProfileYVsRow);
463 collectionQmaxProfileZVsRow ->Add(entry->fhQmaxProfileZVsRow );
464 collectionQtotProfileZVsRow ->Add(entry->fhQtotProfileZVsRow );
465 collectionSigmaYProfileZVsRow->Add(entry->fhSigmaYProfileZVsRow);
466 collectionSigmaZProfileZVsRow->Add(entry->fhSigmaZProfileZVsRow);
468 collectionMeanQtotVsTime ->Add(entry->fhMeanQtotVsTime);
469 collectionQtotVsTime ->Add(entry->fhQtotVsTime);
471 collectionMeanNClustersVsTime->Add(entry->fhMeanNClustersVsTime);
472 collectionNClustersVsTime ->Add(entry->fhNClustersVsTime);
474 collectionTrackQtotPerCluster->Add(entry->fhTrackQtotPerCluster);
476 collectionTrackQtotPerClusterVsPhi->Add(entry->fhTrackQtotPerClusterVsPhi);
477 collectionTrackQtotPerClusterVsTheta->Add(entry->fhTrackQtotPerClusterVsTheta);
479 collectionTrackMeanQtotPerClusterVsPhi->Add(entry->fhTrackMeanQtotPerClusterVsPhi);
480 collectionTrackMeanQtotPerClusterVsTheta->Add(entry->fhTrackMeanQtotPerClusterVsTheta);
482 collectionMeanNTracksVsTime->Add(entry->fhMeanNTracksVsTime);
483 collectionNEventsVsTime->Add(entry->fhNEventsVsTime);
488 fhQmaxVsRow ->Merge(collectionQmaxVsRow );
489 fhQtotVsRow ->Merge(collectionQtotVsRow );
491 fhQmaxProfileVsRow ->Merge(collectionQtotProfileVsRow);
492 fhQtotProfileVsRow ->Merge(collectionQtotProfileVsRow);
494 fhNClustersYVsRow ->Merge(collectionNClustersYVsRow);
495 fhNClustersZVsRow ->Merge(collectionNClustersZVsRow);
497 fhSigmaYVsRow ->Merge(collectionSigmaYVsRow );
498 fhSigmaZVsRow ->Merge(collectionSigmaZVsRow );
500 fhQmaxProfileYVsRow ->Merge(collectionQmaxProfileYVsRow );
501 fhQtotProfileYVsRow ->Merge(collectionQtotProfileYVsRow );
502 fhSigmaYProfileYVsRow->Merge(collectionSigmaYProfileYVsRow);
503 fhSigmaZProfileYVsRow->Merge(collectionSigmaZProfileYVsRow);
505 fhQmaxProfileZVsRow ->Merge(collectionQmaxProfileZVsRow );
506 fhQtotProfileZVsRow ->Merge(collectionQtotProfileZVsRow );
507 fhSigmaYProfileZVsRow->Merge(collectionSigmaYProfileZVsRow);
508 fhSigmaZProfileZVsRow->Merge(collectionSigmaZProfileZVsRow);
510 fhMeanQtotVsTime ->Merge(collectionMeanQtotVsTime);
511 fhQtotVsTime ->Merge(collectionQtotVsTime);
513 fhMeanNClustersVsTime->Merge(collectionMeanNClustersVsTime );
514 fhNClustersVsTime ->Merge(collectionNClustersVsTime);
516 fhTrackQtotPerCluster->Merge(collectionTrackQtotPerCluster);
518 fhTrackQtotPerClusterVsPhi->Merge(collectionTrackQtotPerClusterVsPhi);
519 fhTrackQtotPerClusterVsTheta->Merge(collectionTrackQtotPerClusterVsTheta);
521 fhTrackMeanQtotPerClusterVsPhi->Merge(collectionTrackMeanQtotPerClusterVsPhi);
522 fhTrackMeanQtotPerClusterVsTheta->Merge(collectionTrackMeanQtotPerClusterVsTheta);
524 fhMeanNTracksVsTime->Merge(collectionMeanNTracksVsTime);
525 fhNEventsVsTime->Merge(collectionNEventsVsTime);
527 delete collectionQmaxVsRow;
528 delete collectionQtotVsRow;
530 delete collectionQmaxProfileVsRow;
531 delete collectionQtotProfileVsRow;
533 delete collectionNClustersYVsRow;
534 delete collectionNClustersZVsRow;
536 delete collectionSigmaYVsRow;
537 delete collectionSigmaZVsRow;
539 delete collectionQmaxProfileYVsRow;
540 delete collectionQtotProfileYVsRow;
541 delete collectionSigmaYProfileYVsRow;
542 delete collectionSigmaZProfileYVsRow;
544 delete collectionQmaxProfileZVsRow;
545 delete collectionQtotProfileZVsRow;
546 delete collectionSigmaYProfileZVsRow;
547 delete collectionSigmaZProfileZVsRow;
549 delete collectionMeanQtotVsTime;
550 delete collectionQtotVsTime;
552 delete collectionMeanNClustersVsTime;
553 delete collectionNClustersVsTime;
555 delete collectionTrackQtotPerCluster;
557 delete collectionTrackQtotPerClusterVsPhi;
558 delete collectionTrackQtotPerClusterVsTheta;
560 delete collectionTrackMeanQtotPerClusterVsPhi;
561 delete collectionTrackMeanQtotPerClusterVsTheta;
563 delete collectionMeanNTracksVsTime;
564 delete collectionNEventsVsTime;
570 //____________________________________________________________________
571 void AliTPCClusterHistograms::FillCluster(AliTPCclusterMI* cluster, Int_t time) {
573 // Fills the different histograms with the information from the cluster.
576 Int_t padRow = cluster->GetRow();
577 Float_t qMax = cluster->GetMax();
578 Float_t qTot = cluster->GetQ();
579 Float_t sigmaY = cluster->GetSigmaY2();
580 Float_t sigmaZ = cluster->GetSigmaZ2();
581 Float_t y = cluster->GetY();
582 Float_t z = cluster->GetZ();
584 // check if this is ok!!!
588 printf(Form("\n WARNING: Hi Marian! How can we have Qmax = %f ??? \n \n", qMax));
591 printf(Form("\n WARNING: Hi Marian! How can we have Qtot = %f ??? \n \n ", qTot));
594 // check if the cluster is accepted
595 if (fEdgeSuppression)
596 if (IsClusterOnEdge(cluster))
600 fQtotInEvent = fQtotInEvent + qTot;
601 if (qTot > fMaxQtotInEvent)
602 fMaxQtotInEvent = qTot;
604 fhQmaxVsRow ->Fill(padRow, qMax);
605 fhQtotVsRow ->Fill(padRow, qTot);
607 fhQmaxProfileVsRow ->Fill(padRow, qMax);
608 fhQtotProfileVsRow ->Fill(padRow, qTot);
610 fhNClustersYVsRow ->Fill(padRow, y, 1);
611 fhNClustersZVsRow ->Fill(padRow, z, 1);
613 fhSigmaYVsRow ->Fill(padRow, sigmaY);
614 fhSigmaZVsRow ->Fill(padRow, sigmaZ);
616 fhQmaxProfileYVsRow ->Fill(padRow, y, qMax);
617 fhQtotProfileYVsRow ->Fill(padRow, y, qTot);
618 fhSigmaYProfileYVsRow ->Fill(padRow, y, sigmaY);
619 fhSigmaZProfileYVsRow ->Fill(padRow, y, sigmaZ);
621 fhQmaxProfileZVsRow ->Fill(padRow, z, qMax);
622 fhQtotProfileZVsRow ->Fill(padRow, z, qTot);
623 fhSigmaYProfileZVsRow ->Fill(padRow, z, sigmaY);
624 fhSigmaZProfileZVsRow ->Fill(padRow, z, sigmaZ);
626 if (time>0 & fTimeStart>0 & fTimeStop>0 & time>fTimeStart) {
627 //Float_t timeFraction = (time - fTimeStart)/(fTimeStop-fTimeStart);
629 fhMeanQtotVsTime->Fill(time,qTot);
630 fhQtotVsTime->Fill(time,qTot);
634 //____________________________________________________________________
635 void AliTPCClusterHistograms::FillTrack(const AliTPCseed* seed) {
637 // fill histograms related to tracks
640 Float_t totalQtot = 0;
642 for (Int_t clusterID = 0; clusterID < 160; clusterID++) {
643 AliTPCclusterMI* cluster = 0;
645 cluster = seed->GetClusterPointer(clusterID);
650 // only use clusters within this detector
651 if (cluster->GetDetector()!=fDetector)
654 // check if the cluster is accepted
655 if (fEdgeSuppression)
656 if (IsClusterOnEdge(cluster))
659 Int_t padRow = cluster->GetRow();
660 Float_t qMax = cluster->GetMax();
661 Float_t qTot = cluster->GetQ();
670 Float_t meanQtot = totalQtot/nClusters;
673 Float_t phi = TMath::ASin(seed->GetSnp() + seed->GetAlpha());
674 // angle with respect to the central membrane
675 Float_t theta = TMath::ATan(seed->GetTgl());
677 fhTrackQtotPerCluster->Fill(meanQtot);
679 fhTrackMeanQtotPerClusterVsPhi->Fill(phi, meanQtot);
680 fhTrackMeanQtotPerClusterVsTheta->Fill(theta, meanQtot);
682 fhTrackQtotPerClusterVsPhi->Fill(phi, meanQtot);
683 fhTrackQtotPerClusterVsTheta->Fill(theta, meanQtot);
686 //____________________________________________________________________
687 void AliTPCClusterHistograms::FillEvent(Int_t time, Int_t nTracks) {
692 fhMeanNTracksVsTime->Fill(time, nTracks);
694 // fhNEventsVsTime->Fill(time);
698 //____________________________________________________________________
699 Bool_t AliTPCClusterHistograms::IsClusterOnEdge(AliTPCclusterMI* clusterMI) {
701 // check if the cluster is on the edge
704 Int_t padRow = clusterMI->GetRow();
705 Float_t y = clusterMI->GetY();
710 limit = 12 + padRow * (20.0 - 12.0) / 63;
713 limit = 16 + padRow * (36.0 - 16.0) / 96;
715 if (TMath::Abs(y) > limit)
721 //____________________________________________________________________
722 Float_t AliTPCClusterHistograms::DistanceToEdge(AliTPCclusterMI* clusterMI) {
724 // get the y-distance to closest edge
727 Int_t detector = clusterMI->GetDetector();
728 Int_t padRow = clusterMI->GetRow();
729 Float_t y = clusterMI->GetY();
731 Float_t yEdge = -9999;
736 yEdge = 14 + padRow * 0.1333;
740 if (padRow<64) // small pads
741 yEdge = 22.5 + padRow * 0.1746;
743 yEdge = 34.0 + (padRow-64) * 0.2581;
745 if (y<=0) yEdge = -yEdge;
753 //____________________________________________________________________
754 Bool_t AliTPCClusterHistograms::KeepThisEvent(TString& why) {
756 // is this event interesting?
758 // the criteria are ...
762 why = TString(fWhyKeepEvent);
766 if (fNClustersInEvent>20000) {
767 why.Append("_moreThan20000clusters");
768 fWhyKeepEvent = TString(why);
773 if (fMaxQtotInEvent>10000) {
774 why.Append("_clusterWithQtot20000plus");
775 fWhyKeepEvent = TString(why);
780 if (gRandom->Uniform()<0.001) {
781 why.Append("_random");
782 fWhyKeepEvent = TString(why);
790 //____________________________________________________________________
791 void AliTPCClusterHistograms::StartEvent() {
796 fNClustersInEvent = 0;
800 fWhyKeepEvent = TString("");
805 //____________________________________________________________________
806 void AliTPCClusterHistograms::FinishEvent(Int_t timeStamp) {
808 // fill histograms related to the event
811 fhMeanNClustersVsTime->Fill(timeStamp, fNClustersInEvent);
812 fhNClustersVsTime ->Fill(timeStamp, fNClustersInEvent);
814 fhNEventsVsTime->Fill(timeStamp);
819 //____________________________________________________________________
820 void AliTPCClusterHistograms::SaveHistograms()
823 // saves the histograms
826 gDirectory->mkdir(fName.Data());
827 gDirectory->cd(fName.Data());
829 fhQmaxVsRow ->Write();
830 fhQtotVsRow ->Write();
832 fhQmaxProfileVsRow ->Write();
833 fhQtotProfileVsRow ->Write();
835 fhNClustersYVsRow ->Write();
836 fhNClustersZVsRow ->Write();
838 fhSigmaYVsRow ->Write();
839 fhSigmaZVsRow ->Write();
841 fhQmaxProfileYVsRow ->Write();
842 fhQtotProfileYVsRow ->Write();
843 fhSigmaYProfileYVsRow ->Write();
844 fhSigmaZProfileYVsRow ->Write();
846 fhQmaxProfileZVsRow ->Write();
847 fhQtotProfileZVsRow ->Write();
848 fhSigmaYProfileZVsRow ->Write();
849 fhSigmaZProfileZVsRow ->Write();
851 TNamed* comment = new TNamed("comment", fCommentToHistograms.Data());
854 if (fhMeanQtotVsTime->GetEntries()>0)
855 fhMeanQtotVsTime->Write();
857 if (fhQtotVsTime->GetEntries()>0)
858 fhQtotVsTime->Write();
860 if (fhMeanNClustersVsTime->GetEntries()>0)
861 fhMeanNClustersVsTime->Write();
863 if (fhNClustersVsTime->GetEntries()>0)
864 fhNClustersVsTime->Write();
866 if (fhNEventsVsTime->GetEntries()>0)
867 fhNEventsVsTime->Write();
869 gDirectory->mkdir("track_hists");
870 gDirectory->cd("track_hists");
872 fhTrackQtotPerCluster->Write();
874 fhTrackQtotPerClusterVsPhi->Write();
875 fhTrackQtotPerClusterVsTheta->Write();
877 fhTrackMeanQtotPerClusterVsPhi->Write();
878 fhTrackMeanQtotPerClusterVsTheta->Write();
880 fhMeanNTracksVsTime->Write();
882 gDirectory->cd("../");
884 gDirectory->cd("../");
889 //____________________________________________________________________
890 TCanvas* AliTPCClusterHistograms::DrawHistograms(const Char_t* /*opt*/) {
892 // Draws some histograms and save the canvas as eps and gif file.
895 TCanvas* c = new TCanvas(fName.Data(), fName.Data(), 1200, 1000);
897 gStyle->SetOptStat(0);
898 gStyle->SetOptFit(0);
900 gStyle->SetPadLeftMargin(0.1);
908 // this is not really a nice way to do it...
909 c->GetPad(1)->Delete();
911 TLatex* tName = new TLatex(0.05,0.9,fName.Data());
912 tName->SetTextSize(0.02);
916 if (fEdgeSuppression)
917 tEdge = new TLatex(0.05,0.85,"(edges cut)");
919 tEdge = new TLatex(0.05,0.85,"(no edge cut)");
921 tEdge->SetTextSize(0.015);
927 fhNClustersYVsRow->Draw("colz");
930 fhNClustersZVsRow->Draw("colz");
933 fhQmaxVsRow->Draw("colz");
934 fhQmaxProfileVsRow->Draw("same");
937 fhQtotVsRow->Draw("colz");
938 fhQtotProfileVsRow->Draw("same");
941 fhQtotProfileYVsRow ->Draw("colz");
944 fhQtotProfileZVsRow ->Draw("colz");
947 fhQmaxProfileYVsRow ->Draw("colz");
950 fhQmaxProfileZVsRow ->Draw("colz");