+
+ SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ;
+ TH1F * histRawsOccupancy = (TH1F*)GetRawsData(kRawsOccupancy) ;
+ TH1F * histRawsOccupancyVsSector = (TH1F*)GetRawsData(kRawsOccupancyVsSector) ;
+ TH1F * histRawsNClustersPerEventVsSector = (TH1F*)GetRawsData(kRawsNClustersPerEventVsSector) ;
+ TH1F * histRawsQVsSector = (TH1F*)GetRawsData(kRawsQVsSector) ;
+ TH1F * histRawsQmaxVsSector = (TH1F*)GetRawsData(kRawsQmaxVsSector) ;
+ TH1F * histRawsOccupancyVsEvent = (TH1F*)GetRawsData(kRawsOccupancyVsEvent) ;
+ TH1F * histRawsNclustersVsEvent = (TH1F*)GetRawsData(kRawsNclustersVsEvent) ;
+ if ( !histRawsOccupancy ||
+ !histRawsOccupancyVsSector ||
+ !histRawsNClustersPerEventVsSector ||
+ !histRawsQVsSector ||
+ !histRawsQmaxVsSector ||
+ !histRawsOccupancyVsEvent ||
+ !histRawsNclustersVsEvent ) {
+ AliError("Something very wrong here, corrupted memory ?????. Please check\n") ;
+ continue ;
+ }
+
+ //Add2RawsList(fTPCdataQA, 0);
+ // get the histograms and add them to the output
+ // 31/8-08 Histogram is only added if the Calibration class
+ // receives TPC data
+ const Int_t eventCounter = fTPCdataQA[specie]->GetEventCounter();
+ if(eventCounter>0) { // some TPC data has been processed
+
+ // Reset histograms and refill them
+ histRawsOccupancy->Reset();
+ histRawsOccupancyVsSector->Reset();
+ histRawsNClustersPerEventVsSector->Reset();
+ histRawsQVsSector->Reset();
+ histRawsQmaxVsSector->Reset();
+
+ TH1F* hNormOcc = new TH1F("hNormOcc", 0, 72, 0, 72);
+ hNormOcc->Sumw2();
+ TH1F* hNormNclusters = new TH1F("hNormNclusters", 0, 72, 0, 72);
+ hNormNclusters->Sumw2();
+
+ for (Int_t iSec = 0; iSec < 72; iSec++) {
+
+ AliTPCCalROC* occupancyROC =
+ fTPCdataQA[specie]->GetNoThreshold()->GetCalROC(iSec);
+ AliTPCCalROC* nclusterROC =
+ fTPCdataQA[specie]->GetNLocalMaxima()->GetCalROC(iSec);
+ AliTPCCalROC* qROC =
+ fTPCdataQA[specie]->GetMeanCharge()->GetCalROC(iSec);
+ AliTPCCalROC* qmaxROC =
+ fTPCdataQA[specie]->GetMaxCharge()->GetCalROC(iSec);
+
+ const Int_t nRows = occupancyROC->GetNrows();
+ for (Int_t iRow = 0; iRow < nRows; iRow++) {
+
+ const Int_t nPads = occupancyROC->GetNPads(iRow);
+ for (Int_t iPad = 0; iPad < nPads; iPad++) {
+
+ histRawsOccupancy->Fill(occupancyROC->GetValue(iRow, iPad));
+ hNormOcc->Fill(iSec);
+ histRawsOccupancyVsSector
+ ->Fill(iSec, occupancyROC->GetValue(iRow, iPad));
+
+ const Int_t nClusters = TMath::Nint(nclusterROC->GetValue(iRow, iPad));
+
+ if(nClusters>0) {
+
+ hNormNclusters->Fill(iSec,nClusters);
+ histRawsNClustersPerEventVsSector->Fill(iSec, nClusters);
+ histRawsQVsSector->Fill(iSec,
+ nClusters*qROC->GetValue(iRow, iPad));
+ histRawsQmaxVsSector->Fill(iSec,
+ nClusters*qmaxROC->GetValue(iRow, iPad));
+ }
+ }
+ }
+ } // end loop over sectors
+
+ // update event histograms - copy info from TPDdataQA histos
+ TH1F* hQAOccVsEvent = fTPCdataQA[specie]->GetHistOccupancyVsEvent();
+ TH1F* hQANclVsEvent = fTPCdataQA[specie]->GetHistNclustersVsEvent();
+
+ // the two event histograms should have the same number of bins
+ const Int_t nBins = hQAOccVsEvent->GetXaxis()->GetNbins();
+ for(Int_t bin = 1; bin <= nBins; bin++) {
+
+ histRawsOccupancyVsEvent->SetBinContent(bin, hQAOccVsEvent->GetBinContent(bin));
+ histRawsNclustersVsEvent->SetBinContent(bin, hQANclVsEvent->GetBinContent(bin));
+ }
+
+ histRawsOccupancyVsEvent->GetXaxis()->SetRange(hQAOccVsEvent->GetXaxis()->GetFirst(), hQAOccVsEvent->GetXaxis()->GetLast());
+ histRawsNclustersVsEvent->GetXaxis()->SetRange(hQANclVsEvent->GetXaxis()->GetFirst(), hQANclVsEvent->GetXaxis()->GetLast());
+
+ // Normalize histograms
+ histRawsOccupancyVsSector->Divide(hNormOcc);
+ histRawsNClustersPerEventVsSector->Scale(1.0/Float_t(eventCounter));
+ histRawsQVsSector->Divide(hNormNclusters);
+ histRawsQmaxVsSector->Divide(hNormNclusters);
+ delete hNormOcc;
+ delete hNormNclusters;
+
+ if(fBeautifyOption!=0) {
+ // Help make the histogram easier to interpret for the DQM shifter
+
+ histRawsOccupancyVsSector->ResetBit(AliQAv1::GetQABit());
+ histRawsQmaxVsSector->ResetBit(AliQAv1::GetQABit());
+
+ histRawsOccupancyVsSector->SetMinimum(0.0);
+ if(histRawsOccupancyVsSector->GetMaximum()<1.5*fOccHighLimit)
+ histRawsOccupancyVsSector->SetMaximum(1.5*fOccHighLimit);
+
+ histRawsQmaxVsSector->SetMinimum(0.0);
+ if(histRawsQmaxVsSector->GetMaximum()<1.5*fQmaxHighLimit)
+ histRawsQmaxVsSector->SetMaximum(1.5*fQmaxHighLimit);
+
+ Double_t xminOcc = histRawsOccupancyVsSector->GetXaxis()->GetXmin();
+ Double_t xmaxOcc = histRawsOccupancyVsSector->GetXaxis()->GetXmax();
+ Double_t yminOcc = histRawsOccupancyVsSector->GetMinimum();
+ Double_t ymaxOcc = histRawsOccupancyVsSector->GetMaximum();
+
+ Double_t xminQmax = histRawsQmaxVsSector->GetXaxis()->GetXmin();
+ Double_t xmaxQmax = histRawsQmaxVsSector->GetXaxis()->GetXmax();
+ Double_t yminQmax = histRawsQmaxVsSector->GetMinimum();
+ Double_t ymaxQmax = histRawsQmaxVsSector->GetMaximum();
+
+ TBox* boxOccOk = new TBox(xminOcc,0,xmaxOcc,fOccHighLimit);
+ boxOccOk->SetFillColor(kGreen);
+ histRawsOccupancyVsSector->GetListOfFunctions()->Add(boxOccOk);
+
+ TBox* boxQmaxOk = new TBox(xminQmax,fQmaxLowLimit,xmaxQmax,fQmaxHighLimit);
+ boxQmaxOk->SetFillColor(kGreen);
+ histRawsQmaxVsSector->GetListOfFunctions()->Add(boxQmaxOk);
+
+
+ for(Int_t bin = 1; bin <= 72; bin++) {
+
+ if(histRawsOccupancyVsSector->GetBinContent(bin)<=0 ||
+ histRawsOccupancyVsSector->GetBinContent(bin)>fOccHighLimit) {
+
+ histRawsOccupancyVsSector->SetBit(AliQAv1::GetQABit());
+
+ TBox* boxErr =
+ new TBox(histRawsOccupancyVsSector->GetXaxis()->GetBinLowEdge(bin), yminOcc,
+ histRawsOccupancyVsSector->GetXaxis()->GetBinUpEdge(bin), ymaxOcc);
+ boxErr->SetFillColor(kRed);
+ histRawsOccupancyVsSector->GetListOfFunctions()->Add(boxErr);
+ }
+
+ if(histRawsQmaxVsSector->GetBinContent(bin)<fQmaxLowLimit||
+ histRawsQmaxVsSector->GetBinContent(bin)>fQmaxHighLimit) {
+
+ // Mark that histogram has error
+ histRawsQmaxVsSector->SetBit(AliQAv1::GetQABit());
+
+ TBox* boxErr =
+ new TBox(histRawsQmaxVsSector->GetXaxis()->GetBinLowEdge(bin), yminQmax,
+ histRawsQmaxVsSector->GetXaxis()->GetBinUpEdge(bin), ymaxQmax);
+ boxErr->SetFillColor(kRed);
+ histRawsQmaxVsSector->GetListOfFunctions()->Add(boxErr);
+ }
+ }
+
+ // Now we have to add a copy of the histograms to draw
+ // because the boxes covers the data points
+ TH1F* hOccCopy = new TH1F(*histRawsOccupancyVsSector);
+ hOccCopy->SetOption("SAME P");
+ histRawsOccupancyVsSector->GetListOfFunctions()->Add(hOccCopy);
+
+ TH1F* hQmaxCopy = new TH1F(*histRawsQmaxVsSector);
+ hQmaxCopy->SetOption("SAME P");
+ histRawsQmaxVsSector->GetListOfFunctions()->Add(hQmaxCopy);
+
+ } // end beautify
+ }