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 **************************************************************************/
16 // Checks the quality assurance for ACORDE.
17 // Default implementation
19 // Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
20 // Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
21 // Arturo Fernandez <afernan@mail.cern.ch> (FCFM-BUAP)
22 // Last update: Nov. 14t 2009 --> MRC <mrodrigu@mail.cern.ch> (FCFM-BUAP)
25 // --- ROOT system ---
29 #include <TIterator.h>
32 #include <TPaveText.h>
34 // --- Standard library ---
36 // --- AliRoot header files ---
39 #include "AliQAChecker.h"
40 #include "AliACORDEQAChecker.h"
41 #include "AliCDBEntry.h"
42 #include "AliQAManager.h"
44 /*************************************************************************
45 Last update: Oct. 10th 2011 from Mario RC, <mrodrigu@mail.cern.ch>
46 |-> Adding the checker class for raw and esd index
47 |-> Setting the threshold lines and box for DQM shifter
49 *************************************************************************/
51 ClassImp(AliACORDEQAChecker)
53 //____________________________________________________________________________
55 AliACORDEQAChecker::AliACORDEQAChecker() :
56 AliQACheckerBase("ACORDE","ACORDE Quality Assurance Data Maker"),
57 fTextDQMShifterInfo(new TPaveText(35,0.5,55,0.7,"T")),
58 fMax(new TLine(0,0.9,60,0.9)),
59 fMin(new TLine(0,0.3,60,0.3))
61 // default constructor
62 fMax->SetLineColor(kGreen);
63 fMax->SetLineWidth(3);
64 fMin->SetLineColor(kGreen);
65 fMax->SetLineWidth(3);
67 //____________________________________________________________________________
68 AliACORDEQAChecker::~AliACORDEQAChecker()
71 delete fTextDQMShifterInfo;
75 //____________________________________________________________________________
76 AliACORDEQAChecker::AliACORDEQAChecker(const AliACORDEQAChecker& qac) :
77 AliQACheckerBase(qac.GetName(), qac.GetTitle()),
78 fTextDQMShifterInfo(new TPaveText(35,0.5,55,0.7,"T")),
79 fMax(static_cast<TLine*>(qac.fMax->Clone())),
80 fMin(static_cast<TLine*>(qac.fMin->Clone()))
84 //____________________________________________________________________________
85 AliACORDEQAChecker& AliACORDEQAChecker::operator = (const AliACORDEQAChecker &qac)
88 fTextDQMShifterInfo = new TPaveText(35,0.5,55,0.7,"T");
89 fMax = static_cast<TLine*>(qac.fMax->Clone());
90 fMin = static_cast<TLine*>(qac.fMin->Clone());
93 //____________________________________________________________________________
94 void AliACORDEQAChecker::Check(Double_t * test, AliQAv1::ALITASK_t /*index*/)
96 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
99 //____________________________________________________________________________
100 void AliACORDEQAChecker::Check(Double_t * test, AliQAv1::ALITASK_t /*index*/, TObjArray ** list, const AliDetectorRecoParam * /*recoParam*/)
102 // Close version to the final one for the ACORDE QA Checker
104 // Loop over the run species (for specie!= cosmic by now we set QA to INFO)
106 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
108 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) continue ;
109 if (list[specie]->GetEntries() == 0) test[specie] = 1.; // Nothing to check
112 TIter next(list[specie]) ;
113 TH1 * hdata ; // Data created by the AliACORDEQADataMakerXXX (Sim/Rec)
114 while ( (hdata = dynamic_cast<TH1 *>(next())) )
119 if(hdata->GetEntries()>0) rv=1;
120 AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)) ;
121 TString hdataName = hdata->GetName();
122 if (hdata->GetListOfFunctions()->GetEntries() == 0 && (hdataName.Contains("HitsSL0_DQM")||(hdataName.Contains("HitsAMU_DQM")))){
123 hdata->GetListOfFunctions()->Add(fTextDQMShifterInfo);
124 hdata->GetListOfFunctions()->Add(fMax);
125 hdata->GetListOfFunctions()->Add(fMin);
128 // Here we use the QAref ACORDE data from fRefOCDBSubDir
130 if ( (fRefOCDBSubDir[specie]) && (hdataName.Contains("ACORDEBitPattern")) )
133 if (fRefSubDir) href = static_cast<TH1*>(fRefSubDir->Get(hdata->GetName()));
134 else if (fRefOCDBSubDir[specie]) href = static_cast<TH1*>(fRefOCDBSubDir[specie]->FindObject(hdata->GetName()));
135 test[specie] = CheckAcordeRefHits(href,hdata);
136 }else if (hdataName.Contains("ACORDEBitPattern")||hdataName.Contains("HitsSL0_DQM")||hdataName.Contains("HitsAMU_DQM"))
137 // Here we use an inner QA Checher without the QAref data
139 Float_t acoDataMax = hdata->GetMaximum();
140 Int_t flagAcoQAChecker = 0;
142 if (acoDataMax == 0) continue;
143 for(Int_t i=0;i<60;i++)
145 if ((hdata->GetBinContent(i)/acoDataMax) < 0.75) flagAcoQAChecker++;
146 if (hdataName.Contains("HitsSL0_DQM")||hdataName.Contains("HitsAMU_DQM")){
147 if (hdata->GetBinContent(i)<0.29) flagAcoQA++;
150 if (hdataName.Contains("ACORDEBitPattern")){
151 Double_t simpleFlag = 1.-flagAcoQAChecker/60.;
152 if ( (simpleFlag >= 0.90) && (simpleFlag <= 1.0) ) test[specie] = 0.75; // INFO
153 if ( (simpleFlag >= 0.70) && (simpleFlag < 0.90) ) test[specie] = 0.50; // WARNING
154 if ( (simpleFlag >= 0.25) && (simpleFlag < 0.70) ) test[specie] = 0.25; // ERROR
155 if ( (simpleFlag >= 0.0) && (simpleFlag < 0.25) ) test[specie] = -1.0; // FATAL
156 } else if (hdataName.Contains("HitsSL0_DQM")||hdataName.Contains("HitsAMU_DQM")){
157 if (flagAcoQA < 30) test[specie] = 0.75;
158 else test[specie] = 0.3;
164 // Setting Warning message for possible Empty Events with the ACORDE-Trigger
166 if (hdataName.Contains("ACORDEMultiplicity") && (hdata->GetBinContent(0)!=0)) AliWarning("Empty event registered with ACORDE Trigger !!!");
169 }else AliError("Data type cannot be processed") ;
170 if (fTextDQMShifterInfo)
172 fTextDQMShifterInfo->Clear();
173 if (test[specie] > 0.3){
174 fTextDQMShifterInfo->SetFillColor(kGreen);
175 fTextDQMShifterInfo->AddText("ACORDE: O.K.");
177 fTextDQMShifterInfo->SetFillColor(kRed);
178 fTextDQMShifterInfo->AddText("ACORDE: Not, O.K.");
179 fTextDQMShifterInfo->AddText("CALL THE EXPERTS");
185 if ( (specie == AliRecoParam::kHighMult) || (specie == AliRecoParam::kLowMult) || (specie == AliRecoParam::kCalib) ) test[specie] = 0.75;
188 //____________________________________________________________________________
189 Double_t AliACORDEQAChecker::CheckAcordeRefHits(const TH1 * href, const TH1 * hdata) const
193 for (Int_t i=0;i<60;i++)
195 if (TMath::Abs(href->GetBinContent(i)-hdata->GetBinContent(i))>10) flag++;
197 if ((flag>50)&&(flag<=60)) test = -1.;
198 if ((flag>30)&&(flag<=50)) test = 0.25;
199 if ((flag>10)&&(flag<=30)) test = 0.5;
200 if ((flag>0)&&(flag<=10)) test = 0.75;