1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // *****************************************
19 // Checks the quality assurance
20 // by comparing with reference data
21 // P. Cerello Apr 2008
24 // --- ROOT system ---
27 #include "Riostream.h"
29 // --- AliRoot header files ---
30 #include "AliITSQASSDChecker.h"
33 ClassImp(AliITSQASSDChecker)
34 //__________________________________________________________________
35 AliITSQASSDChecker& AliITSQASSDChecker::operator = (const AliITSQASSDChecker& qac )
38 this->~AliITSQASSDChecker();
39 new(this) AliITSQASSDChecker(qac);
43 void AliITSQASSDChecker::CheckRaws(TH1* histo) {
45 Double_t minSSDDataSize = 0;
46 Double_t maxSSDDataSize = 200;
47 Double_t minDDLDataSize = 0;
48 Double_t maxDDLDataSize = 50;
49 Double_t minLDCDataSize = 0;
50 Double_t maxLDCDataSize = 100;
51 Double_t minMeanDDLDataSize = 0;
52 Double_t maxMeanDDLDataSize = 50;
53 Double_t minMeanLDCDataSize = 0;
54 Double_t maxMeanLDCDataSize = 100;
55 // Double_t maxOccupancy = 5;
57 TString histname = histo->GetName();
59 if (histname.EndsWith("SSDEventType")) {
60 if (histo->GetEntries()==0) {
61 AliWarning("Event type histogram is empty");
63 else if (histo->GetBinContent(histo->FindBin(7))==0) AliWarning("No type 7 (physics) events in EventType");
66 if (histname.EndsWith("SSDDataSize")) {
67 if (histo->GetEntries()==0) AliWarning("SSD data size histogram is empty");
68 if (histo->GetMean()>maxSSDDataSize||histo->GetMean()<minSSDDataSize) AliWarning(Form("SSD mean data size is %-.2g kB", histo->GetMean()));
71 if (histname.EndsWith("SSDDataSizePerDDL")) {
72 if (histo->GetEntries()==0) {
73 AliWarning("Data size per DDL histogram is empty");
76 for(Int_t i = 512; i < 528; i++) {
77 if(histo->GetBinContent(histo->FindBin(i))==0) {
78 AliWarning(Form("Data size / DDL histogram: bin for DDL %i is empty",i));
80 else if(histo->GetBinContent(histo->FindBin(i))<minDDLDataSize||histo->GetBinContent(histo->FindBin(i))>maxDDLDataSize) AliWarning(Form("Data size DDL %i is %-.2g kB",i,histo->GetBinContent(histo->FindBin(i))));
85 if (histname.EndsWith("SSDDataSizePerLDC")) {
86 if (histo->GetEntries()==0) {
87 AliWarning("Data size per LDC histogram is empty");
90 AliInfo(Form("Data size per LDC histogram has %i entries",histo->GetEntries()));
91 for(Int_t i = 170; i < 178; i++) {
92 if(histo->GetBinContent(histo->FindBin(i))==0) {
93 AliWarning(Form("Data size / LDC histogram: bin for LDC %i is empty",i));
95 else if(histo->GetBinContent(histo->FindBin(i))==minLDCDataSize||histo->GetBinContent(histo->FindBin(i))>maxLDCDataSize) AliWarning(Form("Data size LDC %i is %-.2g kB",i,histo->GetBinContent(i)));
100 if (histname.EndsWith("SSDLDCId")) {
101 if (histo->GetEntries()==0) {
102 AliWarning("LDC ID histogram is empty");
105 for(Int_t i = 170; i < 177; i++) {
106 if(histo->GetBinContent(histo->FindBin(i))==0) {
107 AliWarning(Form("LDC ID histogram: No entries for LDC %i",i));
109 else if(histo->GetBinContent(histo->FindBin(i))!=histo->GetBinContent(histo->FindBin(i+1))) {
110 AliWarning("LDC Id distribution is not uniform");
117 if (histname.EndsWith("SSDDDLId")) {
118 if (histo->GetEntries()==0) {
119 AliWarning("DDL ID histogram is empty");
122 for(Int_t i = 512; i < 527; i++) {
123 if(histo->GetBinContent(histo->FindBin(i))==0) {
124 AliWarning(Form("DDL ID histogram: No entries for DDL %i",i));
126 else if(histo->GetBinContent(histo->FindBin(i))!=histo->GetBinContent(histo->FindBin(i+1))) {
127 AliWarning("DDL Id distribution is not uniform");
134 if (histname.Contains("SSDDataSizeLDC")) {
135 if (histo->GetEntries()==0) {
136 AliWarning(Form("LDC %s data size distribution is empty", histname(histname.Length()-3,3).Data()));
138 else if (histo->GetMean()<minMeanLDCDataSize||histo->GetMean()>maxMeanLDCDataSize) AliWarning(Form("Mean data size of LDC %s is %-.2g kB",histname(histname.Length()-3,3).Data(), histo->GetMean()));
141 if (histname.Contains("SSDDataSizeDDL")) {
142 if (histo->GetEntries()==0) {
143 AliWarning(Form("DDL %s data size distribution is empty", histname(histname.Length()-3,3).Data()));
145 else if (histo->GetMean()<minMeanDDLDataSize||histo->GetMean()>maxMeanDDLDataSize) AliWarning(Form("Mean data size of DDL %s is %-.2g kB",histname(histname.Length()-3,3).Data(), histo->GetMean()));
148 if (histname.Contains("SSDAverageOccupancy")) {
150 const char* side = "";
154 if (histname.EndsWith("5")) layernr = 499;
155 if (histname.EndsWith("6")) layernr = 599;
157 for (Int_t i = 1; i < histo->GetNbinsY() + 1; i++) { //ladder/side loop
159 ladder=int(i/3.)+layernr;
162 else if(i==3.*int(i+1/3.)){
163 ladder=int((i+1)/3.)+layernr;
167 for (Int_t j = 1; j < histo->GetNbinsX() + 1; j++) { //module loop
168 //if(histo->GetBinContent(j,i)>maxOccupancy)
169 // AliWarning(Form("Occupancy ladder %i, module %i, %s is %-.2f %%",ladder,j,side, histo->GetBinContent(j,i)));
176 void AliITSQASSDChecker::CheckRecPoints(TH1* /*histo*/) {
181 //__________________________________________________________________
182 Double_t AliITSQASSDChecker::Check(AliQAv1::ALITASK_t /*index*/, TObjArray * list) {
183 AliDebug(AliQAv1::GetQADebugLevel(),Form("AliITSQASSDChecker called with offset: %d\n", fSubDetOffset));
184 //cout<<"(AliITSQASSDChecker::Check): List name "<<list->GetName()<<endl;
185 Double_t test = 0.0 ;
187 TString listname = list->GetName();
189 if (list->GetEntries() == 0){
190 test = 1. ; // nothing to check
197 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
199 TString histname = hdata->GetName();
200 if(!histname.Contains("fHistSSD")) continue;
202 if(hdata->GetEntries()>0) {
205 //if(histname.Contains("PerDDL")) cout << "(AliITSQASSDChecker::Check) " << histname << " has " << hdata->GetEntries() << " entries. Mean: " << hdata->GetMean() << endl;
207 // if(hdata->GetMean()>0&&!histname.Contains("_Ladder")) cout << "(AliITSQASSDChecker::Check) " << histname << " not empty! " << hdata->GetEntries() << " entries. Mean: " << hdata->GetMean() << endl;
210 // if (listname.Contains("Raws")) CheckRaws(hdata);
211 // if (listname.Contains("RecPoints")) CheckRecPoints(hdata);
213 //AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)) ;
214 //cout<<hdata->GetName()<<" - "<<rv<<endl;
219 AliError("Data type cannot be processed") ;
224 AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
225 test = 0.5; //upper limit value to set kWARNING flag for a task
233 //AliDebug(AliQAv1::GetQADebugLevel(), Form("Test Result = %f", test)) ;
234 //cout<<"Test result: "<<test<<endl;
243 //__________________________________________________________________
244 void AliITSQASSDChecker::SetTaskOffset(Int_t TaskOffset)
246 fSubDetOffset = TaskOffset;