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(AliQAv1::ALITASK_t /*index*/, TObjArray ** list, AliDetectorRecoParam * /*recoParam*/)
48 Double_t * test = new Double_t[AliRecoParam::kNSpecies] ;
49 Int_t * count = new Int_t[AliRecoParam::kNSpecies] ;
50 Double_t * acoTest = new Double_t[AliRecoParam::kNSpecies];
53 // Look at the QAref data for ACORDE
55 char * acoOCDBDir = Form("ACORDE/%s/%s",AliQAv1::GetRefOCDBDirName(),AliQAv1::GetRefDataDirName());
56 AliCDBEntry *acoQARefDir = AliQAManager::QAManager()->Get(acoOCDBDir);
58 // Check variables set to 0
60 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
64 acoTest[specie] = 0.0;
67 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
69 if (list[specie]->GetEntries() == 0)
71 test[specie] = 1. ; // nothing to check
76 TIter next(list[specie]) ;
78 while ( (hdata = dynamic_cast<TH1 *>(next())) )
83 if(hdata->GetEntries()>0) rv=1;
84 AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)) ;
88 if (hdata->GetMaximum()==1) acoHitsNorm = 1;
89 else acoHitsNorm = (hdata->GetMaximum() - 0.50)/hdata->GetMaximum();
90 // here we implement the second version for ACORDEQAChecker
91 // by the moment we only compare the Mean between the QA histograms and the Reference data
94 //AliWarning("Using the QA Reference data for ACORDE !!!");
95 Double_t acoHistChecked = CheckAcordeRefHits(list[specie],(TObjArray *)acoQARefDir->GetObject());
96 if ( (acoHistChecked>0.75) && (acoHistChecked<=1) ) acoTest[specie] = 0.86;
97 if ( (acoHistChecked>0.0020) && (acoHistChecked<=0.75) ) acoTest[specie] = 0.251;
98 if ( (acoHistChecked>0.0) && (acoHistChecked<=0.0020) ) acoTest[specie] = 0.0010;
99 if ( (acoHistChecked>-1.0) && (acoHistChecked<=0.0) ) acoTest[specie] = -0.5;
103 //AliWarning("Using the inner ACORDE QA Checker !!!");
104 if ( (acoHitsNorm>0.40) && (acoHitsNorm<=1) ) acoTest[specie] = 0.86;
105 if ( (acoHitsNorm>0.0020) && (acoHitsNorm<=0.40) ) acoTest[specie] = 0.251;
106 if ( (acoHitsNorm>0.0) && (acoHitsNorm<=0.0020) ) acoTest[specie] = 0.0010;
107 if ( (acoHitsNorm>-1.0) && (acoHitsNorm<=0.0) ) acoTest[specie] = -0.5;
112 AliError("Data type cannot be processed") ;
115 if (count[specie] != 0)
119 test[specie] = 0.5; //upper limit value to set kWARNING flag for a task
123 if (acoQARefDir) test[specie] = acoTest[specie];
126 test[specie] = acoTest[specie];
134 Double_t AliACORDEQAChecker::CheckAcordeRefHits(TObjArray *HistAcordeList, TObjArray *AcordeRef) const
136 Double_t acordeTest = 0;
137 TIter next(AcordeRef);
138 TIter next1(HistAcordeList);
141 Float_t acordeHistoQAMaker=0;
142 Float_t meanACOQAReference=0;
143 Float_t meanACOQAMaker=0;
144 Float_t test1ACORDE = 0;
145 while((histoAcordeRef=(TH1*)next()) && (histoAcorde=(TH1*)next1()))
147 for(Int_t i=0;i<60;i++) acordeHistoQAMaker=acordeHistoQAMaker + histoAcorde->GetBinContent(i)/histoAcorde->GetMaximum();
148 meanACOQAReference = histoAcordeRef->GetMean();
149 meanACOQAMaker = acordeHistoQAMaker/60;
150 test1ACORDE = TMath::Abs(meanACOQAReference-meanACOQAMaker);
151 if (test1ACORDE<0.45) acordeTest = 0.86;
152 if (test1ACORDE > 0.45) acordeTest = 0.50;
153 if (test1ACORDE > 0.70) acordeTest = 0.25;