From 07b3a6a62eedce64992f7bfa10467a6a17c6edef Mon Sep 17 00:00:00 2001 From: abercuci Date: Mon, 28 Nov 2011 10:47:29 +0000 Subject: [PATCH] protect resolution task against running on old data (differently formated) add half chamber mask monitoring --- PWG1/TRD/AliTRDinfoGen.cxx | 6 +++++- PWG1/TRD/AliTRDrecoTask.cxx | 16 ++++++++++++++-- PWG1/TRD/AliTRDresolution.cxx | 15 ++++++++++++++- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/PWG1/TRD/AliTRDinfoGen.cxx b/PWG1/TRD/AliTRDinfoGen.cxx index 9268938a6a7..514f0cf0377 100644 --- a/PWG1/TRD/AliTRDinfoGen.cxx +++ b/PWG1/TRD/AliTRDinfoGen.cxx @@ -796,7 +796,11 @@ void AliTRDinfoGen::MakeChambers() tgl = glb[2]/glb[0]/TMath::Sqrt(1.+glb[1]*glb[1]/glb[0]/glb[0]); eta = -TMath::Log(TMath::Tan(0.5 * (0.5*TMath::Pi() - TMath::ATan(tgl)))); pos[2] = eta; pos[3] = phi; - pos[4] = calib->IsChamberGood(idet)?0.:1.; + pos[4] = 0.; + if(calib->IsChamberGood(idet)){ + if(calib->IsHalfChamberNoData(idet, 0)) pos[4] += 1.; + if(calib->IsHalfChamberNoData(idet, 1)) pos[4] += 2.; + } else pos[4] += 4.; chmb->AddAt(new TVectorF(pos), idet); } } diff --git a/PWG1/TRD/AliTRDrecoTask.cxx b/PWG1/TRD/AliTRDrecoTask.cxx index 5f1fce349e3..f7660a656d8 100644 --- a/PWG1/TRD/AliTRDrecoTask.cxx +++ b/PWG1/TRD/AliTRDrecoTask.cxx @@ -334,8 +334,20 @@ void AliTRDrecoTask::MakeDetectorPlot(Int_t ly) if(!det) continue; AliDebug(2, Form("det[%03d] 0[%+4.1f %+4.1f] 1[%+4.1f %+4.1f]", idet, (*det)[0], (*det)[1], (*det)[2], (*det)[3])); Int_t iopt = Int_t((*det)[4]); - gdet->SetFillStyle(style[iopt]); - gdet->DrawBox((*det)[0], (*det)[1], (*det)[2], (*det)[3]); + if(iopt==4){ + gdet->SetFillStyle(style[1]);gdet->SetFillColor(kBlack); + gdet->DrawBox((*det)[0], (*det)[1], (*det)[2], (*det)[3]); + } else { + gdet->SetFillStyle(style[0]); + gdet->DrawBox((*det)[0], (*det)[1], (*det)[2], (*det)[3]); + if(iopt==1){ + gdet->SetFillStyle(style[1]);gdet->SetFillColor(kBlue); + gdet->DrawBox((*det)[0], (*det)[1], (*det)[2], 0.5*((*det)[3]+(*det)[1])); + } else if(iopt==2){ + gdet->SetFillStyle(style[1]);gdet->SetFillColor(kRed); + gdet->DrawBox((*det)[0], 0.5*((*det)[3]+(*det)[1]), (*det)[2], (*det)[3]); + } else if(iopt!=0) AliError(Form("Wrong chmb. status[%d] for det[%03d]", iopt, idet)); + } } } diff --git a/PWG1/TRD/AliTRDresolution.cxx b/PWG1/TRD/AliTRDresolution.cxx index 12615fef453..c45e7738372 100644 --- a/PWG1/TRD/AliTRDresolution.cxx +++ b/PWG1/TRD/AliTRDresolution.cxx @@ -2744,8 +2744,21 @@ void AliTRDresolution::AliTRDresolutionProjection::Build(const Char_t *n, const { // check and build (if neccessary) projection determined by axis "ix", "iy" and "iz" if(!aa[ix] || !aa[iy] || !aa[iz]) return; - SetNameTitle(n,t); TAxis *ax(aa[ix]), *ay(aa[iy]), *az(aa[iz]); + // check ax definiton to protect against older versions of the data + if(ax->GetNbins()<=0 || (ax->GetXmax()-ax->GetXmin())<=0.){ + AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, ax->GetTitle(), ax->GetNbins(), ax->GetXmin(), ax->GetXmax())); + return; + } + if(ay->GetNbins()<=0 || (ay->GetXmax()-ay->GetXmin())<=0.){ + AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, ay->GetTitle(), ay->GetNbins(), ay->GetXmin(), ay->GetXmax())); + return; + } + if(az->GetNbins()<=0 || (az->GetXmax()-az->GetXmin())<=0.){ + AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, az->GetTitle(), az->GetNbins(), az->GetXmin(), az->GetXmax())); + return; + } + SetNameTitle(n,t); fH = new TH3I(n, Form("%s;%s;%s;%s", t, ax->GetTitle(), ay->GetTitle(), az->GetTitle()), ax->GetNbins(), ax->GetXmin(), ax->GetXmax(), ay->GetNbins(), ay->GetXmin(), ay->GetXmax(), -- 2.43.0