]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSQASDDChecker.cxx
Code cleanup in AliITSDetTypeRec and vertexers + minor bug fix in AliITSVertexer3D...
[u/mrichter/AliRoot.git] / ITS / AliITSQASDDChecker.cxx
CommitLineData
3647765c 1
5b716935 2/**************************************************************************
3 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
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 **************************************************************************/
16
17/* $Id$ */
18
19// *****************************************
20// Checks the quality assurance
21// by comparing with reference data
22// P. Cerello Apr 2008
23// INFN Torino
24
25// --- ROOT system ---
3647765c 26#include "TH1.h"
27#include <TCanvas.h>
5b716935 28
29// --- AliRoot header files ---
30#include "AliITSQASDDChecker.h"
c71529b0 31#include "AliLog.h"
3647765c 32#include "AliCDBEntry.h"
33#include "AliCDBManager.h"
34#include "AliQACheckerBase.h"
35#include "TSystem.h"
5b716935 36
5b716935 37
3647765c 38ClassImp(AliITSQASDDChecker)
5b716935 39//__________________________________________________________________
40AliITSQASDDChecker& AliITSQASDDChecker::operator = (const AliITSQASDDChecker& qac )
41{
42 // Equal operator.
43 this->~AliITSQASDDChecker();
44 new(this) AliITSQASDDChecker(qac);
45 return *this;
46}
47
48//__________________________________________________________________
938494b4 49Double_t AliITSQASDDChecker::Check(AliQA::ALITASK_t index, TObjArray * list)
c71529b0 50{
3647765c 51 AliDebug(1,Form("AliITSQASDDChecker called with offset: %d\n", fSubDetOffset));
52 AliCDBEntry *QARefObj = AliCDBManager::Instance()->Get("ITS/QARef/SDD");
53 if( !QARefObj){
54 AliError("Calibration object retrieval failed! SDD will not be processed");
55 return 1.;
5b716935 56 }
3647765c 57
58 Double_t test = 0.0;
59 Int_t offset = 0;
60
614c7e17 61 if(index==AliQA::kRAW){ //analizing RAWS
3647765c 62 TH1F *ModPattern = (TH1F*)QARefObj->GetObject();
63 if (list->GetEntries() == 0){
64 test = 1. ; // nothing to check
65 }
66 else {
67 TIter next(list) ;
68 TH1 * hdata ;
69 for(offset =0;offset < fSubDetOffset; offset++){
70 hdata = dynamic_cast<TH1 *>(next());
5b716935 71 }
3647765c 72
73 while ( (hdata = dynamic_cast<TH1 *>(next())) && offset >= fSubDetOffset){
74 if (hdata) {
75 if(offset == fSubDetOffset){ //ModPattern check
76 if ( hdata->Integral() == 0 ) {
77 AliWarning(Form("Spectrum %s is empty", hdata->GetName())) ;
78 return 0.5 ;
79 }
80 test = hdata->Chi2Test(ModPattern,"UU,p");
81 } // ModPattern check
82 }
83 else{
84 AliError("Data type cannot be processed") ;
85 }
86 offset++;
87 } //SDD histo
88
89 while ( (hdata = dynamic_cast<TH1 *>(next()))) {
90 offset++;
5b716935 91 }
3647765c 92 } //else entries !=0
93 AliInfo(Form("Test Result for RAWS = %f", test)) ;
94 } // if(index==0)
5b716935 95
3647765c 96
614c7e17 97 if( index==AliQA::kREC){ //analizing RECP
3647765c 98 //printf("analizing recp, offset %d \n",fSubDetOffset);
99 if (list->GetEntries() == 0){
100 test = 1. ; // nothing to check
5b716935 101 }
3647765c 102 else {
103 TIter next(list) ;
104 TH1 * hdata ;
105 for(offset =0;offset < fSubDetOffset; offset++){
106 hdata = dynamic_cast<TH1 *>(next()); // magari TIter++ ??
107 //printf("Skipping histo %s, offset %d \n",hdata->GetName(),fSubDetOffset);
5b716935 108 }
3647765c 109
110 while ( (hdata = dynamic_cast<TH1 *>(next())) && offset >= fSubDetOffset ){
111 if (hdata) { // offset=9 ModPatternRP
112 //printf("Treating histo %s, offset %d \n",hdata->GetName(),fSubDetOffset);
113 if( offset == 9 && hdata->GetEntries()>0)test = 0.1;
114 }
115 else{
116 AliError("Data type cannot be processed") ;
117 }
118 offset++;
5b716935 119 }
3647765c 120 } // GetEntries loop
121 AliInfo(Form("Test Result for RECP = %f", test)) ;
122 } // if(index==2) loop
5b716935 123
3647765c 124 return test;
5b716935 125}
126
3647765c 127//__________________________________________________________________
128void AliITSQASDDChecker::SetTaskOffset(Int_t TaskOffset)
129{
130 fSubDetOffset = TaskOffset;
131}