2 /**************************************************************************
3 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
19 // *****************************************
20 // Checks the quality assurance
21 // by comparing with reference data
22 // P. Cerello Apr 2008
25 // --- ROOT system ---
29 // --- AliRoot header files ---
30 #include "AliITSQASDDChecker.h"
32 #include "AliCDBEntry.h"
33 #include "AliQAManager.h"
34 #include "AliQACheckerBase.h"
38 ClassImp(AliITSQASDDChecker)
39 //__________________________________________________________________
40 AliITSQASDDChecker& AliITSQASDDChecker::operator = (const AliITSQASDDChecker& qac )
43 this->~AliITSQASDDChecker();
44 new(this) AliITSQASDDChecker(qac);
48 //__________________________________________________________________
49 Double_t AliITSQASDDChecker::Check(AliQA::ALITASK_t index, TObjArray * list)
51 AliDebug(1,Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset));
52 char * detOCDBDir = Form("ITS/%s/%s", AliQA::GetRefOCDBDirName(), AliQA::GetRefDataDirName()) ;
53 AliCDBEntry *QARefObj = AliQAManager::QAManager()->Get(detOCDBDir);
55 AliError("Calibration object retrieval failed! SDD will not be processed");
62 if(index==AliQA::kRAW){ //analizing RAWS
63 TH1F *ModPattern = (TH1F*)QARefObj->GetObject();
64 if (list->GetEntries() == 0){
65 test = 1. ; // nothing to check
70 for(offset =0;offset < fSubDetOffset; offset++){
71 hdata = dynamic_cast<TH1 *>(next());
74 while ( (hdata = dynamic_cast<TH1 *>(next())) && offset >= fSubDetOffset){
76 if(offset == fSubDetOffset){ //ModPattern check
77 if ( hdata->Integral() == 0 ) {
78 AliWarning(Form("Spectrum %s is empty", hdata->GetName())) ;
81 test = hdata->Chi2Test(ModPattern,"UU,p");
85 AliError("Data type cannot be processed") ;
90 while ( (hdata = dynamic_cast<TH1 *>(next()))) {
94 AliInfo(Form("Test Result for RAWS = %f", test)) ;
98 if( index==AliQA::kREC){ //analizing RECP
99 //printf("analizing recp, offset %d \n",fSubDetOffset);
100 if (list->GetEntries() == 0){
101 test = 1. ; // nothing to check
106 for(offset =0;offset < fSubDetOffset; offset++){
107 hdata = dynamic_cast<TH1 *>(next()); // magari TIter++ ??
108 //printf("Skipping histo %s, offset %d \n",hdata->GetName(),fSubDetOffset);
111 while ( (hdata = dynamic_cast<TH1 *>(next())) && offset >= fSubDetOffset ){
112 if (hdata) { // offset=9 ModPatternRP
113 //printf("Treating histo %s, offset %d \n",hdata->GetName(),fSubDetOffset);
114 if( offset == 9 && hdata->GetEntries()>0)test = 0.1;
117 AliError("Data type cannot be processed") ;
122 AliInfo(Form("Test Result for RECP = %f", test)) ;
123 } // if(index==2) loop
128 //__________________________________________________________________
129 void AliITSQASDDChecker::SetTaskOffset(Int_t TaskOffset)
131 fSubDetOffset = TaskOffset;