AliRoot Core  edcc906 (edcc906)
AliMUONTriggerQAChecker.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
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  **************************************************************************/
15 
16 // $Id$
17 
19 
28 
29 
30 #include "AliRecoParam.h"
31 #include "AliMUONQAIndices.h"
32 #include "AliQAv1.h"
33 #include "TH1.h"
34 #include "TPaveText.h"
35 #include "TString.h"
36 #include "TObjArray.h"
37 #include "TList.h"
38 
42 
43 //__________________________________________________________________
45 {
47 }
48 
49 //__________________________________________________________________
51 {
53 }
54 
55 //______________________________________________________________________________
58 {
60 
61  if ( value != AliMUONVQAChecker::kInfo )
62  {
63  histo.SetBit(AliQAv1::GetQABit());
64  }
65 
66  return value;
67 }
68 
69 //__________________________________________________________________
72 {
74 
76 
77  Int_t histoRawsPercentIndex[] = {
81  };
82  const Int_t kNrawsHistos = sizeof(histoRawsPercentIndex)/sizeof(histoRawsPercentIndex[0]);
83 
84  // BEGIN OF LIMITS
85  // Fixme: Move me to reference histos
86  Float_t safeFactor = 5.;
87  Float_t warningPercentTrigAlgo[AliMUONQAIndices::kNtrigAlgoErrorBins] = {static_cast<Float_t>(safeFactor*1.), static_cast<Float_t>(safeFactor*1.), static_cast<Float_t>(safeFactor*1.), 100., 100., 100., 100., static_cast<Float_t>(safeFactor*1.), static_cast<Float_t>(safeFactor*1.), static_cast<Float_t>(safeFactor*1.)};
88  Float_t warningPercentCalib[AliMUONQAIndices::kNtrigCalibSummaryBins] = {static_cast<Float_t>(safeFactor*0.4), static_cast<Float_t>(safeFactor*1.), 3.1, 0.0001, static_cast<Float_t>(safeFactor*0.4)};
89  Float_t warningPercentReadout[AliMUONQAIndices::kNtrigStructErrorBins] = {static_cast<Float_t>(safeFactor*1.), static_cast<Float_t>(safeFactor*1.), static_cast<Float_t>(safeFactor*1.), static_cast<Float_t>(safeFactor*1.)};
90 
91  Float_t* warningPercent[kNrawsHistos] = {warningPercentTrigAlgo, warningPercentCalib, warningPercentReadout};
92 
93  Float_t errorFactor = 30.;
94  Float_t errorPercentTrigAlgo[AliMUONQAIndices::kNtrigAlgoErrorBins] = {static_cast<Float_t>(errorFactor*1.), static_cast<Float_t>(errorFactor*1.), static_cast<Float_t>(errorFactor*1.), 100., 100., 100., 100., static_cast<Float_t>(errorFactor*1.), static_cast<Float_t>(errorFactor*1.), static_cast<Float_t>(errorFactor*1.)};
95  Float_t errorPercentCalib[AliMUONQAIndices::kNtrigCalibSummaryBins] = {static_cast<Float_t>(errorFactor*0.4), static_cast<Float_t>(errorFactor*1.), 6.2, 3.*0.0001, static_cast<Float_t>(errorFactor*0.4)};
96  Float_t errorPercentReadout[AliMUONQAIndices::kNtrigStructErrorBins] = {static_cast<Float_t>(errorFactor*1.), static_cast<Float_t>(errorFactor*1.), static_cast<Float_t>(errorFactor*1.), static_cast<Float_t>(errorFactor*1.)};
97  // END OF LIMTS
98 
99  Float_t* errorPercent[kNrawsHistos] = {errorPercentTrigAlgo, errorPercentCalib, errorPercentReadout};
100 
101  TObjArray messages;
102  messages.SetOwner(kTRUE);
103 
104  TH1* currHisto = 0x0;
105  for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
106  rv[specie] = AliMUONVQAChecker::kInfo;
107 
109 
110  //if ( nAnalyzedEvents == 0 ) rv[specie] = AliMUONVQAChecker::kFatal;
111 
112  for(Int_t ihisto = 0; ihisto<kNrawsHistos; ihisto++){
113  Int_t nAnalyzedEvents = 0;
114  Int_t ibinNevents = ( histoRawsPercentIndex[ihisto] == AliMUONQAIndices::kTriggerReadOutErrorsNorm ) ? 1 : 2;
115  if ( hAnalyzedEvents ) nAnalyzedEvents = TMath::Nint(hAnalyzedEvents->GetBinContent(ibinNevents));
117  messages.Clear();
118  currHisto = AliQAv1::GetData(list,histoRawsPercentIndex[ihisto],AliRecoParam::ConvertIndex(specie));
119  if ( ! currHisto ) continue;
120 
121  Int_t nbins = currHisto->GetXaxis()->GetNbins();
122  for (Int_t ibin = 1; ibin<=nbins; ibin++){
123  Double_t binContent = currHisto->GetBinContent(ibin);
124  if ( binContent > errorPercent[ihisto][ibin-1] )
125  currRv = AliMUONVQAChecker::kError;
126  else if ( binContent > warningPercent[ihisto][ibin-1] )
128  else if ( ibin == 4 && binContent > 50. && AliRecoParam::ConvertIndex(specie) == AliRecoParam::kCalib) {
129  messages.Add(new TObjString("Do not panic:"));
130  messages.Add(new TObjString("copy errors do not affect data"));
131  }
132  } // loop on bins
133  if ( currRv != AliMUONVQAChecker::kInfo ) {
134  switch ( histoRawsPercentIndex[ihisto] ) {
137  messages.Add(new TObjString("Trigger algo errors"));
138  break;
139  case AliMUONQAIndices::kTriggerReadOutErrorsNorm:
140  messages.Add(new TObjString("Readout errors"));
141  break;
142  }
143  if ( currRv == AliMUONVQAChecker::kWarning )
144  messages.Add(new TObjString("are a little bit high"));
145  else if ( currRv == AliMUONVQAChecker::kError ||
146  currRv == AliMUONVQAChecker::kFatal )
147  messages.Add(new TObjString("are too high"));
148  }
149  else if ( nAnalyzedEvents != 0 ) {
150  switch ( histoRawsPercentIndex[ihisto] ) {
153  case AliMUONQAIndices::kTriggerReadOutErrorsNorm:
154  messages.Add(new TObjString("Values within limits"));
155  break;
156  }
157  }
158  if ( MarkHisto(*currHisto, currRv) < rv[specie] )
159  rv[specie] = currRv;
160  currHisto->GetYaxis()->SetRangeUser(0., 110.);
161  SetupHisto(nAnalyzedEvents, messages, *currHisto, currRv, specie);
162  } // loop on histos
163  } // loop on species
164 
165  return rv;
166 }
167 
168 //__________________________________________________________________
171 {
173  return 0x0;
174 }
175 
176 //__________________________________________________________________
179 {
181  return 0x0;
182 }
183 
184 
185 //___________________________________________________________________
186 void AliMUONTriggerQAChecker::SetupHisto(Int_t nevents, const TObjArray& messages, TH1& histo, AliMUONVQAChecker::ECheckCode code, Int_t esIndex)
187 {
188  //
190  //
191 
192  Double_t y1 = 0.87 - (messages.GetLast()+2)*0.075;
193  TPaveText* text = new TPaveText(0.25,y1,0.75,0.89,"NDC");
194 
195  Int_t eventLimit = ( AliRecoParam::ConvertIndex(esIndex) == AliRecoParam::kCalib ) ? 5 : 20;
196 
197  text->AddText(Form("MTR - Specie: %s", AliRecoParam::GetEventSpecieName(esIndex)));
198  text->AddText(Form("Total events %i", nevents));
199 
200  TString defaultText = "";
201  Int_t color = 0;
202 
203  if ( nevents == 0 ) {
205  defaultText = "No events analyzed!";
206  }
207  else if ( nevents <= eventLimit ) {
209  text->AddText("Not enough events to judge");
210  defaultText = "Please wait for more statistics";
211  }
212  else {
213  TIter next(&messages);
214  TObjString* str;
215 
216  while ( ( str = static_cast<TObjString*>(next()) ) ){
217  text->AddText(str->String());
218  }
219 
220  switch ( code ) {
223  defaultText = "All is fine!";
224  break;
227  defaultText = "Please keep an eye on it!";
228  break;
231  defaultText = "PLEASE CALL MUON TRIGGER EXPERT!!!";
232  break;
233  default:
235  defaultText = "PLEASE CALL MUON TRIGGER EXPERT!";
236  break;
237  }
238  }
239 
240  text->AddText(defaultText.Data());
241  text->SetFillColor(color);
242 
243  histo.SetFillStyle(1001);
244  histo.SetFillColor(color);
245 
246  histo.SetStats(kFALSE);
247 
248  histo.GetListOfFunctions()->Delete();
249  histo.GetListOfFunctions()->Add(text);
250 }
static const char * GetEventSpecieName(EventSpecie_t es)
Total number of bins for trigger calibration summary.
warning, i.e. might become an error later on
#define TObjArray
color for warning (online convention)
ECheckCode
Classification of errors severity.
virtual ECheckCode * CheckESD(TObjArray **list, const AliMUONRecoParam *recoParam)
Check the QA object(s) for the ESD.
Class with MUON reconstruction parameters.
Total number of bins for trigger error summary.
void SetupHisto(Int_t nevents, const TObjArray &messages, TH1 &histo, AliMUONVQAChecker::ECheckCode code, Int_t esIndex)
color for normal error (online convention)
static EventSpecie_t ConvertIndex(Int_t index)
static TH1 * GetData(TObjArray **list, Int_t index, AliRecoParam::EventSpecie_t eventSpecie)
Definition: AliQAv1.cxx:329
Number of analyzed events per event specie.
just so you know...
Base class for a MUON QA checker.
static UInt_t GetQABit()
Definition: AliQAv1.h:66
Percentage of read-out errors.
Implementation of QAChecker for MTR.
normal error, i.e. something is wrong
Percentage of errors for each trigger decision level.
error is really serious
AliMUONVQAChecker::ECheckCode MarkHisto(TH1 &histo, AliMUONVQAChecker::ECheckCode value) const
virtual ECheckCode * CheckRecPoints(TObjArray **list, const AliMUONRecoParam *recoParam)
Check the QA object(s) for the RecPoints.
color for information (online convention)
Total number of bins for struct error summary.
virtual ECheckCode * CheckRaws(TObjArray **list, const AliMUONRecoParam *recoParam)
Check the QA object(s) for the raw data.
color for fatal error (online convention)
Percentage of responding strips/boards and noisy strips.