1 /**************************************************************************
\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
\r
4 * Author: The ALICE Off-line Project. *
\r
5 * Contributors are mentioned in the code where appropriate. *
\r
7 * Permission to use, copy, modify and distribute this software and its *
\r
8 * documentation strictly for non-commercial purposes is hereby granted *
\r
9 * withount fee, provided that the abov copyright notice appears in all *
\r
10 * copies and that both the copyright notice and this permission notice *
\r
11 * appear in the supporting documentation. The authors make no claims *
\r
12 * about the suitability of this software for any purpose. It is *
\r
13 * provided "as is without express or implied warranty. *
\r
14 **************************************************************************/
\r
16 /* $Id: AliTRDqaBlackEvents.cxx 23387 2008-01-17 17:25:16Z cblume $ */
\r
18 ////////////////////////////////////////////////////////////////////////////
\r
20 // QA of black events //
\r
23 // Sylwester Radomski (radomski@physi.uni-heidelberg.de) //
\r
25 ////////////////////////////////////////////////////////////////////////////
\r
33 #include "TCanvas.h"
\r
39 #include "AliTRDgeometry.h"
\r
40 #include "AliTRDrawStreamTB.h"
\r
41 #include "AliTRDqaBlackEvents.h"
\r
43 ClassImp(AliTRDqaBlackEvents)
\r
45 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
47 AliTRDqaBlackEvents::AliTRDqaBlackEvents()
\r
78 // ,fRefFileName("")
\r
82 // to create the histograms call Init()
\r
85 strcpy(fRefFileName, "");
\r
88 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
90 AliTRDqaBlackEvents::AliTRDqaBlackEvents(const AliTRDqaBlackEvents &qa)
\r
120 //,fRefFileName("")
\r
123 // Copy constructor
\r
124 // to create the histograms call Init()
\r
127 strcpy(fRefFileName, "");
\r
130 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
132 void AliTRDqaBlackEvents::Init()
\r
135 // creates histograms
\r
138 //TFile *file = new
\r
139 //Info("Init", "Statring");
\r
143 // histograms for chambers
\r
144 for(Int_t det=0; det<kDET; det++) {
\r
146 fNPoint[det] = new TH2D(Form("entries_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5);
\r
147 fData[det] = new TH3F(Form("data_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5, 50, -0.5, 49.5);
\r
149 // pedestal noise maps using RMS and Fit
\r
150 fChPed[det] = new TH2D(Form("ped_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5);
\r
151 fChNoise[det] = new TH2D(Form("noise_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5);
\r
153 //fChPed[det] = new TH2D(Form("ped_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5);
\r
154 //fChNoise[det] = new TH2D(Form("noise_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5);
\r
156 // distribution per detector
\r
157 fPed[det] = new TH1D(Form("pedDist_%d", det), ";pedestals (ADC counts)", 100, 5, 15);
\r
158 fNoise[det] = new TH1D(Form("noiseDist_%d", det), ";noise (ADC counts)", 100, 0, 5);
\r
159 fSignal[det] = new TH1D(Form("signal_%d", det), ";signal (ADC counts)", 100, -0.5, 99.5);
\r
160 fChPP[det] = new TH1D(Form("pp_%d", det), ";pp (ADC)", 200, -0.5, 199.5);
\r
162 fnEntriesRM[det] = new TH2D(Form("entriesRM_%d", det), ";ROB,MCM", 8, -0.5, 7.5, 16, -0.5, 15.5);
\r
164 // histograms after reference subtraction
\r
165 fChPedRes[det] = new TH2D(Form("pedRef_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5);
\r
166 fChNoiseRes[det] = new TH2D(Form("noiseRef_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5);
\r
170 fErrorLocMCM[det] = new TH2D(Form("errorLocMCM_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5);
\r
171 fErrorLocADC[det] = new TH2D(Form("errorLocADC_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5);
\r
172 fErrorLocHC[det] = new TH2D(Form("errorLocHC_%d", det), "", 16, -0.5, 15.5, 144, -0.5, 143.5);
\r
175 // histogram for each MCM
\r
176 for(Int_t i=0; i < kDET * kROB * kMCM; i++)
\r
177 fFullCounter[i] = 0;
\r
179 // histograms from the whole detector
\r
180 fOccupancy = new TH1D("occupancy", "", 20, -0.5, 19.5);
\r
181 fDetRob = new TH2D("DetRob", ";detector;ROB", kDET, -0.5, 539.5, 8, -0.5, 7.5);
\r
182 fTBEvent = new TH2D("tbEvent", ";event ID;time bin", 100, -0.5, 99.5, 30, -0.5, 29.5);
\r
184 // errors statistics and location
\r
185 fErrorHC = new TH1D("errorHC", ";error ID;", 7, -0.5, 6.5);
\r
186 fErrorMCM = new TH1D("errorMCM", ";error ID;", 7, -0.5, 6.5);
\r
187 fErrorADC = new TH1D("errorADC", ";error ID;", 7, -0.5, 6.5);
\r
189 fErrorSMHC = new TH1D("errorSM_HC", ";SM id", 18, -0.5, 17.5);
\r
190 fErrorSMMCM = new TH1D("errorSM_MCM", ";SM id", 18, -0.5, 17.5);
\r
191 fErrorSMADC = new TH1D("errorSM_ADC", ";SM id", 18, -0.5, 17.5);
\r
194 fErrorGraphHC = new TGraph();
\r
195 fErrorGraphMCM = new TGraph();
\r
196 fErrorGraphADC = new TGraph();
\r
198 fGraphMCM = new TGraph();
\r
200 fMapMCM = new TH2D("mapMCM", ";det;mcm", 540, -0.5, 539.5, kROB*kMCM, -0.5, kROB*kMCM-0.5);
\r
201 fFracMCM = new TH1D("fracMCM", ";frequency", 100, 0, 1);
\r
204 fErrorGraphHC->GetHistogram()->SetTitle("Error HC;event number;fraction with error (%)");
\r
205 fErrorGraphMCM->GetHistogram()->SetTitle("Error MCM;event number;fraction with error (%)");
\r
206 fErrorGraphADC->GetHistogram()->SetTitle("Error ADC;event number;fraction with error (%)");
\r
209 fSMHCped = new TH2D("smHcPed", ";super module;half chamber", 18, -0.5, 17.5, 60, -0.5, 59.5);
\r
212 //Info("Init", "Done");
\r
214 // number of ADC channels fired per SM and in total
\r
215 for(Int_t sm=0; sm<kSM+1; sm++)
\r
216 fNumberADC[sm] = new TGraph();
\r
219 fNoiseTotal = new TH1D("noiseTotal", "noise (ADC)", 250, 0, 10);
\r
220 fPP = new TH1D("peakPeak", "p-p (ADC)", 200, -0.5, 199.5);
\r
222 for(Int_t sm=0; sm<kSM; sm++) {
\r
223 fSmNoiseRms[sm] = new TH1D(Form("noiseRms_sm%d", sm), ";noise from RMS (ADC)", 100, 0, 10);
\r
224 fSmNoiseFit[sm] = new TH1D(Form("noiseFit_sm%d", sm), ";noise frim Fit (ADC)", 100, 0, 10);
\r
225 fSmPP[sm] = new TH1D(Form("peakPeak_sm%d", sm), ";peak-peak (ADC)", 200, -0.5, 199.5);
\r
228 fMcmTracks = new TObjArray();
\r
232 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
234 void AliTRDqaBlackEvents::Reset()
\r
237 // Resets the histograms
\r
240 for(Int_t i=0; i<kDET; i++) {
\r
242 fChPed[i]->Reset();
\r
243 fChNoise[i]->Reset();
\r
248 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
250 void AliTRDqaBlackEvents::SetRefFile(const char *filename) {
\r
252 strcpy(fRefFileName, filename);
\r
255 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
257 void AliTRDqaBlackEvents::ReadRefHists(Int_t det) {
\r
263 if (fRefFileName) TFile::Open(fRefFileName);
\r
266 fRefHistPed = (TH2D*)file->Get(Form("ped_%d",det));
\r
267 fRefHistNoise = (TH2D*)file->Get(Form("noise_%d", det));
\r
269 if (file) file->Close();
\r
272 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
274 Int_t AliTRDqaBlackEvents::AddEvent(AliTRDrawStreamTB *data)
\r
280 // structure to keep track if particular chanel is used
\r
281 Char_t isUsed[kDET][kCOL][kPAD];
\r
282 for(Int_t i=0; i<kDET; i++)
\r
283 for(Int_t j=0; j<kCOL; j++)
\r
284 for(Int_t k=0; k<kPAD; k++)
\r
285 isUsed[i][j][k] = 0;
\r
288 // clear the mcm data
\r
289 for(Int_t i=0; i < kDET * kROB * kMCM; i++) {
\r
290 if (fFullSignal[i]) fFullSignal[i]->Reset();
\r
291 fFullCounter[i] = 0;
\r
296 Int_t lastdet = -1;
\r
297 Int_t lastside = -1;
\r
298 Int_t lastmcm = -1;
\r
300 Int_t rob_last = -1;
\r
301 Int_t mcm_last = -1;
\r
304 Int_t nGoodMCM = 0;
\r
305 Int_t nGoodADC = 0;
\r
307 Int_t nErrorHC = 0;
\r
308 Int_t nErrorMCM = 0;
\r
309 Int_t nErrorADC = 0;
\r
312 //Int_t adc_last = -1;
\r
313 // Int_t sm_01 = -1;
\r
315 // number of ADCs per SM
\r
316 Int_t nADCinSM[kSM+1];
\r
317 for(Int_t sm=0; sm<kSM+1; sm++) nADCinSM[sm] = 0;
\r
321 while (data->Next()) {
\r
323 Int_t sm = data->GetSM();
\r
324 Int_t layer = data->GetLayer();
\r
325 Int_t stack = data->GetStack();
\r
327 Int_t det = data->GetDet();
\r
328 Int_t side = data->GetSide();
\r
330 Int_t row = data->GetRow();
\r
331 Int_t col = data->GetCol();
\r
333 Int_t rob = data->GetROB();
\r
334 Int_t mcm = data->GetMCM();
\r
335 Int_t adc = data->GetADC();
\r
338 Int_t *sig = data->GetSignals();
\r
344 // memory coruption protection
\r
345 if (det<0 || det>=kDET) continue;
\r
350 //fErrorHC->Fill(data->GetHCErrorCode());
\r
351 if (data->GetMCMErrorCode() > 0) fErrorLocMCM[det]->Fill(row, col);
\r
352 if (data->GetADCErrorCode() > 0) fErrorLocADC[det]->Fill(row, col);
\r
355 if ((det + side*kDET) != (lastdet + lastside*kDET)) {
\r
356 Int_t code = data->GetHCErrorCode();
\r
358 fErrorHC->Fill(code);
\r
360 if (code) fErrorSMHC->Fill(sm);
\r
361 if (code) nErrorHC++;
\r
365 //for(Int_t cc = 0; cc < 3; cc++) {
\r
366 // if (code & mask) fErrorHC->Fill(cc);
\r
375 if (mcm != lastmcm){
\r
376 Int_t code = data->GetMCMErrorCode();
\r
377 fErrorMCM->Fill(code);
\r
379 if (code) fErrorSMMCM->Fill(sm);
\r
380 if (code) nErrorMCM++;
\r
385 // new ADC channel found
\r
386 Int_t code = data->GetADCErrorCode();
\r
387 fErrorADC->Fill(code);
\r
388 if (code) fErrorSMADC->Fill(sm);
\r
389 if (code) nErrorADC++;
\r
392 // end of error checking
\r
395 fDetRob->Fill(det, rob, 1./(kMCM*18));
\r
396 isUsed[det][row][col]++;
\r
398 // check if mcm signal is continuus
\r
399 if ((rob_last != rob) || (mcm_last != mcm)) {
\r
402 fnEntriesRM[det]->Fill(rob,mcm);
\r
405 // number of entries for each channels
\r
406 fNPoint[det]->Fill(row, col);
\r
409 // create a structure for an MCM if needed
\r
410 Int_t mcmIndex = det * (kMCM * kROB) + rob * kMCM + mcm;
\r
411 if (fCreateFull && !fFullSignal[mcmIndex])
\r
412 fFullSignal[mcmIndex] = new TH2S(Form("mcm_%d_%d_%d_%d_%d", sm, stack, layer, rob, mcm),
\r
413 Form("mcm-%d-%d-%d-%d-%d;ADC;time bin", sm, stack, layer, rob, mcm),
\r
414 21, -0.5, 20.5, 30, -0.5, 29.5);
\r
417 // loop over Time Bins and fill histograms
\r
421 for(Int_t k=0; k<kTB; k++) { /// to be corrected
\r
423 //if (data->GetADCErrorCode() > 0) continue;
\r
425 //if (col == 0 || col == 143)
\r
426 //printf("TB: %d %d %d\n", row, col, sig[k]);
\r
429 //printf("det = %d rob = %d mcm = %d adc = %d k = %d S = %d\n", det, rob, mcm, adc, k, sig[k]);
\r
431 fSignal[det]->Fill(sig[k]);
\r
432 fData[det]->Fill(row, col, sig[k]);
\r
434 minV = (minV < sig[k]) ? minV : sig[k];
\r
435 maxV = (maxV > sig[k]) ? maxV : sig[k];
\r
438 // check if data strange enought
\r
439 if (fCreateFull && fFullSignal[mcmIndex]) {
\r
440 //if (sm == 17 && )
\r
442 if (sig[k] > fThresh || sig[k] < 1) fFullCounter[mcmIndex]++;
\r
443 //if (sig[k] < 1) fFullCounter[mcmIndex] = 0; // remove austrian flag
\r
445 fFullSignal[mcmIndex]->Fill(adc, k, sig[k]);
\r
449 if (det == 29 && col > 7) {
\r
450 fTBEvent->Fill(fnEvents, k, sig[k]);
\r
454 fPP->Fill(maxV-minV);
\r
455 fChPP[det]->Fill(maxV-minV);
\r
456 fSmPP[sm]->Fill(maxV-minV);
\r
459 // is the dead-alive status changing during the run
\r
460 for(Int_t i=0; i<kDET; i++) {
\r
461 for(Int_t j=0; j<kCOL; j++)
\r
462 for(Int_t k=0; k<kPAD; k++)
\r
463 fOccupancy->Fill(isUsed[i][j][k]);
\r
466 // save interesting histos
\r
467 Int_t mcmTrackCandidate = 0;
\r
468 for(Int_t i = 0; i < kDET * kROB * kMCM; i++) {
\r
469 if (fFullCounter[i] && fFullSignal[i] && CheckMCM(i) ) {
\r
471 fMcmTracks->AddLast(fFullSignal[i]->Clone(Form("event_%d_%s", fnEvents, fFullSignal[i]->GetName())));
\r
472 mcmTrackCandidate++;
\r
474 Int_t mcmTrackletDet = i/(kROB * kMCM);
\r
475 Int_t mcmTrackletMcm = i%(kROB * kMCM);
\r
476 fMapMCM->Fill(mcmTrackletDet, mcmTrackletMcm);
\r
480 fGraphMCM->SetPoint(fnEvents, fnEvents, mcmTrackCandidate);
\r
481 printf("Number of MCM track candidates = %d\n", mcmTrackCandidate);
\r
484 // update fraction of error graphs
\r
487 err = (nGoodHC > 0)? 100.*nErrorHC/nGoodHC : -1;
\r
488 fErrorGraphHC->SetPoint(fnEvents, fnEvents, err);
\r
490 err = (nGoodMCM > 0)? 100.*nErrorMCM/nGoodMCM : -1;
\r
491 fErrorGraphMCM->SetPoint(fnEvents, fnEvents, err);
\r
493 err = (nGoodADC > 0)? 100.*nErrorADC/nGoodADC : -1;
\r
494 fErrorGraphADC->SetPoint(fnEvents, fnEvents, err);
\r
496 // number of fired ADC per SM
\r
497 for(Int_t sm=0; sm<kSM+1; sm++)
\r
498 fNumberADC[sm]->SetPoint(fnEvents, fnEvents, nADCinSM[sm]);
\r
505 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
507 void AliTRDqaBlackEvents::Process(const char *filename)
\r
510 // Process something
\r
514 strcpy(fn, filename);
\r
516 //printf("FILENAME = %s (%s)\n", filename, fn);
\r
520 TH1D *hist = new TH1D("fitSignal", "", 50, -0.5, 49.5);
\r
521 TF1 *fit = new TF1("fit", "gaus(0)", 0, 20);
\r
522 fit->SetParameters(1e3, 10, 1);
\r
524 for(Int_t det=0; det<kDET; det++) {
\r
526 //printf("processing chamber %d\n", det);
\r
529 if (fData[det]->GetSum() < 10) continue;
\r
532 // read reference distributions
\r
535 for(Int_t row=0; row<fData[det]->GetXaxis()->GetNbins(); row++) {
\r
536 for(Int_t pad=0; pad<fData[det]->GetYaxis()->GetNbins(); pad++) {
\r
538 // project the histogramm
\r
540 for(Int_t bb=0; bb<50; bb++) {
\r
541 Int_t dataBin = fData[det]->FindBin(row, pad, bb);
\r
542 Double_t v = fData[det]->GetBinContent(dataBin);
\r
543 hist->SetBinContent(bb+1, v);
\r
546 Int_t bin = fChPed[det]->FindBin(row, pad);
\r
548 if (hist->GetSum() > 1) {
\r
550 Double_t ped = 0, noise = 0;
\r
552 if (fFitType == 0) {
\r
553 fit->SetParameters(1e3, 10, 1);
\r
554 hist->Fit(fit, "q0", "goff", 0, 20);
\r
555 TF1 *f = hist->GetFunction("fit");
\r
556 ped = TMath::Abs(f->GetParameter(1));
\r
557 noise = TMath::Abs(f->GetParameter(2));
\r
558 fSmNoiseFit[det/30]->Fill(noise);
\r
560 ped = hist->GetMean();
\r
561 noise = hist->GetRMS();
\r
562 fSmNoiseRms[det/30]->Fill(noise);
\r
564 // printf("data %f %f %f\n", hist->GetSum(), ped, noise);
\r
567 fChPed[det]->SetBinContent(bin, ped);
\r
568 fChNoise[det]->SetBinContent(bin, noise);
\r
569 fNoiseTotal->Fill(noise);
\r
571 // subtract reference values
\r
572 Double_t refped = 0;
\r
573 Double_t refnoise = 0;
\r
575 if (fRefHistPed) refped = fRefHistPed->GetBinContent(bin);
\r
576 if (fRefHistNoise) refnoise = fRefHistPed->GetBinContent(bin);
\r
578 fChPedRes[det]->SetBinContent(bin, ped-refped);
\r
579 fChNoiseRes[det]->SetBinContent(bin, noise-refnoise);
\r
581 fPed[det]->Fill(ped);
\r
582 fNoise[det]->Fill(noise);
\r
585 Int_t sm = det / 30;
\r
586 Int_t hc = (pad < kPAD/2) ? 2* (det % 30) : 2* (det % 30) + 1;
\r
587 if (ped > 9. && ped < 11) fSMHCped->Fill(sm, hc, 1./1152.); // number of pads in HC
\r
591 // not enought data found
\r
592 fChPed[det]->SetBinContent(bin, 0);
\r
593 fChNoise[det]->SetBinContent(bin, 0);
\r
594 fChPedRes[det]->SetBinContent(bin, 0);
\r
595 fChNoiseRes[det]->SetBinContent(bin, 0);
\r
604 //printf("Number of events = %d\n", fnEvents);
\r
606 // normalize number of entries histos
\r
608 for(Int_t i=0; i<kDET; i++) {
\r
609 if (!map[i]) continue;
\r
610 for(Int_t j=0; j<fNPoint[i]->GetXaxis()->GetNbins(); j++) {
\r
611 for(Int_t k=0; k<fNPoint[i]->GetYaxis()->GetNbins(); k++) {
\r
612 Int_t dataBin = fNPoint[i]->FindBin(j, k);
\r
613 Double_t v = fNPoint[i]->GetBinContent(dataBin);
\r
614 if (v > max) max = (Int_t)v;
\r
619 char entriesDistName[100];
\r
621 for(Int_t i=0; i<kDET; i++) {
\r
623 if (!map[i]) continue;
\r
625 sprintf(entriesDistName, "entriesDist_%d", i);
\r
626 fNPointDist[i] = new TH1D(entriesDistName, ";number of events", max+2, -0.5, max+1.5);
\r
628 for(Int_t j=0; j<fNPoint[i]->GetXaxis()->GetNbins(); j++) {
\r
629 for(Int_t k=0; k<fNPoint[i]->GetYaxis()->GetNbins(); k++) {
\r
630 Int_t dataBin = fNPoint[i]->FindBin(j, k);
\r
631 Double_t v = fNPoint[i]->GetBinContent(dataBin);
\r
632 //if (v > fnEvents) printf("N = %d V = %lf\n", fnEvents, v);
\r
633 fNPointDist[i]->Fill(v);
\r
637 fNPoint[i]->Scale(1./fnEvents);
\r
641 for(Int_t i=0; i<kDET; i++) {
\r
642 fnEntriesRM[i]->SetMaximum(fnEvents * 1.5);
\r
647 //printf("FILENAME 2 = %s (%d)\n", fn, fn);
\r
648 TFile *file = new TFile(fn, "recreate");
\r
649 for(Int_t det = 0; det < kDET; det++) {
\r
650 if (!map[det]) continue;
\r
651 fChPed[det]->Write();
\r
652 fChNoise[det]->Write();
\r
653 fNPoint[det]->Write();
\r
654 fNPointDist[det]->Write();
\r
655 fPed[det]->Write();
\r
656 fNoise[det]->Write();
\r
657 fSignal[det]->Write();
\r
658 fnEntriesRM[det]->Write();
\r
659 fChPP[det]->Write();
\r
661 fChPedRes[det]->Write();
\r
662 fChNoiseRes[det]->Write();
\r
664 // save error hists
\r
665 fErrorLocMCM[det]->SetMinimum(0);
\r
666 fErrorLocMCM[det]->SetMaximum(fnEvents);
\r
667 fErrorLocMCM[det]->Write();
\r
669 fErrorLocADC[det]->SetMinimum(0);
\r
670 fErrorLocADC[det]->SetMaximum(fnEvents);
\r
671 fErrorLocADC[det]->Write();
\r
674 for(Int_t sm=0; sm<kSM; sm++) {
\r
675 fSmNoiseRms[sm]->Write();
\r
676 fSmNoiseFit[sm]->Write();
\r
677 fSmPP[sm]->Write();
\r
683 for(Int_t i=0; i < kDET * kROB * kMCM; i++) {
\r
684 if (fFullSignal[i] && fFullCounter[i] > fCount) {
\r
685 fFullSignal[i]->Write();
\r
690 printf("Number of saved MCMs = %d\n", nMcm);
\r
692 fMcmTracks->Write();
\r
693 printf("Number of tracks = %d\n", fMcmTracks->GetEntries());
\r
695 // permanently problematic MCMs
\r
696 for(Int_t det=0; det<kDET; det++) {
\r
697 for(Int_t mcm=0; mcm<kROB*kMCM; mcm++) {
\r
699 Int_t mRob = mcm / kMCM;
\r
700 Int_t mMcm = mcm % kMCM;
\r
701 Int_t bin = fMapMCM->FindBin(det, mcm);
\r
702 Double_t frac = 1. * fMapMCM->GetBinContent(bin) / fnEvents;
\r
703 fFracMCM->Fill(frac);
\r
706 printf("{%d, %d, %d}, \n", det, mRob, mMcm, frac);
\r
713 fOccupancy->Write();
\r
719 fErrorMCM->Write();
\r
720 fErrorADC->Write();
\r
722 fErrorSMHC->Write();
\r
723 fErrorSMMCM->Write();
\r
724 fErrorSMADC->Write();
\r
727 fErrorGraphHC->Write("trendErrorHC");
\r
728 fErrorGraphMCM->Write("trendErrorMCM");
\r
729 fErrorGraphADC->Write("trendErrorADC");
\r
731 fGraphMCM->Write("trendMCM");
\r
733 fMapMCM->SetMaximum(fnEvents);
\r
739 for(Int_t sm=0; sm<kSM; sm++)
\r
740 fNumberADC[sm]->Write(Form("nADCinSM%d",sm));
\r
742 fNumberADC[kSM]->Write("nADCinEvent");
\r
744 fNoiseTotal->Write();
\r
751 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
753 Int_t AliTRDqaBlackEvents::CheckMCM(Int_t index) {
\r
757 static Int_t data[21][3] = {
\r
781 for(Int_t i=0; i<21; i++) {
\r
782 Int_t wIndex = data[i][0] * kROB*kMCM + data[i][1] * kMCM + data[i][2];
\r
783 if (index == wIndex) return 0;
\r
789 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
797 void AliTRDqaBlackEvents::DrawChamber(const char *filename, Int_t det, Int_t w, Int_t h)
\r
800 // Draw raport for one chamber:
\r
801 // pedestal map, noise map, distribution of pedestal and noise
\r
804 // name of the file with histograms (created with Process())
\r
805 // detector Id (0 - 539)
\r
808 // setup global style
\r
809 gStyle->SetPalette(1);
\r
810 gStyle->SetOptStat(0);
\r
811 gStyle->SetPadTopMargin(0.02);
\r
812 gStyle->SetPadBottomMargin(0.05);
\r
814 TFile *file = new TFile(filename, "READ");
\r
816 TCanvas *c = new TCanvas("blackEvents",Form("blackEvents %d",det), w, h);
\r
817 c->SetVertical(kFALSE);
\r
818 c->Divide(3,1, 0.01, 0.01);
\r
821 TPad *mPad = (TPad*) gPad;
\r
822 mPad->Divide(1,2,0.01,0.01);
\r
825 TH2D *h2 = (TH2D*)file->Get(Form("ped_%d",det));
\r
827 h2->SetMaximum(15);
\r
828 h2->SetTitle(";Z direction;#phi direction");
\r
832 h2 = (TH2D*)file->Get(Form("noise_%d",det));
\r
833 h2->SetMinimum(fMinNoise);
\r
834 h2->SetMaximum(fMaxNoise);
\r
835 h2->SetTitle(";Z direction;#phi direction");
\r
840 TH1D *h1 = (TH1D*)file->Get(Form("pedDist_%d", det));
\r
845 h1 = (TH1D*)file->Get(Form("noiseDist_%d", det));
\r
849 TF1 *f = h1->GetFunction("gaus");
\r
850 const char *tt = Form("#mu = %.2f #sigma = %0.2f ", f->GetParameter(1),f->GetParameter(2));
\r
851 TLatex *ll = new TLatex(2, 100, tt);
\r
852 ll->SetTextSize(0.06);
\r
856 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r
858 void AliTRDqaBlackEvents::DrawSm(const char *filename, Int_t sm, Int_t w, Int_t h)
\r
864 gStyle->SetPalette(1);
\r
865 gStyle->SetOptStat(0);
\r
867 gStyle->SetPadTopMargin(0.02);
\r
868 //gStyle->SetPadBottomMargin(0.05);
\r
869 //gStyle->SetPadLeftMargin(0.02);
\r
870 //gStyle->SetPadRightMargin(0.02);
\r
872 TFile *file = new TFile(filename, "READ");
\r
874 TCanvas *c = new TCanvas("blackEventsSM",Form("blackEvents SM %d",sm), w, h);
\r
875 c->SetVertical(kFALSE);
\r
876 c->Divide(5, 6, 0.001, 0.01);
\r
878 for(Int_t i=0; i<30; i++) {
\r
880 TH2D *h2 = (TH2D*)file->Get(Form("noise_%d",i+30*sm));
\r
882 h2->SetMinimum(fMinNoise);
\r
883 h2->SetMaximum(fMaxNoise);
\r
885 // to be replaced by the official calculation
\r
888 Int_t index = (5-layer)*5 + stack + 1;
\r
889 //printf("%d %d %d %d\n", i, stack, layer, index);
\r
891 gPad->SetBottomMargin(0.02);
\r
892 gPad->SetTopMargin(0.02);
\r
898 ///////////////////////////////////////////////////////////////////////////////////////////////////
\r