]>
Commit | Line | Data |
---|---|---|
5dfa9b71 | 1 | /************************************************************************** |
2 | * Copyright(c) 2007-2009, 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 | ||
2eb1130f | 16 | /* $Id $ */ |
5dfa9b71 | 17 | |
18 | // ***************************************** | |
19 | // Checks the quality assurance | |
20 | // by comparing with reference data | |
21 | // P. Cerello Apr 2008 | |
22 | // INFN Torino | |
23 | ||
24 | // --- ROOT system --- | |
2eb1130f | 25 | #include "TH1.h" |
26 | #include "TString.h" | |
5dfa9b71 | 27 | |
28 | // --- AliRoot header files --- | |
29 | #include "AliITSQASPDChecker.h" | |
c71529b0 | 30 | #include "AliLog.h" |
5dfa9b71 | 31 | |
32 | ClassImp(AliITSQASPDChecker) | |
5dfa9b71 | 33 | //__________________________________________________________________ |
34 | AliITSQASPDChecker& AliITSQASPDChecker::operator = (const AliITSQASPDChecker& qac ) | |
35 | { | |
36 | // Equal operator. | |
37 | this->~AliITSQASPDChecker(); | |
38 | new(this) AliITSQASPDChecker(qac); | |
39 | return *this; | |
40 | } | |
41 | ||
3647765c | 42 | |
5dfa9b71 | 43 | //__________________________________________________________________ |
4e25ac79 | 44 | Double_t AliITSQASPDChecker::Check(AliQAv1::ALITASK_t /*index*/, TObjArray * list) |
5dfa9b71 | 45 | { |
5379c4a3 | 46 | AliDebug(2, Form("AliITSQASPDChecker called with offset: %d\n", fSubDetOffset)); |
c71529b0 | 47 | |
2eb1130f | 48 | Double_t test = 0.0; |
49 | Int_t count = 0; | |
5dfa9b71 | 50 | |
2eb1130f | 51 | if (list->GetEntries() == 0) { |
52 | test = 1.; // nothing to check | |
5dfa9b71 | 53 | } |
54 | else { | |
2eb1130f | 55 | TIter next(list); |
56 | TH1 * hdata; | |
57 | count = 0; | |
5dfa9b71 | 58 | while ( (hdata = dynamic_cast<TH1 *>(next())) ) { |
59 | if (hdata) { | |
2eb1130f | 60 | TString histName = hdata->GetName(); |
61 | if (!histName.Contains("_SPD")) continue; | |
5dfa9b71 | 62 | Double_t rv = 0.; |
2eb1130f | 63 | if (hdata->GetEntries()>0) rv = 1; |
954ef57a | 64 | if (histName.Contains("LayPattern")) { |
683601f2 | 65 | if (hdata->GetBinContent(1)) { |
954ef57a | 66 | Double_t ratio=hdata->GetBinContent(2)/hdata->GetBinContent(1); |
5379c4a3 | 67 | AliDebug(2, Form("%s: ratio RecPoints lay2 / lay1 = %f", hdata->GetName(), ratio)); |
683601f2 | 68 | } |
69 | else | |
5379c4a3 | 70 | AliDebug(AliQAv1::GetQADebugLevel(), "No RecPoints in lay1"); |
683601f2 | 71 | } |
954ef57a | 72 | else if(histName.Contains("ModPattern")) { |
73 | Int_t ndead=0; | |
74 | for(Int_t ibin=0;ibin<hdata->GetNbinsX();ibin++) { | |
75 | if(histName.Contains("SPD1") && ibin<80 && hdata->GetBinContent(ibin+1)>0) ndead++; | |
76 | if(histName.Contains("SPD2") && ibin>79 && hdata->GetBinContent(ibin+1)>0) ndead++; | |
77 | } | |
5379c4a3 | 78 | AliDebug(2, Form("%s: Entries = %d number of empty modules = %d", |
954ef57a | 79 | hdata->GetName(),(Int_t)hdata->GetEntries(),ndead)); |
80 | } | |
81 | else if(histName.Contains("SizeYvsZ")) { | |
82 | Double_t meanz=hdata->GetMean(1); | |
83 | Double_t meany=hdata->GetMean(2); | |
84 | Double_t rmsz=hdata->GetRMS(1); | |
85 | Double_t rmsy=hdata->GetRMS(2); | |
5379c4a3 | 86 | AliDebug(AliQAv1::GetQADebugLevel(), Form("%s: Cluster sizeY mean = %f rms = %f", hdata->GetName(),meany,rmsy)); |
87 | AliDebug(AliQAv1::GetQADebugLevel(), Form("%s: Cluster sizeZ mean = %f rms = %f", hdata->GetName(),meanz,rmsz)); | |
954ef57a | 88 | } |
f4ed01ae | 89 | else if(histName.Contains("SPDMultiplicity")) { |
5379c4a3 | 90 | AliDebug(2, Form("%s: Events = %d mean = %f rms = %f", |
954ef57a | 91 | hdata->GetName(),(Int_t)hdata->GetEntries(),hdata->GetMean(),hdata->GetRMS()));} |
92 | ||
5379c4a3 | 93 | // else AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)); |
2eb1130f | 94 | count++; |
95 | test += rv; | |
5dfa9b71 | 96 | } |
954ef57a | 97 | else { |
5dfa9b71 | 98 | AliError("Data type cannot be processed") ; |
99 | } | |
5dfa9b71 | 100 | } |
954ef57a | 101 | |
5dfa9b71 | 102 | if (count != 0) { |
103 | if (test==0) { | |
104 | AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING"); | |
105 | test = 0.5; //upper limit value to set kWARNING flag for a task | |
106 | } | |
107 | else { | |
2eb1130f | 108 | test /= count; |
5dfa9b71 | 109 | } |
110 | } | |
111 | } | |
112 | ||
5379c4a3 | 113 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Test Result = %f", test)); |
5dfa9b71 | 114 | return test ; |
3647765c | 115 | |
954ef57a | 116 | } |
3647765c | 117 | |
118 | //__________________________________________________________________ | |
119 | void AliITSQASPDChecker::SetTaskOffset(Int_t TaskOffset) | |
120 | { | |
121 | fSubDetOffset = TaskOffset; | |
122 | } |