1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 #include "AliMUONTriggerQAChecker.h"
20 /// \class AliMUONTriggerQAChecker
22 /// Implementation of QAChecker for MTR
24 /// For the moment we only implement the checking of raw data QA for the trigger
25 /// by looking at the local structure and trigger response errors.
27 /// \author Diego Stocco, Subatech
30 #include "AliRecoParam.h"
31 #include "AliMUONTriggerQADataMakerRec.h"
34 #include "TPaveText.h"
36 #include "TObjArray.h"
40 ClassImp(AliMUONTriggerQAChecker)
43 //__________________________________________________________________
44 AliMUONTriggerQAChecker::AliMUONTriggerQAChecker() : AliMUONVQAChecker()
49 //__________________________________________________________________
50 AliMUONTriggerQAChecker::~AliMUONTriggerQAChecker()
55 //______________________________________________________________________________
56 AliMUONVQAChecker::ECheckCode
57 AliMUONTriggerQAChecker::MarkHisto(TH1& histo, AliMUONVQAChecker::ECheckCode value) const
59 /// Mark histo as originator of some QA error/warning
61 if ( value != AliMUONVQAChecker::kInfo )
63 histo.SetBit(AliQAv1::GetQABit());
69 //__________________________________________________________________
70 AliMUONVQAChecker::ECheckCode*
71 AliMUONTriggerQAChecker::CheckRaws(TObjArray** list, AliMUONRecoParam* )
75 AliMUONVQAChecker::ECheckCode * rv = new AliMUONVQAChecker::ECheckCode[AliRecoParam::kNSpecies] ;
77 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
78 rv[specie] = AliMUONVQAChecker::kInfo;
81 Int_t histoRawsPercentIndex[] = {
82 AliMUONTriggerQADataMakerRec::kTriggerErrorSummaryNorm,
83 AliMUONTriggerQADataMakerRec::kTriggerCalibSummaryNorm,
84 AliMUONTriggerQADataMakerRec::kTriggerReadOutErrorsNorm
86 const Int_t kNrawsHistos = sizeof(histoRawsPercentIndex)/sizeof(histoRawsPercentIndex[0]);
88 // MOVE THESE TO REFERENCE HISTOS
89 // START WITH THOSE COMMENTED OUT UNTIL WE GAIN CONFIDENCE...
90 // Float_t safeFactor = 5.;
91 // Float_t alarmPercentTrigAlgo[AliMUONTriggerQADataMakerRec::kNtrigAlgoErrorBins] = {safeFactor*1., safeFactor*1., safeFactor*1., 100., 100., 100., 100., safeFactor*1., safeFactor*1., safeFactor*1.};
92 // Float_t alarmPercentCalib[AliMUONTriggerQADataMakerRec::kNtrigCalibSummaryBins] = {safeFactor*0.4, safeFactor*1., 6.2, 0.0001, safeFactor*0.4};
93 // Float_t alarmPercentReadout[AliMUONTriggerQADataMakerRec::kNtrigStructErrorBins] = {safeFactor*1., safeFactor*1., safeFactor*1., safeFactor*1.};
95 // Float_t* alarmPercent[kNrawsHistos] = {alarmPercentTrigAlgo, alarmPercentCalib, alarmPercentReadout};
96 // END OF COWARD COMMENTING...
99 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
100 for(Int_t ihisto = 0; ihisto<kNrawsHistos; ihisto++){
101 currHisto = AliQAv1::GetData(list,histoRawsPercentIndex[ihisto],AliRecoParam::ConvertIndex(specie));
103 currHisto->SetBarWidth(0.5);
104 currHisto->SetBarOffset(0.25);
105 TPaveText* text = new TPaveText(0.65,0.65,0.99,0.99,"NDC");
108 Int_t nbins = currHisto->GetXaxis()->GetNbins();
109 for (Int_t ibin = 1; ibin<=nbins; ibin++){
110 binName = currHisto->GetXaxis()->GetBinLabel(ibin);
111 binName.ReplaceAll("#splitline","");
112 binName.ReplaceAll("{","");
113 binName.ReplaceAll("}","");
114 Float_t binContent = currHisto->GetBinContent(ibin);
115 // if (binContent > alarmPercent[ihisto][ibin-1]) isOk = kFALSE;
116 text->AddText(Form("%5.2f %% in %s", binContent, binName.Data()));
117 //text->AddText(Form("%5.2f %% in %s (limit %5.2f %%)", binContent, binName.Data(), alarmPercent[ihisto][ibin-1]));
120 text->SetFillColor(kRed);
121 rv[specie] = MarkHisto(*currHisto, AliMUONVQAChecker::kError);
123 else text->SetFillColor(kGreen);
124 currHisto->GetListOfFunctions()->Add(text);
125 currHisto->SetStats(kFALSE);
126 currHisto->GetYaxis()->SetRangeUser(0., 110.);
134 //__________________________________________________________________
135 AliMUONVQAChecker::ECheckCode*
136 AliMUONTriggerQAChecker::CheckRecPoints(TObjArray** , AliMUONRecoParam* )
142 //__________________________________________________________________
143 AliMUONVQAChecker::ECheckCode*
144 AliMUONTriggerQAChecker::CheckESD(TObjArray** , AliMUONRecoParam* )