From 92ae9768026e2625ae15f42440b44c94d941e1a2 Mon Sep 17 00:00:00 2001 From: jthaeder Date: Wed, 28 Mar 2012 20:56:35 +0000 Subject: [PATCH] TPC DQM update to have 2d occupancy plot and to disable calib plots from logbook by making them expert plots. Changes have been tested locally and on DQM test machine. (Peter C.) --- TPC/AliTPCQADataMakerRec.cxx | 32 ++++++++++++-- TPC/AliTPCQADataMakerRec.h | 4 +- TPC/AliTPCRawStreamV3.h | 1 + TPC/AliTPCdataQA.cxx | 84 +++++++++++++++++++++++++++++++++--- TPC/AliTPCdataQA.h | 10 ++++- 5 files changed, 116 insertions(+), 15 deletions(-) diff --git a/TPC/AliTPCQADataMakerRec.cxx b/TPC/AliTPCQADataMakerRec.cxx index cb5de15f324..80b27416094 100644 --- a/TPC/AliTPCQADataMakerRec.cxx +++ b/TPC/AliTPCQADataMakerRec.cxx @@ -79,6 +79,9 @@ #include #include #include +#include +#include +#include // --- Standard library --- @@ -92,6 +95,7 @@ #include "AliTPCClustersRow.h" #include "AliTPCclusterMI.h" #include "AliSimDigits.h" +#include ClassImp(AliTPCQADataMakerRec) @@ -215,8 +219,11 @@ void AliTPCQADataMakerRec::InitRaws() histRawsOccupancyVsSector->SetMarkerStyle(20); histRawsOccupancyVsSector->SetOption("P"); histRawsOccupancyVsSector->SetStats(kFALSE); - Add2RawsList(histRawsOccupancyVsSector, kRawsOccupancyVsSector, !expert, image, !saveCorr); - + if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) + Add2RawsList(histRawsOccupancyVsSector, kRawsOccupancyVsSector, expert, image, !saveCorr); + else + Add2RawsList(histRawsOccupancyVsSector, kRawsOccupancyVsSector, !expert, image, !saveCorr); + TProfile * histRawsQVsSector = new TProfile("hRawsQVsSector", " vs sector; Sector; ", 72, 0, 72); @@ -228,7 +235,21 @@ void AliTPCQADataMakerRec::InitRaws() histRawsQmaxVsSector->SetMarkerStyle(20); histRawsQmaxVsSector->SetOption("P"); histRawsQmaxVsSector->SetStats(kFALSE); - Add2RawsList(histRawsQmaxVsSector, kRawsQmaxVsSector, !expert, image, !saveCorr); + if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) + Add2RawsList(histRawsQmaxVsSector, kRawsQmaxVsSector, expert, image, !saveCorr); + else + Add2RawsList(histRawsQmaxVsSector, kRawsQmaxVsSector, !expert, image, !saveCorr); + + TProfile2D * histRawsOccupancy2dVsSector = + new TProfile2D("hRawsOccupancy2dVsSector", "Occupancy vs sector; Sector; Patch", + 72, 0, 36, 6, 0, 6); + histRawsOccupancy2dVsSector->SetOption("COLZ"); + histRawsOccupancy2dVsSector->SetStats(kFALSE); + if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) + Add2RawsList(histRawsOccupancy2dVsSector, kRawsOccupancy2dVsSector, expert, image, !saveCorr); + else + Add2RawsList(histRawsOccupancy2dVsSector, kRawsOccupancy2dVsSector, !expert, image, !saveCorr); + // ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line } @@ -358,6 +379,11 @@ void AliTPCQADataMakerRec::MakeRaws(AliRawReader* rawReader) TProfile* hRawsOccupancyVsSector = dynamic_cast(arrRW->At(ih)); if (hRawsOccupancyVsSector) hRawsOccupancyVsSector->Add(fTPCdataQA->GetHistOccVsSector()); } + arrRW = GetMatchingRawsData(kRawsOccupancy2dVsSector); + for (int ih=arrRW->GetEntriesFast();ih--;) { + TProfile2D* hRawsOccupancy2dVsSector = dynamic_cast(arrRW->At(ih)); + if (hRawsOccupancy2dVsSector) hRawsOccupancy2dVsSector->Add(fTPCdataQA->GetHistOcc2dVsSector()); + } arrRW = GetMatchingRawsData(kRawsQVsSector); for (int ih=arrRW->GetEntriesFast();ih--;) { TProfile* hRawsQVsSector = dynamic_cast(arrRW->At(ih)); diff --git a/TPC/AliTPCQADataMakerRec.h b/TPC/AliTPCQADataMakerRec.h index ba9548b74a2..56a5f7129eb 100644 --- a/TPC/AliTPCQADataMakerRec.h +++ b/TPC/AliTPCQADataMakerRec.h @@ -15,8 +15,6 @@ // --- ROOT system --- -#include -#include // --- Standard library --- @@ -30,7 +28,7 @@ class AliTPCQADataMakerRec: public AliQADataMakerRec { public: - enum HRawsType_t {kRawsOccupancyVsSector=0, kRawsQVsSector, kRawsQmaxVsSector} ; + enum HRawsType_t {kRawsOccupancyVsSector=0, kRawsQVsSector, kRawsQmaxVsSector, kRawsOccupancy2dVsSector} ; enum HDigitType_t {kDigitsADC=0} ; enum HRECPOINTsType_t {kClusters=0, kRatio, kPt} ; enum HESDsType_t {kQmaxShort=0, kQmaxMedium, kQmaxLong, kQShort, kQMedium, kQLong, kRow} ; diff --git a/TPC/AliTPCRawStreamV3.h b/TPC/AliTPCRawStreamV3.h index 815dc3770a6..c9ebdcd10c0 100644 --- a/TPC/AliTPCRawStreamV3.h +++ b/TPC/AliTPCRawStreamV3.h @@ -32,6 +32,7 @@ class AliTPCRawStreamV3: public AliAltroRawStreamV3 { inline Int_t GetPad() const { return fPad; } // Provide index of current pad inline Int_t GetPrevPad() const { return fPrevPad; } // Provide index of previous pad inline Bool_t IsNewPad() const {return (fPad != fPrevPad) || IsNewRow();}; + inline Int_t GetPatchIndex() const { return fPatchIndex; } // Provide index of current patch protected : diff --git a/TPC/AliTPCdataQA.cxx b/TPC/AliTPCdataQA.cxx index 68ab0201268..f10ccbf5157 100644 --- a/TPC/AliTPCdataQA.cxx +++ b/TPC/AliTPCdataQA.cxx @@ -123,6 +123,7 @@ #include "AliTPCdataQA.h" #include "AliLog.h" + ClassImp(AliTPCdataQA) AliTPCdataQA::AliTPCdataQA() : /*FOLD00*/ @@ -163,10 +164,13 @@ AliTPCdataQA::AliTPCdataQA() : /*FOLD00*/ fTimeBinsMax(0), fIsDQM(kFALSE), fHistOccVsSector(0x0), + fHistOcc2dVsSector(0x0), fHistQVsSector(0x0), fHistQmaxVsSector(0x0), fOccVec(0x0), - fOccMaxVec(0x0) + fOccMaxVec(0x0), + fOccVecFine(0x0), + fOccMaxVecFine(0x0) { // // default constructor @@ -213,10 +217,13 @@ AliTPCdataQA::AliTPCdataQA(const AliTPCdataQA &ped) : /*FOLD00*/ fTimeBinsMax(0), fIsDQM(ped.GetIsDQM()), fHistOccVsSector(0x0), + fHistOcc2dVsSector(0x0), fHistQVsSector(0x0), fHistQmaxVsSector(0x0), fOccVec(0x0), - fOccMaxVec(0x0) + fOccMaxVec(0x0), + fOccVecFine(0x0), + fOccMaxVecFine(0x0) { // // copy constructor @@ -307,10 +314,13 @@ AliTPCdataQA::AliTPCdataQA(const TMap *config) : /*FOLD00*/ fTimeBinsMax(0), fIsDQM(kFALSE), fHistOccVsSector(0x0), + fHistOcc2dVsSector(0x0), fHistQVsSector(0x0), fHistQmaxVsSector(0x0), fOccVec(0x0), - fOccMaxVec(0x0) + fOccMaxVec(0x0), + fOccVecFine(0x0), + fOccMaxVecFine(0x0) { // // default constructor @@ -366,10 +376,13 @@ AliTPCdataQA::~AliTPCdataQA() /*FOLD00*/ // DQM delete fHistOccVsSector; + delete fHistOcc2dVsSector; delete fHistQVsSector; delete fHistQmaxVsSector; delete fOccVec; delete fOccMaxVec; + delete fOccVecFine; + delete fOccMaxVecFine; for (Int_t iRow = 0; iRow < fRowsMax; iRow++) { delete [] fAllBins[iRow]; @@ -500,6 +513,8 @@ Bool_t AliTPCdataQA::ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3) Int_t iSector = rawStreamV3->GetSector(); // current sector Int_t iRow = rawStreamV3->GetRow(); // current row Int_t iPad = rawStreamV3->GetPad(); // current pad + Int_t iPatch = rawStreamV3->GetPatchIndex(); // current patch + Int_t iBranch = rawStreamV3->GetBranch(); // current branch if (iRow<0 || iPad<0) continue; // Call local maxima finder if the data is in a new sector if(iSector != lastSector) { @@ -520,7 +535,7 @@ Bool_t AliTPCdataQA::ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3) for (Int_t iTimeBin = 0; iTimeBinSetDirectory(0); + fHistOcc2dVsSector = new TProfile2D("hOcc2dVsSector", "Occupancy vs sector and patch; Sector; Patch", 72, 0, 36, 6, 0, 6); + fHistOcc2dVsSector->SetDirectory(0); + fHistQVsSector = new TProfile("hQVsSector", "Q vs sector; Sector; Q [ADC ch]", 72, 0, 72); fHistQVsSector->SetDirectory(0); @@ -717,13 +737,40 @@ Int_t AliTPCdataQA::Update(const Int_t iSector, /*FOLD00*/ fOccVec->GetArray()[i] = 0; fOccMaxVec = new TArrayD(72); - Double_t nTimeBins = fLastTimeBin - fFirstTimeBin +1; + const Double_t nTimeBins = fLastTimeBin - fFirstTimeBin +1; for(Int_t i = 0; i < 72; i++) if(i<36) // IROCs (5504 pads) fOccMaxVec->GetArray()[i] = nTimeBins*5504; else // OROCs (9984 pads) fOccMaxVec->GetArray()[i] = nTimeBins*9984; + + // 12 branches for each full sector + const Int_t nBranches = 36*12; + fOccVecFine = new TArrayD(nBranches); + for(Int_t i = 0; i < nBranches; i++) + fOccVecFine->GetArray()[i] = 0; + + // Pads per patch same for all sectors + Int_t nPads0[6] = {1152, 1536, 1152, 1280, 1280, 1280}; + Int_t nPads1[6] = {1152, 1664, 1152, 1280, 1280, 1280}; + + fOccMaxVecFine = new TArrayD(nBranches); + for(Int_t i = 0; i < nBranches; i++) { + + const Int_t fullSector = Int_t(i/12); + Int_t branch = i - fullSector*12; + R__ASSERT(branch>=0 && branch<12); + + const Int_t patch = Int_t(branch/2); + branch -= patch*2; + + R__ASSERT(branch>=0 && branch<2); + if(branch == 0) + fOccMaxVecFine->GetArray()[i] = nTimeBins*nPads0[patch]; + else // OROCs (9984 pads) + fOccMaxVecFine->GetArray()[i] = nTimeBins*nPads1[patch]; + } } } // Make the arrays for expanding the data @@ -768,6 +815,9 @@ Int_t AliTPCdataQA::Update(const Int_t iSector, /*FOLD00*/ if(fIsDQM) { fOccVec->GetArray()[iSector] += 1.0; + // To change before committing + if(iPatch>=0 && iBranch>=0 && iPatch<=5 && iBranch <= 1) + fOccVecFine->GetArray()[(iSector%36)*12+iPatch*2+iBranch] += 1.0; } else { // In fNoThreshold we fill all data to estimate the ZS volume Float_t count = fNoThreshold->GetCalROC(iSector)->GetValue(iRow, iPad); @@ -1190,6 +1240,21 @@ void AliTPCdataQA::FillOccupancyProfile() fOccVec->GetArray()[i] /= fOccMaxVec->GetArray()[i]; fHistOccVsSector->Fill(i, fOccVec->GetArray()[i]); } + + const Int_t nBranches = 36*12; + for(Int_t i = 0; i < nBranches; i++) { + + fOccVecFine->GetArray()[i] /= fOccMaxVecFine->GetArray()[i]; + + const Int_t fullSector = Int_t(i/12); + + Int_t branch = i - fullSector*12; + const Int_t patch = Int_t(branch/2); + + branch -= patch*2; + + fHistOcc2dVsSector->Fill(fullSector+0.5*branch+0.1, patch+0.5, fOccVecFine->GetArray()[i]); + } } //____________________________________________________________________________________________ @@ -1204,8 +1269,13 @@ void AliTPCdataQA::ResetProfiles() fHistQmaxVsSector->Reset(); if(fHistOccVsSector) fHistOccVsSector->Reset(); + if(fHistOcc2dVsSector) + fHistOcc2dVsSector->Reset(); if(fOccVec) for(Int_t i = 0; i < 72; i++) fOccVec->GetArray()[i] = 0.0; + if(fOccVecFine) + for(Int_t i = 0; i < 36*12; i++) + fOccVecFine->GetArray()[i] = 0.0; } diff --git a/TPC/AliTPCdataQA.h b/TPC/AliTPCdataQA.h index 94d02392796..7b35a245050 100644 --- a/TPC/AliTPCdataQA.h +++ b/TPC/AliTPCdataQA.h @@ -6,7 +6,8 @@ #include -class TProfile; +#include +#include #include "AliRecoParam.h" #include @@ -74,6 +75,7 @@ public: // DQM output TProfile* GetHistOccVsSector() const { return fHistOccVsSector; } + TProfile2D* GetHistOcc2dVsSector() const { return fHistOcc2dVsSector; } TProfile* GetHistQVsSector() const { return fHistQVsSector; } TProfile* GetHistQmaxVsSector() const { return fHistQmaxVsSector; } @@ -106,7 +108,8 @@ public: private: Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad, - const Int_t iTimeBin, Float_t signal); + const Int_t iTimeBin, Float_t signal, + const Int_t iPatch=-1, const Int_t iBranch=-1); void FindLocalMaxima(const Int_t iSector); void MakeArrays(); // Create arrays for random data acces @@ -168,10 +171,13 @@ private: // DQM variables Bool_t fIsDQM; //! Is DQM -> Simple output (no 2D!) TProfile* fHistOccVsSector; //! Occ vs sector (for DQM only) + TProfile2D* fHistOcc2dVsSector; //! Occ vs sector 2D (for DQM only) TProfile* fHistQVsSector; //! Q vs sector (for DQM only) TProfile* fHistQmaxVsSector; //! QMax vs sector (for DQM only) TArrayD* fOccVec; //! Occupancy help counter for DQM TArrayD* fOccMaxVec; //! Occupancy help normlization for DQM + TArrayD* fOccVecFine; //! "2D" occupancy help counter for DQM + TArrayD* fOccMaxVecFine; //! "2D" occupancy help normlization for DQM ClassDef(AliTPCdataQA, 5) // Implementation of the TPC Raw QA -- 2.43.0