From 9b99c029c45a22703634c1d502945ec073e265e7 Mon Sep 17 00:00:00 2001 From: hristov Date: Tue, 4 Mar 2008 09:15:53 +0000 Subject: [PATCH] Updated QA version (Sylwester) --- TRD/AliTRDQADataMakerRec.cxx | 134 ++++++++++++++++++++++---- TRD/AliTRDQADataMakerRec.h | 4 +- TRD/AliTRDqaBlackEvents.cxx | 116 ++++++++++++++++++---- TRD/AliTRDqaBlackEvents.h | 20 ++-- TRD/qaGui/AliTRDqaGuiBlackChamber.cxx | 63 +++++++++--- TRD/qaGui/AliTRDqaGuiBlackChamber.h | 9 +- TRD/qaGui/AliTRDqaGuiBlackSM.cxx | 17 ++-- TRD/qaGui/AliTRDqaGuiESDs.cxx | 12 ++- TRD/qaGui/AliTRDqaGuiESDs.h | 4 +- TRD/qaGui/AliTRDqaGuiMain.cxx | 3 + TRD/qaGui/AliTRDqaGuiMain.h | 2 +- TRD/qaGui/AliTRDqaGuiMainBlack.cxx | 4 +- 12 files changed, 314 insertions(+), 74 deletions(-) diff --git a/TRD/AliTRDQADataMakerRec.cxx b/TRD/AliTRDQADataMakerRec.cxx index 9778a940504..2b95b0565bc 100644 --- a/TRD/AliTRDQADataMakerRec.cxx +++ b/TRD/AliTRDQADataMakerRec.cxx @@ -91,7 +91,7 @@ void AliTRDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * //TStopwatch watch; //watch.Start(); - //AliInfo(Form("Fitting RecPoints %d", task)) + AliInfo("End of TRD cycle"); if (task == AliQA::kRECPOINTS) { @@ -104,7 +104,7 @@ void AliTRDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * Int_t sm = i/30; Int_t det = i%30; - TH2D *detMap = (TH2D*)list->At(51); + TH2D *detMap = (TH2D*)list->At(87); Int_t bin = detMap->FindBin(sm, det); detMap->SetBinContent(bin, v); } @@ -231,6 +231,12 @@ void AliTRDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * //ratio->Divide(histD); } } + + // ratio for the fraction of electrons per stack + TH1D *histN = (TH1D*)list->At(33); + TH1D *histD = (TH1D*)list->At(32); + TH1D *ratio = (TH1D*)list->At(34); + BuildRatio(ratio, histN, histD); } @@ -245,7 +251,8 @@ void AliTRDQADataMakerRec::InitESDs() // Create ESDs histograms in ESDs subdir // - const Int_t kNhist = 27; + const Int_t kNhist = 36+5; + TH1 *hist[kNhist]; Int_t histoCounter = -1 ; @@ -262,9 +269,9 @@ void AliTRDQADataMakerRec::InitESDs() hist[++histoCounter] = new TH1D(Form("qaTRD_esd_trdz%s", suf[i]), ";z (cm)", 200, -400, 400); } - hist[++histoCounter] = new TH1D("qaTRD_esd_clsTRDo", "TRDo;number of clusters", 130, -0.5, 129.5);; - hist[++histoCounter] = new TH1D("qaTRD_esd_clsTRDr", "TRDr;number of clusters", 130, -0.5, 129.5);; - hist[++histoCounter] = new TH1D("qaTRD_esd_clsTRDz", "TRDz;number of clusters", 130, -0.5, 129.5);; + hist[++histoCounter] = new TH1D("qaTRD_esd_clsTRDo", "TRDo;number of clusters", 180, -0.5, 179.5);; + hist[++histoCounter] = new TH1D("qaTRD_esd_clsTRDr", "TRDr;number of clusters", 180, -0.5, 179.5);; + hist[++histoCounter] = new TH1D("qaTRD_esd_clsTRDz", "TRDz;number of clusters", 180, -0.5, 179.5);; //hist[++histoCounter] = new TH1D("qaTRD_esd_clsRatio", ";cluster ratio", 100, 0., 1.3);; hist[++histoCounter] = new TH2D("qaTRD_esd_sigMom", ";momentum (GeV/c);signal", 100, 0, 5, 200, 0, 1e3); @@ -282,7 +289,27 @@ void AliTRDQADataMakerRec::InitESDs() 200, -400, 400); } - for(Int_t i=0; i<=histoCounter; i++) { + // 27 - 31 + hist[27] = new TH1D("qaTRD_esd_quality", ";quality", 120, 0, 12); + hist[28] = new TH1D("qaTRD_esd_budget", ";NN", 110, -1000, 100); + hist[29] = new TH1D("qaTRD_esd_chi2", ";chi2", 200, 0, 100); + hist[30] = new TH1D("qaTRD_esd_timeBin", ";time bin", 7, -0.5, 6.5); + hist[31] = new TH1D("qaTRD_esd_pidQuality", "pid Quality", 7, -0.5, 6.5); + + // stack by stack electron identyfication + hist[32] = new TH1D("qaTRD_esd_tracksStack", "number of all tracks;stack", 90, -0.5, 89.5); + hist[33] = new TH1D("qaTRD_esd_electronStack", "number of electron tracks;stack", 90, -0.5, 89.5); + hist[34] = new TH1D("qaTRD_esd_elRatioStack", "fraction of electron tracks;stack", 90, -0.5, 89.5); + hist[35] = new TH1D("qaTRD_esd_thetaOut", ";tan(theta);", 100, -1, 1); + + const char *partType[5] = {"Electron", "Muon", "Pion", "Kaon", "Proton"}; + + for(Int_t i=0; iSumw2(); Add2ESDsList(hist[i], i); } @@ -296,7 +323,7 @@ void AliTRDQADataMakerRec::InitRecPoints() // Create Reconstructed Points histograms in RecPoints subdir // - const Int_t kNhist = 14 + 18 + 18 + 2; + const Int_t kNhist = 14 + 4 * 18 + 2; TH1 *hist[kNhist]; hist[0] = new TH1D("qaTRD_recPoints_det", ";Detector ID of the cluster", 540, -0.5, 539.5); @@ -313,14 +340,14 @@ void AliTRDQADataMakerRec::InitRecPoints() hist[9] = new TH1D("qaTRD_recPoints_nCls", ";number of clusters", 500, -0.5, 499.5); hist[10] = new TH3D("qaTRD_recPoints_sigTime", ";chamber;time bin;signal", - 540, -0.5, 539.5, 35, -0.5, 34.5, 100, 0, 200); + 540, -0.5, 539.5, 35, -0.5, 34.5, 200, -0.5, 199.5); hist[11] = new TProfile("qaTRD_recPoints_prf", ";distance;center of gravity" , 120, -0.6, 0.6, -1.2, 1.2, ""); hist[12] = new TH1D("qaTRD_recPoints_ampMPV", ";amplitude MPV", 200, 0, 200); hist[13] = new TH1D("qaTRD_recPoints_ampSigma", ";amplitude Sigma", 200, 0, 200); - // chamber bu chamber + // chamber by chamber for(Int_t i=0; i<18; i++) { hist[14+i] = new TH2D(Form("qaTRD_recPoints_sigTime_sm%d",i), Form("sm%d;det;time bin"), 30, -0.5, 29.5, 35, -0.5, 34.5); @@ -333,19 +360,32 @@ void AliTRDQADataMakerRec::InitRecPoints() hist[14+18+i] = new TH1D(Form("qaTRD_recPoints_sigTimeShape_sm%d", i), Form("sm%d;time bin;signal"), 35, -0.5, 34.5); - + hist[14+18+i]->SetMaximum(120); } - hist[50] = new TH1D("qaTRD_recPoints_signal", ";amplitude", 200, -0.5, 199.5); - hist[51] = new TH2D("qaTRD_recPoints_detMap", ";sm;chamber", 18, -0.5, 17.5, 30, -0.5, 29.5); + // str = 50 + for(Int_t i=0; i<18; i++) { + hist[50+i] = new TH1D(Form("qaTRD_recPoints_nCls_sm%d",i), + Form("sm%d;time bin;number of clusters",i), + 35, -0.5, 34.5); + } + + // str = 68 + for(Int_t i=0; i<18; i++) { + hist[68+i] = new TH1D(Form("qaTRD_recPoints_totalCharge_sm%d", i), + Form("sm%d;time bin;total charge", i), + 35, -0.5, 34.5); + } + + hist[86] = new TH1D("qaTRD_recPoints_signal", ";amplitude", 200, -0.5, 199.5); + hist[87] = new TH2D("qaTRD_recPoints_detMap", ";sm;chamber", 18, -0.5, 17.5, 30, -0.5, 29.5); for(Int_t i=0; iSumw2(); Add2RecPointsList(hist[i], i); } - } //____________________________________________________________________________ @@ -409,7 +449,7 @@ void AliTRDQADataMakerRec::MakeESDs(AliESDEvent * esd) // .. in the acceptance Int_t sector = GetSector(paramOut->GetAlpha()); - GetESDsData(1)->Fill(sector); + Int_t stack = GetStack(paramOut); UInt_t u = 1; UInt_t status = track->GetStatus(); @@ -438,7 +478,7 @@ void AliTRDQADataMakerRec::MakeESDs(AliESDEvent * esd) // clusters for(Int_t b=0; b<3; b++) - if (bit[3+b]) GetESDsData(b+15)->Fill(track->GetTRDncls()); + if (bit[3+b]) GetESDsData(b+15)->Fill(track->GetTRDncls0()); // refitted only if (!bit[4]) continue; @@ -446,9 +486,41 @@ void AliTRDQADataMakerRec::MakeESDs(AliESDEvent * esd) //fQuality->Fill(track->GetTRDQuality()); //fBudget->Fill(track->GetTRDBudget()); //fSignal->Fill(track->GetTRDsignal()); - + + GetESDsData(1)->Fill(sector); GetESDsData(18)->Fill(track->GetP(), track->GetTRDsignal()); + GetESDsData(27)->Fill(track->GetTRDQuality()); + GetESDsData(28)->Fill(track->GetTRDBudget()); + GetESDsData(29)->Fill(track->GetTRDchi2()); + GetESDsData(30)->Fill(track->GetTRDTimBin(0)); + GetESDsData(31)->Fill(track->GetTRDpidQuality()); + + // probabilities + if (status & AliESDtrack::kTRDpid) { + for(Int_t i=0; iFill(track->GetTRDpid(i)); + } + + // probabilities uniformity + if (track->GetTRDpidQuality() < 6) continue; + GetESDsData(35)->Fill(paramOut->GetZ()/paramOut->GetX()); + + Int_t idx = 5 * sector + stack; + GetESDsData(32)->Fill(idx); // all tracks + if (track->GetTRDpid(AliPID::kElectron) > 0.9) + GetESDsData(33)->Fill(idx); // electrons only + + + + /* + hist[27] = new TH1D("qaTRD_esd_quality", ";quality", 120, 0, 12); + hist[28] = new TH1D("qaTRD_esd_budget", ";NN", 110, -1000, 100); + hist[29] = new TH1D("qaTRD_esd_chi2", ";chi2", 300, 0, 100); + hist[30] = new TH1D("qaTRD_esd_timeBin", 7, -0.5, 6.5); + hist[31] = new TH1D("qaTRD_esd_pidQuality", 7, -0.5, 6.5); + */ + /* // PID only if (status & AliESDtrack::kTRDpid) { @@ -488,17 +560,33 @@ void AliTRDQADataMakerRec::MakeESDs(AliESDEvent * esd) } //______________________________________________________________________________ -Int_t AliTRDQADataMakerRec::GetSector(const Double_t alpha) const +Int_t AliTRDQADataMakerRec::GetSector(Double_t alpha) const { // // Gets the sector number // Double_t size = TMath::DegToRad() * 20.; // shall use TRDgeo - Int_t sector = (Int_t)((alpha + TMath::Pi())/size); + if (alpha < 0) alpha += 2*TMath::Pi(); + Int_t sector = (Int_t)(alpha/size); return sector; } +//______________________________________________________________________________ + +Int_t AliTRDQADataMakerRec::GetStack(const AliExternalTrackParam *paramOut) const +{ + // + // calculates the stack the track is in + // + + const Double_t L = -0.9; + const Double_t W = (2*L)/5; + + Double_t tan = paramOut->GetZ() / paramOut->GetX(); + Double_t pos = (tan - L) / W; + return (Int_t) pos; +} //______________________________________________________________________________ Double_t AliTRDQADataMakerRec::GetExtZ(const AliExternalTrackParam *in) const @@ -566,6 +654,8 @@ void AliTRDQADataMakerRec::MakeRaws(AliRawReader* rawReader) GetRawsData(3)->Fill(sm); GetRawsData(4+sm)->Fill(index); } + + delete raw; } //____________________________________________________________________________ @@ -609,7 +699,7 @@ void AliTRDQADataMakerRec::MakeRecPoints(TTree * clustersTree) Int_t iDet = c->GetDetector(); nDet[iDet]++; GetRecPointsData(0)->Fill(iDet); - GetRecPointsData(50)->Fill(c->GetQ()); + GetRecPointsData(86)->Fill(c->GetQ()); GetRecPointsData(1)->Fill(iDet, c->GetQ()); GetRecPointsData(2)->Fill(c->GetNPads()); if (c->GetNPads() < 6) @@ -620,6 +710,10 @@ void AliTRDQADataMakerRec::MakeRecPoints(TTree * clustersTree) GetRecPointsData(8)->Fill(c->GetPadTime()); ((TH3D*)GetRecPointsData(10))->Fill(iDet, c->GetPadTime(), c->GetQ()); + + Int_t iSM = iDet / 30; + GetRecPointsData(50+iSM)->Fill(c->GetPadTime()); + GetRecPointsData(68+iSM)->Fill(c->GetPadTime(), c->GetQ()); // PRF for 2pad //if (c->GetNPads() == 2) { diff --git a/TRD/AliTRDQADataMakerRec.h b/TRD/AliTRDQADataMakerRec.h index 2c0373637d9..10188bf62a8 100644 --- a/TRD/AliTRDQADataMakerRec.h +++ b/TRD/AliTRDQADataMakerRec.h @@ -48,8 +48,10 @@ class AliTRDQADataMakerRec: public AliQADataMakerRec { Int_t CheckPointer(TObject *obj, const char *name); // internal methods - Int_t GetSector(const Double_t alpha) const; + Int_t GetSector(Double_t alpha) const; + Int_t GetStack(const AliExternalTrackParam *paramOut) const; Double_t GetExtZ(const AliExternalTrackParam *paramIn) const; + void BuildRatio(TH1D *ratio, TH1D *histN, TH1D *histD); ClassDef(AliTRDQADataMakerRec,1) // Creates the TRD QA data diff --git a/TRD/AliTRDqaBlackEvents.cxx b/TRD/AliTRDqaBlackEvents.cxx index a62cfadf3ef..0d7fb887b7b 100644 --- a/TRD/AliTRDqaBlackEvents.cxx +++ b/TRD/AliTRDqaBlackEvents.cxx @@ -6,7 +6,7 @@ * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the abovśe copyright notice appears in all * + * withount fee, provided that the abovśe copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * @@ -47,6 +47,8 @@ AliTRDqaBlackEvents::AliTRDqaBlackEvents() :TObject() ,fMinNoise(0.5) ,fMaxNoise(2) + ,fFitType(0) + ,fnEvents(0) { // // Constructor @@ -60,6 +62,8 @@ AliTRDqaBlackEvents::AliTRDqaBlackEvents(const AliTRDqaBlackEvents &qa) :TObject(qa) ,fMinNoise(0.5) ,fMaxNoise(2) + ,fFitType(0) + ,fnEvents(0) { // // Copy constructor @@ -78,15 +82,20 @@ void AliTRDqaBlackEvents::Init() //TFile *file = new //Info("Init", "Statring"); + fnEvents = 0; + for(Int_t i=0; i<540; i++) { + fNPoint[i] = new TH2D(Form("entries_%d", i), "", 16, -0.5, 15.5, 144, -0.5, 143.5); fData[i] = new TH3D(Form("data_%d", i), "", 16, -0.5, 15.5, 144, -0.5, 143.5, 50, -0.5, 49.5); - fChPed[i] = new TH2D(Form("ped_%d", i), "", 16, -0.5, 15.5, 150, -0.5, 149.5); + fChPed[i] = new TH2D(Form("ped_%d", i), "", 16, -0.5, 15.5, 144, -0.5, 143.5); fChNoise[i] = new TH2D(Form("noise_%d", i), "", 16, -0.5, 15.5, 144, -0.5, 143.5); - fPed[i] = new TH1D(Form("pedDist_%d", i), ";pedestals", 100, 0, 20); - fNoise[i] = new TH1D(Form("noiseDist_%d", i), ";noise", 100, 0, 5); - fSignal[i] = new TH1D(Form("signal_%d", i), "", 100, -0.5, 99.5); + fPed[i] = new TH1D(Form("pedDist_%d", i), ";pedestals (ADC counts)", 100, 5, 15); + fNoise[i] = new TH1D(Form("noiseDist_%d", i), ";noise (ADC counts)", 100, 0, 5); + fSignal[i] = new TH1D(Form("signal_%d", i), "signal (ADC counts)", 100, -0.5, 99.5); } + fOccupancy = new TH1D("occupancy", "", 20, -0.5, 19.5); + //Info("Init", "Done"); } @@ -114,22 +123,49 @@ Int_t AliTRDqaBlackEvents::AddEvent(AliTRDrawStreamTB *data) // Add an event // + + Char_t isUsed[540][16][144]; + for(Int_t i=0; i<540; i++) + for(Int_t j=0; j<16; j++) + for(Int_t k=0; k<144; k++) + isUsed[i][j][k] = 0; + Int_t nb = 0; while (data->Next()) { Int_t det = data->GetDet(); + Int_t row = data->GetRow(); + Int_t col = data->GetCol(); Int_t *sig = data->GetSignals(); nb++; + //printf("det = %d\n", det); + if (det<0 || det>=540) continue; + isUsed[det][row][col]++; + + // if (!isUsed[det][data->GetRow()][data->GetCol()]) { + // isUsed[det][data->GetRow()][data->GetCol()] = 1; + // continue; + // } + + fNPoint[det]->Fill(row, col); - for(Int_t k=0; k<30; k++) { + for(Int_t k=0; k<30; k++) { /// to be corrected fSignal[det]->Fill(sig[k]); - //if(sig[k]>13) printf("timebin: %d signal: %d\n",k,sig[k]); - fData[det]->Fill(data->GetRow(), data->GetCol(), sig[k]); + fData[det]->Fill(row, col, sig[k]); } } + + for(Int_t i=0; i<540; i++) { + if (i != 0 && i != 8) continue; + for(Int_t j=0; j<16; j++) + for(Int_t k=0; k<144; k++) + fOccupancy->Fill(isUsed[i][j][k]); + } + + fnEvents++; return nb; } @@ -148,9 +184,9 @@ void AliTRDqaBlackEvents::Process(const char *filename) fit->SetParameters(1e3, 10, 1); for(Int_t i=0; i<540; i++) { - + map[i] = 0; - if (fData[i]->GetSum() < 100) continue; + if (fData[i]->GetSum() < 10) continue; map[i] = 1; Info("process", "processing chamber %d", i); @@ -170,11 +206,20 @@ void AliTRDqaBlackEvents::Process(const char *filename) Int_t bin = fChPed[i]->FindBin(j, k); - if (hist->GetSum() > 10) { - hist->Fit(fit, "q0", "goff", 0, 20); - TF1 *f = hist->GetFunction("fit"); - Double_t ped = TMath::Abs(f->GetParameter(1)); - Double_t noise = TMath::Abs(f->GetParameter(2)); + if (hist->GetSum() > 1) { + + Double_t ped = 0, noise = 0; + + if (fFitType == 0) { + fit->SetParameters(1e3, 10, 1); + hist->Fit(fit, "q0", "goff", 0, 20); + TF1 *f = hist->GetFunction("fit"); + ped = TMath::Abs(f->GetParameter(1)); + noise = TMath::Abs(f->GetParameter(2)); + } else { + ped = hist->GetMean(); + noise = hist->GetRMS(); + } fChPed[i]->SetBinContent(bin, ped); fChNoise[i]->SetBinContent(bin, noise); @@ -183,8 +228,8 @@ void AliTRDqaBlackEvents::Process(const char *filename) fNoise[i]->Fill(noise); } else { - fChPed[i]->SetBinContent(bin, 10); - fChNoise[i]->SetBinContent(bin, 1); + fChPed[i]->SetBinContent(bin, 0); + fChNoise[i]->SetBinContent(bin, 0); } //delete hist; @@ -192,15 +237,52 @@ void AliTRDqaBlackEvents::Process(const char *filename) } } + // normalize number of entries histos + + + Int_t max = 0; + for(Int_t i=0; i<540; i++) { + if (!map[i]) continue; + for(Int_t j=0; jGetXaxis()->GetNbins(); j++) { + for(Int_t k=0; kGetYaxis()->GetNbins(); k++) { + Int_t dataBin = fNPoint[i]->FindBin(j, k); + Double_t v = fNPoint[i]->GetBinContent(dataBin); + if (v > max) max = (Int_t)v; + } + } + } + + for(Int_t i=0; i<540; i++) { + + if (!map[i]) continue; + + fNPointDist[i] = new TH1D(Form("entriesDist_%d", i), ";number of events", max+2, -0.5, max+1.5); + + for(Int_t j=0; jGetXaxis()->GetNbins(); j++) { + for(Int_t k=0; kGetYaxis()->GetNbins(); k++) { + Int_t dataBin = fNPoint[i]->FindBin(j, k); + Double_t v = fNPoint[i]->GetBinContent(dataBin); + //if (v > fnEvents) printf("N = %d V = %lf\n", fnEvents, v); + fNPointDist[i]->Fill(v); + } + } + + fNPoint[i]->Scale(1./fnEvents); + } + + TFile *file = new TFile(filename, "UPDATE"); for(Int_t i=0; i<540; i++) { if (!map[i]) continue; fChPed[i]->Write(); fChNoise[i]->Write(); + fNPoint[i]->Write(); + fNPointDist[i]->Write(); fPed[i]->Write(); fNoise[i]->Write(); fSignal[i]->Write(); } + fOccupancy->Write(); file->Close(); delete file; } diff --git a/TRD/AliTRDqaBlackEvents.h b/TRD/AliTRDqaBlackEvents.h index 04d951b5295..e8ea8fbd8b1 100644 --- a/TRD/AliTRDqaBlackEvents.h +++ b/TRD/AliTRDqaBlackEvents.h @@ -42,20 +42,28 @@ class AliTRDqaBlackEvents : public TObject { TH2D *GetChamberNoise(Int_t det) {return fChNoise[det];} void SetNoiseLevel(Double_t min, Double_t max) {fMinNoise = min; fMaxNoise = max;} + void SetFitMethod(Int_t fit) {fFitType = fit;} void DrawChamber(const char *filename, Int_t det, Int_t w=700, Int_t h=400); //void ScanChamber(const char *filename, Int_t first, Int_t last); void DrawSm(const char *filename, Int_t sm, Int_t w=900, Int_t h=700); private: + + Int_t fnEvents; // number of events processed + + TH1D *fOccupancy; // how many times is a pad present in data - TH1D *fPed[540]; // Some histograms - TH1D *fNoise[540]; // Some histograms - TH2D *fChPed[540]; // Some histograms - TH2D *fChNoise[540]; // Some histograms - TH3D *fData[540]; // Some histograms - TH1D *fSignal[540]; // Some histograms + TH1D *fPed[540]; // reconstructed pedestals distribution (on hist per chamber) + TH1D *fNoise[540]; // reconstructed noise distribution (on hist per chamber) + TH1D *fNPointDist[540]; // distributin of the number of points + TH2D *fChPed[540]; // Some histograms + TH2D *fChNoise[540]; // Some histograms + TH2D *fNPoint[540]; // number of data points + TH3D *fData[540]; // Some histograms + TH1D *fSignal[540]; // Some histograms + Int_t fFitType; Double_t fMinNoise; // Minimum noise Double_t fMaxNoise; // Maximum noise diff --git a/TRD/qaGui/AliTRDqaGuiBlackChamber.cxx b/TRD/qaGui/AliTRDqaGuiBlackChamber.cxx index 5e6627607ad..353ee5ddded 100644 --- a/TRD/qaGui/AliTRDqaGuiBlackChamber.cxx +++ b/TRD/qaGui/AliTRDqaGuiBlackChamber.cxx @@ -54,7 +54,8 @@ const Int_t AliTRDqaGuiBlackChamber::fgknChamber = 30; ////////////////////////////////////////////////////////////////////////////////// AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber() - : fSetRangePed(0), + : fView(0), + fSetRangePed(0), fSetRangeNoise(0), fIdxSM(0), fIdxChamber(0), @@ -73,8 +74,9 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber() ////////////////////////////////////////////////////////////////////////////////// -AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent) +AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent) : TGCompositeFrame(parent, 720, 500), + fView(0), fSetRangePed(0), fSetRangeNoise(0), fIdxSM(0), @@ -94,10 +96,9 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent) // main constructor // - // steering panel + // steering panel SetLayoutManager(new TGVerticalLayout(this)); - fGPanel = new TGHorizontalFrame(this); // fGLabel = new TGLabel(fGPanel, "Current Chamber: "); @@ -117,6 +118,14 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent) fGSelectChamber->Resize(100, fGPrevSM->GetHeight()); fGSelectChamber->Select(fIdxChamber); + // vew + fGSelectView = new TGComboBox(fGPanel); + fGSelectView->AddEntry("pedestals",0); + fGSelectView->AddEntry("entiries", 1); + fGSelectView->Resize(150, fGPrevSM->GetHeight()); + fGSelectView->Select(0); + + //fGPlay = new TGTextButton(fGPanel, "PLAY"); TGLayoutHints *hint = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5); @@ -131,6 +140,7 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent) fGPanel->AddFrame(fGNextChamber, hint); fGPanel->AddFrame(fGNextSM, hint); + fGPanel->AddFrame(fGSelectView, hint); //fGPanel->AddFrame(fGPlay, hint); AddFrame(fGPanel); @@ -144,6 +154,8 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent) fGSelectSM->Connect("Selected(Int_t)", "AliTRDqaGuiBlackChamber", this, "SelectSM(Int_t)"); fGSelectChamber->Connect("Selected(Int_t)", "AliTRDqaGuiBlackChamber", this, "SelectChamber(Int_t)"); + fGSelectView->Connect("Selected(Int_t)", "AliTRDqaGuiBlackChamber", this, "SelectView(Int_t)"); + //fGPlay->Connect("Clicked()", "AliTRDqaGuiBlackChamber", this, "Play()"); // histograms @@ -196,9 +208,13 @@ void AliTRDqaGuiBlackChamber::SetQAFile(const char *filename) { // - const char *names[5] = {"ped", "noise", "pedDist", "noiseDist", "signal"}; - const char *opt[5] = {"colz", "colz", "", "", ""}; - const Int_t kLogy[5] = {0, 0, 1, 1, 0}; + //const char *names[5] = {"ped", "noise", "pedDist", "noiseDist", "signal"}; + const char *names[10] = { + "ped", "noise", "pedDist", "noiseDist", "signal", + "entries", "", "entriesDist", "", "" + }; + const char *opt[10] = {"colz", "colz", "", "", "", "colz", "colz", "", "", ""}; + const Int_t kLogy[10] = {0, 0, 1, 1, 1, 0, 0, 1, 1,1}; strcpy(fFileName, filename); @@ -214,27 +230,35 @@ void AliTRDqaGuiBlackChamber::SetQAFile(const char *filename) { for(Int_t i=0; i<5; i++) { Int_t index = fIdxSM * 30 + fIdxChamber; - const char *nn = Form("%s_%d", names[i], index); + const char *nn = Form("%s_%d", names[i+5*fView], index); //printf("%s\n", nn); fHistList[i] = (TH1*)file->Get(nn); //Form("%s_$d", names[fIdxType], index)); if (!fHistList[i]) continue; - - if ( (i == 0) && fSetRangePed) { + + if ( (fView == 1) && (i == 0)) { + fHistList[i]->SetMinimum(0); + fHistList[i]->SetMaximum(2); + } + + if ( (fView == 0) && (i == 0) && fSetRangePed) { fHistList[i]->SetMinimum(fRangePed[0]); fHistList[i]->SetMaximum(fRangePed[1]); } - if ( (i == 1) && fSetRangeNoise) { + if ( (fView == 0) && (i == 1) && fSetRangeNoise) { fHistList[i]->SetMinimum(fRangeNoise[0]); fHistList[i]->SetMaximum(fRangeNoise[1]); } fCanvasList[i]->GetCanvas()->cd(); - fCanvasList[i]->GetCanvas()->SetLogy(kLogy[i]); - if (fHistList[i]) fHistList[i]->Draw(opt[i]); - fCanvasList[i]->GetCanvas()->Update(); + fCanvasList[i]->GetCanvas()->SetLogy(kLogy[i+5*fView]); + if (fHistList[i]) fHistList[i]->Draw(opt[i+5*fView]); + //fCanvasList[i]->GetCanvas()->Update(); } + + for(Int_t i=0; i<5; i++) + fCanvasList[i]->GetCanvas()->Update(); } ////////////////////////////////////////////////////////////////////////////////// @@ -264,3 +288,14 @@ void AliTRDqaGuiBlackChamber::SetSM(Int_t idxSM) { } ////////////////////////////////////////////////////////////////////////////////// + +void AliTRDqaGuiBlackChamber::SetView(Int_t idxView) { + // + // sets active view + // + + fView = idxView; + fGSelectView->Select(idxView); + SetQAFile(fFileName); +} +////////////////////////////////////////////////////////////////////////////////// diff --git a/TRD/qaGui/AliTRDqaGuiBlackChamber.h b/TRD/qaGui/AliTRDqaGuiBlackChamber.h index 4dc396b82da..33a681c9841 100644 --- a/TRD/qaGui/AliTRDqaGuiBlackChamber.h +++ b/TRD/qaGui/AliTRDqaGuiBlackChamber.h @@ -41,6 +41,7 @@ class AliTRDqaGuiBlackChamber : public TGCompositeFrame { void SetQAFile(const char *filename); void SetSM(Int_t idxSM); void SetChamber(Int_t idxChamber); + void SetView(Int_t idxView); void SetRangePed(Double_t min, Double_t max) { fSetRangePed = 1; @@ -64,11 +65,13 @@ class AliTRDqaGuiBlackChamber : public TGCompositeFrame { void SelectChamber(Int_t idx) {SetChamber(idx);} // *SLOT* void SelectSM(Int_t idx) {SetSM(idx);} // *SLOT* - // void SelectView(Int_t idx) {SetView(idx);} // *SLOT* + void SelectView(Int_t idx) {SetView(idx);} // *SLOT* protected: + Int_t fView; + static const Int_t fgknSM; // number of supermodules static const Int_t fgknChamber; // number of chamberd (30) @@ -96,8 +99,8 @@ class AliTRDqaGuiBlackChamber : public TGCompositeFrame { // steering panel // TGLabel *fGLabel; TGComboBox *fGSelectSM; // selector for Super Module - TGComboBox *fGSelectChamber; // selectro for Chamber - //TGComboBox *fGSelectView; + TGComboBox *fGSelectChamber; // selector for Chamber + TGComboBox *fGSelectView; // select view TGTextButton *fGPrevSM; // button TGTextButton *fGPrevChamber; // button diff --git a/TRD/qaGui/AliTRDqaGuiBlackSM.cxx b/TRD/qaGui/AliTRDqaGuiBlackSM.cxx index c335880fc85..388c8c510b9 100644 --- a/TRD/qaGui/AliTRDqaGuiBlackSM.cxx +++ b/TRD/qaGui/AliTRDqaGuiBlackSM.cxx @@ -99,12 +99,12 @@ AliTRDqaGuiBlackSM::AliTRDqaGuiBlackSM(TGWindow *parent) fGSelect->Resize(100, fGPrev->GetHeight()); fGSelect->Select(fIdx,0); - const char *textTypes[5] = { - "pedestals", "noise", "pedestalDist", "noiseDist", "signal" + const char *textTypes[7] = { + "pedestals", "noise", "pedestalDist", "noiseDist", "signal", "entries", "entriesDist" }; fGSelectType = new TGComboBox(fGPanel); - for(int i=0; i<5; i++) fGSelectType->AddEntry(textTypes[i], i); + for(int i=0; i<7; i++) fGSelectType->AddEntry(textTypes[i], i); fGSelectType->Resize(100, fGPrev->GetHeight()); fGSelectType->Select(fIdxType, 0); @@ -155,9 +155,9 @@ void AliTRDqaGuiBlackSM::SetQAFile(const char *filename) { // Set the file with histograms // - const char *names[5] = {"ped", "noise", "pedDist", "noiseDist", "signal"}; - const char *opt[5] = {"col", "col", "", "", ""}; - const Int_t kLogy[5] = {0, 0, 1, 1, 0}; + const char *names[7] = {"ped", "noise", "pedDist", "noiseDist", "signal", "entries", "entriesDist"}; + const char *opt[7] = {"col", "col", "", "", "", "colz", ""}; + const Int_t kLogy[7] = {0, 0, 1, 1, 1, 0, 1}; fFileName = filename; @@ -182,6 +182,11 @@ void AliTRDqaGuiBlackSM::SetQAFile(const char *filename) { if (fHistList[i]) fHistList[i]->Draw(opt[fIdxType]); + if (fHistList[i] && (fIdxType == 5)) { + fHistList[i]->SetMinimum(0); + fHistList[i]->SetMaximum(2); + } + if ( fHistList[i] && (fIdxType == 0) && fSetRangePed) { fHistList[i]->SetMinimum(fRangePed[0]); fHistList[i]->SetMaximum(fRangePed[1]); diff --git a/TRD/qaGui/AliTRDqaGuiESDs.cxx b/TRD/qaGui/AliTRDqaGuiESDs.cxx index f7ced38b44c..71bb7bc7129 100644 --- a/TRD/qaGui/AliTRDqaGuiESDs.cxx +++ b/TRD/qaGui/AliTRDqaGuiESDs.cxx @@ -39,7 +39,7 @@ ClassImp(AliTRDqaGuiESDs) ////////////////////////////////////////////////////////////////////////////////// -const Int_t AliTRDqaGuiESDs::fgkLogList[12] = {1,1,0,0,0,0,1,1,1,1,1,1}; +const Int_t AliTRDqaGuiESDs::fgkLogList[18] = {1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0}; ////////////////////////////////////////////////////////////////////////////////// AliTRDqaGuiESDs::AliTRDqaGuiESDs(TGWindow *parent, Int_t page) @@ -66,9 +66,17 @@ AliTRDqaGuiESDs::AliTRDqaGuiESDs(TGWindow *parent, Int_t page) fNameList[10] = "pidQuality"; fNameList[11] = "chi2"; + fNameList[12] = "pid0"; + fNameList[13] = "pid2"; + fNameList[14] = "pid4"; + fNameList[15] = "tracksStack"; + fNameList[16] = "electronStack"; + fNameList[17] = "elRatioStack"; + + for(Int_t i=0; i<6; i++) { - fCanvasList[i] = new TRootEmbeddedCanvas(fNameList[i], this, 320, 320); + fCanvasList[i] = new TRootEmbeddedCanvas(fNameList[i+6*fPage], this, 320, 320); AddFrame(fCanvasList[i]); fCanvasList[i]->GetCanvas()->SetRightMargin(0.05); //TGToolTip *tip = new TGToolTip(this,fCanvasList[i], Form("Wal sie na ryja %d", i),1000); diff --git a/TRD/qaGui/AliTRDqaGuiESDs.h b/TRD/qaGui/AliTRDqaGuiESDs.h index 9c686126279..dd97e79031f 100644 --- a/TRD/qaGui/AliTRDqaGuiESDs.h +++ b/TRD/qaGui/AliTRDqaGuiESDs.h @@ -39,8 +39,8 @@ class AliTRDqaGuiESDs : public TGCompositeFrame { protected: Int_t fPage; // histogram set - const char *fNameList[12]; // list of histograms - static const Int_t fgkLogList[12]; // flag for log scale + const char *fNameList[18]; // list of histograms + static const Int_t fgkLogList[18]; // flag for log scale TRootEmbeddedCanvas *fCanvasList[6]; // canvas list TH1D *fHistList[6]; // and histograms diff --git a/TRD/qaGui/AliTRDqaGuiMain.cxx b/TRD/qaGui/AliTRDqaGuiMain.cxx index 349cef116b3..43c7d3ace00 100644 --- a/TRD/qaGui/AliTRDqaGuiMain.cxx +++ b/TRD/qaGui/AliTRDqaGuiMain.cxx @@ -69,12 +69,14 @@ AliTRDqaGuiMain::AliTRDqaGuiMain(TGWindow *parent) : fGStack = new AliTRDqaGuiClustersStack(fGTabPanel); fGESDs[0] = new AliTRDqaGuiESDs(fGTabPanel,0); fGESDs[1] = new AliTRDqaGuiESDs(fGTabPanel,1); + fGESDs[2] = new AliTRDqaGuiESDs(fGTabPanel,2); fGTabPanel->AddTab("Clusters", fGDet); fGTabPanel->AddTab("Clusters - Super Module", fGSM); fGTabPanel->AddTab("Clusters - Stack", fGStack); fGTabPanel->AddTab("ESDs (1)", fGESDs[0]); fGTabPanel->AddTab("ESDs (2)", fGESDs[1]); + fGTabPanel->AddTab("ESDs (3)", fGESDs[2]); AddFrame(fGTabPanel); @@ -96,6 +98,7 @@ void AliTRDqaGuiMain::SetQAFile(const char *file) { fGStack->SetQAFile(file); fGESDs[0]->SetQAFile(file); fGESDs[1]->SetQAFile(file); + fGESDs[2]->SetQAFile(file); } //////////////////////////////////////////////////////////////////////////////// diff --git a/TRD/qaGui/AliTRDqaGuiMain.h b/TRD/qaGui/AliTRDqaGuiMain.h index dec698f802a..35ed50d0a52 100644 --- a/TRD/qaGui/AliTRDqaGuiMain.h +++ b/TRD/qaGui/AliTRDqaGuiMain.h @@ -46,7 +46,7 @@ class AliTRDqaGuiMain : public TGMainFrame { AliTRDqaGuiClusters *fGDet; // panel with clusers AliTRDqaGuiClustersSM *fGSM; // panel with clusers AliTRDqaGuiClustersStack *fGStack; // panel with clusers - AliTRDqaGuiESDs *fGESDs[2]; // panel with ESDs + AliTRDqaGuiESDs *fGESDs[3]; // panel with ESDs ClassDef(AliTRDqaGuiMain,1) // }; diff --git a/TRD/qaGui/AliTRDqaGuiMainBlack.cxx b/TRD/qaGui/AliTRDqaGuiMainBlack.cxx index d11fe453b89..462ed623668 100644 --- a/TRD/qaGui/AliTRDqaGuiMainBlack.cxx +++ b/TRD/qaGui/AliTRDqaGuiMainBlack.cxx @@ -52,11 +52,11 @@ AliTRDqaGuiMainBlack::AliTRDqaGuiMainBlack(TGWindow *parent) : fGChamber->SetRangeNoise(0.5, 2); fGSM->SetRangePed(8, 11); - fGSM->SetRangeNoise(0.5, 2); + fGSM->SetRangeNoise(0.5, 3); fGTabPanel->AddTab("Super Module", fGSM); fGTabPanel->AddTab("Chamber", fGChamber); - + AddFrame(fGTabPanel); SetWindowName("TRD QA -- Black Events"); -- 2.39.3