]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ACORDE/AliACORDEQAChecker.cxx
updated cluster histo component for ITS (Gaute)
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEQAChecker.cxx
CommitLineData
51504028 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// Checks the quality assurance for ACORDE.
17// Default implementation
18// Authors:
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//...
23
24// --- ROOT system ---
25#include <TClass.h>
26#include <TH1F.h>
27#include <TH1I.h>
28#include <TIterator.h>
29#include <TKey.h>
30#include <TFile.h>
31
32// --- Standard library ---
33
34// --- AliRoot header files ---
35#include "AliLog.h"
4e25ac79 36#include "AliQAv1.h"
51504028 37#include "AliQAChecker.h"
38#include "AliACORDEQAChecker.h"
fcdfb1ff 39#include "AliCDBEntry.h"
40#include "AliQAManager.h"
51504028 41
42ClassImp(AliACORDEQAChecker)
43
57acd2d2 44//____________________________________________________________________________
4e25ac79 45Double_t * AliACORDEQAChecker::Check(AliQAv1::ALITASK_t /*index*/)
57acd2d2 46{
47 Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ;
48 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
49 rv[specie] = 0.0 ;
50 return rv ;
51}
f307c383 52
57acd2d2 53//__________________________________________________________________
4e25ac79 54Double_t * AliACORDEQAChecker::Check(AliQAv1::ALITASK_t /*index*/, TObjArray ** list)
f307c383 55{
56
fcdfb1ff 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.
57acd2d2 62 Double_t * test = new Double_t[AliRecoParam::kNSpecies] ;
63 Int_t * count = new Int_t[AliRecoParam::kNSpecies] ;
fcdfb1ff 64 Double_t * acoTest = new Double_t[AliRecoParam::kNSpecies];
60e45583 65 // Double_t acoHitsNorm = 0;
fcdfb1ff 66 Double_t * acoRefTest = new Double_t[AliRecoParam::kNSpecies];
67
68 // Look at the QAref data for ACORDE
69
4e25ac79 70 char * acoOCDBDir = Form("ACORDE/%s/%s",AliQAv1::GetRefOCDBDirName(),AliQAv1::GetRefDataDirName());
fcdfb1ff 71 AliCDBEntry *acoQARefDir = AliQAManager::QAManager()->Get(acoOCDBDir);
72
73
57acd2d2 74 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
75 test[specie] = 0.0 ;
76 count[specie] = 0 ;
fcdfb1ff 77 acoTest[specie] = 0.0;
f307c383 78 }
57acd2d2 79
80 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
81 if (list[specie]->GetEntries() == 0){
82 test[specie] = 1. ; // nothing to check
fcdfb1ff 83 acoTest[specie] = 1.;
f307c383 84 }
57acd2d2 85 else {
86 TIter next(list[specie]) ;
87 TH1 * hdata ;
88 while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
89 if (hdata) {
90 Double_t rv = 0.0 ;
91 if(hdata->GetEntries()>0)rv=1;
5379c4a3 92 AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)) ;
57acd2d2 93 count[specie]++ ;
94 test[specie] += rv ;
fcdfb1ff 95
96 // here we implement the second version for ACORDEQAChecker
97 // by the moment we only compare that the hits in every ACORDE's channel
98 // are close and > 0
60e45583 99 Double_t acoHitsNorm = hdata->GetMaximum();
fcdfb1ff 100 if (acoQARefDir)
101 {
4662d69c 102 // AliWarning("Using the QA Reference data for ACORDE !!!");
fcdfb1ff 103 test[specie] = CheckAcordeRefHits(list[specie],(TObjArray *)acoQARefDir->GetObject());
104 if ((test[specie] = 0.86) || (acoHitsNorm>0.50))
105 {
4662d69c 106 acoRefTest[specie]=0.78;//printf("testMario: %f\n",acoRefTest[specie]);printf("histo:%f\n",hdata->GetMaximum());
fcdfb1ff 107 }
108 }else{
4662d69c 109 // AliWarning("Using the inner ACORDE QA Checker !!!");
fcdfb1ff 110 if ( (acoHitsNorm>0.40) && (acoHitsNorm<=1) ) acoTest[specie] = 0.75;
111 if ( (acoHitsNorm>0.0020) && (acoHitsNorm<=0.40) ) acoTest[specie] = 0.251;
112 if ( (acoHitsNorm>0.0) && (acoHitsNorm<=0.0020) ) acoTest[specie] = 0.0010;
113 if ( (acoHitsNorm>-1.0) && (acoHitsNorm<=0.0) ) acoTest[specie] = -0.5;
114 }
57acd2d2 115 }
116 else{
117 AliError("Data type cannot be processed") ;
118 }
f307c383 119 }
57acd2d2 120 if (count[specie] != 0) {
121 if (test[specie]==0) {
4662d69c 122 // AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
57acd2d2 123 test[specie] = 0.5; //upper limit value to set kWARNING flag for a task
124 }
125 else {
fcdfb1ff 126 if (acoQARefDir) test[specie] = acoRefTest[specie];
127 else{
4662d69c 128 test[specie] = acoTest[specie];//printf("testDyMa: %f\n",test[specie]);
129 }
57acd2d2 130 }
f307c383 131 }
132 }
5379c4a3 133 // AliDebug(AliQAv1::GetQADebugLevel(), Form("Test Result = %f", test[specie])) ;
f307c383 134 }
f307c383 135 return test ;
f307c383 136}
f6f88056 137Double_t AliACORDEQAChecker::CheckAcordeRefHits(TObjArray *AcordeList, TObjArray * /*AcordeRef */) const
fcdfb1ff 138{
139 Double_t acoTest = 0;
140 TIter next(AcordeList);
4662d69c 141 TH1 *histo;
142 for (Int_t i=0;i<60;i++)
fcdfb1ff 143 {
4662d69c 144 while ( (histo = dynamic_cast<TH1 *>(next())) )
145 {
1b70710b 146 if (histo->GetMaximum() && ((histo->GetBinContent(i)/histo->GetMaximum())<1.0) ) acoTest = 0.86;
4662d69c 147// if( histo->KolmogorovTest((TH1F *)AcordeRef->At(0))<0.8) acoTest = 0.86;
148 //printf("href:%f\n",histo->GetMaximum());
149 }
fcdfb1ff 150 }
151 return acoTest;
152}