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)
24 // --- ROOT system ---
28 #include <TIterator.h>
32 // --- Standard library ---
34 // --- AliRoot header files ---
37 #include "AliQAChecker.h"
38 #include "AliACORDEQAChecker.h"
39 #include "AliCDBEntry.h"
40 #include "AliQAManager.h"
42 ClassImp(AliACORDEQAChecker)
44 //____________________________________________________________________________
45 Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/)
47 Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ;
48 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
53 //__________________________________________________________________
54 Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray ** list)
57 // We added one check to the ACORDE's QA histograms:
58 // 1.- We check if they are empty
59 // we check for the reference histogram to start the QAChecker. If not QAref object
60 // is found, we check that the number of hits per channel is not so far from
61 // the maximum number of hits.
62 Double_t * test = new Double_t[AliRecoParam::kNSpecies] ;
63 Int_t * count = new Int_t[AliRecoParam::kNSpecies] ;
64 Double_t * acoTest = new Double_t[AliRecoParam::kNSpecies];
65 Double_t acoHitsNorm = 0;
66 Double_t * acoRefTest = new Double_t[AliRecoParam::kNSpecies];
68 // Look at the QAref data for ACORDE
70 char * acoOCDBDir = Form("ACORDE/%s/%s",AliQA::GetRefOCDBDirName(),AliQA::GetRefDataDirName());
71 AliCDBEntry *acoQARefDir = AliQAManager::QAManager()->Get(acoOCDBDir);
74 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
77 acoTest[specie] = 0.0;
80 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
81 if (list[specie]->GetEntries() == 0){
82 test[specie] = 1. ; // nothing to check
86 TIter next(list[specie]) ;
88 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
91 if(hdata->GetEntries()>0)rv=1;
92 AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
97 // here we implement the second version for ACORDEQAChecker
98 // by the moment we only compare that the hits in every ACORDE's channel
100 for (Int_t i=0;i<60;i++)
102 acoHitsNorm = hdata->GetBinContent(i)/hdata->GetMaximum();
105 AliWarning("Using the QA Reference data for ACORDE !!!");
106 test[specie] = CheckAcordeRefHits(list[specie],(TObjArray *)acoQARefDir->GetObject());
107 if ((test[specie] = 0.86) || (acoHitsNorm>0.50))
109 acoRefTest[specie]=0.78;printf("testMario: %f\n",acoRefTest[specie]);
112 AliWarning("Using the inner ACORDE QA Checker !!!");
113 if ( (acoHitsNorm>0.40) && (acoHitsNorm<=1) ) acoTest[specie] = 0.75;
114 if ( (acoHitsNorm>0.0020) && (acoHitsNorm<=0.40) ) acoTest[specie] = 0.251;
115 if ( (acoHitsNorm>0.0) && (acoHitsNorm<=0.0020) ) acoTest[specie] = 0.0010;
116 if ( (acoHitsNorm>-1.0) && (acoHitsNorm<=0.0) ) acoTest[specie] = -0.5;
121 AliError("Data type cannot be processed") ;
124 if (count[specie] != 0) {
125 if (test[specie]==0) {
126 AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
127 test[specie] = 0.5; //upper limit value to set kWARNING flag for a task
130 if (acoQARefDir) test[specie] = acoRefTest[specie];
132 test[specie] = acoTest[specie];printf("testDyMa: %f\n",test[specie]);}
136 AliInfo(Form("Test Result = %f", test[specie])) ;
140 Double_t AliACORDEQAChecker::CheckAcordeRefHits(TObjArray *AcordeList, TObjArray *AcordeRef) const
142 Double_t acoTest = 0;
143 TIter next(AcordeList);
146 while ( (histo = dynamic_cast<TH1 *>(next())) )
148 if( histo->KolmogorovTest((TH1F *)AcordeRef->At(0))<0.8) acoTest = 0.86;